/* Main World — design tokens. Light is the default; [data-theme="dark"] overrides. */
:root {
  --bg: #f3f2ee;
  --bg-2: #e9e8e2;
  --ink: #111110;
  --ink-dim: #5b5a55;
  --ink-faint: #8f8d86;
  --line: rgba(17, 17, 16, .14);
  --accent: #e4502a;
  --accent-ink: #ffffff;

  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --max: 1440px;
  --pad: clamp(20px, 3.4vw, 48px);
  --gap: clamp(10px, 1.7vw, 24px);
  --nav-h: 60px;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #111110;
  --bg-2: #1b1b19;
  --ink: #f3f2ee;
  --ink-dim: #a3a19a;
  --ink-faint: #6b6a64;
  --line: rgba(243, 242, 238, .14);
  --accent: #ff6a3d;
  --accent-ink: #111110;

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .5s, color .5s;
}

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

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.mono { font-family: var(--mono); }

/* ---- Global chrome ---- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.nav__row {
  height: var(--nav-h);
  align-items: center;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}
.nav__name { grid-column: 1 / 4; font-weight: 600; white-space: nowrap; }
.nav__meta { color: var(--ink-dim); white-space: nowrap; }
.nav__role { grid-column: 4 / 6; }
.nav__loc { grid-column: 6 / 8; }
.nav__end {
  grid-column: 8 / 13;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 1.8vw, 24px);
}
.nav__link:hover { color: var(--accent); }
.nav__cv {
  background: var(--ink);
  color: var(--bg);
  padding: 7px 12px;
  font-weight: 600;
  white-space: nowrap;
}
.nav__progress { height: 2px; }
.nav__progress > div {
  height: 100%;
  width: calc(var(--g, 0) * 100%);
  background: var(--accent);
}

.theme-toggle {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
}
.theme-toggle span {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 7px;
  color: var(--ink-dim);
}
:root:not([data-theme="dark"]) .theme-toggle__l,
[data-theme="dark"] .theme-toggle__d { background: var(--ink); color: var(--bg); }

.hud {
  position: fixed;
  left: var(--pad);
  bottom: 20px;
  z-index: 40;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--ink);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.hud > span { padding: 9px 12px; }
.hud > span + span { border-left: 1px solid var(--ink); }
.hud__run { display: flex; align-items: center; gap: 8px; }
.hud__run i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pdot 2.4s infinite;
}
.hud__dim { color: var(--ink-dim); }
.hud b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.hud__stage { min-width: 118px; }

@keyframes pdot {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---- Latent field stage (hero + learning curve) ---- */

.field-stage { position: relative; }
.field-wrap {
  position: sticky;
  top: 0;
  height: 100vh;
  margin-bottom: -100vh;
  z-index: 0;
  overflow: hidden;
}
.field-wrap > * { position: absolute; inset: 0; }
.field-wrap__fade {
  pointer-events: none;
  opacity: var(--p1, 0);
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--bg) 88%, transparent) 0%,
    color-mix(in oklab, var(--bg) 55%, transparent) 45%,
    transparent 78%);
}
.field-wrap__dim {
  pointer-events: none;
  background: var(--bg);
  opacity: calc(var(--p2, 0) * .55);
}
.field-stage > section { position: relative; z-index: 2; }

/* ---- 01 Hero ---- */

.hero { height: 160vh; }
.hero__stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
/* Mobile / fallback: fluid stack. Desktop overrides to a fixed scaled artboard below. */
.hero__box {
  position: relative;
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 86px var(--pad) 76px;
  display: flex;
  flex-direction: column;
}
.hero__meta {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
  opacity: calc(1 - var(--p1, 0) * 1.6);
}
.hero__meta-sample { grid-column: 1 / 4; }
.hero__meta-step { grid-column: 4 / 8; }
.hero__meta-step b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.hero__meta-now { grid-column: 8 / 13; text-align: right; }
.hero__hi-wrap { margin-top: clamp(24px, 6vh, 72px); opacity: calc(1 - var(--p1, 0) * 1.6); }
.hero__hi {
  font-size: clamp(22px, min(2.8vw, 4.4vh), 40px);
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--ink-dim);
  animation: rise 1.1s cubic-bezier(.2, .7, .2, 1) .2s both;
}
/* The particle field draws the letterforms; the real text stays for a11y and measurement. */
.hero__name {
  margin: clamp(4px, 1vh, 12px) 0 0 -.03em;
  font-size: min(7.8vw, 15vh, 112px);
  line-height: 1;
  letter-spacing: -.06em;
  font-weight: 700;
  color: transparent;
  white-space: nowrap;
  pointer-events: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(36px); filter: blur(10px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@media (min-width: 901px) {
  .hero__box {
    position: absolute;
    left: 50%;
    top: calc(62px + (100vh - 120px) / 2);
    width: 1440px;
    max-width: none;
    height: 792px;
    margin: 0;
    padding: 26px 48px 8px;
    transform: translate(-50%, -50%) scale(var(--hs, 1));
    transform-origin: 50% 50%;
  }
  .hero__hi-wrap { margin-top: 48px; }
  .hero__hi { font-size: 34px; }
  .hero__name { font-size: 112px; margin-top: 10px; }
}

@media (max-width: 900px) {
  .hide-sm { display: none !important; }
  .hero__name { font-size: min(12.5vw, 96px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hud__run i { animation: none; }
  .hero__hi { animation: none; }
}
