/* Zack Richardson — portfolio v3 (v2 identity and motion system).
   One continuous page. Each project is a "scene": copy on one side, a stage on the other
   that pins while you scroll and plays an animation explaining the project.

   How the motion works (see static/site.js):
   - site.js adds `html.motion` unless the visitor prefers reduced motion. Only then do
     tracks get tall and stages pin.
   - site.js writes scroll progress into custom properties on each .stage (--p and friends).
     Every var() below falls back to its FINAL value, so with JS off or reduced motion on,
     each stage simply shows its finished state.
   - Only transform, opacity and (for the before/after wipe) clip-path change while
     scrolling, so it stays smooth on phones.

   Type: Archivo, one variable family (width + weight), self-hosted. Display type runs
   expanded, body type stays at normal width. */

@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #071219;      /* page */
  --ink-2: #0d1f2a;    /* raised surfaces */
  --ink-3: #15303f;
  --line: #22404f;
  --fog: #e7ecea;      /* text */
  --mute: #93a8b0;     /* secondary text */
  --teal: #2bb5a4;     /* passed, positive */
  --sodium: #f3b52f;   /* streetlight yellow: the accent */
  --coral: #ff6a4d;    /* failed cell, Spire */
  --paper: #f6f8f7;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem);
  --step-3: clamp(2.1rem, 1.2rem + 4vw, 4.4rem);
  --step-4: clamp(3rem, 0.9rem + 8.6vw, 8.6rem);

  --gutter: clamp(20px, 4vw, 48px);
  --bar: 60px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--bar); background: var(--ink); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--fog);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

p { margin: 0 0 1em; max-width: 64ch; }
h1, h2, h3 { text-wrap: balance; margin: 0; font-weight: 800; line-height: 1.02; letter-spacing: -0.01em; }
figure { margin: 0; }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--sodium); }

:focus-visible { outline: 3px solid var(--sodium); outline-offset: 3px; border-radius: 2px; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 30;
  background: var(--sodium); color: var(--ink); padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Topbar + scroll progress ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgb(7 18 25 / 0.92);
  border-bottom: 1px solid rgb(231 236 234 / 0.06);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--bar); }
.wordmark { font-weight: 800; font-stretch: 125%; font-size: 1.02rem; text-decoration: none; white-space: nowrap; }
nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); font-size: var(--step--1); font-weight: 600; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; }
.nav-cta { background: var(--sodium); color: var(--ink); padding: 8px 14px; border-radius: 999px; }
.nav-cta:hover { text-decoration: none; background: var(--fog); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.progress i {
  display: block; height: 100%; background: var(--sodium);
  transform: scaleX(0); transform-origin: 0 50%; will-change: transform;
}

/* ---------- Buttons, placeholders ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  font-size: var(--step-0); font-weight: 700; text-decoration: none;
  border-radius: 999px; border: 2px solid var(--fog);
}
.btn-sodium { background: var(--sodium); border-color: var(--sodium); color: var(--ink); }
.btn-sodium:hover { background: var(--fog); border-color: var(--fog); }

/* Visible placeholders Zack must fill in. Search the source for TODO(zack). */
.todo {
  display: inline-block; padding: 2px 10px;
  border: 2px dashed var(--sodium); border-radius: 4px;
  font-size: var(--step--1); font-weight: 700;
}
.todo-dark { border-color: var(--ink); }

/* ---------- Hero ---------- */
.hero { min-height: min(calc(100svh - var(--bar)), 980px); display: flex; align-items: center; padding: clamp(40px, 8vw, 96px) 0; }
.hero-inner { width: 100%; }
/* Scroll-out drift for the headline only. The chapter list (#work, a nav target) stays put. */
.hero-kicker, .hero-title { opacity: calc(1 - var(--hp, 0) * 0.9); transform: translateY(calc(var(--hp, 0) * -60px)); }
.hero-kicker {
  font-size: var(--step--1); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sodium); margin-bottom: 18px;
}
.hero-title {
  font-size: var(--step-4);
  font-stretch: 125%;
  font-weight: 850;
  line-height: 0.94;
  letter-spacing: -0.03em;
  max-width: 11ch;
}
.hero-title .w { display: inline-block; }
.hero-title .hl { color: var(--sodium); }
.motion .hero-title .w { animation: rise 0.9s var(--ease) both; }
.motion .hero-title .w:nth-child(2) { animation-delay: 60ms; }
.motion .hero-title .w:nth-child(3) { animation-delay: 120ms; }
.motion .hero-title .w:nth-child(4) { animation-delay: 180ms; }
.motion .hero-title .w:nth-child(5) { animation-delay: 300ms; }
.motion .hero-title .w:nth-child(6) { animation-delay: 380ms; }
@keyframes rise {
  from { opacity: 0; transform: translateY(0.45em); }
  to   { opacity: 1; transform: none; }
}

.hero-body {
  margin-top: clamp(28px, 4vw, 48px);
  max-width: 36rem;
  font-size: var(--step-1);
  line-height: 1.5;
  color: #c6d3d7;
}
.motion .hero-body, .motion .chapters { animation: rise 0.9s 0.5s var(--ease) both; }

.chapters {
  list-style: none; padding: 0; margin: clamp(32px, 5vw, 56px) 0 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) { .chapters { grid-template-columns: repeat(4, 1fr); column-gap: 24px; } }   /* 8 items = 2 even rows */
.chapters li { display: flex; }   /* stretch each link to the row height so bottom borders line up */
.chapters a {
  flex: 1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px;
  padding: 12px 12px 12px 0; text-decoration: none; font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.chapters span { font-family: var(--mono); font-size: 0.75rem; color: var(--sodium); }
.chapters em { font-style: normal; font-weight: 400; color: var(--mute); font-size: var(--step--1); }
.chapters a:hover em { color: var(--fog); }
.scroll-cue {
  margin: 32px 0 0; font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute);
}
.scroll-cue::after {
  content: ""; display: block; width: 1px; height: 36px; margin-top: 8px; background: var(--mute);
  transform-origin: top;
}
.motion .scroll-cue::after { animation: cue 2s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Scenes: shared layout ---------- */
.scene {
  --accent: var(--sodium);
  position: relative;
  max-width: 1240px; margin: 0 auto;
  padding: clamp(72px, 10vw, 128px) var(--gutter) clamp(48px, 7vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "track" "body";
}
.scene::before {   /* hairline between scenes */
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter);
  height: 1px; background: var(--line);
}
#workers, #games { --accent: var(--teal); }
#wordhold { --accent: var(--coral); }
#spire { --accent: var(--coral); }

.scene-copy { display: contents; }
.scene-head { grid-area: head; }
.scene-body { grid-area: body; margin-top: 32px; color: #c6d3d7; }
.track { grid-area: track; margin-top: 28px; }

.eyebrow {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  font-size: var(--step--1); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow span { font-family: var(--mono); letter-spacing: 0; color: var(--mute); }
.eyebrow::after { content: ""; flex: 0 0 40px; height: 2px; background: currentColor; order: 3; }
.scene-title { font-size: var(--step-3); font-stretch: 112%; font-weight: 850; line-height: 0.98; letter-spacing: -0.02em; }
.scene-body strong { color: var(--fog); }
.scene-body cite { font-style: italic; }
.scene-body a { text-decoration-color: var(--accent); }
.scene-link { margin-top: 1.4em; font-weight: 700; }
.scene-link a { color: var(--accent); }
.scene-link a::after { content: ""; display: inline-block; width: 0.5em; height: 0.5em; margin-left: 0.4em; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg) translateY(-0.1em); }
.scene-body .aside { margin-top: 1.4em; padding-left: 14px; border-left: 2px solid var(--line); font-size: var(--step--1); color: var(--mute); }

/* The stage: in motion mode the track is tall and the stage pins inside it. */
.stage { position: relative; }
.stage-label { display: none; margin: 0 0 12px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.stage-label span { font-family: var(--mono); color: var(--mute); letter-spacing: 0; }
.motion .track { height: calc(var(--len) * 1vh); height: calc(var(--len) * 1svh); }
.motion .stage {
  /* As tall as its content (no empty half-screens). site.js sets `top` so the pinned stage
     sits centred below the bar, and sizes the track so the scroll length is fixed. */
  position: sticky; top: var(--bar);
  padding: 16px 0;
}

/* Beats: the one-line narration under a stage. Static: a list. Motion: one at a time. */
.beats { list-style: none; padding: 0; margin: 18px 0 0; font-size: var(--step-1); font-weight: 600; line-height: 1.35; }
.beats li { padding: 4px 0; }
.motion .beats { display: grid; }
.motion .beats li {
  /* Swaps never overlap: the outgoing beat is gone (0.15s) before the incoming one starts. */
  grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}
.motion .beats li.on {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.3s ease 0.18s, transform 0.4s var(--ease) 0.18s, visibility 0s linear 0.15s;
}

figcaption { margin-top: 12px; font-size: var(--step--1); color: var(--mute); }

/* Scroll-in reveal for the non-pinned bits. */
.motion .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.45s ease, transform 0.6s var(--ease); }
.motion .reveal.in { opacity: 1; transform: none; }

/* ---------- 01 Auryn: the day ---------- */
.day {
  position: relative; overflow: hidden; isolation: isolate;
  border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 14px;
  background: var(--ink-2);
}
.day-sky { position: absolute; inset: 0; z-index: -1; }
.day-sky i { position: absolute; inset: 0; }
.sky-dawn  { background: radial-gradient(120% 70% at 0% 0%, rgb(243 181 47 / 0.35), transparent 60%); opacity: var(--sky0, 0); }
.sky-day   { background: radial-gradient(120% 70% at 50% -10%, rgb(124 196 255 / 0.28), transparent 65%); opacity: var(--sky1, 0); }
.sky-dusk  { background: radial-gradient(120% 70% at 100% 0%, rgb(255 106 77 / 0.32), transparent 60%); opacity: var(--sky2, 0); }
.sky-night { background: radial-gradient(120% 70% at 80% 0%, rgb(60 80 160 / 0.32), transparent 65%); opacity: var(--sky3, 1); }

.day-head { margin-bottom: 12px; }
.day-clock { font-family: var(--mono); font-size: var(--step-2); font-weight: 700; letter-spacing: -0.02em; }
.day-rail { position: relative; height: 18px; margin: 10px 0 4px; }
.day-rail::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: var(--line); }
.day-sun { position: absolute; inset: 0; transform: translateX(calc(var(--p, 1) * 100%)); will-change: transform; }
.day-sun i {
  position: absolute; left: -9px; top: 0; width: 18px; height: 18px; border-radius: 50%;
  background: var(--sodium); box-shadow: 0 0 0 6px rgb(243 181 47 / 0.18);
}
.day-ticks { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--mute); font-family: var(--mono); }

.day-events { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.day-events li {
  display: grid; grid-template-columns: 3.6rem 1fr; column-gap: 10px; align-items: baseline;
  padding: 8px 12px; border-radius: 10px; background: var(--ink-3);
  border-left: 3px solid var(--sodium);
}
.day-events time { font-family: var(--mono); font-size: 0.8rem; color: var(--mute); grid-row: span 2; }
.day-events b { font-size: 0.98rem; }
.day-events span { font-size: 0.85rem; color: var(--mute); line-height: 1.35; }
.motion .day-events li { opacity: 0.18; transform: translateX(-10px); border-left-color: var(--line); transition: opacity 0.4s ease, transform 0.5s var(--ease), border-color 0.4s; }
.motion .day-events li.on { opacity: 1; transform: none; border-left-color: var(--sodium); }

/* ---------- 02 The Deck: jobs and a decision card ---------- */
.desk { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.jobs { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.jobs li {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--ink-2); border: 1px solid var(--line);
}
.job-name { font-size: 0.9rem; line-height: 1.3; }
.job-state {
  font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--teal); color: var(--ink); white-space: nowrap;
}
.job-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--teal); transform-origin: 0 50%; transform: scaleX(var(--j, 1)); }
.jobs li[data-s="0"] .job-state { background: transparent; color: var(--mute); box-shadow: inset 0 0 0 1.5px var(--line); }
.jobs li[data-s="1"] .job-state { background: var(--ink-3); color: var(--fog); }
.jobs li[data-s="2"] .job-state { background: var(--sodium); color: var(--ink); }

.phone {
  justify-self: center; width: min(100%, 300px);
  border: 1px solid var(--line); border-radius: 26px; padding: 12px 12px 14px;
  background: linear-gradient(180deg, var(--ink-2), #0a1a24);
}
.phone-top { display: flex; justify-content: space-between; margin: 2px 6px 10px; font-weight: 800; font-stretch: 112%; }
.phone-top span { font-weight: 600; font-stretch: 100%; font-size: 0.78rem; color: var(--sodium); }
.dcard {
  position: relative; padding: 16px; border-radius: 16px; background: var(--paper); color: var(--ink);
  transform: translate(calc(var(--sw, 0) * 22%), calc((1 - var(--ci, 1)) * 30px)) rotate(calc(var(--sw, 0) * 7deg));
  opacity: var(--ci, 1); will-change: transform;
}
.dcard p { margin: 0; }
.dcard-kind { font-size: 0.75rem; font-weight: 700; color: #0f6f6d; }
.dcard-title { margin-top: 4px !important; font-size: 1.12rem; font-weight: 800; font-stretch: 108%; line-height: 1.2; }
.dcard-pick { margin-top: 10px !important; font-size: 0.84rem; line-height: 1.4; color: #31424b; }
.dcard-pick b { color: var(--ink); }
.dcard-keys { display: flex; justify-content: space-between; margin-top: 12px !important; font-size: 0.75rem; font-weight: 700; color: #50606a; }
.dcard-stamp {
  position: absolute; top: -16px; left: 14px; padding: 1px 10px; border: 3px solid #0f6f6d; border-radius: 8px; background: var(--paper);
  color: #0f6f6d; font-weight: 900; font-stretch: 125%; font-size: 1.1rem; transform: rotate(-6deg);
  opacity: var(--st, 1);
}
.phone-after { margin: 12px 6px 0; font-size: 0.8rem; color: var(--mute); opacity: var(--pa, 1); }

/* ---------- 03 Wordhold: speech into text ---------- */
.dictate { border: 1px solid var(--line); border-radius: 18px; background: var(--ink-2); padding: 18px; }
.mic { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.rec { display: inline-flex; align-items: center; gap: 8px; font-size: var(--step--1); font-weight: 700; color: var(--coral); white-space: nowrap; }
.rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.motion .rec i { animation: pulse 1.4s ease-in-out infinite; }
.wave { flex: 1; display: flex; align-items: center; justify-content: space-between; height: 40px; }
.wave i { flex: 0 0 5px; height: 100%; border-radius: 2px; background: var(--sodium); transform: scaleY(calc(var(--h) * var(--lv, 1))); transform-origin: 50% 50%; opacity: 0.85; }
.wave i:nth-child(1) { --h: .35; } .wave i:nth-child(2) { --h: .6; } .wave i:nth-child(3) { --h: .9; } .wave i:nth-child(4) { --h: .5; } .wave i:nth-child(5) { --h: .75; } .wave i:nth-child(6) { --h: .3; } .wave i:nth-child(7) { --h: .55; } .wave i:nth-child(8) { --h: 1; } .wave i:nth-child(9) { --h: .65; } .wave i:nth-child(10) { --h: .4; } .wave i:nth-child(11) { --h: .8; } .wave i:nth-child(12) { --h: .45; } .wave i:nth-child(13) { --h: .7; } .wave i:nth-child(14) { --h: .25; } .wave i:nth-child(15) { --h: .6; } .wave i:nth-child(16) { --h: .9; } .wave i:nth-child(17) { --h: .5; } .wave i:nth-child(18) { --h: .35; } .wave i:nth-child(19) { --h: .7; } .wave i:nth-child(20) { --h: .3; }
.raw { margin: 0; font-size: var(--step-1); line-height: 1.5; max-width: none; }
.raw span { display: inline; }
.raw .cut { color: var(--mute); text-decoration: line-through; text-decoration-color: var(--coral); text-decoration-thickness: 2px; }
.motion .raw span { opacity: 0.12; transition: opacity 0.3s, color 0.3s; }
.motion .raw span.on { opacity: 1; }
.motion .raw .cut { color: var(--fog); text-decoration-color: transparent; transition: opacity 0.3s, color 0.3s, text-decoration-color 0.3s; }
.motion .raw .cut.x { color: var(--mute); text-decoration-color: var(--coral); opacity: 0.6; }
.clean {
  margin: 16px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--paper); color: var(--ink);
  font-size: var(--step-1); font-weight: 700; line-height: 1.35; max-width: none;
  opacity: var(--cl, 1); transform: translateY(calc((1 - var(--cl, 1)) * 12px));
}
.clean-label { display: block; font-size: 0.75rem; font-weight: 700; color: #0f6f6d; margin-bottom: 2px; }

/* ---------- 04 Spire: flywheel ---------- */
.spin { position: relative; display: grid; place-items: center; min-height: min(78vw, 440px); }
.kinetic {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: 2% 0; overflow: hidden; pointer-events: none;
  font-weight: 900; font-stretch: 125%; font-size: clamp(3.4rem, 2rem + 6vw, 7rem); line-height: 0.9;
  text-transform: uppercase; white-space: nowrap; letter-spacing: -0.02em;
}
.kinetic span { display: block; will-change: transform; }
.kinetic b { font-weight: inherit; }
.k1 { color: transparent; -webkit-text-stroke: 1.5px rgb(255 106 77 / 0.55); transform: translateX(calc(-10% - var(--p, 1) * 30%)); }
.k2 { color: rgb(255 106 77 / 0.16); transform: translateX(calc(-45% + var(--p, 1) * 30%)); }
@media (min-width: 900px) {   /* a marquee that fades out at the edges instead of being cut */
  .spin { min-height: 500px; padding-bottom: 44px; }
  figure.spin > figcaption { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; }
  figure.spin > .kinetic { bottom: 44px; line-height: 1; }
  .kinetic { -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
}
@media (max-width: 899px) {   /* phones: one whole word above the wheel, one below, never clipped */
  .spin { display: flex; flex-direction: column; align-items: center; min-height: 0; gap: 8px; overflow-x: clip; }  /* .kinetic is display:contents here, so the sliding words need clipping on .spin */
  .kinetic { display: contents; font-size: min(13vw, 3.4rem); }
  .kinetic b + b { display: none; }
  .k1 { order: 0; transform: translateX(calc((1 - var(--p, 1)) * -12vw)); opacity: clamp(0, var(--p, 1) * 2.5, 1); }
  .flywheel { order: 1; width: min(54vw, 260px); }
  .k2 { order: 2; transform: translateX(calc((1 - var(--p, 1)) * 12vw)); opacity: clamp(0, var(--p, 1) * 2.5 - 0.6, 1); color: rgb(255 106 77 / 0.3); }
  .spin figcaption { order: 3; }
}
.flywheel { position: relative; width: min(64vw, 320px); height: auto; overflow: visible; }
.fw-rim { fill: var(--ink-2); stroke: var(--fog); stroke-width: 5; }
.fw-speed { fill: none; stroke: var(--coral); stroke-width: 6; stroke-dasharray: 18 14; opacity: var(--p, 1); }
.fw-spokes, .fw-speed { transform: rotate(var(--spin, 0deg)); will-change: transform; }
.fw-spokes path { stroke: var(--fog); stroke-width: 4; stroke-linecap: round; }
.fw-hub { fill: var(--coral); }
.spin figcaption { position: relative; text-align: center; color: var(--fog); font-weight: 600; }

/* ---------- 05 Bet Boyz: leaderboard ---------- */
.board { border: 1px solid var(--line); border-radius: 18px; background: var(--ink-2); padding: 16px; }
.board-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-family: var(--mono); font-size: var(--step--1); color: var(--mute); }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--coral); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); }
.motion .live i { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.board-rows { list-style: none; padding: 0; margin: 0; position: relative; }
.board-rows li {
  display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: 10px;
  height: 58px; padding: 0 14px; margin: 0; border-radius: 12px; background: var(--ink-3);
  border: 1px solid transparent; background-clip: padding-box;
}
.board-rows li + li { margin-top: 6px; }
.board-rows .rk { font-family: var(--mono); color: var(--mute); }
.board-rows b { font-size: var(--step-1); font-stretch: 110%; }
.board-rows .pts { font-family: var(--mono); font-size: var(--step-1); font-weight: 700; font-variant-numeric: tabular-nums; }
.board-rows li:first-child .rk, .board-rows li.lead .rk { color: var(--sodium); }
/* Rows are fixed rank slots. When a team changes slot, its name and score roll into the new
   slot from the direction it came from, clipped by the slot, so rows never cross. */
.board-rows li { overflow: hidden; }
.row-in { grid-column: 2 / 4; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.row-in.from-below { animation: roll-up 0.45s var(--ease); }
.row-in.from-above { animation: roll-down 0.45s var(--ease); }
@keyframes roll-up { from { transform: translateY(80%); opacity: 0; } }
@keyframes roll-down { from { transform: translateY(-80%); opacity: 0; } }
.motion .board-rows li:first-child { transition: border-color 0.3s; }
.motion .board-rows li.lead { border-color: rgb(243 181 47 / 0.6); }
.motion .board-rows li:first-child:not(.lead) .rk { color: var(--mute); }
.pts.bump { animation: bump 0.5s var(--ease); color: var(--teal); }
@keyframes bump { from { transform: scale(1.35); } to { transform: none; } }

/* ---------- 06 Custom systems ---------- */
.strip-view { overflow: hidden; }
.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sys { display: grid; justify-items: center; align-content: center; gap: 4px; }
.sys figcaption { color: var(--fog); font-weight: 600; font-size: var(--step-0); }

.wall {
  position: relative; width: 100%; max-width: 280px; aspect-ratio: 4 / 3;
  border: 6px solid #2a3e49; border-radius: 12px; background: #0a1820; padding: 10px;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr 1fr; gap: 8px;
}
.wall-clock {
  grid-column: 1 / -1; font-family: var(--mono); font-weight: 700; font-size: 1.6rem; line-height: 1;
  opacity: clamp(0, var(--c1, 1) * 5, 1);
}
.tile {
  border-radius: 6px; background: var(--ink-3);
  opacity: clamp(0, var(--c1, 1) * 5 - var(--i), 1);
  transform: scale(calc(0.85 + 0.15 * clamp(0, var(--c1, 1) * 5 - var(--i), 1)));
}
.tile::before, .tile::after { content: ""; display: block; height: 6px; margin: 10px 10px 0; border-radius: 3px; background: var(--line); }
.tile::after { width: 50%; }
.t1 { --i: 1; border-top: 3px solid var(--sodium); }
.t2 { --i: 1.6; border-top: 3px solid var(--teal); }
.t3 { --i: 2.2; border-top: 3px solid var(--coral); }
.t4 { --i: 2.8; border-top: 3px solid #7cc4ff; }

.sys-card { perspective: 900px; }
.card {
  position: relative; width: 100%; max-width: 280px; aspect-ratio: 4 / 3;
  transform-style: preserve-3d; transform: rotateY(calc(var(--c2, 1) * 180deg));
  will-change: transform;
}
.card-face {
  position: absolute; inset: 0; border-radius: 14px; padding: 16px;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 1.05rem; line-height: 1.3;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.card-face small { font-family: var(--mono); font-weight: 400; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; }
.card-front { background: var(--paper); color: var(--ink); }
.card-back { background: var(--sodium); color: var(--ink); transform: rotateY(180deg); }

.pgrid { width: 100%; max-width: 150px; height: auto; overflow: visible; }
.pg-ghost { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 4 4; }
.pg-row {
  --k: clamp(0, var(--c3, 1) * 9 - var(--i), 1);
  opacity: var(--k); transform: translateY(calc((1 - var(--k)) * -18px));
}
/* Row order and bar heights live here, not inline: site.js clears inline styles in the static fallback. */
.pg-row:nth-of-type(1) { --i: 0; }
.pg-row:nth-of-type(2) { --i: 1; }
.pg-row:nth-of-type(3) { --i: 2; }
.pg-row:nth-of-type(4) { --i: 3; }
.pg-row:nth-of-type(5) { --i: 4; }
.pg-row:nth-of-type(6) { --i: 5; }
.pg-row:nth-of-type(7) { --i: 6; }
.pg-row circle { fill: var(--sodium); }
.pg-row path { fill: none; stroke: #7cc4ff; stroke-width: 3; stroke-linecap: round; }

/* ---------- 07 Work with me: before / after ---------- */
.hire-from { margin: 0 0 16px; font-weight: 800; font-stretch: 112%; color: var(--fog); }
.ba-frame { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; max-width: 620px; }
.ba-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #dfe5e3; color: #50606a; font-family: var(--mono); font-size: 0.72rem; }
.ba-bar i { width: 9px; height: 9px; border-radius: 50%; background: #b5c0bd; }
.ba-bar span { margin-left: 8px; padding: 2px 10px; background: #fff; border-radius: 999px; }
.ba-view { position: relative; height: clamp(300px, 52svh, 420px); }
.ba-pane { position: absolute; inset: 0; overflow: hidden; }
.ba-pane img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

.ba-before {
  background: #f4e9c8 repeating-linear-gradient(45deg, transparent 0 10px, rgb(0 0 0 / 0.03) 10px 20px);
  color: #2b2b2b; font-family: "Times New Roman", Times, serif; padding: 10px; text-align: center;
}
.old-marquee { margin: 0 0 6px; font: 700 0.7rem/1.2 "Comic Sans MS", cursive; color: #c00; background: #ff0; padding: 3px; max-width: none; white-space: nowrap; overflow: hidden; }
.old-title { margin: 6px 0; font: italic 700 1.7rem/1 "Times New Roman", serif; color: #6a1b9a; text-shadow: 2px 2px 0 #ffb300; max-width: none; }
.old-img { margin: 8px auto; width: 80%; height: 30%; display: grid; place-items: center; background: #b9a77a; color: #5d4f2a; font: 700 0.8rem/1 var(--mono); border: 3px ridge #8d7b4f; }
.old-small { font-size: 0.62rem; line-height: 1.3; margin: 6px auto; max-width: 30ch; color: #444; }
.old-small u { color: #00e; }
.old-row { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.old-row i { width: 26%; height: 44px; background: #cdbb8e; border: 2px outset #e9d9a9; }

.ba-after {
  background: var(--paper); color: var(--ink); padding: 22px 20px;
  clip-path: inset(0 calc((1 - var(--w, 1)) * 100%) 0 0);
}
.new-title { margin: 0 0 6px; font-weight: 850; font-stretch: 125%; font-size: 1.9rem; line-height: 1; }
.new-open { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-weight: 600; color: #0f6f6d; }
.new-open i { width: 9px; height: 9px; border-radius: 50%; background: #0f6f6d; }
.new-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.new-actions span { padding: 9px 16px; border-radius: 999px; background: var(--ink); color: var(--fog); font-weight: 700; font-size: 0.9rem; }
.new-actions span:first-child { background: var(--sodium); color: var(--ink); }
.new-facts { list-style: none; padding: 0; margin: 0; }
.new-facts li { display: grid; grid-template-columns: 4.2rem 1fr; padding: 9px 0; border-top: 1px solid #d5ddda; font-size: 0.92rem; }
.new-facts b { font-weight: 700; }
.new-facts li { transition: background 0.4s; }
.ba.facts .new-facts b { color: #0f6f6d; }
.ba.facts .new-facts li { background: linear-gradient(90deg, rgb(43 181 164 / 0.14), transparent 70%); }

.ba-handle { position: absolute; inset: 0; pointer-events: none; transform: translateX(calc(var(--w, 1) * 100%)); opacity: var(--hw, 0); will-change: transform; }
.ba-handle::before { content: ""; position: absolute; left: -1.5px; top: 0; bottom: 0; width: 3px; background: var(--sodium); }
.ba-handle i { position: absolute; left: -16px; top: 50%; width: 32px; height: 32px; margin-top: -16px; border-radius: 50%; background: var(--sodium); box-shadow: 0 2px 10px rgb(0 0 0 / 0.3); }

/* ---------- How it works, About, Footer ---------- */
.section-title { font-size: var(--step-3); font-stretch: 112%; font-weight: 850; margin-bottom: clamp(24px, 4vw, 48px); }
.hire-details { padding: clamp(72px, 10vw, 128px) 0; background: linear-gradient(180deg, var(--ink), #0b2230); }
.hire-details a:not(.btn) { color: var(--sodium); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 32px; }
.steps li {
  counter-increment: step; padding: 22px; border-radius: 16px; background: var(--ink-2); border: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  width: 2.2rem; height: 2.2rem; border-radius: 50%; margin-bottom: 14px;
  display: grid; place-items: center;
  background: var(--sodium); color: var(--ink);
  font-weight: 800; font-size: 1rem;
}
.steps h3 { font-size: var(--step-1); font-stretch: 112%; line-height: 1.25; }
.steps p { margin: 8px 0 0; color: #b9c8cd; }

.ready {
  list-style: none; padding: 24px 0 0; margin: clamp(28px, 4vw, 48px) 0 0;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 32px;
}
.ready li { padding-left: 22px; position: relative; }
.ready li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 10px; height: 10px; background: var(--sodium); border-radius: 2px; }
.ready code { font-family: inherit; font-weight: 700; }
.offer-meta { margin-top: clamp(28px, 4vw, 48px); padding-top: 24px; border-top: 1px solid var(--line); }
.price { font-size: var(--step-1); margin-bottom: 20px; }
.price b { color: var(--sodium); }
.offer-meta .ready { border-top: 0; padding-top: 0; margin-top: 0; }
.offer-meta .scene-link { --accent: var(--sodium); margin-top: 24px; }
.chores { margin-top: clamp(72px, 9vw, 120px); }
.chores-body { max-width: 46rem; font-size: var(--step-1); line-height: 1.5; color: #c6d3d7; }
.chore-list { list-style: none; padding: 0; margin: 8px 0 24px; display: grid; gap: 14px; font-size: var(--step-0); }
.chore-list li { padding: 16px 18px; border-left: 3px solid var(--teal); background: var(--ink-2); border-radius: 0 12px 12px 0; }
.chore-list b { display: block; color: var(--fog); margin-bottom: 2px; }
.about-body a { color: var(--sodium); }
.hire-contact { margin: clamp(36px, 5vw, 56px) 0 16px; }
.hire-proof { font-size: var(--step--1); color: #b9c8cd; }

.about { padding: clamp(72px, 10vw, 128px) 0; border-top: 1px solid var(--line); }
.about-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 clamp(24px, 4vw, 64px); }
.about-body { font-size: var(--step-1); line-height: 1.55; color: #c6d3d7; }

/* Latest post (filled in by build.py between the build:latest-post markers). */
.latest { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.latest-label { font-size: var(--step--1); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sodium); margin-bottom: 18px; }
.latest-card {
  display: grid; gap: 8px; max-width: 46rem; padding: clamp(20px, 3vw, 28px);
  border-radius: 16px; background: var(--ink-2); border: 1px solid var(--line); text-decoration: none;
  transition: border-color 0.2s;
}
.latest-card:hover { border-color: var(--sodium); }
.latest-meta { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.latest-title { font-size: var(--step-2); font-stretch: 112%; font-weight: 800; line-height: 1.1; text-wrap: balance; }
.latest-dek { color: #b9c8cd; }
.nowrap { white-space: nowrap; }
.latest-all { margin: 16px 0 0; font-size: var(--step--1); font-weight: 700; }
.draft-tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; vertical-align: 1px;
  border: 1.5px dashed var(--sodium); border-radius: 4px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sodium);
}

.footer { padding: 28px 0; font-size: var(--step--1); color: var(--mute); border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer p { margin: 0; }

/* ---------- Phones: tighten so a pinned stage fits one screen ---------- */
@media (max-width: 899px) {
  .motion .stage-label { display: block; }
  .day { padding: 14px 14px 10px; }
  .day-events { gap: 5px; }
  .day-events li { padding: 6px 10px; }
  .day-clock { font-size: 1.4rem; }
  .doc { padding: 12px 14px; }
  .doc p { font-size: 0.88rem; }
  .beats { font-size: var(--step-0); }
  .board-rows li { height: 52px; }
  .scene { padding-top: 56px; padding-bottom: 24px; }
  .hero { min-height: 0; }
  /* Custom systems: the three panels slide sideways as you scroll down. */
  .strip { width: 300%; gap: 0; transform: translateX(calc(var(--sx, 0) * -33.3333%)); will-change: transform; }
  .sys { padding: 0 8px; }
  .wall, .card { max-width: 340px; aspect-ratio: 1; }
  .card-face { font-size: 1.3rem; padding: 22px; }
  .wall-clock { font-size: 2.4rem; }
  .pgrid { max-width: 300px; }
  .phone { width: 100%; border: 0; padding: 0; background: none; }
  .phone-top { display: none; }
  .phone-after { margin-top: 8px; }
  .job-name { font-size: 0.82rem; }
  .jobs li { padding: 8px 10px; }
  .raw { font-size: 1.1rem; }
  .clean { font-size: 1.1rem; }
  .steps, .ready, .about-inner { grid-template-columns: 1fr; }
  /* Static fallback on phones: stack the three panels instead of sliding. */
  html:not(.motion) .strip { width: auto; grid-template-columns: 1fr; gap: 32px; transform: none; }
}
@media (max-height: 760px) and (max-width: 899px) {
  .motion #auryn .day-events span { display: none; }   /* pinned scene only */
  .motion #auryn .day-events time { grid-row: auto; }
  .motion #workers .jobs li:nth-child(n+4) { display: none; }   /* pinned scene only: static pages keep it all */
  .motion #workers .dcard-pick { display: none; }
  .ba-view { height: max(320px, 44svh); }   /* never shorter than the mock's content */
}
.nav-cta { white-space: nowrap; }
@media (max-width: 560px) {   /* phones: Writing and the CTA stay, Work and About go */
  nav a:not(.nav-cta):not(.nav-keep) { display: none; }
  nav { gap: 12px; }
  .nav-cta { padding: 8px 12px; }
}
@media (max-width: 380px) { .wordmark { font-stretch: 108%; font-size: 0.96rem; } }
@media (max-width: 340px) { .wordmark { font-stretch: 100%; font-size: 0.9rem; } nav { font-size: 0.8rem; gap: 10px; } }

/* ---------- Desktop: copy on the left (sticky), stage on the right ---------- */
@media (min-width: 900px) {
  .scene {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas: "copy track";
    column-gap: clamp(40px, 5vw, 80px);
  }
  .scene-copy {
    display: block; grid-area: copy; align-self: start;
    position: sticky; top: calc(var(--bar) + 12vh);
  }
  .scene-body { margin-top: 28px; }
  .track { margin-top: 0; }
  .topbar { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); background: rgb(7 18 25 / 0.78); }
  .desk { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .desk > .beats, .desk > figcaption { grid-column: 1 / -1; }
  .day-events { grid-template-columns: 1fr 1fr; }
  .day-events li:last-child { grid-column: 1 / -1; }
}

/* Reduced motion: no pinning, no scroll-linked anything, finished states only. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
