:root {
  color-scheme: dark;
  --ink: #050505;
  --paper: #f4f4ef;
  --signal: #31ee8a;
  --muted: #a6aca8;
  --line: rgba(244, 244, 239, 0.22);
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--ink);
  color: var(--paper);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--ink);
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  background: var(--ink);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.topbar {
  position: absolute;
  top: 0;
  left: clamp(1.25rem, 3.2vw, 3rem);
  right: clamp(1.25rem, 3.2vw, 3rem);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.9rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  text-decoration: none;
  font-family: "Arial Narrow", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -0.03em;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 3.4rem);
}

.nav-link {
  position: relative;
  padding: 0.75rem 0;
  cursor: pointer;
  background: transparent;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: 0.42rem;
  left: 0;
  height: 1px;
  background: var(--signal);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero__footer {
  position: absolute;
  right: clamp(1.25rem, 3.2vw, 3rem);
  bottom: clamp(1.4rem, 4vh, 3.25rem);
  left: clamp(1.25rem, 3.2vw, 3rem);
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.intro {
  outline: none;
}

.intro > p:first-child {
  max-width: 20ch;
  margin: 0;
  font-size: clamp(1.45rem, 2.15vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.intro__note {
  max-width: 34ch;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(0.45rem);
  transition:
    opacity 320ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.intro.is-revealed .intro__note {
  opacity: 1;
  transform: translateY(0);
}

.meet {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.75rem;
  padding: 0.35rem 0;
  cursor: pointer;
  background: transparent;
  font-size: clamp(1rem, 1.55vw, 1.35rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: left;
  text-decoration: none;
}

.meet__icon {
  display: grid;
  width: 3.75rem;
  height: 3.75rem;
  place-items: center;
  border: 1px solid var(--signal);
  color: var(--signal);
  font-size: 1.8rem;
  transition:
    background-color 220ms ease,
    color 220ms ease,
    transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.meet:hover .meet__icon,
.meet:focus-visible .meet__icon,
.meet[aria-expanded="true"] .meet__icon {
  background: var(--signal);
  color: var(--ink);
  transform: translateX(0.3rem);
}

.motion-hint {
  position: absolute;
  top: calc(32% - 2rem);
  right: clamp(1.25rem, 3.2vw, 3rem);
  z-index: 2;
  margin: 0;
  color: rgba(244, 244, 239, 0.7);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.status {
  position: absolute;
  top: calc(32% - 2.25rem);
  left: clamp(1.25rem, 3.2vw, 3rem);
  z-index: 2;
  max-width: 32ch;
  margin: 0;
  color: var(--signal);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.35;
  opacity: 0;
  text-transform: uppercase;
  transform: translateY(0.35rem);
  transition:
    opacity 240ms ease,
    transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 5px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .topbar {
    min-height: 4.25rem;
  }

  nav {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.78rem;
  }

  .hero__footer {
    align-items: flex-start;
    bottom: 1.2rem;
    flex-direction: column;
    gap: 0.9rem;
  }

  .intro > p:first-child {
    font-size: clamp(1.25rem, 6.4vw, 1.7rem);
  }

  .intro__note {
    margin-top: 0.55rem;
  }

  .meet {
    align-self: flex-end;
    min-height: 3rem;
    font-size: 0.95rem;
  }

  .meet__icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.45rem;
  }

  .motion-hint {
    display: none;
  }

  .status {
    top: 5.35rem;
    right: 1.25rem;
    left: 1.25rem;
    font-size: 0.66rem;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* The game is a real destination alongside the portfolio navigation. */
.nav-link[data-game] { color: var(--signal); }
.language-button { min-width: 48px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); color: var(--signal); background: transparent; font-size: 12px; white-space: nowrap; flex-shrink: 0; cursor: pointer; }
.language-button:hover { border-color: var(--signal); background: var(--signal); color: var(--ink); }
.topbar { gap: 12px; }
html[lang="en"] .education-copy h3 > span { display: none; }

/* Reading surfaces extend the portfolio's existing type, mint and hairlines. */
::selection { background: var(--signal); color: var(--ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 5px; }
html { scrollbar-color: var(--signal) var(--ink); scrollbar-width: thin; }
.skip-link { position: fixed; top: 12px; left: 20px; z-index: 10; padding: 12px 16px; color: var(--ink); background: var(--signal); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.meet__icon svg { width: 28px; height: 28px; }
.nav-link[aria-current="page"] { color: var(--signal); }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.reading-section { display: grid; grid-template-columns: minmax(140px, .3fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); }
.reading-section h2 { margin: 0; font-size: 16px; font-weight: 500; color: var(--signal); }
.reading-section p { margin: 0; max-width: 70ch; }
.about-section { margin: 0 clamp(20px, 3.2vw, 48px); padding: clamp(64px, 8vw, 112px) 0; border-top: 1px solid var(--line); scroll-margin-top: 32px; }
.about-section p { font-size: clamp(19px, 2vw, 28px); line-height: 1.9; max-width: 58ch; }
.about-section:focus { outline: none; }
.site-footer { display: flex; align-items: center; gap: 24px; justify-content: space-between; margin: 0 clamp(20px, 3.2vw, 48px); padding: 24px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.site-footer .brand { color: var(--paper); }
.document-header { position: relative; top: auto; left: auto; right: auto; margin: 0 clamp(20px, 3.2vw, 48px); }
.document-main { max-width: 1160px; margin: 0 auto; padding: clamp(56px, 6vw, 96px) clamp(20px, 3.2vw, 48px) 88px; }
.document-main h1 { margin: 0 0 48px; font-size: clamp(42px, 6.6vw, 88px); font-weight: 500; line-height: 1.18; letter-spacing: -.03em; text-wrap: balance; }
.profile-copy { max-width: 72ch; margin-left: auto; font-size: clamp(17px, 1.45vw, 20px); line-height: 1.9; }
.profile-copy p { margin: 0 0 32px; }
.page-action { margin-top: 24px; }
.resume-name { display: block; margin-top: 20px; font-size: clamp(17px, 2vw, 23px); color: var(--muted); letter-spacing: 0; }
.resume-summary { max-width: 70ch; margin: 0 0 64px; font-size: 18px; line-height: 1.85; }
.resume-section { padding: 40px 0; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.85; }
.resume-section h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.55; font-weight: 500; }
.education-copy h3 span { display: block; color: var(--muted); font-size: 16px; }
.education-copy p + p { margin-top: 12px; }
.secondary, .date { color: var(--muted); }
.date { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.experience-entry { padding: 0 0 36px; }
.experience-entry + .experience-entry { padding-top: 32px; border-top: 1px solid var(--line); }
.experience-entry:last-child { padding-bottom: 0; }
.experience-entry .date { display: block; margin-bottom: 8px; }
.experience-entry .role { color: var(--signal); font-size: 14px; margin-bottom: 12px; }
.skills-list { margin: 0; }
.skills-list > div { margin-bottom: 24px; }
.skills-list > div:last-child { margin-bottom: 0; }
.skills-list dt { margin-bottom: 4px; color: var(--muted); font-size: 14px; }
.skills-list dd { margin: 0; }
.contact-action { margin-top: 24px; font-size: 17px; }
@media (max-width: 720px) {
 nav { gap: 8px; }
 nav .nav-link { min-width: 44px; justify-content: center; }
 .reading-section { grid-template-columns: 1fr; gap: 24px; }
 .document-main h1 { margin-bottom: 36px; }
 .resume-summary { margin-bottom: 40px; font-size: 16px; }
 .resume-section { padding: 32px 0; }
 .profile-copy { font-size: 17px; }
 .site-footer { gap: 12px; flex-wrap: wrap; }
 .site-footer > span { font-size: 11px; }
}
