:root {
  --bg: #050506;
  --fg: #ededef;
  --dim: #a3a3ab;
  --muted: #76767f;
  --faint: #2a2a30;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #8ff0c0;
  --gutter: clamp(16px, 4vw, 48px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.js:not(.is-loaded) { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

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

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.faint { color: var(--muted); }

/* ---------- Loader ---------- */

.loader { display: none; }
.js .loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px var(--gutter);
  background: var(--bg);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1s var(--ease-io);
}
.js .loader.out { clip-path: inset(0 0 100% 0); }

.loader-top { display: flex; justify-content: space-between; color: var(--muted); }
#loadLog { color: var(--accent); }

.loader-num {
  align-self: flex-end;
  font-size: clamp(96px, 22vw, 320px);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 20px;
}

.loader-bar { height: 1px; background: var(--line); }
.loader-bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}

/* ---------- Cursor ---------- */

.cursor { display: none; }
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor .cursor {
  display: block;
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 90;
  pointer-events: none;
  mix-blend-mode: difference;
}
.cursor-dot,
.cursor-ring {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform;
}
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; }
.cursor-ring {
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), margin 0.35s var(--ease-out), background 0.35s;
}
.cursor.hover .cursor-ring {
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  background: #fff;
}

/* ---------- Background layers ---------- */

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 50% 45%, transparent 55%, rgba(5, 5, 6, 0.7) 100%),
    linear-gradient(to bottom, rgba(5, 5, 6, 0.6) 0%, transparent 12%, transparent 80%, rgba(5, 5, 6, 0.7) 100%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

section,
footer {
  position: relative;
  z-index: 3;
}

/* ---------- Intro ---------- */

.intro {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding-inline: var(--gutter);
}

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(48px, 10vh, 120px) clamp(24px, 6vh, 64px);
}

.eyebrow { margin: 0 0 clamp(16px, 3vh, 28px); color: var(--muted); }

.title {
  margin: 0;
  font-weight: 600;
  font-size: clamp(4.6rem, 17vw, 16rem);
  line-height: 0.86;
  letter-spacing: -0.06em;
}
.title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.title .word { display: inline-block; }
.title .muted { color: transparent; -webkit-text-stroke: 1px rgba(237, 237, 239, 0.5); }
.js .title .word { transform: translateY(105%); }
.js.is-loaded .title .word { animation: rise 1.2s var(--ease-out) forwards; }
.js.is-loaded .title .line:nth-child(2) .word { animation-delay: 0.12s; }

/* Particle mode: the canvas draws the name, the DOM text stays for layout + a11y. */
.title.pm .word { transform: none !important; animation: none !important; color: transparent; -webkit-text-stroke-color: transparent; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content));
  margin: clamp(28px, 5vh, 48px) 0 0;
  border-top: 1px solid var(--line);
  width: fit-content;
}
.metric {
  padding: 14px 32px 0 0;
  margin-right: 32px;
  border-right: 1px solid var(--line);
}
.metric:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.metric dt { color: var(--muted); margin-bottom: 6px; font-size: 11px; }
.metric dd { margin: 0; color: var(--fg); }

.dots::after {
  content: "";
  display: inline-block;
  width: 3ch;
  text-align: left;
  animation: dots 1.6s steps(4, end) infinite;
}

.status { padding-block: 0 28px; }
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.status-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-size: 13px;
}

.scroll-hint { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.scroll-hint span {
  position: relative;
  width: 1px;
  height: 28px;
  background: var(--line-strong);
  overflow: hidden;
}
.scroll-hint span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(-100%);
  animation: drip 1.8s var(--ease-io) infinite;
}

.pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ping 2s var(--ease-out) infinite;
}

.bar {
  position: relative;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}
.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 18%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}
.is-loaded .bar-fill,
html:not(.js) .bar-fill { animation: fill 1.8s var(--ease-out) 0.9s forwards; }
.bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-100%);
  animation: sweep 3.2s ease-in-out 2.4s infinite;
}

/* ---------- Statement ---------- */

.statement { background: linear-gradient(to bottom, transparent, var(--bg) 40vh); }
.js .statement { height: 220vh; }
.statement-pin {
  display: flex;
  align-items: center;
  padding: 20vh var(--gutter);
}
.js .statement-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding-block: 0;
}

.statement-text {
  margin: 0;
  max-width: 19em;
  font-size: clamp(30px, 5.2vw, 84px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.035em;
}
.statement-text em { font-style: normal; }
.statement-text .w {
  opacity: var(--o, 1);
  transition: opacity 0.15s linear, color 0.4s;
}
.statement-text em .w.lit { color: var(--accent); }

/* ---------- CV chart ---------- */

.cv { background: var(--bg); }
.js .cv { height: 460vh; }

.cv-pin { display: none; }
.js .cv-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: clamp(12px, 2.5vh, 28px);
  padding: clamp(20px, 4vh, 40px) var(--gutter);
  overflow: hidden;
}

.cv-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.cv-head h2 { margin: 0; font-weight: 500; color: var(--fg); }
.cv-stats { display: flex; gap: 20px; margin: 0; color: var(--muted); }

.cv-date { display: flex; align-items: flex-end; gap: 18px; }

.odometer {
  display: flex;
  font-size: clamp(72px, 13vw, 200px);
  font-weight: 600;
  line-height: 1;
  height: 1em;
  letter-spacing: -0.05em;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.digit { display: block; width: 0.6em; height: 1em; overflow: hidden; }
.digit:last-child { color: transparent; -webkit-text-stroke: 1px var(--fg); }
.strip {
  display: flex;
  flex-direction: column;
  transition: transform 0.8s var(--ease-out);
}
.strip span { display: block; height: 1em; }

.cv-month { padding-bottom: 0.9em; font-size: 14px; color: var(--muted); }
.cv-month.now { color: var(--accent); }

.chart {
  position: relative;
  margin-top: clamp(0px, 3vh, 32px);
  padding-bottom: 28px;
}

.lane + .lane { margin-top: clamp(10px, 2vh, 18px); }
.lane-name { color: var(--muted); font-size: 11px; margin-bottom: 4px; }

.track {
  position: relative;
  height: 46px;
  border-bottom: 1px dashed var(--line);
}

.gbar {
  position: absolute;
  bottom: 14px;
  height: 8px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  overflow: hidden;
}
.gbar-fill {
  position: absolute;
  inset: 0;
  background: var(--fg);
  transform-origin: left;
  transform: scaleX(var(--f, 0));
}
.gbar.active { border-color: var(--accent); box-shadow: 0 0 18px rgba(143, 240, 192, 0.45); }
.gbar.active .gbar-fill { background: var(--accent); }

.gbar-label {
  position: absolute;
  bottom: 27px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--faint);
  transition: color 0.4s;
}
.gbar-label.seen { color: var(--dim); }
.gbar-label.active { color: var(--accent); }
.gbar-label.below { bottom: auto; top: 33px; }

.axis { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; }
.tick {
  position: absolute;
  bottom: 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  transform: translateX(-50%);
}
.tick::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 1px;
  height: 6px;
  background: var(--line-strong);
}

.playhead {
  position: absolute;
  left: 0;
  top: -10px;
  bottom: 20px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--accent) 20%, var(--accent));
  box-shadow: 0 0 12px var(--accent);
  will-change: transform;
}
.playhead::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  min-height: 132px;
  align-content: start;
}

.card {
  display: none;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.card.on { display: block; animation: cardIn 0.6s var(--ease-out); }
.card-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; margin: 0 0 8px; }
.card-meta b { font-weight: 400; color: var(--accent); }
.card h3 { margin: 0; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.card p { margin: 2px 0 0; font-size: 14px; color: var(--dim); }
.card .card-desc { margin-top: 8px; font-size: 13px; color: var(--muted); }
.card a { color: var(--fg); text-decoration: underline; text-decoration-color: rgba(143, 240, 192, 0.5); text-underline-offset: 3px; }

/* Plain list: shown without JS, kept for screen readers with JS. */
.cv-list {
  list-style: none;
  margin: 0;
  padding: 80px var(--gutter);
  display: grid;
  gap: 24px;
}
.cv-list li { display: grid; gap: 2px; }
.cv-list .when { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.cv-list .role { font-weight: 500; }
.cv-list .org,
.cv-list .desc { color: var(--dim); }
.js .cv-list {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- End ---------- */

.end {
  background: var(--bg);
  padding-top: clamp(64px, 14vh, 160px);
  overflow: hidden;
}

.marquee { overflow: hidden; border-block: 1px solid var(--line); padding-block: clamp(12px, 2vh, 24px); }
.marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
}
.marquee-track span {
  font-size: clamp(64px, 12vw, 180px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  white-space: nowrap;
  padding-inline: 0.25em;
}
.marquee-track span:nth-of-type(3n + 2) { color: transparent; -webkit-text-stroke: 1px rgba(237, 237, 239, 0.55); }
.marquee-track i {
  width: clamp(14px, 2vw, 28px);
  height: clamp(14px, 2vw, 28px);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 24px var(--accent);
  flex: none;
}

.end-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: clamp(40px, 8vh, 80px) var(--gutter);
}
.end-note { margin: 10px 0 0; color: var(--muted); }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 20px 30px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 18px;
  font-weight: 500;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.5s var(--ease-out);
  will-change: transform;
}
.cta:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.end-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px var(--gutter) 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

/* ---------- Reveal ---------- */

.js .reveal { opacity: 0; transform: translateY(14px); }
.js.is-loaded .reveal {
  animation: up 1s var(--ease-out) forwards;
  animation-delay: calc(var(--d, 0) * 0.08s + 0.5s);
}

@keyframes rise   { to { transform: translateY(0); } }
@keyframes up     { to { opacity: 1; transform: none; } }
@keyframes fill   { to { transform: scaleX(1); } }
@keyframes sweep  { to { transform: translateX(400%); } }
@keyframes ping   { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes dots   { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@keyframes drip   { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .cv-stats span:nth-child(n + 3) { display: none; }
  .card .card-desc { display: none; }
  .end-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .title { font-size: 27vw; }
  .metrics { grid-template-columns: 1fr 1fr; width: 100%; }
  .metric { padding-right: 16px; margin-right: 16px; }
  .metric:nth-child(2) { border-right: 0; margin-right: 0; padding-right: 0; }
  .metric:nth-child(3) { grid-column: 1 / -1; border-right: 0; border-top: 1px solid var(--line); margin-top: 14px; }
  .cv-stats { display: none; }
  .track { height: 42px; }
  .gbar { bottom: 12px; }
  .gbar-label { bottom: 25px; }
  .gbar-label.below { top: 31px; }
  .lane + .lane { margin-top: 14px; }
  .cards { grid-template-columns: 1fr; gap: 6px; min-height: 0; }
  .card { padding: 8px 12px; border-radius: 8px; }
  .card-meta { margin-bottom: 2px; }
  .card h3 { font-size: 14px; }
  .card p { font-size: 12px; margin: 0; }
  .odometer { font-size: 22vw; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}
