/* Direction A · The years.
   Default styles = calm, fully readable layout (no JS / reduced motion).
   html.motion = the animated version (set by main.js). */

:root {
  --ink: #0c0c0a;
  --ink-2: #161613;
  --paper: #ece6da;
  --dim: rgba(236, 230, 218, .56);
  --faint: rgba(236, 230, 218, .14);
  --accent: #ff5b1f;          /* rescue orange */
  --holo: #33b5e5;            /* Android 4.0 "Holo" blue, era-accurate */
  --display: "Archivo", "Arial Narrow", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --spine-x: clamp(14px, 2.4vw, 32px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--accent); color: var(--ink); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 56px; z-index: 50; background: var(--paper); color: var(--ink); padding: 8px 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- header (fast lane always visible) ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px var(--gutter);
  font: 500 13px/1 var(--mono); letter-spacing: .02em;
  mix-blend-mode: difference;
}
.bar a { text-decoration: none; }
.bar-name span { opacity: .5; }
.bar-fast { border: 1px solid currentColor; padding: 8px 12px; border-radius: 99px; }
.bar-fast:hover { background: var(--paper); color: var(--ink); }

/* ---------- grain ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 30; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' 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");
}
html.motion .grain { animation: grain 1s steps(4) infinite; }
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-1%,-2%)} }

/* ---------- spine (only in motion mode) ---------- */
.spine { display: none; }
html.motion .spine {
  display: block; position: fixed; z-index: 20; pointer-events: none;
  left: 0; top: 50%; width: 100vw; height: 1px;
  background: var(--faint);
  transform-origin: 50% 50%;
}
.spine-fill { position: absolute; inset: 0; background: var(--accent); transform-origin: 50% 0; }
.spine-head { position: absolute; left: 0; top: 0; opacity: 0; }
.spine-head::before { content: ""; position: absolute; left: -4px; top: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 91, 31, .18); }
.spine-age { position: absolute; left: 14px; top: -8px; white-space: nowrap; font: 500 11px/1 var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .12em; }
.spine-age b { color: var(--paper); font-weight: 600; }

/* ---------- 1. opening ---------- */
.intro {
  position: relative; min-height: 100vh; min-height: 100svh;
  padding: 120px var(--gutter) 64px;
  display: flex; flex-direction: column; justify-content: center; gap: 36px;
}
.throughline {
  margin: 0; max-width: 15ch;
  font-weight: 760; font-stretch: 100%;
  font-size: clamp(2.7rem, 8.4vw, 8.6rem); line-height: .92; letter-spacing: -.025em;
}
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .06em; margin-bottom: -.06em; }
.w > span { display: inline-block; font-stretch: var(--wd, 100%); font-weight: var(--wg, 760); }
.w-better > span { color: var(--accent); }
.intro-sub { margin: 0; max-width: 34ch; font-size: clamp(1rem, 1.5vw, 1.25rem); color: var(--dim); }
.intro-ways { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 22px; font: 500 14px/1.2 var(--mono); }
.way { text-decoration: none; border-bottom: 1px solid var(--faint); padding-bottom: 4px; }
.way small { color: var(--dim); margin-left: 6px; font-size: 12px; }
.way:hover { border-color: var(--accent); }

html.motion .intro { display: block; padding: 0; height: 100vh; height: 100svh; }
html.motion .throughline { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(50% + 22px); }
html.motion .intro-below { position: absolute; left: var(--gutter); right: var(--gutter); top: calc(50% + 24px); }

/* ---------- 2. the phone ---------- */
.phone-ch { position: relative; padding: 80px var(--gutter); display: grid; gap: 40px; justify-items: center; }
.ch-age {
  font-weight: 800; font-stretch: 125%; line-height: .8; letter-spacing: -.04em;
  font-size: clamp(9rem, 34vw, 30rem);
  color: transparent; -webkit-text-stroke: 1.5px var(--faint);
  user-select: none;
}
.ch-head { display: grid; gap: 10px; justify-items: start; text-align: left; max-width: 46ch; }
.ch-label { margin: 0; font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.ch-tldr { margin: 0; font-size: clamp(1rem, 1.4vw, 1.2rem); line-height: 1.35; color: var(--paper); }
.ch-skip { font: 500 12px/1 var(--mono); color: var(--dim); text-decoration: none; border-bottom: 1px solid var(--faint); padding-bottom: 3px; }
.ch-skip:hover { color: var(--paper); border-color: var(--accent); }
.ch-label span { color: var(--accent); margin-right: 10px; }

.rig { position: relative; }
.phone {
  --ph: min(64vh, 560px);
  position: relative; height: var(--ph); aspect-ratio: 10 / 19;
  padding: calc(var(--ph) * .07) calc(var(--ph) * .028) calc(var(--ph) * .085);
  background:
    linear-gradient(160deg, rgba(255,255,255,.09), transparent 30%),
    repeating-linear-gradient(45deg, #151515 0 2px, #1b1b1b 2px 4px); /* kevlar-ish */
  clip-path: polygon(9% 0, 91% 0, 100% 5%, 100% 95%, 94% 100%, 6% 100%, 0 95%, 0 5%); /* RAZR's chamfered corners */
  box-shadow: inset 0 0 0 2px #2c2c2a;
  filter: drop-shadow(0 40px 60px rgba(0,0,0,.7));
}
.phone::after { /* chrome rim */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  clip-path: inherit; border: 1px solid rgba(255,255,255,.12);
}
.phone-speaker { position: absolute; top: 3.2%; left: 38%; right: 38%; height: 4px; border-radius: 4px; background: #050505; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.screen {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background: #000; border-radius: 2px;
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif; /* phone UI, not the site's voice */
  box-shadow: 0 0 0 1px #000;
}
.screen::after { /* glass reflection */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.08) 0 18%, transparent 18.5% 100%);
}
.keys { position: absolute; left: 0; right: 0; bottom: 2.6%; display: flex; justify-content: space-around; padding: 0 14%; color: rgba(255,255,255,.4); font-size: calc(var(--ph) * .026); }

.layer { position: absolute; inset: 0; opacity: 0; }
/* static mode: show the happy ending */
.s-home2 { opacity: 1; }

.s-boot { display: grid; place-items: center; background: #000; }
.s-boot span { font: 700 calc(var(--ph) * .03)/1 Arial, sans-serif; letter-spacing: .32em; color: #e9e9e9; }

.s-home, .s-home2 { color: #fff; padding: 0; }
.s-home { background: radial-gradient(120% 60% at 20% 110%, rgba(51,181,229,.55), transparent 60%), radial-gradient(90% 50% at 90% -10%, rgba(120,200,40,.35), transparent 60%), #05080c; }
.s-home2 { background: radial-gradient(120% 70% at 80% 110%, rgba(255,91,31,.55), transparent 60%), radial-gradient(80% 40% at 0% 0%, rgba(255,91,31,.18), transparent 60%), #0a0605; }
.sb { display: flex; justify-content: space-between; padding: 3px 6px; background: #000; font-size: calc(var(--ph) * .02); color: var(--holo); }
.s-home2 .sb { color: var(--accent); }
.clock { margin-top: 16%; text-align: center; font-weight: 200; font-size: calc(var(--ph) * .11); letter-spacing: -.02em; line-height: 1; }
.clock span { color: var(--holo); }
.s-home2 .clock span { color: var(--accent); }
.date { text-align: center; font-size: calc(var(--ph) * .019); text-transform: uppercase; letter-spacing: .1em; opacity: .7; margin-top: 4px; }
.apps { position: absolute; left: 9%; right: 9%; bottom: 20%; display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(var(--ph) * .03) 12%; }
.apps i, .dock i, .dock b { display: block; aspect-ratio: 1; border-radius: 22%; background: rgba(255,255,255,.18); }
.apps i:nth-child(3n) { background: rgba(51,181,229,.5); }
.s-home2 .apps i:nth-child(3n) { background: rgba(255,91,31,.6); }
.dock { position: absolute; left: 6%; right: 6%; bottom: 4%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10%; padding-top: 4%; border-top: 1px solid rgba(255,255,255,.12); }
.dock b { border-radius: 50%; background: rgba(255,255,255,.4); }

.s-term { background: #000; color: #e6e6e6; font: 400 calc(var(--ph) * .022)/1.6 var(--mono); padding: 0 8px; }
.s-term .tl { margin: 0 -8px 8px; padding: 6px 8px; background: #1d1d1d; color: #bbb; font-size: .9em; }
.s-term p { margin: 0; }
.caret { animation: blink 1s steps(1) infinite; color: var(--holo); }
@keyframes blink { 50% { opacity: 0; } }

.s-rec { background: #000; color: #f2a33a; font: 400 calc(var(--ph) * .019)/1.55 var(--mono); padding: 8px; }
.s-rec .rh { color: #fff; border-bottom: 1px solid #333; padding-bottom: 4px; margin-bottom: 6px; }
.s-rec p { margin: 0; white-space: nowrap; }
.s-rec .zips { position: relative; height: 1.55em; margin: 4px 0; color: #fff; }
.s-rec .z { position: absolute; inset: 0; opacity: 0; }
.s-rec .dim { color: #888; }
.bar-prog { height: 6px; margin-top: 10px; background: #222; }
.bar-prog i { display: block; height: 100%; width: 100%; background: #f2a33a; transform: scaleX(0); transform-origin: 0 50%; }

.s-glitch { display: grid; grid-template-rows: repeat(5, 1fr); background: #000; }
.s-glitch i { display: block; background: linear-gradient(90deg, #ff2d55 0 12%, var(--holo) 12% 40%, #fff 40% 44%, #7cff00 44% 70%, transparent 70%); mix-blend-mode: screen; }

.s-fast { background: #000; color: #fff; font: 400 calc(var(--ph) * .021)/1.5 "Courier New", var(--mono); padding: 14px 10px; }
.s-fast p { margin: 0; }
.f-st { display: grid; }
.f-st > div { grid-area: 1 / 1; }
.s-fast .f-ok { opacity: 0; }
.s-fast .f-prog i { background: #fff; }

/* cable */
.cable { display: none; }
html.motion .cable {
  display: block; position: absolute; left: 0; bottom: calc(100% - 4px);
  width: calc(var(--ph, 64vh) * .55); height: 34vh; overflow: visible;
}
.cable path, .cable circle { fill: none; }
.cable-main { stroke: #2b2b28; stroke-width: 9; stroke-linecap: round; }
.mod-wire { stroke: var(--accent); stroke-width: 2.5; }
.mod-blob { fill: #c9c4ba !important; }
.mod-label { fill: var(--dim); font: 500 11px var(--mono); letter-spacing: .08em; }
.spark circle { fill: rgba(255, 220, 160, .8) !important; filter: blur(3px); }
.spark path { stroke: #ffe2b0; stroke-width: 2; stroke-linecap: round; }

/* beats: static = a readable list */
.beats { list-style: none; margin: 0; padding: 0; max-width: 34ch; display: grid; gap: 18px; font-size: clamp(1.1rem, 1.5vw, 1.35rem); line-height: 1.3; font-weight: 500; }
.beat .k { display: block; margin-bottom: 8px; font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.beat em { font-style: normal; color: var(--accent); }
.beat-big { font-size: 1.7em; line-height: 1.05; font-weight: 800; font-stretch: 112%; letter-spacing: -.02em; }

/* motion layout of the phone chapter (pinned) */
html.motion .phone-ch {
  display: block; height: 100vh; height: 100svh; padding: 0; overflow: hidden;
}
html.motion .ch-age { position: absolute; left: calc(var(--spine-x) + var(--gutter)); bottom: -4vh; }
html.motion .ch-head { position: absolute; left: calc(var(--spine-x) + var(--gutter)); top: 72px; width: min(30ch, 30vw); z-index: 2; }
html.motion .rig { position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%); }
html.motion .layer { opacity: 0; }
/* teleprompter: the whole chapter's text is there; the current line is lit, the rest dimmed */
html.motion .beats-win {
  position: absolute; right: var(--gutter); top: 12vh; bottom: 8vh; width: min(36ch, 32vw); overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
          mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}
html.motion .beats { display: block; max-width: none; }
html.motion .beat { margin: 0 0 1.05em; opacity: .2; }

/* ---------- that guy ---------- */
.guy { padding: 12vh var(--gutter) 10vh calc(var(--spine-x) + var(--gutter)); }
.guy-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 4vw; align-items: end; }
.guy p { margin: 0; font-weight: 800; letter-spacing: -.03em; line-height: .95; font-size: clamp(2.4rem, 6.4vw, 6.6rem); }
.guy p > span { display: inline-block; font-stretch: var(--wd, inherit); }
.guy-a { font-size: clamp(1rem, 1.6vw, 1.3rem) !important; font-weight: 500 !important; color: var(--dim); font-family: var(--mono); letter-spacing: 0 !important; margin-bottom: 18px !important; }
.guy-b { --wd: 70%; }
.guy-c { --wd: 125%; color: var(--accent); }
.guy-list { list-style: none; margin: 0; padding: 0; font: 500 clamp(1rem, 1.6vw, 1.35rem)/1.9 var(--mono); color: var(--dim); }
.guy-list li::before { content: "› "; color: var(--accent); }
.guy-punch { margin-top: 7vh !important; }
.guy-punch span { color: var(--accent); --wd: 125%; }

/* ---------- next ---------- */
.next { position: relative; min-height: 62vh; padding: 10vh var(--gutter) 8vh calc(var(--spine-x) + var(--gutter)); display: flex; flex-direction: column; justify-content: flex-end; border-top: 1px solid var(--faint); }
.next-age { position: absolute; right: var(--gutter); top: 8vh; font-weight: 800; font-stretch: 125%; font-size: clamp(7rem, 24vw, 22rem); line-height: 1; height: 1em; overflow: hidden; color: transparent; -webkit-text-stroke: 1.5px var(--faint); }
.odo { display: flex; flex-direction: column; }
.next-k { margin: 0 0 12px; font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.next-t { margin: 0; font-size: clamp(3rem, 10vw, 10rem); font-weight: 800; font-stretch: 62%; line-height: .9; letter-spacing: -.02em; }
.next-s { margin: 18px 0 0; color: var(--dim); max-width: 36ch; font-size: clamp(1.05rem, 1.6vw, 1.35rem); }

/* ---------- short version ---------- */
.short { padding: 16vh var(--gutter) 14vh calc(var(--spine-x) + var(--gutter)); background: var(--paper); color: var(--ink); position: relative; z-index: 25; }
.short h2 { margin: 0 0 24px; font: 500 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.short-lede { margin: 0 0 40px; font-weight: 700; font-size: clamp(1.6rem, 3.6vw, 3rem); line-height: 1.05; letter-spacing: -.02em; max-width: 26ch; }
.short dl { display: grid; grid-template-columns: max-content 1fr; gap: 14px 28px; max-width: 70ch; margin: 0; }
.short dt { font: 500 12px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: #6a655c; }
.short dd { margin: 0; }
.short-cta { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; }
.short-cta a { text-decoration: none; padding: 12px 18px; border: 1.5px solid var(--ink); border-radius: 99px; font: 500 14px/1 var(--mono); }
.short-cta a:first-child { background: var(--ink); color: var(--paper); }
.short-note { margin-top: 36px; font: 400 12px var(--mono); color: #8a8478; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .short dl { grid-template-columns: 1fr; gap: 4px; }
  .short dd { margin-bottom: 14px; }
  html.motion .phone-ch .ch-age { left: 50%; transform: translateX(-50%); bottom: auto; top: 12vh; font-size: 70vw; }
  html.motion .rig { top: 48%; }
  html.motion .phone { --ph: min(42svh, 420px); }
  .guy-grid { grid-template-columns: 1fr; gap: 5vh; }
  html.motion .ch-head { top: 64px; width: auto; right: var(--gutter); }
  html.motion .ch-tldr { font-size: .95rem; }
  html.motion .beats-win { left: var(--gutter); right: var(--gutter); width: auto; top: auto; bottom: 0; height: 27svh; }
  html.motion .phone-ch::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 32svh; background: linear-gradient(transparent, var(--ink) 22%); pointer-events: none; }
  html.motion .beats-win { z-index: 2; }
  html.motion .beats { font-size: 1.05rem; }
  .beat-big { font-size: 1.6em; }
  .bar-name span { display: none; }
}
