@font-face {
  font-family: "Geist";
  src: url("https://assets.vercel.com/raw/upload/v1694526102/fonts/geist-sans/GeistVF.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("https://assets.vercel.com/raw/upload/v1694526128/fonts/geist-mono/GeistMonoVF.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --background-100: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --gray-1000: #171717;
  --gray-900: #4d4d4d;
  --gray-700: #8f8f8f;
  --gray-alpha-100: #0000000d;
  --gray-alpha-200: #00000015;
  --gray-alpha-400: #0000001f;
  --gray-alpha-500: #00000036;
  --blue-700: #006bff;
  --accent-orange: #f6821f;
  --expand-text: #a85b18;
  --close-text: #9f2d20;
  --shadow-card: 0 2px 2px rgba(0, 0, 0, 0.04);
  --shadow-dialog: 0 1px 1px rgba(0, 0, 0, 0.02), 0 8px 16px -4px rgba(0, 0, 0, 0.04), 0 24px 32px -8px rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background-100: #000000;
  --surface: rgba(0, 0, 0, 0.64);
  --surface-strong: rgba(18, 18, 18, 0.92);
  --gray-1000: #ededed;
  --gray-900: #a0a0a0;
  --gray-700: #8f8f8f;
  --gray-alpha-100: #ffffff12;
  --gray-alpha-200: #ffffff17;
  --gray-alpha-400: #ffffff24;
  --gray-alpha-500: #ffffff3d;
  --blue-700: #006efe;
  --accent-orange: #f6821f;
  --expand-text: #d08a48;
  --close-text: #ff9b8f;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.16);
  --shadow-dialog: 0 1px 1px rgba(0, 0, 0, 0.02), 0 8px 16px -4px rgba(0, 0, 0, 0.04), 0 24px 32px -8px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background-100);
  color: var(--gray-1000);
  font-family: "Geist", Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
}

:root.theme-ready body {
  transition: background-color 220ms ease, color 220ms ease;
}

body.dialog-open {
  overflow: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(var(--gray-alpha-100) 1px, transparent 1px), linear-gradient(90deg, var(--gray-alpha-100) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--background-100), 0 0 0 4px var(--blue-700);
}

.page-shell {
  width: min(80vw, 1280px);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 520px) minmax(150px, 1fr);
  align-items: start;
  gap: 16px;
  padding: 24px 0;
  background: color-mix(in srgb, var(--background-100) 82%, transparent);
  backdrop-filter: blur(16px);
}

:root.theme-ready .site-header,
:root.theme-ready .profile-card,
:root.theme-ready .panel-card,
:root.theme-ready .panel-grid,
:root.theme-ready .theme-toggle,
:root.theme-ready .dialog-close,
:root.theme-ready .detail-dialog,
:root.theme-ready .dialog-list li,
:root.theme-ready .dialog-list a,
:root.theme-ready .banner-image,
:root.theme-ready .avatar-image,
:root.theme-ready .skills-box,
:root.theme-ready .skill-row,
:root.theme-ready .skill-track span {
  transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease, box-shadow 220ms ease;
}

.brand,
.theme-toggle,
.dialog-close {
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  align-self: center;
  width: fit-content;
  font-family: "Geist Mono", monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 20px;
}

.header-quote {
  justify-self: center;
  width: 100%;
  margin: 6px 0 0;
  color: var(--gray-900);
  font-family: "Geist", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 18px;
  text-align: center;
  transition: opacity 160ms ease, transform 160ms ease;
}

body.scrolled .header-quote {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

.theme-toggle {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: end;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--gray-alpha-400);
  background: var(--surface);
  color: var(--gray-1000);
  cursor: pointer;
}

main {
  display: grid;
  min-height: calc(100vh - 104px);
  place-items: center;
  padding: 32px 0 64px;
}

.portfolio-frame {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 32px;
  width: 100%;
  min-height: min(560px, calc(100vh - 176px));
  padding: clamp(16px, 3vw, 40px) 0;
}

.profile-card,
.panel-card {
  border: 1px solid var(--gray-alpha-400);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}

.profile-card {
  display: flex;
  min-height: 440px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
}

.eyebrow,
.panel-card span,
.panel-card small {
  margin: 0;
  color: var(--gray-900);
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  line-height: 16px;
}

h3,
p {
  margin-top: 0;
}

.name-image {
  display: grid;
  width: min(180px, 76%);
  min-height: 56px;
  place-items: center;
  margin: 8px auto 12px;
  border-radius: 10px;
}

.name-image img {
  width: 88%;
  max-height: 72px;
  object-fit: contain;
}

:root[data-theme="light"] .name-image img {
  filter: brightness(0);
}

.banner-image {
  overflow: hidden;
  width: 72%;
  height: 54px;
  margin: 0 auto 16px;
  border: 1px solid var(--gray-alpha-400);
  border-radius: 10px;
  opacity: 0.76;
}

.banner-image img,
.avatar-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-image img {
  object-fit: contain;
}

.role {
  margin-bottom: 12px;
  color: var(--gray-1000);
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
}

.role span {
  color: var(--accent-orange);
}

.cloudflare-text {
  color: var(--accent-orange) !important;
}

.profile-copy {
  max-width: 230px;
  margin-bottom: 0;
  color: var(--gray-900);
  font-size: 14px;
  line-height: 22px;
}

.profile-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
  align-items: end;
  gap: 12px;
}

.contact-stack {
  display: grid;
  gap: 4px;
}

.contact-stack a {
  width: fit-content;
  border-radius: 6px;
  color: var(--gray-1000);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: underline;
  text-decoration-color: var(--gray-alpha-500);
  text-underline-offset: 4px;
}

.contact-stack .linkedin-link {
  color: var(--accent-orange);
}

.contact-stack .github-link {
  color: #28a948;
}

.avatar-image {
  overflow: hidden;
  width: 136px;
  height: 136px;
  margin: 0;
  border: 1px solid var(--gray-alpha-400);
  border-radius: 50%;
  background: var(--surface-strong);
  opacity: 0.94;
}

.panel-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  align-self: center;
  border: 1px solid var(--gray-alpha-400);
  background: transparent;
}

.panel-grid::before,
.panel-grid::after {
  position: absolute;
  z-index: 2;
  width: 12px;
  height: 12px;
  border: 1px solid var(--gray-alpha-400);
  border-radius: 4px;
  background: var(--background-100);
  content: "";
}

.panel-grid::before {
  top: -7px;
  left: -7px;
}

.panel-grid::after {
  right: -7px;
  bottom: -7px;
}

.panel-card {
  position: relative;
  display: flex;
  min-height: 168px;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--gray-1000);
  text-align: left;
  cursor: pointer;
}

.panel-card:nth-child(odd) {
  border-right: 1px solid var(--gray-alpha-400);
}

.panel-card:nth-child(-n + 2) {
  border-bottom: 1px solid var(--gray-alpha-400);
}

.panel-card:hover {
  background: var(--gray-alpha-100);
}

.panel-card strong {
  margin-top: 14px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 28px;
}

.panel-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--gray-alpha-400);
  border-radius: 8px;
  color: var(--gray-1000);
  font-family: "Geist Mono", monospace;
  font-size: 13px;
  line-height: 16px;
}

.panel-card small {
  position: absolute;
  right: 24px;
  bottom: 22px;
  color: var(--expand-text);
  font-weight: 500;
}

.detail-dialog {
  position: fixed;
  inset: 0;
  width: min(720px, calc(100% - 32px));
  max-height: min(700px, calc(100vh - 64px));
  margin: auto;
  padding: 56px 24px 24px;
  border: 1px solid var(--gray-alpha-400);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--gray-1000);
  box-shadow: var(--shadow-dialog);
  overflow: auto;
}

.detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(5px);
}

.detail-dialog[open] {
  animation: dialog-in 180ms cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--gray-alpha-400);
  background: var(--surface);
  color: var(--close-text);
  cursor: pointer;
}

.dialog-content {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--gray-900);
  font-size: 16px;
  line-height: 26px;
}

.certificate-note {
  margin: 0;
  color: var(--expand-text);
  font-family: "Geist Mono", monospace;
  font-size: 13px;
  line-height: 20px;
}

.dialog-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dialog-list li {
  display: grid;
  gap: 2px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-alpha-400);
  background: transparent;
}

.dialog-list li:first-child {
  padding-top: 0;
}

.dialog-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.dialog-list li.has-action {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.dialog-list li div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dialog-list strong {
  color: var(--gray-1000);
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}

.dialog-list a {
  display: inline-flex;
  width: fit-content;
  min-width: 58px;
  height: 32px;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding: 0 10px;
  border: 1px solid var(--gray-alpha-400);
  border-radius: 6px;
  color: var(--gray-1000);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  text-decoration: none;
}

.dialog-list a:hover {
  background: var(--gray-alpha-100);
}

.skills-box {
  overflow: hidden;
  border: 1px solid var(--gray-alpha-400);
  border-radius: 12px;
  background: var(--surface);
}

.skill-row {
  overflow: hidden;
  border-bottom: 1px solid var(--gray-alpha-400);
}

.skill-row:last-child {
  border-bottom: 0;
}

.skill-track {
  display: flex;
  width: max-content;
  min-width: 200%;
  animation: marquee var(--duration) linear infinite;
}

.reverse .skill-track {
  animation-direction: reverse;
}

.skill-track span {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-right: 1px solid var(--gray-alpha-400);
  color: var(--gray-1000);
  font-family: "Geist Mono", monospace;
  font-size: 14px;
  line-height: 20px;
}

.theme-toggle:hover,
.dialog-close:hover {
  background: var(--gray-alpha-100);
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1100px) {
  .page-shell {
    width: min(100% - 32px, 860px);
  }

  .portfolio-frame {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .profile-card {
    min-height: 400px;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 24px, 860px);
  }

  .site-header {
    grid-template-columns: 1fr auto;
    padding: 16px 0;
  }

  .header-quote {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-self: center;
    text-align: center;
  }

  .certificate-note {
    font-size: 12px;
    line-height: 18px;
  }

  main {
    min-height: auto;
    padding: 16px 0 48px;
  }

  .portfolio-frame {
    padding: 16px 0;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .panel-card {
    min-height: 132px;
    padding: 24px;
    border-right: 0;
    border-bottom: 1px solid var(--gray-alpha-400);
  }

  .panel-card:nth-child(odd) {
    border-right: 0;
  }

  .panel-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--gray-alpha-400);
  }

  .panel-card:last-child {
    border-bottom: 0;
  }

  .panel-card small {
    right: 24px;
    bottom: 20px;
  }

  .profile-bottom {
    grid-template-columns: 1fr 112px;
  }

  .avatar-image {
    width: 112px;
    height: 112px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .skill-track,
  .detail-dialog[open] {
    animation: none;
  }
}
