/* ==========================================================================
   jakeharris.au — "arena at night"
   ========================================================================== */

:root {
  --bg: #0a0807;
  --bg-2: #100c0a;
  --surface: #15100d;
  --surface-2: #1c1511;
  --surface-3: #251b15;
  --line: rgba(255, 226, 190, 0.09);
  --line-2: rgba(255, 226, 190, 0.16);
  --line-3: rgba(255, 226, 190, 0.28);

  --text: #f3eadf;
  --text-2: #cbbba8;
  --muted: #92836f;

  --bronze: #cf8e4f;
  --gold: #f1c47d;
  --ember: #ff6b2c;
  --ember-2: #e2461b;
  --ok: #8ad69a;
  --warn: #f3bb4f;
  --bad: #ff6457;

  --grad-ember: linear-gradient(100deg, #ffb35c 0%, #ff6b2c 55%, #e2461b 100%);
  --glow: 0 0 0 1px rgba(255, 140, 70, 0.25), 0 10px 40px -10px rgba(255, 107, 44, 0.45);

  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --gutter: clamp(16px, 4.2vw, 40px);
  --max: 1200px;
  --radius: 14px;
  --radius-lg: 22px;
  --nav-h: 68px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
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;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, video, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: rgba(241, 196, 125, 0.4); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--gold); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
em { font-style: italic; }
::selection { background: rgba(255, 107, 44, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: 10px;
  background: var(--gold); color: #1a0f07; font-weight: 600; text-decoration: none;
  transition: top 0.2s;
}
.skip:focus { top: 12px; }

.container { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
}

/* ---------- buttons ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background-color 0.25s, border-color 0.25s, color 0.25s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.icon-fill { fill: currentColor; stroke: none; }
.btn--small { --h: 38px; padding: 0 16px; font-size: 14px; gap: 8px; }
.btn--small svg { width: 16px; height: 16px; }
.btn--primary { background: var(--grad-ember); color: #1d0c04; box-shadow: var(--glow); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255, 160, 90, 0.45), 0 16px 50px -12px rgba(255, 107, 44, 0.7); }
.btn--ghost { background: rgba(255, 240, 225, 0.04); border-color: var(--line-2); color: var(--text); backdrop-filter: blur(6px); }
.btn--ghost:hover { border-color: var(--line-3); background: rgba(255, 240, 225, 0.08); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }

.icon-btn {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--surface); cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, opacity 0.2s;
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { border-color: var(--gold); }
.icon-btn:disabled { opacity: 0.35; cursor: default; border-color: var(--line-2); }

/* ---------- progress + nav ---------- */
.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--grad-ember); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 12px rgba(255, 107, 44, 0.8); }

.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--nav-h);
  transition: background-color 0.35s, border-color 0.35s, backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10, 8, 7, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
}
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand__mark { width: 38px; height: 38px; color: var(--gold); transition: transform 0.6s var(--ease-out); }
.brand__mark text { font-family: var(--font-display); font-size: 15px; fill: var(--text); letter-spacing: 0.04em; }
.brand:hover .brand__mark { transform: rotate(60deg); }
.brand:hover .brand__mark text { transform-box: fill-box; }
.brand__name { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.01em; }

.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links > a:not(.btn) {
  position: relative;
  padding: 8px 12px;
  font-size: 14px; font-weight: 500;
  color: var(--text-2); text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s;
}
.nav__links > a:not(.btn):hover, .nav__links > a.is-active { color: var(--text); }
.nav__links > a:not(.btn)::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 1px;
  background: var(--grad-ember); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 0.35s var(--ease-out);
}
.nav__links > a.is-active::after { transform: scaleX(1); }
.nav__num { font-family: var(--font-mono); font-size: 10px; color: var(--bronze); margin-right: 6px; letter-spacing: 0.05em; }
.nav__cta { margin-left: 10px; }
.nav__toggle { display: none; }

@media (max-width: 900px) {
  .brand__name { display: none; }
  .nav__toggle {
    display: grid; place-items: center;
    width: 46px; height: 46px; margin-right: -8px;
    background: none; border: 0; cursor: pointer; position: relative; z-index: 2;
  }
  .nav__burger, .nav__burger::before, .nav__burger::after {
    display: block; width: 22px; height: 1.5px; background: var(--text); border-radius: 2px;
    transition: transform 0.35s var(--ease-out), opacity 0.2s;
  }
  .nav__burger { position: relative; }
  .nav__burger::before, .nav__burger::after { content: ""; position: absolute; left: 0; }
  .nav__burger::before { top: -7px; }
  .nav__burger::after { top: 7px; }
  .menu-open .nav__burger { background: transparent; }
  .menu-open .nav__burger::before { transform: translateY(7px) rotate(45deg); }
  .menu-open .nav__burger::after { transform: translateY(-7px) rotate(-45deg); }

  .nav__links {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; align-items: stretch; justify-content: center; gap: 0;
    padding: calc(var(--nav-h) + 20px) var(--gutter) 40px;
    background: radial-gradient(120% 70% at 50% 110%, rgba(255, 107, 44, 0.22), transparent 60%), rgba(10, 8, 7, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.35s var(--ease-out), visibility 0s linear 0.35s;
  }
  .menu-open .nav__links { opacity: 1; visibility: visible; transition: opacity 0.35s var(--ease-out); }
  .nav__links > a:not(.btn) {
    font-family: var(--font-display); font-size: clamp(34px, 9vw, 48px); font-weight: 400;
    color: var(--text); padding: 10px 0; border-bottom: 1px solid var(--line); border-radius: 0;
    transform: translateY(16px); opacity: 0;
    transition: transform 0.5s var(--ease-out), opacity 0.5s var(--ease-out);
  }
  .nav__links > a:not(.btn)::after { display: none; }
  .menu-open .nav__links > a:not(.btn) { transform: none; opacity: 1; }
  .menu-open .nav__links > a:nth-child(2) { transition-delay: 0.04s; }
  .menu-open .nav__links > a:nth-child(3) { transition-delay: 0.08s; }
  .menu-open .nav__links > a:nth-child(4) { transition-delay: 0.12s; }
  .menu-open .nav__links > a:nth-child(5) { transition-delay: 0.16s; }
  .nav__num { font-size: 12px; vertical-align: super; margin-right: 12px; }
  .nav__cta { margin: 28px 0 0; --h: 52px; font-size: 16px; }
  .menu-open { overflow: hidden; }
  .menu-open .nav { background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 96px;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(90% 60% at 50% 110%, #3a1a0c 0%, transparent 60%), var(--bg);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero__veil {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 8, 7, 0.75) 0%, rgba(10, 8, 7, 0.2) 55%, rgba(10, 8, 7, 0) 100%),
    linear-gradient(180deg, rgba(10, 8, 7, 0.4) 0%, transparent 25%, transparent 70%, var(--bg) 100%);
}
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); gap: clamp(32px, 5vw, 72px); align-items: center; }

.hero__eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--gold); opacity: 0; animation: rise 1s var(--ease-out) 0.15s forwards; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 0 rgba(255, 107, 44, 0.7); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 44, 0.6); } 70% { box-shadow: 0 0 0 12px rgba(255, 107, 44, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 107, 44, 0); } }

.hero__title {
  margin: 18px 0 22px;
  font-family: var(--font-display);
  font-size: clamp(76px, 15vw, 196px);
  line-height: 0.86;
  letter-spacing: -0.025em;
}
.hero__title .line { display: block; overflow: hidden; padding: 0 0.1em 0.16em 0.04em; margin: 0 -0.1em -0.1em -0.04em; }
.hero__title .line > span { display: inline-block; transform: translateY(105%); animation: lineUp 1.3s var(--ease-out) forwards; }
.hero__title .line:nth-child(2) > span { animation-delay: 0.12s; }
.hero__title em {
  background: linear-gradient(100deg, #ffd79a 0%, #ff9a4a 40%, #ff5a22 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: 0.08em;
}
@keyframes lineUp { to { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.hero__lede { max-width: 560px; font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); line-height: 1.6; opacity: 0; animation: rise 1s var(--ease-out) 0.45s forwards; }
.hero__lede strong { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; opacity: 0; animation: rise 1s var(--ease-out) 0.6s forwards; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 36px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); letter-spacing: 0.02em;
  opacity: 0; animation: rise 1s var(--ease-out) 0.75s forwards;
}
.hero__meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta li + li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--line-3); margin-right: 14px; }
.dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }

.terminal {
  margin: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(28, 21, 17, 0.82), rgba(16, 12, 10, 0.88));
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 240, 225, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.hero__terminal { opacity: 0; animation: rise 1.2s var(--ease-out) 0.9s forwards; transform-origin: 50% 100%; }
.terminal__bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.terminal__bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a2c23; }
.terminal__bar i:first-child { background: #b8452b; }
.terminal__bar span { margin-left: 8px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.terminal__body {
  margin: 0; padding: 18px 18px 22px;
  min-height: 250px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75;
  color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.terminal__body .t-dim { color: var(--muted); }
.terminal__body .t-tag { color: var(--bronze); }
.terminal__body .t-ok { color: var(--ok); }
.terminal__body .t-hi { color: var(--gold); }
.terminal__body .t-cmd { color: var(--text); }
.caret { display: inline-block; width: 7px; height: 1.1em; vertical-align: -0.2em; background: var(--ember); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; translate: -50% 0;
  width: 26px; height: 42px; border-radius: 14px; border: 1.5px solid var(--line-3);
  display: grid; justify-items: center; padding-top: 8px;
  opacity: 0; animation: rise 1s var(--ease-out) 1.3s forwards;
}
.scroll-cue span { width: 3px; height: 8px; border-radius: 2px; background: var(--gold); animation: cue 2s var(--ease-in-out) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

@media (max-width: 1000px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__terminal { max-width: 560px; }
  .terminal__body { min-height: 0; font-size: 11.5px; }
}
@media (max-width: 560px) {
  .hero { padding-bottom: 88px; align-items: flex-end; }
  .hero__cta .btn { flex: 1 1 auto; }
  .hero__meta li + li::before { display: none; }
  .scroll-cue { display: none; }
}

/* ---------- stats ---------- */
.stats { position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.stats__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { padding: 34px 20px 30px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { font-family: var(--font-display); font-weight: 400; font-size: clamp(44px, 5vw, 64px); line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.stat b small { font-size: 0.42em; margin-left: 6px; color: var(--bronze); font-family: var(--font-mono); letter-spacing: 0.05em; }
.stat > span { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
@media (max-width: 900px) {
  .stats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat, .stat:first-child { border-left: 0; padding: 24px 0; border-top: 1px solid var(--line); }
  .stat:nth-child(1), .stat:nth-child(2) { border-top: 0; }
  .stat:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
  .stat:last-child { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
}

/* ---------- section scaffolding ---------- */
.section { position: relative; padding: clamp(88px, 12vw, 160px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: clamp(40px, 6vw, 72px); max-width: 900px; }
.section-head__kicker { display: flex; align-items: center; gap: 14px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bronze); }
.numeral {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 34px; padding: 0 8px;
  border: 1px solid rgba(207, 142, 79, 0.45); border-radius: 50%;
  font-family: var(--font-display); font-size: 16px; letter-spacing: 0.02em; text-transform: none; color: var(--gold);
}
.section-head__title { margin-top: 18px; font-family: var(--font-display); font-size: clamp(48px, 8vw, 104px); line-height: 0.95; letter-spacing: -0.02em; }
.section-head__title em, .contact__title em { color: var(--gold); }
.section-head__sub { margin-top: 18px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }

.subhead { margin: clamp(80px, 11vw, 136px) 0 32px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 40px; align-items: end; }
.subhead h3 { font-family: var(--font-display); font-size: clamp(34px, 4.6vw, 56px); line-height: 1; letter-spacing: -0.01em; }
.subhead p { color: var(--text-2); max-width: 460px; justify-self: end; }
@media (max-width: 760px) { .subhead { grid-template-columns: 1fr; } .subhead p { justify-self: start; } }

.prose p { color: var(--text-2); font-size: 17px; line-height: 1.75; }
.prose p + p { margin-top: 1.1em; }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--text); }
.dropcap::first-letter {
  float: left; font-family: var(--font-display); font-size: 5.1em; line-height: 0.8;
  padding: 0.08em 0.12em 0 0; color: var(--gold);
}
.figure-note { margin-top: 14px; font-size: 13px; color: var(--muted); font-family: var(--font-mono); letter-spacing: 0.01em; }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); transition-delay: calc(var(--d, 0) * 90ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- case intro ---------- */
.case-intro { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.factcard {
  position: sticky; top: calc(var(--nav-h) + 24px);
  padding: 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9);
}
.factcard dl { margin: 0; display: grid; gap: 14px; }
.factcard dl > div { display: grid; grid-template-columns: 116px 1fr; gap: 12px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.factcard dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.factcard dd { margin: 0; font-size: 14.5px; color: var(--text); }
.factcard__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
@media (max-width: 900px) { .case-intro { grid-template-columns: 1fr; } .factcard { position: static; } }
@media (max-width: 420px) { .factcard dl > div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- video ---------- */
.video { margin: clamp(56px, 8vw, 96px) 0 0; }
.video__frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-2);
  background: #000;
  box-shadow: 0 50px 100px -50px rgba(255, 107, 44, 0.35), 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}
.video__frame img { width: 100%; height: 100%; object-fit: cover; opacity: 0.78; transition: transform 1.2s var(--ease-out), opacity 0.5s; }
.video__frame::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 50% 50%, transparent 0%, rgba(10, 8, 7, 0.55) 100%); pointer-events: none; }
.video__frame:hover img { transform: scale(1.03); opacity: 0.9; }
.video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__frame.is-playing::after { display: none; }
.video__play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 2;
  width: clamp(72px, 10vw, 104px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--grad-ember); border: 0;
  box-shadow: 0 0 0 10px rgba(255, 107, 44, 0.15), 0 20px 60px -10px rgba(255, 107, 44, 0.8);
  transition: transform 0.35s var(--ease-out);
}
.video__play svg { width: 38%; height: 38%; fill: #1d0c04; margin-left: 6%; }
.video__play:hover { transform: scale(1.07); }
.video__ring { position: absolute; inset: -14px; border-radius: 50%; border: 1px solid rgba(255, 180, 120, 0.5); animation: ring 2.6s var(--ease-out) infinite; }
@keyframes ring { from { transform: scale(0.85); opacity: 1; } to { transform: scale(1.45); opacity: 0; } }
.video__badge {
  position: absolute; left: 18px; bottom: 16px; z-index: 2;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 6px; background: rgba(10, 8, 7, 0.7); border: 1px solid var(--line-2); color: var(--gold);
}
.video figcaption { margin-top: 14px; font-size: 14px; color: var(--muted); }

/* ---------- architecture ---------- */
.arch {
  position: relative;
  display: grid; grid-template-columns: 1.05fr 0.95fr 1.1fr 0.95fr; gap: clamp(28px, 4vw, 64px);
  align-items: center;
  padding: clamp(24px, 4vw, 48px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(60% 80% at 20% 0%, rgba(207, 142, 79, 0.08), transparent 60%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg-2);
  background-blend-mode: normal, normal, normal, normal;
}
.arch::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(80% 90% at 50% 50%, transparent 40%, var(--bg-2) 100%); pointer-events: none; }
.arch__wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 1; }
.arch__col { position: relative; z-index: 2; display: grid; gap: 22px; }
.arch__col--route { gap: 56px; }
.arch__group { position: relative; display: grid; gap: 14px; padding: 34px 14px 14px; border-radius: 18px; border: 1px dashed var(--line-2); background: rgba(10, 8, 7, 0.4); }
.arch__group--server { border-style: solid; border-color: rgba(207, 142, 79, 0.35); background: linear-gradient(180deg, rgba(207, 142, 79, 0.07), rgba(10, 8, 7, 0.4)); }
.arch__label { position: absolute; top: 10px; left: 16px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.arch__group--server .arch__label { color: var(--gold); }

.node {
  position: relative;
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.9);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease-out);
  outline: none;
}
.node b { grid-column: 2; font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.node small { grid-column: 2; font-family: var(--font-mono); font-size: 11px; color: var(--muted); line-height: 1.45; }
.node__icon { grid-row: span 2; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 107, 44, 0.1); color: var(--ember); }
.node__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.node__port { grid-row: span 2; font-family: var(--font-mono); font-size: 10.5px; line-height: 1.2; color: var(--gold); padding: 6px 7px; border-radius: 7px; border: 1px solid rgba(241, 196, 125, 0.3); background: rgba(241, 196, 125, 0.06); width: 58px; text-align: center; }
.node--game { border-color: rgba(255, 107, 44, 0.5); box-shadow: 0 0 0 1px rgba(255, 107, 44, 0.12), 0 16px 40px -18px rgba(255, 107, 44, 0.55); }
.node--store .node__icon { background: rgba(138, 214, 154, 0.1); color: var(--ok); }
.node--ghost { background: transparent; border-style: dashed; }
.node--ghost .node__icon { background: rgba(255, 240, 225, 0.05); color: var(--muted); }
.node--patch .node__icon { background: rgba(241, 196, 125, 0.1); color: var(--gold); }
.node:hover, .node:focus-visible, .node.is-focus { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(241, 196, 125, 0.25), 0 18px 40px -16px rgba(241, 196, 125, 0.35); }

.wire { fill: none; stroke: rgba(255, 226, 190, 0.16); stroke-width: 1.5; transition: stroke 0.3s, stroke-width 0.3s; }
.wire--flow { stroke: rgba(255, 140, 70, 0.38); stroke-width: 1.6; }
.wire--dash { stroke-dasharray: 4 6; stroke: rgba(255, 226, 190, 0.22); }
.wire.is-focus { stroke: var(--gold); stroke-width: 2.2; }
.wire-anim { fill: none; stroke: rgba(255, 186, 120, 0.9); stroke-width: 1.6; stroke-dasharray: 2 14; animation: dash 1.4s linear infinite; opacity: 0.6; }
@keyframes dash { to { stroke-dashoffset: -32; } }
.pkt-core { fill: #fff3dd; }
.pkt-halo { fill: rgba(255, 107, 44, 0.35); }
.pkt--back .pkt-core { fill: #d9ffe2; }
.pkt--back .pkt-halo { fill: rgba(138, 214, 154, 0.3); }

.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-top: 26px; counter-reset: step; }
.steps li { position: relative; padding: 18px 16px 0 0; font-size: 14px; color: var(--text-2); line-height: 1.55; border-top: 1px solid var(--line-2); transition: border-color 0.3s; counter-increment: step; }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--font-mono); font-size: 11px; color: var(--bronze); margin-bottom: 8px; }
.steps li b { color: var(--text); font-weight: 600; }
.steps li.is-focus { border-top-color: var(--gold); }
.steps li.is-focus b { color: var(--gold); }

@media (max-width: 1000px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .steps li:last-child { grid-column: 1 / -1; } }
@media (max-width: 860px) {
  .arch { grid-template-columns: 1fr; gap: 44px; padding: 20px; }
  .arch__col--route { grid-template-columns: 1fr 1fr; gap: 14px; }
  .arch__col--route .node { align-content: start; }
}
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ---------- problems ---------- */
.problem {
  position: relative;
  margin-top: 28px;
  padding: clamp(24px, 4vw, 48px);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, rgba(28, 21, 17, 0.9), rgba(16, 12, 10, 0.9));
  border: 1px solid var(--line);
  overflow: hidden;
}
.problem::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 140, 70, 0.6), transparent);
}
.problem__head { display: flex; align-items: flex-start; gap: clamp(16px, 3vw, 32px); margin-bottom: 26px; }
.problem__num {
  font-family: var(--font-display); font-size: clamp(56px, 8vw, 96px); line-height: 0.8;
  background: linear-gradient(180deg, var(--gold), rgba(207, 142, 79, 0.15));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.problem__head h4 { font-family: var(--font-display); font-size: clamp(28px, 3.6vw, 44px); line-height: 1.05; letter-spacing: -0.01em; }
.problem__tag { margin-top: 10px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.problem__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.problem__body--wide { grid-template-columns: 1fr; }
.problem__body--wide > .prose { max-width: 820px; }
@media (max-width: 900px) { .problem__body { grid-template-columns: 1fr; } }

/* packet anatomy */
.packet { padding: 22px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.packet__title, .packet__note { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.packet__note { margin-top: 10px; text-align: right; }
.packet__row { display: flex; gap: 4px; margin-top: 14px; }
.packet__seg {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 8px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  font-family: var(--font-mono); font-size: 11.5px;
  transition: transform 0.3s var(--ease-out), border-color 0.3s;
}
.packet__seg b { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.packet__seg small { font-size: 10px; color: var(--muted); line-height: 1.3; }
.packet__seg:hover { transform: translateY(-3px); border-color: var(--line-3); }
.packet__seg--hdr { flex-grow: 2.3; }
.packet__seg--payload { flex-grow: 2.6; border-color: rgba(255, 107, 44, 0.55); background: linear-gradient(180deg, rgba(255, 107, 44, 0.14), rgba(255, 107, 44, 0.04)); }
.packet__seg--payload b { color: var(--gold); }
.packet__seg--frag { border-color: rgba(241, 196, 125, 0.35); }
.packet__zoom { position: relative; height: 26px; margin-top: 4px; }
.packet__zoom span { position: absolute; inset: 0; clip-path: polygon(48% 0, 90% 0, 100% 100%, 0 100%); background: linear-gradient(180deg, rgba(255, 107, 44, 0.22), rgba(255, 107, 44, 0.03)); }
.packet__row--rmc { margin-top: 0; }
.packet__row--rmc .packet__seg { background: rgba(255, 107, 44, 0.05); border-color: rgba(255, 107, 44, 0.25); }
.packet__seg--grow { flex-grow: 2.4; }
@media (max-width: 520px) {
  .packet { padding: 16px 14px; }
  .packet__row { flex-wrap: wrap; }
  .packet__seg { flex: 1 1 28%; }
  .packet__seg--hdr, .packet__seg--payload, .packet__seg--grow { flex-basis: 60%; }
}

/* replay widget */
.replay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; margin-top: 28px; }
.replay__side { padding: 20px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.replay__side--client { background: radial-gradient(90% 70% at 100% 0%, rgba(138, 214, 154, 0.06), transparent 60%), var(--bg-2); display: flex; flex-direction: column; }
.replay__title { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px var(--ember); }
.led--client { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

.ledger { display: grid; gap: 6px; font-family: var(--font-mono); font-size: 12px; }
.ledger__phase { margin: 10px 0 2px; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bronze); }
.ledger__phase:first-child { margin-top: 0; }
.ledger__row {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2);
  transition: border-color 0.3s, background-color 0.3s, opacity 0.3s, transform 0.3s var(--ease-out);
}
.ledger__row .k { font-size: 10px; letter-spacing: 0.06em; color: var(--muted); }
.ledger__row .v { color: var(--muted); white-space: nowrap; }
.ledger__row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger__row.is-active { border-color: var(--ember); background: rgba(255, 107, 44, 0.12); color: var(--text); transform: translateX(6px); }
.ledger__row.is-done { color: var(--text); }
.ledger__row.is-done .v { color: var(--ok); }
.ledger__row.is-dropped { opacity: 0.35; text-decoration: line-through; }

.client { flex: 1; display: grid; gap: 14px; align-content: start; }
.client__status { font-family: var(--font-mono); font-size: 12px; padding: 9px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); min-height: 38px; }
.client__status.is-ok { color: var(--ok); border-color: rgba(138, 214, 154, 0.35); }
.client__status.is-warn { color: var(--warn); border-color: rgba(243, 187, 79, 0.35); }
.client__status.is-busy { color: var(--gold); }
.client__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kv { padding: 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.kv span { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.kv b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv.flash b, .client__row.flash .chips, .client__row.flash .pips { animation: flash 0.9s var(--ease-out); }
@keyframes flash { 0% { color: var(--gold); text-shadow: 0 0 18px rgba(255, 170, 90, 0.9); } 100% { text-shadow: none; } }
.client__row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: center; }
.client__row > span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pips { display: flex; gap: 6px; flex-wrap: wrap; }
.pips i { width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface); transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s; }
.pips i.on { background: var(--grad-ember); border-color: transparent; box-shadow: 0 0 12px rgba(255, 107, 44, 0.5); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.chips em { font-size: 13px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; background: var(--surface-3); border: 1px solid var(--line-2); animation: pop 0.45s var(--ease-out); }
.chip small { font-family: var(--font-mono); font-size: 10.5px; color: var(--gold); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.replay__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.toggle input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background-color 0.2s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform 0.25s var(--ease-out), background-color 0.2s; }
.toggle input:checked { background: rgba(255, 100, 87, 0.3); border-color: rgba(255, 100, 87, 0.6); }
.toggle input:checked::after { transform: translateX(14px); background: var(--bad); }
@media (max-width: 900px) { .replay { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .replay__side { padding: 14px; }
  .client__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client__row { grid-template-columns: 1fr; gap: 6px; }
}

/* fragmentation widget */
.frag { margin-top: 28px; padding: clamp(18px, 3vw, 28px); border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.frag__controls { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: flex-end; justify-content: space-between; }
.frag__slider { flex: 1 1 320px; display: grid; gap: 10px; }
.frag__slider > span { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.frag__slider output { font-family: var(--font-display); font-size: 34px; letter-spacing: 0; color: var(--text); line-height: 1; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--ember) var(--p, 50%), var(--surface-3) var(--p, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--ember); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: #fff3e4; border: 0; box-shadow: 0 0 0 5px rgba(255, 107, 44, 0.35), 0 4px 12px rgba(0, 0, 0, 0.6); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff3e4; border: 0; box-shadow: 0 0 0 5px rgba(255, 107, 44, 0.35), 0 4px 12px rgba(0, 0, 0, 0.6); }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); }
.seg button { border: 0; background: none; padding: 8px 16px; border-radius: 999px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); cursor: pointer; transition: background-color 0.25s, color 0.25s; }
.seg button[aria-checked="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-3); }
.seg button[data-frag-v="062"][aria-checked="true"] { color: var(--bad); }
.seg button[data-frag-v="063"][aria-checked="true"] { color: var(--warn); }
.seg button[data-frag-v="064"][aria-checked="true"] { color: var(--ok); }

.frag__meter { margin-top: 24px; }
.frag__bar { position: relative; height: 10px; border-radius: 10px; background: var(--surface-3); }
.frag__bar > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--grad-ember); transition: width 0.35s var(--ease-out); box-shadow: 0 0 16px rgba(255, 107, 44, 0.4); }
.frag__limit { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--text); border-radius: 2px; }
.frag__limit em { position: absolute; top: -22px; left: 50%; translate: -50% 0; font-style: normal; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-2); white-space: nowrap; }
.frag__bytes { margin-top: 10px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.frag__bytes b { color: var(--text); font-weight: 500; }

.frag__wire { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; min-height: 104px; align-items: stretch; }
.pkt {
  position: relative;
  display: grid; align-content: space-between; gap: 8px;
  min-width: 148px; flex: 1 1 148px; max-width: 320px;
  padding: 12px; border-radius: 10px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.4;
  background: var(--surface-2); border: 1px solid var(--line-2);
  animation: slideIn 0.5s var(--ease-out) both;
}
.pkt__top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.pkt__id { color: var(--text); font-size: 12px; }
.pkt__flags { color: var(--gold); }
.pkt__size { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.pkt__size span { display: block; height: 100%; background: var(--bronze); }
.pkt--big { max-width: none; flex-basis: 100%; border-color: rgba(255, 100, 87, 0.6); background: linear-gradient(90deg, rgba(255, 100, 87, 0.12), rgba(255, 100, 87, 0.03)); }
.pkt--big .pkt__size span { background: var(--bad); }
.pkt--weak { border-color: rgba(243, 187, 79, 0.5); }
.pkt--weak .pkt__size span { background: var(--warn); }
.pkt--good { border-color: rgba(138, 214, 154, 0.45); }
.pkt--good .pkt__size span { background: var(--ok); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

.frag__outcome { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; margin-top: 18px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.frag__outcome .ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: 700; }
.frag__outcome b { display: block; font-size: 15px; margin-bottom: 3px; }
.frag__outcome p { font-size: 14px; color: var(--text-2); }
.frag__outcome.is-bad { border-color: rgba(255, 100, 87, 0.45); }
.frag__outcome.is-bad .ico { background: rgba(255, 100, 87, 0.15); color: var(--bad); }
.frag__outcome.is-warn { border-color: rgba(243, 187, 79, 0.45); }
.frag__outcome.is-warn .ico { background: rgba(243, 187, 79, 0.15); color: var(--warn); }
.frag__outcome.is-ok { border-color: rgba(138, 214, 154, 0.4); }
.frag__outcome.is-ok .ico { background: rgba(138, 214, 154, 0.14); color: var(--ok); }
.spinner { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 50%; border: 2px solid rgba(255, 100, 87, 0.3); border-top-color: var(--bad); animation: spin 0.8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 560px) { .seg { width: 100%; } .seg button { flex: 1; padding: 8px 6px; } .pkt { min-width: 128px; flex-basis: 128px; } }

/* assembly listing */
.asm { border-radius: var(--radius); background: #0c0908; border: 1px solid var(--line-2); overflow: hidden; font-family: var(--font-mono); }
.asm__head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.asm__lines { padding: 10px 0; counter-reset: ln; overflow-x: auto; }
.asm__lines li {
  display: grid; grid-template-columns: 26px 94px 94px 150px 1fr; gap: 10px; align-items: baseline;
  padding: 7px 16px; font-size: 12.5px; white-space: nowrap; counter-increment: ln;
  transition: background-color 0.2s;
}
.asm__lines li::before { content: counter(ln); color: #4b3d33; text-align: right; }
.asm__lines li:hover { background: rgba(255, 107, 44, 0.07); }
.asm__addr { color: var(--bronze); }
.asm__word { color: var(--muted); }
.asm__op { color: var(--text); white-space: pre; }
.asm__op b { color: var(--ember); font-weight: 500; }
.asm__cmt { color: #7d8f6a; }
.asm__cmt::before { content: "; "; }
@media (max-width: 1100px) {
  .asm__lines li { grid-template-columns: 22px 94px 1fr; grid-template-areas: "n a op" "n w w" "n c c"; row-gap: 2px; white-space: normal; padding: 10px 16px; }
  .asm__lines li::before { grid-area: n; }
  .asm__addr { grid-area: a; }
  .asm__op { grid-area: op; }
  .asm__word { grid-area: w; font-size: 11px; }
  .asm__cmt { grid-area: c; font-size: 11.5px; }
}

/* ---------- timeline rail ---------- */
.rail { position: relative; margin: 0 calc(var(--gutter) * -1); }
.rail__track {
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
  padding: 8px var(--gutter) 26px;
  scrollbar-width: none; cursor: grab;
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
}
.rail__track::-webkit-scrollbar { display: none; }
.rail__track.is-drag { cursor: grabbing; scroll-snap-type: none; }
.rail__track.is-drag * { user-select: none; pointer-events: none; }
.rail__list { display: flex; gap: 16px; width: max-content; position: relative; padding-top: 34px; }
.rail__list::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 1px; background: linear-gradient(90deg, var(--ember), var(--bronze) 30%, var(--line-2)); }
.rail__item {
  position: relative; scroll-snap-align: start;
  width: 268px; padding: 20px 20px 22px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.3s, transform 0.4s var(--ease-out);
}
.rail__item::before { content: ""; position: absolute; top: -28px; left: 22px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--bronze); }
.rail__item:hover { border-color: var(--line-3); transform: translateY(-4px); }
.rail__item time { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--bronze); letter-spacing: 0.06em; }
.rail__item .tag { position: absolute; top: 18px; right: 18px; font-family: var(--font-mono); font-size: 10.5px; padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2); }
.rail__item b { display: block; margin-top: 12px; font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.1; }
.rail__item p { margin-top: 8px; font-size: 14px; color: var(--text-2); line-height: 1.55; }
.rail__item--origin { background: linear-gradient(160deg, rgba(255, 107, 44, 0.16), var(--surface) 70%); border-color: rgba(255, 107, 44, 0.4); }
.rail__item--origin::before { background: var(--ember); border-color: var(--ember); box-shadow: 0 0 14px var(--ember); }
.rail__item--now { border-color: rgba(138, 214, 154, 0.4); }
.rail__item--now::before { border-color: var(--ok); background: var(--ok); box-shadow: 0 0 14px var(--ok); }
.rail__nav { display: flex; align-items: center; gap: 14px; padding: 0 var(--gutter); }
.rail__progress { flex: 1; height: 2px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.rail__progress span { display: block; height: 100%; width: 20%; background: var(--grad-ember); transform-origin: 0 50%; transition: transform 0.15s linear; }
@media (max-width: 560px) { .rail__item { width: 78vw; max-width: 300px; } }

/* ---------- practices ---------- */
.practices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: clamp(64px, 9vw, 110px); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--line); }
.practice { padding: 28px; background: var(--bg); transition: background-color 0.3s; }
.practice:hover { background: var(--surface); }
.practice b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.15; margin-bottom: 8px; }
.practice p { font-size: 14.5px; color: var(--text-2); }
@media (max-width: 900px) { .practices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .practices { grid-template-columns: 1fr; } .practice { padding: 22px; } }
.disclaimer { margin-top: 40px; font-size: 12.5px; color: var(--muted); max-width: 720px; }

/* ---------- 3D section ---------- */
.section--3d { background: radial-gradient(70% 50% at 80% 0%, rgba(40, 70, 120, 0.12), transparent 70%), var(--bg); }
.showreel { margin: 0; }
.showreel__frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius-lg); border: 1px solid var(--line-2);
  background: #03101f;
  box-shadow: 0 60px 120px -60px rgba(40, 110, 200, 0.45), 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}
.showreel video { width: 100%; height: 100%; object-fit: cover; }
.showreel__frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(3, 8, 16, 0.8) 0%, transparent 42%); pointer-events: none; }
.showreel__caption { position: absolute; left: clamp(18px, 3vw, 36px); bottom: clamp(16px, 3vw, 32px); z-index: 2; display: grid; gap: 4px; }
.showreel__caption .eyebrow { color: #9cc7ff; }
.showreel__caption b { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 5vw, 64px); line-height: 1; }
.showreel__caption > span:last-child { font-size: 14px; color: #c6d6ea; }
.showreel__toggle {
  position: absolute; right: 16px; bottom: 16px; z-index: 3;
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(3, 10, 20, 0.55); cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.showreel__toggle svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.showreel__toggle .i-play { fill: #fff; stroke: none; }
.showreel__toggle .i-play { display: none; }
.showreel__toggle.is-paused .i-play { display: block; }
.showreel__toggle.is-paused .i-pause { display: none; }
@media (max-width: 560px) { .showreel__frame { aspect-ratio: 4 / 5; } .showreel__caption b { font-size: 34px; } }

.three-d { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); margin-top: clamp(48px, 7vw, 80px); align-items: start; }
.pipeline { display: grid; gap: 0; border-left: 1px solid var(--line-2); }
.pipeline li { position: relative; display: grid; grid-template-columns: 44px 1fr; column-gap: 8px; padding: 14px 0 14px 24px; border-bottom: 1px dashed var(--line); transition: background-color 0.3s; }
.pipeline li:last-child { border-bottom: 0; }
.pipeline li::before { content: ""; position: absolute; left: -5px; top: 22px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1.5px solid #6fa7e6; transition: background-color 0.3s, box-shadow 0.3s; }
.pipeline li:hover::before { background: #6fa7e6; box-shadow: 0 0 12px #6fa7e6; }
.pipeline span { grid-row: span 2; font-family: var(--font-mono); font-size: 11px; color: #6fa7e6; padding-top: 5px; }
.pipeline b { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.2; }
.pipeline small { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
@media (max-width: 900px) { .three-d { grid-template-columns: 1fr; } }

.builds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.build { display: grid; grid-template-rows: auto 1fr; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); overflow: hidden; transition: border-color 0.3s, transform 0.5s var(--ease-out); }
.build:hover { border-color: var(--line-3); transform: translateY(-4px); }
.build__text { padding: 24px 26px 28px; }
.build__text h4 { font-family: var(--font-display); font-size: 34px; line-height: 1.1; margin: 8px 0 10px; }
.build__text p:last-child { color: var(--text-2); font-size: 15px; }
@media (max-width: 860px) { .builds { grid-template-columns: 1fr; } }

/* CSS Game Boy */
.gameboy {
  --gb: #c9c4bb;
  height: 290px; display: grid; place-items: center; align-content: center; gap: 14px;
  background: radial-gradient(70% 90% at 50% 100%, rgba(155, 188, 15, 0.12), transparent 70%), linear-gradient(180deg, #19140f, #120e0b);
  border-bottom: 1px solid var(--line);
}
.gameboy__screen-wrap {
  position: relative; width: 250px; padding: 16px 26px 24px 36px;
  background: #5b5b6b; border-radius: 10px 10px 34px 10px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.8), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
  transform: perspective(900px) rotateX(8deg);
}
.gameboy__led { position: absolute; left: 12px; top: 50px; width: 8px; height: 8px; border-radius: 50%; background: #ff3b2f; box-shadow: 0 0 10px #ff3b2f; }
.gameboy__screen { background: #9bbc0f; border-radius: 3px; overflow: hidden; box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35); }
.gameboy__screen img { width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; }
.gameboy__brand { display: block; margin-top: 7px; font-family: var(--font-display); font-style: italic; font-size: 13px; color: #c8c8da; letter-spacing: 0.04em; }
.gameboy__controls { display: flex; justify-content: space-between; align-items: center; width: 200px; }
.gameboy__dpad { position: relative; width: 44px; height: 44px; }
.gameboy__dpad::before, .gameboy__dpad::after { content: ""; position: absolute; background: #2a2622; border-radius: 3px; }
.gameboy__dpad::before { left: 15px; top: 0; width: 14px; height: 44px; }
.gameboy__dpad::after { top: 15px; left: 0; width: 44px; height: 14px; }
.gameboy__ab { display: flex; gap: 10px; transform: rotate(-25deg); }
.gameboy__ab i { width: 22px; height: 22px; border-radius: 50%; background: #8c2150; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35); }

/* Capstone illustration */
.capstone { height: 290px; display: flex; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(70% 90% at 50% 100%, rgba(207, 142, 79, 0.12), transparent 70%), linear-gradient(180deg, #19140f, #120e0b); border-bottom: 1px solid var(--line); }
.capstone__sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; padding: 12px; width: 120px; border-radius: 10px; background: #1f3a2a; border: 1px solid #2e5a3f; transform: rotate(-4deg); }
.capstone__sheet span { height: 16px; border-radius: 3px; background: rgba(160, 230, 180, 0.25); }
.capstone__sheet span:nth-child(odd) { background: rgba(160, 230, 180, 0.45); }
.capstone__arrow { width: 60px; height: 24px; fill: none; stroke: var(--bronze); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 6 6; animation: dash 1.2s linear infinite; }
.capstone__app { display: grid; gap: 8px; padding: 14px; width: 130px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-3); transform: rotate(3deg); }
.capstone__app b { font-family: var(--font-mono); font-size: 12px; color: var(--gold); }
.capstone__app i { height: 10px; border-radius: 3px; background: var(--line-2); }
.capstone__app i:nth-of-type(2) { width: 70%; }

/* ---------- toolkit ---------- */
.skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.skillcard { padding: 26px 24px; border-radius: var(--radius-lg); background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); transition: border-color 0.3s, transform 0.5s var(--ease-out); }
.skillcard:hover { border-color: rgba(207, 142, 79, 0.45); transform: translateY(-4px); }
.skillcard h3 { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 26px; line-height: 1.1; margin-bottom: 18px; }
.skillcard h3 span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; font-family: var(--font-mono); font-size: 14px; background: rgba(255, 107, 44, 0.1); color: var(--ember); }
.skillcard__sub { margin-top: 26px; }
.skillcard ul:not(.taglist) li { position: relative; padding: 8px 0 8px 18px; font-size: 14.5px; color: var(--text-2); border-bottom: 1px solid var(--line); }
.skillcard ul:not(.taglist) li:last-child { border-bottom: 0; }
.skillcard ul:not(.taglist) li::before { content: ""; position: absolute; left: 0; top: 17px; width: 6px; height: 6px; border-radius: 1px; background: var(--bronze); transform: rotate(45deg); }
.taglist { display: flex; flex-wrap: wrap; gap: 8px; }
.taglist li { padding: 6px 12px; border-radius: 999px; font-size: 13.5px; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text); }
@media (max-width: 1100px) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .skills { grid-template-columns: 1fr; } }

/* ---------- experience ---------- */
.xp { position: relative; display: grid; gap: 0; }
.xp::before { content: ""; position: absolute; left: 220px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(180deg, var(--ember), var(--line-2) 30%, var(--line)); }
.xp__item { position: relative; display: grid; grid-template-columns: 220px 1fr; gap: 0 48px; padding: 0 0 56px; }
.xp__item:last-child { padding-bottom: 0; }
.xp__item::before { content: ""; position: absolute; left: 215px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--bronze); }
.xp__item:first-child::before { background: var(--ember); border-color: var(--ember); box-shadow: 0 0 14px var(--ember); }
.xp__when { font-family: var(--font-mono); font-size: 12.5px; color: var(--bronze); letter-spacing: 0.04em; padding-top: 4px; padding-right: 24px; }
.xp__what h3 { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 38px); line-height: 1.1; }
.xp__where { margin-top: 6px; font-size: 14.5px; color: var(--muted); }
.xp__what ul { margin-top: 16px; display: grid; gap: 8px; }
.xp__what ul li { position: relative; padding-left: 20px; color: var(--text-2); font-size: 15.5px; }
.xp__what ul li::before { content: "—"; position: absolute; left: 0; color: var(--bronze); }
.grades { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.grades span { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-size: 14px; color: var(--text-2); }
.grades b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-family: var(--font-display); font-weight: 400; font-size: 18px; color: #1d0c04; background: var(--grad-ember); }
.xp__note { margin-top: 12px; font-size: 14px; color: var(--muted); }
@media (max-width: 760px) {
  .xp::before { left: 5px; }
  .xp__item { grid-template-columns: 1fr; padding-left: 32px; padding-bottom: 44px; }
  .xp__item::before { left: 0; }
  .xp__when { padding: 0 0 8px; }
}

/* ---------- contact ---------- */
.section--contact { overflow: hidden; background: radial-gradient(70% 60% at 50% 120%, rgba(255, 107, 44, 0.22), transparent 70%), var(--bg); }
.contact { text-align: center; display: grid; justify-items: center; }
.contact .section-head__kicker { justify-content: center; }
.contact__title { margin-top: 22px; font-family: var(--font-display); font-size: clamp(48px, 9vw, 120px); line-height: 0.95; letter-spacing: -0.02em; max-width: 1000px; }
.contact__lede { margin-top: 24px; max-width: 560px; font-size: 18px; color: var(--text-2); }
.contact__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: 100%; margin-top: 48px; }
.contact__card {
  display: grid; gap: 8px; text-align: left;
  padding: 22px; border-radius: var(--radius);
  background: rgba(21, 16, 13, 0.8); border: 1px solid var(--line-2);
  text-decoration: none;
  transition: border-color 0.3s, transform 0.4s var(--ease-out), background-color 0.3s;
}
.contact__card:hover { border-color: var(--gold); transform: translateY(-4px); background: var(--surface-2); }
.contact__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.contact__value { font-size: 16px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.contact__card--accent { background: var(--grad-ember); border-color: transparent; }
.contact__card--accent .contact__label { color: rgba(29, 12, 4, 0.7); }
.contact__card--accent .contact__value { color: #1d0c04; font-weight: 600; }
.contact__card--accent:hover { background: var(--grad-ember); border-color: transparent; box-shadow: var(--glow); }
.contact__foot { margin-top: 32px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
@media (max-width: 900px) { .contact__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .contact__grid { grid-template-columns: 1fr; } }

.notfound { min-height: 70vh; align-content: center; }
.notfound__cta { margin-top: 36px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 26px 0 calc(26px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--muted); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero__title .line > span { transform: none; }
  .video__ring, .wire-anim { display: none; }
}
