/* PCB: the board is the page; the text floats over it, one part per screen. */
@font-face {
  font-family: 'Archivo';
  src: url('../../fonts/archivo-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: block;
}

:root {
  --bg: #0c0a10;
  --ink: #f5f1fa;
  --text: #d9d1e6;
  --muted: #a99cbd;
  --gold: #e6bd6c;
  --signal: #ffb066;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --pad: clamp(24px, 6vw, 96px);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: 80px; }
body { margin: 0; color: var(--text); font: 400 18px/1.62 'Archivo', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2 { margin: 0; color: var(--ink); text-wrap: balance; }
p, dl, dd { margin: 0; }
a { color: var(--ink); text-decoration: none; background: linear-gradient(var(--signal), var(--signal)) 0 100% / 0 1.5px no-repeat, linear-gradient(rgb(255 255 255 / 0.25), rgb(255 255 255 / 0.25)) 0 100% / 100% 1px no-repeat; transition: background-size 0.45s var(--ease), color 0.25s; }
a:hover { color: var(--signal); background-size: 100% 1.5px, 100% 1px; }
::selection { background: rgb(255 176 102 / 0.3); }

.scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }

/* Bar: invisible over the opening shot, then a dark glass strip naming the part you are at. */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 10; height: 60px; padding: 0 var(--pad);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  transition: background-color 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
/* No backdrop blur: it would re-blur the live WebGL frame behind the bar on every frame. */
.bar.is-docked { background-color: rgb(12 10 16 / 0.84); box-shadow: 0 1px 0 rgb(255 255 255 / 0.06); }
.bar a { background: none; }
.bar-name { white-space: nowrap; font-weight: 720; font-stretch: 115%; color: var(--ink); font-size: 16px; opacity: 0; transition: opacity 0.5s var(--ease); }
.bar-now { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink); opacity: 0; transform: translateY(-6px); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.bar.is-docked .bar-name, .bar.is-docked .bar-now { opacity: 1; transform: none; }
.bar.is-swapping .bar-now { opacity: 0; transform: translateY(4px); transition-duration: 0.18s; }
.bar-contact { justify-self: end; color: var(--ink); font-weight: 600; font-size: 15px; padding: 7px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.5); transition: box-shadow 0.3s, background-color 0.3s, color 0.3s; }
.bar-contact:hover { background: var(--ink); color: var(--bg); box-shadow: inset 0 0 0 1.5px var(--ink); }

/* Reference designators, as printed on the board. */
.des { display: inline-grid; place-items: center; min-width: 34px; height: 22px; padding: 0 6px; border: 1.5px solid var(--gold); border-radius: 4px; color: var(--gold); font-size: 12px; font-weight: 760; font-stretch: 110%; font-variant-numeric: tabular-nums; }

/* Sections: room for the signal to slow into each part and leave it, short enough that the next text is already
   coming up as you finish this one. */
.board { position: relative; z-index: 1; overflow-x: clip; } /* the text's soft backdrops may run past the window edge */
.stop { position: relative; min-height: 112vh; display: flex; align-items: center; padding: 0 var(--pad); pointer-events: none; }
.stop[data-side='r'] { justify-content: flex-end; }
.txt { position: relative; max-width: 31rem; pointer-events: auto; }
.txt::before {
  content: ''; position: absolute; inset: -30% -40% -30% -45%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgb(12 10 16 / 0.82), rgb(12 10 16 / 0.55) 55%, rgb(12 10 16 / 0));
}
.ref { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--muted); margin-bottom: 18px; }
h2 { font-size: clamp(36px, 4.2vw, 64px); line-height: 0.98; font-weight: 800; font-stretch: 118%; letter-spacing: -0.03em; }
.lede { margin-top: 20px; font-size: clamp(19px, 1.5vw, 22px); line-height: 1.5; color: var(--ink); }
.facts { display: flex; flex-wrap: wrap; gap: 18px 34px; margin-top: 28px; }
.facts dd { font-size: 30px; font-weight: 760; font-stretch: 112%; color: var(--ink); line-height: 1.1; letter-spacing: -0.02em; }
.facts dt { font-size: 14px; color: var(--muted); margin-top: 4px; max-width: 14ch; }
.role { margin-top: 24px; font-size: 15px; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; font-size: 15px; font-weight: 600; }

/* Opening shot: the lights come up on the board, then the name. */
.stop-hero { min-height: 100vh; align-items: flex-end; padding-bottom: 13vh; }
.stop-hero .txt::before { inset: -40% -50% -40% -40%; }
h1 { font-size: clamp(min(68px, 21vw), 10.6vw, 176px); /* narrow phones: shrink so 'Wilmer' still fits */ line-height: 0.84; font-weight: 840; font-stretch: 125%; letter-spacing: -0.045em; }
h1 span { display: block; }
.tagline { margin-top: clamp(24px, 3vw, 40px); max-width: 24ch; font-size: clamp(21px, 1.9vw, 28px); line-height: 1.32; color: var(--ink); font-weight: 420; }
h1 span, .tagline { opacity: 0; transform: translateY(0.35em); filter: blur(10px); }
.is-ready h1 span, .is-ready .tagline { opacity: 1; transform: none; filter: none; transition: opacity 1.1s var(--ease), transform 1.4s var(--ease), filter 1.1s var(--ease); }
.is-ready h1 span:nth-child(1) { transition-delay: 0.9s; }
.is-ready h1 span:nth-child(2) { transition-delay: 1.02s; }
.is-ready .tagline { transition-delay: 1.5s; }

.stop-finish { min-height: 130vh; }
.finish-links { display: flex; flex-direction: column; gap: 6px; margin-top: 24px; font-size: clamp(22px, 2vw, 30px); font-weight: 600; }
.finish-links a { width: fit-content; }
.fine { margin-top: 28px; font-size: 14px; color: var(--muted); }

/* Scroll cue: a pill naming what to do, with the signal running down a short trace below it. It stays fixed at
   the bottom of the window (it never rides up with the page) and drops away as soon as you start scrolling. */
.cue {
  position: fixed; z-index: 3; left: 50%; bottom: 5vh; display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600; color: var(--ink); opacity: 0; transform: translate(-50%, 8px);
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
}
.cue-label { white-space: nowrap; padding: 9px 18px; border-radius: 999px; background: rgb(12 10 16 / 0.72); box-shadow: inset 0 0 0 1.5px rgb(255 176 102 / 0.55); }
.is-ready .cue { opacity: 1; transform: translate(-50%, 0); transition-delay: 2.6s; }
.is-ready.is-away .cue { opacity: 0; transform: translate(-50%, 14px); transition: opacity 0.22s ease-out, transform 0.35s ease-out; transition-delay: 0s; }
.cue-trace { position: relative; width: 2px; height: 44px; border-radius: 1px; background: rgb(255 255 255 / 0.18); overflow: hidden; }
.cue-trace::after {
  content: ''; position: absolute; left: -1px; top: 0; width: 4px; height: 14px; border-radius: 2px;
  background: var(--signal); box-shadow: 0 0 8px var(--signal); animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { from { transform: translateY(-16px); } to { transform: translateY(50px); } }
@media (prefers-reduced-motion: reduce) { .cue-trace::after { animation: none; top: 15px; } }

/* ---------------------------------------------------------------- the text plate */

/* Each part's text is printed on a solid patch of soldermask, outlined like an unpopulated footprint. It is
   always there, in one column down the left: you read down the page as you would an article, and the board
   moves beside it. When the signal reaches the part, the outline and its pin-1 mark light up. */
.stop:not(.stop-hero) .txt {
  max-width: 36rem; padding: clamp(28px, 2.8vw, 44px) clamp(28px, 3vw, 48px); border-radius: 6px;
  background: rgb(24 11 37 / 0.95);
  box-shadow: inset 0 0 0 1px rgb(241 237 228 / 0.14), 0 30px 90px rgb(0 0 0 / 0.55);
}
.stop:not(.stop-hero) .txt::before, .etch .txt::before {
  inset: 9px; border: 1px dashed rgb(241 237 228 / 0.18); border-radius: 3px; background: none;
  transition: border-color 0.8s var(--ease);
}
.stop:not(.stop-hero) .txt::after, .etch .txt::after {
  content: ''; position: absolute; top: 18px; left: 18px; width: 7px; height: 7px; border-radius: 50%;
  background: rgb(241 237 228 / 0.4); transition: background-color 0.8s var(--ease), box-shadow 0.8s var(--ease);
}
.stop.is-on .txt::before, .etch.is-on .txt::before { border-color: rgb(255 176 102 / 0.4); }
.stop.is-on .txt::after, .etch.is-on .txt::after { background: var(--signal); box-shadow: 0 0 10px rgb(255 176 102 / 0.7); }
.stop:not(.stop-hero) h2 { font-size: clamp(34px, 3.3vw, 52px); line-height: 1.02; }
.stop:not(.stop-hero) .lede { font-size: clamp(19px, 1.35vw, 21px); line-height: 1.55; }
.stop:not(.stop-hero) .role, .stop:not(.stop-hero) .facts dt, .stop:not(.stop-hero) .ref { color: #c4b8d6; }

/* ---------------------------------------------------------------- etched (?read=etched) */

/* The text lies flat on the board as silkscreen on mask, laid out in CSS pixels at a larger size than it is
   shown, so the browser draws it sharp (etch-layer.mjs scales it to the board). Sections only make scroll room. */
.etch-layer { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.etch-layer:not(.is-placed), .etch.is-far { opacity: 0; }
.etch.is-far .txt { pointer-events: none; }
.etch { width: 900px; color: #e9e2d6; }
.etch .txt { max-width: none; padding: 60px 68px 56px; border-radius: 10px; background: rgb(22 9 34 / 0.9); box-shadow: inset 0 0 0 2px rgb(241 237 228 / 0.14); }
.etch .txt::before { inset: 14px; border-width: 2px; border-radius: 4px; }
.etch .txt::after { top: 28px; left: 28px; width: 11px; height: 11px; }
.etch h1, .etch h2 { color: #f7f2ea; }
.etch h2 { font-size: 76px; line-height: 1; }
.etch .ref { font-size: 23px; margin-bottom: 26px; color: #cfc6dc; }
.etch .des { min-width: 50px; height: 32px; font-size: 17px; border-width: 2px; }
.etch .lede { margin-top: 26px; font-size: 30px; line-height: 1.48; color: #efe9de; }
.etch .facts { gap: 24px 48px; margin-top: 36px; }
.etch .facts dd { font-size: 44px; }
.etch .facts dt { font-size: 22px; color: #cfc6dc; }
.etch .role { margin-top: 30px; font-size: 24px; line-height: 1.5; color: #cfc6dc; }
.etch .links { margin-top: 20px; font-size: 24px; gap: 10px 30px; }
.etch h1 { font-size: 128px; }
.etch .tagline { margin-top: 36px; max-width: 26ch; font-size: 36px; }
.etch .finish-links { font-size: 40px; }
.etch .fine { font-size: 22px; color: #cfc6dc; }
[data-read='etched'] .stop:not(.stop-hero) { min-height: 150vh; }

.is-etch-narrow .etch { width: 440px; }
.is-etch-narrow .etch .txt { padding: 34px 32px 30px; }
.is-etch-narrow .etch .txt::before { inset: 9px; border-width: 1.5px; }
.is-etch-narrow .etch .txt::after { top: 17px; left: 17px; width: 8px; height: 8px; }
.is-etch-narrow .etch h2 { font-size: 40px; }
.is-etch-narrow .etch .ref, .is-etch-narrow .etch .role, .is-etch-narrow .etch .links, .is-etch-narrow .etch .fine, .is-etch-narrow .etch .facts dt { font-size: 16px; }
.is-etch-narrow .etch .lede { font-size: 21px; }
.is-etch-narrow .etch .facts dd { font-size: 28px; }
.is-etch-narrow .etch h1 { font-size: 66px; }
.is-etch-narrow .etch .tagline { font-size: 22px; }
.is-etch-narrow .etch .finish-links { font-size: 24px; }

@media (max-width: 760px) {
  .cue { bottom: 2.5vh; font-size: 14px; }
  .cue-trace { height: 28px; }
  .stop, .stop[data-side='r'] { justify-content: flex-start; align-items: flex-end; padding-bottom: 16vh; }
  /* Room above each plate: when its part is centred, the part shows above the text, not behind it. */
  .stop:not(.stop-hero) { min-height: 0; padding-top: 64vh; padding-bottom: 6vh; }
  [data-read='etched'] .stop:not(.stop-hero) { min-height: 150vh; padding: 0; }
  .bar { grid-template-columns: 1fr auto; } /* the part name is hidden: name and Contact only */
  .bar-now { display: none; }
}
