:root {
  --bg: #08080a;
  --bg-elev: #0e0e11;
  --text: #f3f1ee;
  --muted: #8e8e99;
  --faint: #56565f;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #6fe0a4;
  --accent-dim: rgba(111, 224, 164, 0.14);
  --spot: rgba(111, 224, 164, 0.07);
  --grain-opacity: 0.05;
  --measure: 46rem;
  --ease: cubic-bezier(0.22, 0.72, 0.2, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #faf9f7;
  --bg-elev: #ffffff;
  --text: #131316;
  --muted: #62626c;
  --faint: #9a9aa3;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.2);
  --accent: #1c7a52;
  --accent-dim: rgba(28, 122, 82, 0.1);
  --spot: rgba(28, 122, 82, 0.05);
  --grain-opacity: 0.03;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #faf9f7;
    --bg-elev: #ffffff;
    --text: #131316;
    --muted: #62626c;
    --faint: #9a9aa3;
    --line: rgba(0, 0, 0, 0.1);
    --line-strong: rgba(0, 0, 0, 0.2);
    --accent: #1c7a52;
    --accent-dim: rgba(28, 122, 82, 0.1);
    --spot: rgba(28, 122, 82, 0.05);
    --grain-opacity: 0.03;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga", "calt";
  overflow-x: hidden;
}

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

.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

.spotlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(38rem 38rem at var(--mx, 50%) var(--my, 0%), var(--spot), transparent 70%);
  transition: opacity 0.4s var(--ease);
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 5vw, 3rem);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.nav.scrolled { border-bottom-color: var(--line); }

.nav-mark {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.nav-mark:hover { color: var(--accent); border-color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 1rem; }

.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
}

.dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--accent);
  animation: pulse 2.8s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70% { box-shadow: 0 0 0 0.5rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.theme-toggle {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.4s var(--ease);
}

.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); transform: rotate(35deg); }
.theme-toggle svg { width: 0.9rem; height: 0.9rem; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
:root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: block; }
}

.page {
  position: relative;
  z-index: 2;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem) 6rem;
}

.hero {
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 0 4rem;
}

.eyebrow {
  color: var(--accent);
  margin: 0 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.eyebrow::after {
  content: "";
  height: 1px;
  flex: 1;
  max-width: 5rem;
  background: linear-gradient(to right, var(--accent), transparent);
}

h1 {
  font-size: clamp(2.9rem, 11vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
  font-weight: 600;
  margin: 0 0 1.75rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  color: var(--faint);
  margin-bottom: 2.25rem;
}

.hero-meta .sep { opacity: 0.5; }
#local-time { font-variant-numeric: tabular-nums; }

.lede { max-width: 36rem; }
.lede p { margin: 0 0 1.1rem; color: var(--muted); font-size: 1.02rem; }
.lede p:last-child { margin-bottom: 0; }
.lede strong { color: var(--text); font-weight: 550; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.btn:hover { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.btn svg { width: 0.85rem; height: 0.85rem; }

.btn-ghost:hover { color: var(--text); background: transparent; border-color: var(--text); }

section + section { margin-top: 6.5rem; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.section-head .num { color: var(--accent); }

.section-head h2 {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  margin: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  transition-delay: calc(var(--i, 0) * 60ms);
}

.reveal.in { opacity: 1; transform: none; }

.role {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.5rem;
  padding: 1.4rem 1.1rem 1.4rem 1.25rem;
  margin: 0 -1.1rem;
  border-radius: 12px;
  position: relative;
  transition: background 0.3s var(--ease);
}

.role::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 1px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease);
}

.role:hover { background: var(--bg-elev); }
.role:hover::before { transform: scaleY(1); }
.role:hover .role-company { color: var(--accent); }

.role-year { color: var(--faint); padding-top: 0.3rem; white-space: nowrap; }

.role-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 0.1rem;
}

.role-company {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  transition: color 0.3s var(--ease);
}

.role-note { color: var(--muted); font-size: 0.92rem; margin: 0; }

.stack { display: flex; flex-direction: column; gap: 1.6rem; }

.stack-row { display: grid; grid-template-columns: 7rem 1fr; gap: 1.5rem; align-items: start; }
.stack-label { color: var(--faint); padding-top: 0.3rem; }
.stack-items { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.chip {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.18rem 0.5rem;
  white-space: nowrap;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.chip:hover { color: var(--text); border-color: var(--line-strong); background: var(--bg-elev); }

.contact-lede { color: var(--muted); max-width: 34rem; margin: 0 0 2.5rem; }

.mail {
  display: inline-block;
  font-size: clamp(1.25rem, 5vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  position: relative;
  word-break: break-word;
}

.mail::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15rem;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}

.mail:hover { color: var(--accent); }
.mail:hover::after { transform: scaleX(1); transform-origin: left; }

.contact-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2rem; }

footer {
  margin-top: 6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 40rem) {
  .hero { min-height: auto; padding: 7rem 0 3rem; }
  .role, .stack-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .role-year { padding-top: 0; }
  .nav-status span { display: none; }
  section + section { margin-top: 4.5rem; }
}

.curtain {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: grid;
  place-items: center;
  transform: translateY(0);
}

.curtain.done {
  transform: translateY(-101%);
  transition: transform 1.05s cubic-bezier(0.76, 0, 0.24, 1);
}

.curtain-inner { text-align: center; }

.curtain-count {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(2.5rem, 9vw, 4.5rem);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}

.curtain-bar {
  width: min(16rem, 55vw);
  height: 1px;
  background: var(--line);
  margin: 1.4rem auto 0;
  overflow: hidden;
}

.curtain-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 30;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora i {
  position: absolute;
  display: block;
  width: 46rem;
  height: 46rem;
  border-radius: 50%;
  opacity: 0.5;
  will-change: transform;
}

.aurora i:nth-child(1) {
  top: -18rem;
  left: -12rem;
  background: radial-gradient(circle, var(--accent-dim), transparent 65%);
  animation: drift-a 34s ease-in-out infinite alternate;
}

.aurora i:nth-child(2) {
  bottom: -22rem;
  right: -14rem;
  background: radial-gradient(circle, var(--spot), transparent 65%);
  animation: drift-b 44s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(8rem, 6rem, 0) scale(1.25); }
}

@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.15); }
  to { transform: translate3d(-7rem, -5rem, 0) scale(1); }
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform;
}

.cursor-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  margin: -2.5px 0 0 -2.5px;
}

.cursor-ring {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 1px solid var(--line-strong);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease), border-color 0.3s var(--ease), opacity 0.3s var(--ease);
}

.cursor-ring.hot {
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-color: var(--accent);
}

html.cursor-hidden,
html.cursor-hidden * { cursor: none !important; }

h1 .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

h1 .char {
  display: inline-block;
  transform: translateY(110%);
  will-change: transform;
}

body.ready h1 .char {
  transform: translateY(0);
  transition: transform 0.95s var(--ease);
  transition-delay: calc(var(--ci, 0) * 26ms);
}

html.js .hero .eyebrow,
html.js .hero-meta,
html.js .hero-cta {
  opacity: 0;
  transform: translateY(0.75rem);
}

body.ready .hero .eyebrow,
body.ready .hero-meta,
body.ready .hero-cta {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

body.ready .hero .eyebrow { transition-delay: 0.15s; }
body.ready .hero-meta { transition-delay: 0.62s; }
body.ready .hero-cta { transition-delay: 0.78s; }

.word {
  display: inline-block;
  opacity: 0.16;
  transform: translateY(0.28em);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(var(--wi, 0) * 16ms);
}

.word.in { opacity: 1; transform: none; }
.lede .word { color: inherit; }

.role { transition: background 0.3s var(--ease), transform 0.35s var(--ease); }
.role:hover { transform: translateX(0.35rem); }

.btn { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .aurora, .curtain, .cursor-dot, .cursor-ring, .progress { display: none; }
  h1 .char { transform: none; }
  html.js .hero .eyebrow, html.js .hero-meta, html.js .hero-cta { opacity: 1; transform: none; }
  .hero .eyebrow, .hero-meta, .hero-cta { opacity: 1; transform: none; }
  .word { opacity: 1; transform: none; transition: none; }
  .role:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot { animation: none; }
  h1 .line > span { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .spotlight { display: none; }
  * { transition-duration: 0.01ms !important; }
}
