/* ==========================================================================
   Jayaditya G Nair — Portfolio
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #f5f4ef;
  --bg-2: #eceae3;
  --surface: #ffffff;
  --surface-2: #f1f0ea;
  --border: #e0ded5;
  --border-strong: #cbc8bc;
  --text: #121316;
  --text-2: #4a4d55;
  --text-3: #7d8089;
  --accent: #b9ec4f;
  --accent-text: #3b6300;
  --accent-ink: #11140a;
  --accent-soft: rgba(110, 160, 20, 0.12);
  --accent-line: rgba(80, 130, 0, 0.35);
  --signal: #2f6bff;
  --warn: #c2410c;
  --grid: rgba(18, 19, 22, 0.05);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -12px rgba(0,0,0,.12);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.25);
  --header-bg: rgba(245, 244, 239, 0.78);

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;

  --radius: 14px;
  --radius-sm: 9px;
  --container: 1180px;
  --gutter: 24px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0a08;
    --bg-2: #110e0b;
    --surface: #15120e;
    --surface-2: #1c1813;
    --border: #29231b;
    --border-strong: #3a3126;
    --text: #eee6d8;
    --text-2: #b5aa97;
    --text-3: #7d7262;
    --accent: #c9a46a;
    --accent-text: #d6b57e;
    --accent-ink: #0c0a08;
    --accent-soft: rgba(214, 181, 126, 0.09);
    --accent-line: rgba(214, 181, 126, 0.34);
    --signal: #b36b4f;
    --warn: #d9925f;
    --grid: rgba(238, 230, 216, 0.03);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -12px rgba(0,0,0,.7);
    --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.85);
    --header-bg: rgba(12, 10, 8, 0.78);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0a08;
  --bg-2: #110e0b;
  --surface: #15120e;
  --surface-2: #1c1813;
  --border: #29231b;
  --border-strong: #3a3126;
  --text: #eee6d8;
  --text-2: #b5aa97;
  --text-3: #7d7262;
  --accent: #c9a46a;
  --accent-text: #d6b57e;
  --accent-ink: #0c0a08;
  --accent-soft: rgba(214, 181, 126, 0.09);
  --accent-line: rgba(214, 181, 126, 0.34);
  --signal: #b36b4f;
  --warn: #d9925f;
  --grid: rgba(238, 230, 216, 0.03);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -12px rgba(0,0,0,.7);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.85);
  --header-bg: rgba(12, 10, 8, 0.78);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
p { margin: 0; }
em.serif, .serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link {
  position: absolute; left: 12px; top: -40px; z-index: 200;
  background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* Grid backdrop used by several sections */
.gridbg {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--text); color: var(--bg);
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0;
  position: relative; overflow: hidden;
}
.brand-mark::after {
  content: ""; position: absolute; right: 4px; bottom: 4px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}
.brand-name { font-size: 15px; }
.brand-role { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-size: 14px; color: var(--text-2); padding: 7px 12px; border-radius: 8px;
  transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-text); margin-right: 7px; vertical-align: middle; transform: translateY(-1px);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }

.kbd {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; background: var(--surface-2);
}
.menu-btn { display: none; }

.mobile-menu {
  display: none; position: fixed; inset: 64px 0 0 0; z-index: 49;
  background: var(--bg); padding: 24px var(--gutter);
  flex-direction: column; gap: 4px;
}
.mobile-menu.open { display: flex; animation: fadeIn .2s var(--ease); }
.mobile-menu a { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mobile-menu a[aria-current="page"] { color: var(--accent-text); }

/* ---------- Buttons ---------- */

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2);
  border-bottom: 1px solid var(--border-strong); padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}
.link-arrow:hover { color: var(--text); border-color: var(--text); }

/* ---------- Chips & tags ---------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
.eyebrow .idx { color: var(--accent-text); }
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.status.live::before { background: var(--accent-text); animation: pulse 2s infinite; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding: 112px 0; }
.section-sm { padding: 72px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 48px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(32px, 4.4vw, 52px); max-width: 760px; margin-top: 14px; }
.section-head p { max-width: 460px; color: var(--text-2); }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); display: flex; align-items: flex-start; overflow: hidden; padding: clamp(48px, 10vh, 104px) 0 96px; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 30% 50%, transparent 0%, var(--bg) 100%);
  opacity: .55;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(44px, 7.6vw, 104px);
  line-height: .98; letter-spacing: -0.045em; font-weight: 600;
  margin: 28px 0 0; max-width: 1050px;
}
.hero h1 .serif { font-weight: 400; letter-spacing: -0.02em; }
.hero-sub { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 44px; }
.hero-sub p { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); max-width: 600px; line-height: 1.55; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 32px; }
.rotator {
  display: inline-block; color: var(--accent-text); font-family: var(--font-mono);
  font-size: .5em; letter-spacing: 0; vertical-align: middle;
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  padding: .18em .5em; border-radius: .4em; transform: translateY(-.2em);
  min-width: 2ch;
}
.rotator::after { content: "▍"; animation: blink 1s steps(1) infinite; margin-left: 2px; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3); letter-spacing: .1em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-hint span { width: 1px; height: 32px; background: linear-gradient(var(--text-3), transparent); animation: drip 2s var(--ease) infinite; }

/* ---------- Stats ---------- */

/* ---------- Cards (spotlight) ---------- */

.spot::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 45%);
  transition: opacity .3s;
}
.spot:hover::before { opacity: 1; }

/* Project cards */

/* Featured layout on home: first card spans */

/* ---------- Capabilities ---------- */

/* ---------- Now teaser / list ---------- */

.now-list { display: flex; flex-direction: column; }
.now-row {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 20px; align-items: center;
  padding: 18px 0; border-top: 1px solid var(--border);
}
.now-row:last-child { border-bottom: 1px solid var(--border); }
.now-row h4 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.now-row .muted { font-size: 14px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; }
.tl-item { display: grid; grid-template-columns: 220px 1fr; gap: 40px; padding: 40px 0; border-top: 1px solid var(--border); }
.tl-item:last-child { border-bottom: 1px solid var(--border); }
.tl-period { font-family: var(--font-mono); font-size: 13px; color: var(--text-3); padding-top: 6px; }
.tl-period .place { display: block; margin-top: 4px; }
.tl-role { font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -0.02em; }
.tl-org { color: var(--accent-text); margin-top: 6px; font-weight: 500; }
.tl-points { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 10px; }
.tl-points li { position: relative; padding-left: 22px; color: var(--text-2); max-width: 760px; }
.tl-points li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 8px; height: 1px; background: var(--text-3); }
.tl-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: 64px 0 48px; position: relative; overflow: hidden; }
.page-head h1 { font-size: clamp(44px, 7vw, 92px); letter-spacing: -0.045em; line-height: .98; margin-top: 18px; }
.page-head p.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); max-width: 640px; margin-top: 24px; }
.page-head-row { display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; }

/* Project filters */

/* Lab */

/* ---------- Project detail ---------- */
.pd-hero { padding-top: 48px; padding-bottom: 48px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); }
.crumbs a:hover { color: var(--text); }
.pd-hero h1 { font-size: clamp(38px, 6vw, 80px); letter-spacing: -0.045em; line-height: 1; margin-top: 28px; max-width: 1000px; }
.pd-hero .lead { font-size: clamp(17px, 1.7vw, 21px); color: var(--text-2); max-width: 760px; margin-top: 24px; line-height: 1.55; }
.pd-meta { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-top: 48px; }
.pd-meta > div { padding: 20px 20px 20px 0; }
.pd-meta > div + div { padding-left: 20px; border-left: 1px solid var(--border); }
.pd-meta dt { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.pd-meta dd { margin: 6px 0 0; font-size: 15px; }

.pd-body { display: grid; grid-template-columns: 240px 1fr; gap: 64px; padding-top: 64px; padding-bottom: 40px; }
.pd-toc { position: sticky; top: 96px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.pd-toc a { font-size: 14px; color: var(--text-3); padding: 6px 0 6px 14px; border-left: 1px solid var(--border); transition: color .2s, border-color .2s; }
.pd-toc a:hover { color: var(--text); }
.pd-toc a.active { color: var(--text); border-left-color: var(--accent-text); }
.pd-section { padding-bottom: 64px; scroll-margin-top: 96px; }
.pd-section h2 { font-size: clamp(26px, 3vw, 36px); margin: 12px 0 20px; }
.pd-section > p { color: var(--text-2); font-size: 17.5px; max-width: 720px; line-height: 1.65; }
.pd-section > p + p { margin-top: 16px; }
.built-list { list-style: none; padding: 0; margin: 0; counter-reset: b; border-top: 1px solid var(--border); }
.built-list li {
  counter-increment: b; display: grid; grid-template-columns: 48px 1fr; gap: 12px;
  padding: 16px 0; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 16px;
}
.built-list li::before { content: counter(b, decimal-leading-zero); font-family: var(--font-mono); font-size: 12px; color: var(--accent-text); padding-top: 4px; }

/* ---------- Demos ---------- */

/* Pipeline (generic step diagram) */
.pipeline { display: grid; gap: 10px; }
.pipe-row { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.pipe-node {
  flex: 1 0 128px; min-width: 128px; border: 1px solid var(--border); border-radius: 11px; padding: 14px;
  background: var(--bg-2); position: relative; transition: all .35s var(--ease); cursor: pointer; text-align: left;
}
.pipe-node .n { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.pipe-node .t { font-size: 14px; font-weight: 500; margin-top: 6px; line-height: 1.3; }
.pipe-node .s { font-size: 12px; color: var(--text-3); margin-top: 4px; line-height: 1.4; }
.pipe-node.active { border-color: var(--accent-text); background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); }
.pipe-node.active .n { color: var(--accent-text); }
.pipe-node.done { border-color: var(--accent-line); }
.pipe-link { flex: 0 0 28px; align-self: center; height: 2px; background: var(--border); position: relative; overflow: hidden; }
.pipe-link.flow::after {
  content: ""; position: absolute; inset: 0; width: 40%;
  background: var(--accent-text); animation: flow 0.9s linear infinite;
}

/* Gamify demo */
.game { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.phone {
  border: 1px solid var(--border-strong); border-radius: 28px; padding: 18px; background: var(--bg-2);
  max-width: 340px; width: 100%; margin: 0 auto; box-shadow: var(--shadow);
}
.phone-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); }
.phone-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.phone-stats div { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--surface); text-align: center; }
.phone-stats b { display: block; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.phone-stats span { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.level { margin-top: 12px; border-radius: 12px; padding: 12px; background: var(--text); color: var(--bg); }
.level-row { display: flex; justify-content: space-between; font-size: 13px; }
.level-track { height: 6px; border-radius: 99px; background: rgba(127,127,127,.35); margin-top: 8px; overflow: hidden; }
.level-fill { height: 100%; background: var(--accent); border-radius: inherit; transition: width .6s var(--ease); }
.missions { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.mission { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); font-size: 13.5px; }
.mission button { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-strong); }
.mission button.ready { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); animation: glow 1.6s infinite; }
.mission button.done { opacity: .5; cursor: default; }
.flame { font-family: var(--font-mono); font-size: 12px; }
.game-log { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: hidden; }
.game-log div { animation: slideIn .35s var(--ease); }
.game-log b { color: var(--accent-text); font-weight: 500; }

/* Dashboard demo */
.dash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi { border: 1px solid var(--border); border-radius: 11px; padding: 14px; background: var(--bg-2); }
.kpi .k { font-size: 11.5px; color: var(--text-3); font-family: var(--font-mono); }
.kpi .v { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.dash-chart { grid-column: 1 / -1; border: 1px solid var(--border); border-radius: 11px; padding: 14px; background: var(--bg-2); }
.dash-chart svg { width: 100%; height: 200px; overflow: visible; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin-top: 8px; font-family: var(--font-mono); }
.legend i { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 6px; }
.access-flow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.access-step { font-family: var(--font-mono); font-size: 12px; padding: 7px 11px; border-radius: 8px; border: 1px solid var(--border); color: var(--text-3); transition: all .3s; }
.access-step.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* Signal canvas demos */
.signal-wrap { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }
.signal-canvas { width: 100%; height: 260px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-2); }
.readouts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.readout { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg-2); }
.readout .k { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.readout .v { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 2px; }
.verdict { grid-column: 1 / -1; border-radius: 10px; padding: 12px 14px; background: var(--text); color: var(--bg); }
.verdict .k { font-family: var(--font-mono); font-size: 11px; opacity: .7; }
.verdict .v { font-size: 16px; font-weight: 500; margin-top: 2px; }
.emo-bars { display: flex; flex-direction: column; gap: 10px; }
.emo-bar .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); font-family: var(--font-mono); }
.emo-bar .track { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); margin-top: 4px; overflow: hidden; }
.emo-bar .fill { height: 100%; background: var(--text-3); border-radius: inherit; transition: width .5s var(--ease); }
.emo-bar.top .fill { background: var(--accent); }
.emo-bar.top .row { color: var(--text); }

/* Excel mapping demo */
.xmap { display: grid; grid-template-columns: 1fr 80px 1fr; gap: 0; align-items: stretch; }
.xcol { display: flex; flex-direction: column; gap: 10px; }
.xcol h4 { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 500; margin-bottom: 4px; }
.xitem { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--bg-2); font-size: 14px; transition: all .25s; cursor: default; text-align: left; }
.xitem .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.xitem.on { border-color: var(--accent-text); background: var(--accent-soft); }
.xitem.sheet { font-family: var(--font-mono); font-size: 13px; }
.xitem.sheet::before { content: "▦ "; color: #1d7a45; }
.xlinks { position: relative; }
.xlinks svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 64px; align-items: start; }

.about-copy p { font-size: 19px; line-height: 1.65; color: var(--text-2); }
.about-copy p + p { margin-top: 22px; }
.about-copy p:first-child { color: var(--text); font-size: 22px; }
.contact-list { display: flex; flex-direction: column; margin-top: 20px; }
.contact-list a { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-2); transition: color .2s; gap: 12px; }
.contact-list a:hover { color: var(--text); }
.contact-list a span:last-child { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- CTA + Footer ---------- */
.cta { padding: 120px 0; text-align: center; border-top: 1px solid var(--border); position: relative; overflow: hidden; }
.cta h2 { font-size: clamp(40px, 7vw, 96px); letter-spacing: -0.045em; line-height: 1; }
.cta p { color: var(--text-2); margin: 20px auto 0; max-width: 520px; font-size: 18px; }
.cta .hero-cta { justify-content: center; }
.email-big {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 36px;
  font-size: clamp(18px, 2.4vw, 26px); font-family: var(--font-mono); letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border-strong); padding-bottom: 6px; transition: border-color .2s, color .2s;
  max-width: 100%; overflow-wrap: anywhere;
}
.email-big:hover { color: var(--accent-text); border-color: var(--accent-text); }
.site-footer { border-top: 1px solid var(--border); padding: 32px 0 40px; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }

/* ---------- Command palette ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(5, 6, 8, 0.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 12vh 16px 16px;
}
.overlay.open { display: block; animation: fadeIn .15s var(--ease); }
.palette {
  max-width: 600px; margin: 0 auto; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop .2s var(--ease);
}
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 56px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.palette-input svg { width: 18px; height: 18px; }
.palette-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--text); min-width: 0; }
.palette-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.palette-group { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; padding: 10px 10px 6px; }
.palette-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px; border-radius: 9px; font-size: 14.5px; color: var(--text-2);
}
.palette-item .pi-icon { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); display: grid; place-items: center; flex: none; background: var(--surface-2); }
.palette-item .pi-icon svg { width: 14px; height: 14px; }
.palette-item .pi-sub { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.palette-item.sel { background: var(--surface-2); color: var(--text); }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }

/* ---------- Assistant ---------- */

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 120;
  background: var(--text); color: var(--bg); font-size: 13.5px; padding: 10px 16px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-line); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@keyframes flow { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-line); } 50% { box-shadow: 0 0 0 5px transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  
  
  
  .pd-body { grid-template-columns: 1fr; gap: 0; }
  .pd-toc { display: none; }
  
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  
  .signal-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --gutter: 20px; }
  .nav-links, .nav-actions .hide-sm { display: none; }
  .menu-btn { display: inline-flex; }
  .section { padding: 80px 0; }
  .hero { padding: 48px 0 88px; }
  .hero-sub { grid-template-columns: 1fr; gap: 24px; }
  
  .scroll-hint { display: none; }
  
  
  
  
  
  
  
  .tl-item { grid-template-columns: 1fr; gap: 12px; }
  
  .pd-meta { grid-template-columns: repeat(2, 1fr); }
  .pd-meta > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .pd-meta > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .dash { grid-template-columns: repeat(2, 1fr); }
  .game { grid-template-columns: 1fr; }
  .xmap { grid-template-columns: 1fr 36px 1fr; }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .brand-role { display: none; }
  
  
  
  
  
  
  
  .now-row { grid-template-columns: 1fr; gap: 6px; }
  
  
  
  .xmap { grid-template-columns: 1fr; gap: 10px; }
  .xlinks { display: none; }
  
  
  
  
}

/* ---------- Card artwork ---------- */

.art-l { stroke: var(--border-strong); fill: none; stroke-width: 1.2; }
.art-m { stroke: var(--text-3); fill: none; stroke-width: 1.2; }
.art-mf { fill: var(--text-3); }
.art-a { stroke: var(--accent-text); fill: none; stroke-width: 1.8; }
.art-af { fill: var(--accent-text); }
.art-f { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1; }
.art-dot { fill: var(--text-3); opacity: .55; }
.art-t { fill: var(--text-3); font-family: var(--font-mono); font-size: 10px; }
.art-t-ink { fill: var(--accent-ink); font-family: var(--font-mono); font-size: 9px; }
.art-big { fill: var(--text); font-family: var(--font-sans); font-size: 20px; font-weight: 600; letter-spacing: -0.03em; }
.art-cell-on { fill: var(--accent-soft); stroke: var(--accent-text); stroke-width: 1; }
.art-bar { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1; }
.art-moon { fill: var(--text-3); opacity: .5; }
.art-acc-pill { fill: var(--accent); }

/* hero focus line */
.hero-now { margin-top: 18px; font-size: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-now .rotator { font-size: 14px; transform: none; }
.hero-cta .kbd { margin-left: 2px; }

/* keep wide demo content from stretching grid columns */
.pd-body > *, .about-grid > *, .tl-item > *, .signal-wrap > *, .game > * { min-width: 0; }

/* ==========================================================================
   v2 — interaction layer
   ========================================================================== */

/* ---------- Page transitions & progress ---------- */
main { animation: pageIn .6s var(--ease) both; }
body.page-leave main { opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 70; pointer-events: none;
  background: var(--accent-text); transform-origin: left; transform: scaleX(0);
}

/* subtle film grain for depth */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 999; pointer-events: none; opacity: .028;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Word-by-word headings ---------- */
.words .w {
  display: inline-block; opacity: 0; transform: translateY(.35em); filter: blur(8px);
  animation: wordIn .9s var(--ease) forwards; animation-delay: calc(var(--i) * 65ms + 120ms);
}
@keyframes wordIn { to { opacity: 1; transform: none; filter: blur(0); } }

/* ---------- Tilt & magnetic ---------- */

/* ---------- Nav hover pill ---------- */
.nav-links { position: relative; }
.nav-links a { position: relative; z-index: 1; }
.nav-links a:hover { background: transparent; }

/* ---------- Hero extras ---------- */
.hero-glow {
  position: absolute; z-index: 0; pointer-events: none; right: -12%; top: -25%;
  width: min(68vw, 900px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 62%);
  animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(-8%, 10%) scale(1.08); } }
.hero-tip {
  position: absolute; z-index: 1; bottom: 30px; right: max(24px, calc((100vw - var(--container)) / 2 + 24px));
  font-size: 11px; color: var(--text-3); letter-spacing: .04em;
}

.cta-glow {
  position: absolute; left: 50%; top: 50%; width: min(900px, 120vw); height: 460px; transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, var(--accent-soft), transparent 65%); pointer-events: none;
}
.cta .container { position: relative; z-index: 1; }

/* ---------- Marquee ---------- */

/* ---------- Venture (home) ---------- */

/* ---------- Triptych phone ---------- */
.tt-phone {
  --paper: #FBFAF8; --ink: #1C1C1C; --rule: #E4DFD7; --muted: #8A8680;
  width: 100%; max-width: 340px; background: var(--paper); color: var(--ink);
  border-radius: 34px; border: 9px solid #121212; overflow: hidden; user-select: none; -webkit-user-select: none;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.04);
  display: flex; flex-direction: column;
}
.tt-mini { max-width: 290px; border-radius: 30px; border-width: 8px; }
.tt-head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 18px 10px; border-bottom: 1px solid var(--rule); }
.tt-word { font-family: var(--font-serif); font-style: italic; font-size: 26px; line-height: 1; letter-spacing: -0.01em; }
.tt-motto { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tt-band { position: relative; height: 152px; overflow: hidden; border-bottom: 1px solid var(--rule); touch-action: pan-y; cursor: grab; outline: none; }
.tt-band:nth-of-type(odd) { background: #F6F3EE; }
.tt-mini .tt-band { height: 122px; }
.tt-band:focus-visible { box-shadow: inset 0 0 0 2px #2F6A4C; }
.tt-band.dragging { cursor: grabbing; }
.tt-track { display: flex; height: 100%; will-change: transform; }
.tt-item { flex: none; height: 100%; display: flex; align-items: center; justify-content: center; padding: 14px 6px; opacity: .25; transform: scale(.8); transition: opacity .45s, transform .55s var(--ease); }
.tt-item.cur { opacity: 1; transform: scale(1); }
.tt-item svg { height: 100%; width: 100%; filter: drop-shadow(0 8px 10px rgba(0,0,0,.14)); pointer-events: none; }
.tt-num { position: absolute; left: 14px; top: 10px; z-index: 2; font-family: var(--font-serif); font-style: italic; font-size: 16px; color: var(--muted); }
.tt-arrow {
  position: absolute; top: 50%; z-index: 2; width: 30px; height: 30px; border-radius: 50%; transform: translateY(-50%);
  display: grid; place-items: center; font-size: 18px; line-height: 1; padding-bottom: 2px;
  background: rgba(255,255,255,.9); border: 1px solid var(--rule); color: var(--ink);
  opacity: 0; transition: opacity .2s, transform .2s;
}
.tt-arrow:hover { transform: translateY(-50%) scale(1.08); }
.tt-arrow.prev { left: 10px; }
.tt-arrow.next { right: 10px; }
.tt-band:hover .tt-arrow, .tt-band:focus-within .tt-arrow { opacity: 1; }
@media (hover: none) { .tt-arrow { opacity: .85; } }
.tt-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px 15px; background: var(--ink); color: var(--paper); }
.tt-sum { min-width: 0; }
.tt-total { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tt-names { font-size: 10.5px; opacity: .6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-bag { flex: none; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; background: var(--paper); color: var(--ink); padding: 8px 12px; border-radius: 99px; }

/* ---------- Triptych demo (Now page) ---------- */

.tt-panel { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.tt-score { display: flex; align-items: baseline; gap: 10px; }
.tt-score #tt-score { font-size: clamp(64px, 7vw, 88px); font-weight: 500; letter-spacing: -0.05em; line-height: .9; font-variant-numeric: tabular-nums; transition: color .4s; }
.tt-score small { font-family: var(--font-mono); font-size: 13px; color: var(--text-3); }
.tt-score[data-band="good"] #tt-score { color: var(--accent-text); }
.tt-score[data-band="low"] #tt-score { color: var(--warn); }
.tt-meters { display: flex; flex-direction: column; gap: 12px; }
.tt-meter .row { display: flex; justify-content: space-between; font-size: 14px; }
.tt-meter .row .mono { font-size: 12px; }
.tt-meter .track { height: 6px; margin-top: 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.tt-meter .fill { height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .7s var(--ease); }
.tt-reasons { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; min-height: 54px; }
.tt-reasons li { position: relative; padding-left: 24px; font-size: 15.5px; animation: slideIn .35s var(--ease); }
.tt-reasons li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent-text); font-size: 13px; }
.tt-occasion { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.tt-note { font-size: 12.5px; color: var(--text-3); }

/* ---------- Roadmap ---------- */

/* ---------- Skill explorer (About) ---------- */

/* ---------- Timeline rail ---------- */
.timeline { position: relative; }
.tl-item { position: relative; }
.tl-rail { position: absolute; top: 0; bottom: 0; left: 240px; width: 1px; background: var(--border); }
.tl-rail-fill { position: absolute; inset: 0; background: var(--accent-text); transform-origin: top; transform: scaleY(0); }
.tl-dot {
  position: absolute; left: 234px; top: 47px; z-index: 1; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border-strong); transition: background-color .3s, border-color .3s, box-shadow .3s;
}
.tl-dot.on { background: var(--accent); border-color: var(--accent-text); box-shadow: 0 0 0 5px var(--accent-soft); }

/* ---------- Projects page extras ---------- */

@keyframes cardPop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Misc ---------- */

.footer-clock { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 12px; }

@media (max-width: 860px) {
  
  
  .tl-rail, .tl-dot, .hero-tip { display: none; }
  
  
  
}
@media (max-width: 560px) {
  
  .tt-band { height: 138px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-glow { animation: none; }
  .words .w { opacity: 1; transform: none; filter: none; }
}

/* links inside the Triptych demo copy */
.tt-note a { color: var(--accent-text); border-bottom: 1px solid var(--accent-line); }
.pd-section > p .link-arrow { display: inline; color: var(--accent-text); border-color: var(--accent-line); white-space: nowrap; }
.pd-section > p .link-arrow svg { display: inline; vertical-align: -1px; }

/* on stacked layouts the portrait box becomes a short banner so the bio stays close */

/* phone line under the big email in the contact section */
.phone-big {
  display: block; width: fit-content; margin: 14px auto 0; font-family: var(--font-mono);
  font-size: clamp(15px, 1.8vw, 19px); color: var(--text-2); letter-spacing: .02em;
  border-bottom: 1px solid var(--border-strong); padding-bottom: 4px; transition: color .2s, border-color .2s;
}
.phone-big:hover { color: var(--accent-text); border-color: var(--accent-text); }

/* LinkedIn / GitHub logos in the contact section */

/* ---------- Hero links: two editorial entry points instead of buttons ---------- */
.hero-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; margin-top: 36px; border-top: 1px solid var(--border-strong); }
.hero-link { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 18px 20px 6px 0; color: var(--text); }
.hero-link + .hero-link { padding-left: 22px; border-left: 1px solid var(--border); }
.hero-link::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: var(--accent-text);
  transform: scaleX(0); transform-origin: left; transition: transform .55s var(--ease);
}
.hl-num { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent-text); padding-top: 6px; }
.hl-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hl-label { position: relative; width: fit-content; font-size: 20px; font-weight: 500; letter-spacing: -0.015em; }
.hl-label::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease);
}
.hl-sub { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.hl-arrow { display: block; padding-top: 5px; color: var(--text-3); transition: transform .4s var(--ease), color .25s; }
.hl-arrow svg { width: 18px; height: 18px; display: block; }
.hero-link[href^="#"] .hl-arrow svg { transform: rotate(90deg); }
.hero-link:hover::before, .hero-link:focus-visible::before { transform: scaleX(1); }
.hero-link:hover .hl-label::after, .hero-link:focus-visible .hl-label::after { transform: scaleX(1); transform-origin: left; }
.hero-link:hover .hl-arrow, .hero-link:focus-visible .hl-arrow { color: var(--accent-text); transform: translateX(5px); }
.hero-link[href^="#"]:hover .hl-arrow, .hero-link[href^="#"]:focus-visible .hl-arrow { transform: translateY(4px); }
@media (max-width: 560px) {
  .hero-links { grid-template-columns: 1fr; }
  .hero-link { padding: 16px 0 14px; }
  .hero-link + .hero-link { padding-left: 0; border-left: 0; border-top: 1px solid var(--border); }
}

/* ---------- Page-to-page transitions (Chrome, Edge, Safari 18+) ----------
   Forward: the page slides out to the left and the next one comes in from the
   right. Back (tagged in app.js): the reverse. The header stays put. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
.vt main { animation: none; }
::view-transition-old(root) { animation: vt-out .3s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in .55s cubic-bezier(.2, .7, .2, 1) .04s both; }
html:active-view-transition-type(back)::view-transition-old(root) { animation-name: vt-out-back; }
html:active-view-transition-type(back)::view-transition-new(root) { animation-name: vt-in-back; }
@keyframes vt-out { to { opacity: 0; transform: translateX(-32px); filter: blur(6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(32px); filter: blur(6px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(32px); filter: blur(6px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-32px); filter: blur(6px); } }

/* ---------- Light / dark switch ---------- */
/* a circle of the new theme grows from the toggle (animated in app.js) */
html.theme-vt .site-header { view-transition-name: none; }
html.theme-vt::view-transition-old(root), html.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-vt::view-transition-old(root) { z-index: 1; }
html.theme-vt::view-transition-new(root) { z-index: 2; }
html.theme-vt *, html.theme-vt *::before, html.theme-vt *::after { transition: none !important; }
/* fallback where view transitions aren't available: colours ease across */
html.theme-fade, html.theme-fade *, html.theme-fade *::before, html.theme-fade *::after {
  transition: background-color .45s ease, color .45s ease, border-color .45s ease, fill .45s ease, stroke .45s ease, box-shadow .45s ease !important;
}
#theme-btn svg { transition: transform .6s var(--ease); }
#theme-btn:active svg { transform: rotate(-30deg) scale(.9); }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ==========================================================================
   v3 — editorial layer: content sits on the page, not in cards or buttons
   ========================================================================== */

/* ---------- Dark theme ambience: low lamp light, deep corners ---------- */
:root[data-theme="dark"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 998; pointer-events: none;
  background:
    radial-gradient(560px circle at var(--lx, 70%) var(--ly, -10%), rgba(226, 182, 112, 0.065), transparent 62%),
    radial-gradient(ellipse 120% 95% at 50% 35%, transparent 52%, rgba(0, 0, 0, 0.42) 100%);
}
:root[data-theme="dark"] body::after { opacity: .045; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body::before {
    content: ""; position: fixed; inset: 0; z-index: 998; pointer-events: none;
    background:
      radial-gradient(560px circle at var(--lx, 70%) var(--ly, -10%), rgba(226, 182, 112, 0.065), transparent 62%),
      radial-gradient(ellipse 120% 95% at 50% 35%, transparent 52%, rgba(0, 0, 0, 0.42) 100%);
  }
  :root:not([data-theme="light"]) body::after { opacity: .045; }
}

/* ---------- Actions as text, not buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 6px 0;
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap;
  color: var(--text); background: none; border: 0; cursor: pointer; transition: color .25s;
}
.btn::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease), background-color .25s;
}
.btn:hover::after, .btn:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.btn svg { width: 16px; height: 16px; transition: transform .35s var(--ease); }
.btn:hover svg.arrow { transform: translateX(4px); }
.btn-primary { color: var(--accent-text); }
.btn-primary::after { transform: scaleX(1); background: var(--accent-line); }
.btn-primary:hover::after { background: var(--accent-text); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 4px 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }
.btn:disabled { opacity: .5; cursor: default; }
.hero-cta { gap: 10px 30px; }

/* toggles: plain words, the active one underlined */
.chip-row { gap: 6px 24px; }
.chip {
  position: relative; display: inline-flex; align-items: baseline; padding: 6px 0;
  background: none; border: 0; font-size: 14.5px; color: var(--text-3); transition: color .25s;
}
.chip::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent-text);
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.chip:hover, .chip[aria-pressed="true"] { color: var(--text); }
.chip[aria-pressed="true"]::after { transform: scaleX(1); }
.chip .count { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); margin-left: 3px; transform: translateY(-6px); }

/* tags read as a quiet line of text */
.tags { display: flex; flex-wrap: wrap; gap: 4px 0; }
.tag { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.tag + .tag::before { content: "·"; margin: 0 9px; color: var(--text-3); }

/* spotlight that follows the pointer across rows */
.spot { position: relative; isolation: isolate; }
.spot::before { z-index: -1; }

/* header controls without boxes */
.icon-btn {
  height: 36px; min-width: 36px; padding: 0 8px; border-radius: 9px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-2); font-size: 13px; transition: color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.menu-btn { display: none; }
@media (max-width: 860px) { .icon-btn.menu-btn { display: inline-flex; } }
.nav-pill {
  position: absolute; bottom: 7px; height: 1px; background: var(--accent-text); opacity: 0; pointer-events: none;
  transition: left .3s var(--ease), width .3s var(--ease), opacity .2s;
}
.nav-links:hover .nav-pill { opacity: 1; }

/* ---------- Projects: an index instead of a card grid ---------- */
.filters { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 32px; }
.filters-right { display: flex; align-items: center; gap: 18px; }
.search {
  display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 6px 0;
  border-bottom: 1px solid var(--border-strong); color: var(--text-3); transition: border-color .25s, color .25s;
}
.search:focus-within { border-color: var(--accent-text); color: var(--accent-text); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 15px; color: var(--text); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.search svg { width: 16px; height: 16px; flex: none; }
.empty { display: none; padding: 60px 0; text-align: center; color: var(--text-3); font-family: var(--font-mono); font-size: 13px; }

.work-list { border-top: 1px solid var(--border-strong); }
.work-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 190px 28px; gap: 24px; align-items: baseline;
  padding: 30px 0 28px; border-bottom: 1px solid var(--border); color: var(--text);
  transition: opacity .35s var(--ease);
}
.work-row.is-hidden { display: none; }
.work-row.pop { animation: cardPop .5s var(--ease) both; }
.wr-num { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); transition: color .3s; }
.wr-main { min-width: 0; }
.wr-title { display: block; font-size: clamp(26px, 3.4vw, 42px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; transition: transform .55s var(--ease), color .3s; }
.wr-sum { display: block; margin-top: 12px; max-width: 640px; color: var(--text-2); font-size: 15.5px; }
.wr-stack { display: block; margin-top: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.wr-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); text-align: right; }
.wr-meta .wr-label { color: var(--text-2); }
.wr-arrow { align-self: center; color: var(--text-3); transition: transform .5s var(--ease), color .3s; }
.wr-arrow svg { width: 22px; height: 22px; display: block; }
.wr-art { display: none; }
.work-list:has(.work-row:hover) .work-row:not(:hover) { opacity: .4; }
.work-row:hover .wr-title { transform: translateX(12px); }
.work-row:hover .wr-num, .work-row:hover .wr-arrow { color: var(--accent-text); }
.work-row:hover .wr-arrow { transform: rotate(-45deg); }

.art-frame svg { width: 100%; height: 100%; display: block; }
.art-frame svg * { vector-effect: non-scaling-stroke; }
.work-preview {
  position: fixed; left: 0; top: 0; z-index: 45; width: 340px; height: 186px; pointer-events: none;
  border-radius: 12px; overflow: hidden; background: var(--bg-2); box-shadow: var(--shadow-lg);
  opacity: 0; scale: .9; transition: opacity .3s var(--ease), scale .45s var(--ease);
}
.work-preview.on { opacity: 1; scale: 1; }
.work-preview .art-frame { position: absolute; inset: 0; opacity: 0; transition: opacity .35s var(--ease); }
.work-preview .art-frame.on { opacity: 1; }

/* Lab: rows that open */
.lab-list { border-top: 1px solid var(--border-strong); }
.lab-item { border-bottom: 1px solid var(--border); }
.lab-head { width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto 18px; gap: 24px; align-items: center; padding: 24px 0; text-align: left; }
.lab-n { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); transition: color .3s; }
.lab-title { font-size: clamp(19px, 2vw, 25px); font-weight: 500; letter-spacing: -0.02em; transition: transform .5s var(--ease); }
.lab-tags { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.lab-plus { position: relative; width: 14px; height: 14px; justify-self: end; }
.lab-plus::before, .lab-plus::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--text-2); transition: transform .45s var(--ease), background-color .3s; }
.lab-plus::after { transform: rotate(90deg); }
.lab-head:hover .lab-title { transform: translateX(10px); }
.lab-head:hover .lab-n, .lab-item.open .lab-n { color: var(--accent-text); }
.lab-item.open .lab-plus::after { transform: rotate(0deg); }
.lab-item.open .lab-plus::before, .lab-item.open .lab-plus::after { background: var(--accent-text); }
.lab-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.lab-item.open .lab-body { grid-template-rows: 1fr; }
.lab-body > div { overflow: hidden; padding-left: 80px; }
.lab-body p { color: var(--text-2); max-width: 680px; font-size: 16px; }
.lab-body .btn { margin: 12px 0 26px; }
.lab-body p:last-child { padding-bottom: 26px; }

/* ---------- Home: "What I do" as an index ---------- */
.cap-index { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 72px; align-items: start; }
.cap-tabs { border-top: 1px solid var(--border-strong); }
.cap-tab {
  position: relative; width: 100%; display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: baseline; gap: 12px;
  padding: 24px 0; border-bottom: 1px solid var(--border); text-align: left; color: var(--text-3); transition: color .35s;
}
.cap-tab .n { font-family: var(--font-mono); font-size: 12px; transition: color .35s; }
.cap-tab .t { font-size: clamp(22px, 2.6vw, 34px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; transition: transform .55s var(--ease); }
.cap-tab:hover { color: var(--text-2); }
.cap-tab[aria-selected="true"] { color: var(--text); }
.cap-tab[aria-selected="true"] .n { color: var(--accent-text); }
.cap-tab[aria-selected="true"] .t { transform: translateX(12px); }
.cap-tab .bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--accent-text); transform: scaleX(0); transform-origin: left; }
.cap-tab[aria-selected="true"] .bar { transform: scaleX(1); transition: transform .6s var(--ease); }
.cap-index.auto .cap-tab[aria-selected="true"] .bar { transition: none; animation: capTimer 6s linear both; }
.cap-index.auto:hover .bar, .cap-index.paused .bar { animation-play-state: paused !important; }
@keyframes capTimer { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.cap-panels { display: grid; padding-top: 26px; }
.cap-panel { grid-area: 1 / 1; opacity: 0; transform: translateY(14px); transition: opacity .45s var(--ease), transform .6s var(--ease); pointer-events: none; }
.cap-panel.on { opacity: 1; transform: none; pointer-events: auto; transition-delay: .08s; }
.cap-glyph { width: 72px; height: 72px; color: var(--accent-text); }
.cap-glyph svg { width: 100%; height: 100%; }
.cap-glyph svg * { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cap-panel.on .cap-glyph svg * { animation: drawLine 1.4s var(--ease) .1s forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.cap-panel p { margin-top: 26px; max-width: 520px; font-size: clamp(19px, 1.8vw, 23px); line-height: 1.5; color: var(--text); }
.cap-tools { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.cap-tools li { font-family: var(--font-mono); font-size: 13px; color: var(--text-2); }
.cap-tools li::before { content: "— "; color: var(--text-3); }

/* ---------- Home: about, unframed ---------- */
.about-card { position: sticky; top: 96px; }
.avatar { position: relative; width: 100%; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--bg-2); display: grid; place-items: center; }
.avatar canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar .initials { position: relative; font-family: var(--font-serif); font-style: italic; font-size: 120px; color: var(--text); letter-spacing: -0.04em; }

/* ---------- Home: skill explorer as words ---------- */
.explorer { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.ex-skills { display: flex; flex-direction: column; gap: 28px; }
.ex-group h3 { margin-bottom: 10px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.ex-chips { display: flex; flex-wrap: wrap; gap: 2px 22px; }
.ex-chip { position: relative; padding: 4px 0; font-size: clamp(16px, 1.45vw, 19px); color: var(--text-2); transition: color .25s, opacity .25s; }
.ex-chip::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: var(--accent-text);
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.ex-chip .n { margin-left: 3px; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); vertical-align: super; }
.ex-chip:hover { color: var(--text); }
.explorer.focus .ex-chip { opacity: .3; }
.explorer.focus .ex-chip.on { opacity: 1; color: var(--text); }
.ex-chip.on::after { transform: scaleX(1); }
.ex-chip.on .n, .ex-chip[aria-pressed="true"] .n { color: var(--accent-text); }
.ex-chip[aria-pressed="true"] { color: var(--accent-text); }
.ex-works { position: sticky; top: 96px; border-top: 1px solid var(--border-strong); }
.ex-head { min-height: 46px; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.ex-row { display: grid; grid-template-columns: 1fr auto 14px; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); transition: opacity .25s, padding .4s var(--ease); }
.ex-name { font-size: 16px; font-weight: 500; transition: color .25s; }
.ex-tag { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.ex-arrow { color: var(--text-3); opacity: 0; transition: opacity .2s; }
.ex-row:hover .ex-arrow { opacity: 1; }
.explorer.focus .ex-row { opacity: .3; }
.explorer.focus .ex-row.on { opacity: 1; padding-left: 12px; }
.ex-row.on .ex-name { color: var(--accent-text); }

/* ---------- Inline stats (project and Now pages) ---------- */
.fact-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border); }
.fact-item { padding: 26px 20px 24px 0; transition: opacity .3s; }
.fact-item + .fact-item { padding-left: 20px; border-left: 1px solid var(--border); }
.fact-item .v { font-size: clamp(22px, 2.5vw, 32px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.12; font-variant-numeric: tabular-nums; transition: color .3s; }
.fact-item .k { margin-top: 10px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.fact-row:has(.fact-item:hover) .fact-item:not(:hover) { opacity: .4; }
.fact-item:hover .v { color: var(--accent-text); }

/* ---------- Previous / next ---------- */
.pd-next { display: grid; grid-template-columns: 1fr 1fr; padding-top: 24px; padding-bottom: 112px; }
.pd-next a { display: flex; flex-direction: column; gap: 10px; padding: 36px 0; border-top: 1px solid var(--border-strong); }
.pd-next a + a { padding-left: 24px; text-align: right; align-items: flex-end; }
.pd-next a::after {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--accent-text);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.pd-next a + a::after { transform-origin: right; }
.pd-next .dir { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.pd-next .t { font-size: clamp(26px, 3.4vw, 44px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; transition: transform .55s var(--ease), color .3s; }
.pd-next .l { font-size: 14px; color: var(--text-2); }
.pd-next a:hover::after { transform: scaleX(1); }
.pd-next a:hover .t { color: var(--accent-text); transform: translateX(-12px); }
.pd-next a + a:hover .t { transform: translateX(12px); }

/* ---------- Education as rows ---------- */
.edu-list { border-top: 1px solid var(--border-strong); }
.edu-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 40px; align-items: baseline; padding: 30px 0; border-bottom: 1px solid var(--border); transition: opacity .3s; }
.edu-row .p { font-family: var(--font-mono); font-size: 13px; color: var(--text-3); }
.edu-row h3 { font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -0.02em; }
.edu-row .s { margin-top: 6px; font-size: 15px; color: var(--text-2); }
.edu-row .g { font-size: clamp(30px, 3.6vw, 48px); font-weight: 500; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; transition: color .3s; }
.edu-list:has(.edu-row:hover) .edu-row:not(:hover) { opacity: .4; }
.edu-row:hover .g { color: var(--accent-text); }

/* ---------- Contact: logos, no circles ---------- */
.cta-links { display: flex; justify-content: center; align-items: center; gap: 30px; flex-wrap: wrap; margin-top: 38px; }
.social { display: inline-grid; place-items: center; width: 30px; height: 30px; color: var(--text-2); transition: color .25s, transform .4s var(--ease); }
.social svg { width: 22px; height: 22px; }
.social:hover { color: var(--accent-text); transform: translateY(-3px); }

/* ---------- Triptych demo on the page, not in a box ---------- */
.tt-demo { display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); gap: 64px; align-items: center; margin-top: 36px; }
.tt-demo > * { min-width: 0; }
.tt-demo-phone, .tt-demo-phone > div { display: flex; justify-content: center; width: 100%; }

/* ---------- Project demos framed by rules, not boxes ---------- */
.demo { position: relative; }
.demo-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0;
  border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--text-3);
}
.demo-bar .lights { display: none; }
.demo-stage { position: relative; padding: 30px 0; }
.demo-caption { padding-top: 12px; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); }
.demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; }
.rag-query { margin-bottom: 24px; padding: 2px 0 2px 18px; border-left: 2px solid var(--accent-text); font-family: var(--font-serif); font-style: italic; font-size: clamp(19px, 2vw, 24px); line-height: 1.35; color: var(--text); }
.rag-query .mono { font-style: normal; font-size: 12px; margin-right: 6px; }
.pipe-detail { min-height: 92px; margin-top: 20px; padding: 2px 0 2px 18px; border-left: 1px solid var(--border-strong); color: var(--text-2); font-size: 15px; }
.pipe-detail .h { margin-bottom: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--accent-text); }
.pipe-detail code { font-family: var(--font-mono); font-size: .9em; color: var(--text); }
.pipe-node { background: transparent; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .about-card { position: static; max-width: 420px; }
  .about-card .avatar { aspect-ratio: 16 / 9; }
  .avatar .initials { font-size: 88px; }
  .tt-demo { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .cap-index { gap: 48px; }
}
@media (max-width: 860px) {
  .work-row { grid-template-columns: 36px minmax(0, 1fr) 22px; gap: 14px; padding: 26px 0 24px; }
  .wr-meta { grid-column: 2; grid-row: 2; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; text-align: left; }
  .wr-arrow { grid-column: 3; grid-row: 1; }
  .wr-art { display: block; height: 160px; margin-top: 16px; border-radius: 10px; overflow: hidden; background: var(--bg-2); }
  .lab-head { grid-template-columns: 36px minmax(0, 1fr) 18px; gap: 14px; }
  .lab-tags { display: none; }
  .lab-body > div { padding-left: 50px; }
  .cap-index { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .explorer { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .ex-works { position: static; }
  .fact-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-item:nth-child(3) { padding-left: 0; border-left: 0; }
  .fact-item:nth-child(n+3) { border-top: 1px solid var(--border); }
  .edu-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; }
  .edu-row .p { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .search { min-width: 0; width: 100%; }
  .filters-right { width: 100%; }
  .pd-next { grid-template-columns: 1fr; }
  .pd-next a + a { padding-left: 0; text-align: left; align-items: flex-start; }
  .pd-next a + a::after { transform-origin: left; }
  .pd-next a + a:hover .t { transform: translateX(-12px); }
  .lab-body > div { padding-left: 0; }
}
@media (hover: none) {
  .wr-art { display: block; height: 170px; margin-top: 16px; border-radius: 10px; overflow: hidden; background: var(--bg-2); }
}
@media (prefers-reduced-motion: reduce) {
  .cap-glyph svg * { stroke-dashoffset: 0; }
}

/* the hero title is now the first line on the page */
.hero h1 { margin-top: 0; }

/* ==========================================================================
   Splash — first load only (decided in the <head> script, played by app.js).
   Uses the page's own colours, so it matches whichever theme is active.
   ========================================================================== */
.splash { display: none; }
html.splash-on body { overflow: hidden; }
.splash-on .splash {
  position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text);
  background: radial-gradient(ellipse 60% 55% at 50% 46%, var(--accent-soft), transparent 72%), var(--bg);
  clip-path: inset(0 0 0 0); transition: clip-path 1s cubic-bezier(.76, 0, .24, 1);
}
.splash::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .04; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.splash-core { display: flex; flex-direction: column; align-items: center; text-align: center; transition: transform 1s cubic-bezier(.76, 0, .24, 1), opacity .5s ease; }
.splash.out { clip-path: inset(0 0 100% 0); }
.splash.out .splash-core { transform: translateY(-48px); opacity: 0; }
.splash.out .splash-foot { opacity: 0 !important; transition: opacity .3s; }

/* a small network draws itself */
.splash-mark { width: 120px; height: 64px; overflow: visible; }
.sm-line { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; }
.sm-node { fill: var(--text-2); opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.2); }
.sm-hot { fill: var(--accent-text); }
.splash.go .sm-line { animation: drawLine 1.1s cubic-bezier(.6, 0, .2, 1) forwards; }
.splash.go .sm-line + .sm-line { animation-delay: .25s; }
.splash.go .sm-node { animation: smNode .5s var(--ease) forwards; }
.splash.go .sm-node:nth-of-type(2) { animation-delay: .12s; }
.splash.go .sm-node:nth-of-type(3) { animation-delay: .3s; }
.splash.go .sm-node:nth-of-type(4) { animation: smNode .5s var(--ease) .2s forwards, smPulse 1.8s ease-in-out .9s infinite; }
.splash.go .sm-node:nth-of-type(5) { animation-delay: .4s; }
.splash.go .sm-node:nth-of-type(6) { animation-delay: .55s; }
.splash.go .sm-node:nth-of-type(7) { animation-delay: .65s; }
@keyframes smNode { to { opacity: 1; transform: scale(1); } }
@keyframes smPulse { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 5px var(--accent-text)); } }

/* name, rule and role arrive in turn */
.splash-name { margin-top: 30px; font-family: var(--font-serif); font-style: italic; font-size: clamp(44px, 7vw, 86px); line-height: 1; letter-spacing: -0.02em; }
.splash-name span { display: inline-block; opacity: 0; transform: translateY(.35em); filter: blur(8px); }
.splash.go .splash-name span { animation: wordIn .95s var(--ease) forwards; animation-delay: calc(.35s + var(--i) * .13s); }
.splash-rule { display: block; width: min(320px, 60vw); height: 1px; margin-top: 28px; background: var(--accent-text); transform: scaleX(0); }
.splash.go .splash-rule { animation: ruleGrow 1s cubic-bezier(.6, 0, .2, 1) .85s forwards; }
@keyframes ruleGrow { to { transform: scaleX(1); } }
.splash-role { margin-top: 18px; padding-left: .34em; font-family: var(--font-mono); font-size: 12px; letter-spacing: .34em; text-transform: uppercase; color: var(--text-2); opacity: 0; }
.splash.go .splash-role { animation: fadeUp .8s var(--ease) 1.1s forwards; }
.splash-foot {
  position: absolute; left: 0; right: 0; bottom: 28px; margin: 0 auto; max-width: var(--container); padding: 0 var(--gutter);
  display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); opacity: 0;
}
.splash.go .splash-foot { animation: fadeUp .8s var(--ease) .2s forwards; }
.splash-count { min-width: 3ch; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* hold the hero's own entrance until the curtain lifts */
.splash-on:not(.splash-leaving) .words .w { animation-play-state: paused; }
