/* Spec-sheet style. Tokens first; components use tokens only. */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 75% 112%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F2F2EE;
  --text: #121314;
  --text-2: #2A2C30;
  --muted: #55575C;
  --hair: #CFCFC8;
  --rule: #121314;
  --band: #121314;
  --band-text: #F2F2EE;
  --band-muted: #C9CAC4;
  --band-rule: #3A3C40;
  --stage: #121314;
  --stage-text: #F2F2EE;
  --accent: #F0642D;
  --on-accent: #121314;
  --accent-text: #B8380F;
  --btn: #121314;
  --btn-text: #F2F2EE;
  --focus: #121314;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --max: 1280px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121314;
    --text: #F2F2EE;
    --text-2: #DADBD5;
    --muted: #A8AAA4;
    --hair: #3A3C40;
    --rule: #F2F2EE;
    --band: #1C1D20;
    --band-text: #F2F2EE;
    --band-muted: #C9CAC4;
    --band-rule: #3A3C40;
    --stage: #1C1D20;
    --accent-text: #F0642D;
    --btn: #F2F2EE;
    --btn-text: #121314;
    --focus: #F2F2EE;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 17px/1.55 var(--sans);
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; }
h2 {
  font-weight: 800; font-stretch: 75%; text-transform: uppercase;
  font-size: clamp(2.25rem, 5vw, 4rem); line-height: .95; letter-spacing: -.005em;
}
p { margin: 0 0 1em; }
a { color: inherit; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.visually-hidden { 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: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--paper); color: var(--text); padding: 8px 12px; z-index: 10; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 14px 22px;
  font: 700 1rem/1.1 var(--sans); text-transform: uppercase; letter-spacing: .03em;
  text-decoration: none; border-radius: 0; white-space: nowrap;
}
.btn-ink { background: var(--btn); color: var(--btn-text); }
.btn-ink:hover { color: var(--btn-text); background: var(--accent-text); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { color: var(--on-accent); filter: brightness(1.06); }
.btn-nav { font: 600 .8rem/1.1 var(--mono); padding: 12px 16px; letter-spacing: .04em; }
.btn-big { font-size: 1.1rem; font-weight: 800; padding: 20px 28px; }

/* ---------- nav ---------- */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 800; font-stretch: 112%; text-transform: uppercase; letter-spacing: .01em; text-decoration: none; font-size: 1.05rem; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-a { font: .8rem var(--mono); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; display: none; }
@media (min-width: 720px) { .nav-a { display: inline; } }
@media (max-width: 559px) { .nav-long { display: none; } }
@media (max-width: 380px) { .brand { font-size: .95rem; } .btn-nav { padding: 10px 12px; font-size: .74rem; } }

/* ---------- hero ---------- */
.hero {
  padding-top: 40px; padding-bottom: 56px;
  display: grid; gap: 28px;
  grid-template-areas: "top" "stage" "bottom";
  grid-template-columns: minmax(0, 1fr);
}
.hero-top { grid-area: top; }
.hero .stage { grid-area: stage; }
.hero-bottom { grid-area: bottom; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
@media (min-width: 900px) {
  .hero {
    padding-top: 72px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "top stage" "bottom stage";
    column-gap: 56px; row-gap: 28px;
    align-items: start;
  }
}
.eyebrow { font: .8rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 20px; }
h1 {
  font-weight: 800; font-stretch: 75%; text-transform: uppercase;
  font-size: clamp(2.75rem, 7vw, 5.75rem); line-height: .92; letter-spacing: -.01em;
}
.h1-sub {
  margin: 20px 0 0; max-width: 44ch;
  font: 600 clamp(.78rem, 1.4vw, .92rem)/1.5 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.lede { font-size: 1.2rem; max-width: 38ch; color: var(--text-2); margin: 20px 0 0; }
.hero-cta { margin-top: 28px; }
.loc { margin: 0; font-size: .74rem; }

.proof { margin: 0; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; border-top: 1px solid var(--rule); }
@media (min-width: 560px) { .proof { grid-template-columns: 1.7fr 1fr 1.1fr .8fr 1fr; } }
.proof div { padding: 14px 10px 0 0; border-right: 1px solid var(--hair); min-width: 0; }
.proof div:last-child { border-right: 0; }
.proof div + div { padding-left: 10px; }
@media (max-width: 559px) { .proof div:nth-child(3) { border-right: 0; } .proof div:nth-child(4) { padding-left: 0; } }
.proof dt { font: .7rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.proof dd { margin: 4px 0 0; font-weight: 800; font-stretch: 85%; font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.1; }

/* ---------- spec figure: crop marks + dark stage + mono table ---------- */
.specfig { position: relative; margin: 0; padding: 18px; min-width: 0; --mark: var(--rule); }
.crop { position: absolute; width: 16px; height: 16px; border: 0 solid var(--mark); }
.crop.tl { left: 0; top: 0; border-left-width: 1.5px; border-top-width: 1.5px; }
.crop.tr { right: 0; top: 0; border-right-width: 1.5px; border-top-width: 1.5px; }
.crop.bl { left: 0; bottom: 0; border-left-width: 1.5px; border-bottom-width: 1.5px; }
.crop.br { right: 0; bottom: 0; border-right-width: 1.5px; border-bottom-width: 1.5px; }

.viewer {
  position: relative; overflow: hidden; width: 100%;
  background: var(--stage); --well: var(--stage);
  touch-action: none;
}
.viewer-hero { aspect-ratio: 1 / 1; max-height: 70vh; }
@media (min-width: 900px) { .viewer-hero { aspect-ratio: 5 / 4; } }
.viewer canvas { display: block; width: 100%; height: 100%; outline: none; }
.viewer canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.live-tag {
  position: absolute; left: 14px; top: 12px; z-index: 2; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
  font: .72rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--stage-text);
}
.live-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.loader {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font: .8rem var(--mono); color: var(--band-muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 16px; text-align: center; transition: opacity .3s;
}
.loader.done { opacity: 0; pointer-events: none; }
/* Still frame of the first view, shown until the live canvas has drawn. */
.viewer-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  pointer-events: none; transition: opacity .4s ease;
}
.viewer.rendered .viewer-poster { opacity: 0; }
.viewer .live-tag, .viewer .loader, .viewer .hint { z-index: 1; }
/* Over the still frame, loading progress sits low so the model stays visible. */
.viewer:has(.viewer-poster) .loader { justify-content: flex-end; padding-bottom: 28px; }
.viewer:has(.viewer-poster):not(.rendered) .hint { opacity: 0; }
.loader.error { color: var(--accent); }
.bar { width: min(220px, 70%); height: 3px; background: var(--band-rule); overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  font: .7rem var(--mono); text-transform: uppercase; letter-spacing: .04em;
  color: var(--stage-text); background: rgba(18, 19, 20, .7); padding: 4px 10px;
  white-space: nowrap; pointer-events: none; transition: opacity .4s;
}
.viewer.touched .hint { opacity: 0; }

.figtable { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rule); border-top: 0; font-family: var(--mono); }
.figtable > div { padding: 10px 12px 12px; border-right: 1px solid var(--rule); min-width: 0; }
.figtable > div:last-child { border-right: 0; }
.figtable dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.figtable dd { margin: 2px 0 0; }
.figtable .v { display: block; font-weight: 600; font-size: clamp(1rem, 3.6vw, 1.35rem); line-height: 1.3; white-space: nowrap; }
.figtable small { display: block; font-size: .68rem; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
/* on narrow screens the explanations wrap to four lines or more; the figures stand alone */
@media (max-width: 559px) { .figtable small { display: none; } }

.panel-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--rule); flex: 1 1 160px; max-width: 240px; }
.seg button {
  font: 600 .8rem var(--mono); text-transform: uppercase; letter-spacing: .06em;
  color: var(--text); background: transparent; border: 0; border-radius: 0; padding: 8px; cursor: pointer; min-height: 44px;
}
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-checked="true"] { background: var(--btn); color: var(--btn-text); }
.seg button:disabled { cursor: progress; }
.swatches { display: flex; gap: 4px; min-height: 44px; }
.swatches[hidden] { display: none; }
.swatch { width: 44px; height: 44px; padding: 0; cursor: pointer; border: 0; border-radius: 0; background: transparent; display: grid; place-items: center; }
.swatch::before { content: ""; width: 28px; height: 28px; background: var(--swatch); box-shadow: inset 0 0 0 1px var(--hair); }
.swatch[aria-pressed="true"]::before { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--text); }
.swatch:focus-visible { outline-offset: 0; }

.fig-cap { margin: 10px 0 0; font: .74rem/1.5 var(--mono); color: var(--muted); }

/* ---------- bands ---------- */
.band { background: var(--band); color: var(--band-text); --muted: var(--band-muted); --rule: var(--band-text); --hair: var(--band-rule); --text-2: var(--band-muted); --mark: var(--band-text); }
.band a:hover { color: var(--accent); }
#web { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.band-inner { padding-top: 64px; padding-bottom: 64px; }
.band-inner > h2 { max-width: 16ch; margin-bottom: 20px; }
.lead-narrow { max-width: 46ch; color: var(--band-muted); }

.pair { display: grid; gap: 24px; margin-top: 28px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "video" "live" "figs"; }
.pair > .video { grid-area: video; }
.pair > .live { grid-area: live; }
.pair > .live-figures { grid-area: figs; }
@media (min-width: 900px) {
  .pair {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "video live" "figs live";
    column-gap: 40px; row-gap: 24px;
    align-items: stretch;
  }
}
.live { display: flex; flex-direction: column; }
/* crop marks sit outside the column so the stage aligns with the video */
@media (min-width: 900px) { .pair > .live.specfig { margin: -18px; } }
.band .viewer { --stage: #0B0C0D; --well: #0B0C0D; border: 1px solid var(--band-rule); }
.viewer.viewer-tall { aspect-ratio: 4 / 5; }
@media (min-width: 900px) { .viewer.viewer-tall { aspect-ratio: auto; flex: 1 1 auto; min-height: 320px; } }
.viewer-tall canvas { position: absolute; inset: 0; }
.live-figures { align-self: end; }
.live-figures .figtable { border-top: 1px solid var(--rule); }
.live-note { font: .74rem var(--mono); color: var(--band-muted); margin: 10px 0 0; }

/* ---------- sections ---------- */
.block { padding-top: 72px; padding-bottom: 72px; }
.ruled { border-top: 1px solid var(--rule); }
.block > h2 { margin-bottom: 28px; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; margin-bottom: 28px; }
.sec-note { margin: 0; font: .85rem var(--mono); color: var(--muted); }

.stages { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--rule); }
@media (min-width: 720px) { .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stages li { padding: 20px 24px 22px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; }
.stages .num { font: 600 .9rem var(--mono); color: var(--accent-text); }
.stages h3 { font-weight: 700; font-size: 1.35rem; line-height: 1.2; letter-spacing: -.005em; }
.stages p { margin: 0; color: var(--text-2); }

/* captions: title left, mono tag right, ink rule above */
/* line 1: FIG. number + spec (mono) and tag; line 2: title; line 3: action links */
.cap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 10px; }
.cap-spec { order: 0; font: .72rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); min-width: 0; }
.fig-n { color: var(--accent-text); font-weight: 600; }
.band .fig-n { color: var(--accent); }
.cap .tag { order: 1; }
.cap-t { order: 2; flex-basis: 100%; font-weight: 700; font-size: 1rem; line-height: 1.3; }
.cap .tags { order: 3; flex-basis: 100%; }
.tag { font: .72rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }

/* videos */
.videos { display: grid; gap: 28px 24px; margin-top: 28px; }
@media (min-width: 720px) { .videos.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gallery-frame .videos { margin-top: 0; }
.video { margin: 0; min-width: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
/* vertical clips: a tall card crops the side bars of the 16:9 thumbnail */
.video-frame.tall { aspect-ratio: 4 / 5; }
.video-frame > .video-link, .video-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; margin: 0;
  display: block; background: #000; cursor: pointer; border-radius: 0;
}
.video-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play {
  position: absolute; left: 12px; bottom: 12px; width: 48px; height: 48px;
  background: var(--accent); display: flex; align-items: center; justify-content: center; transition: transform .15s;
}
.play svg { fill: #121314; }
.video-link:hover .play, .video-link:focus-visible .play { transform: scale(1.08); }
.video-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

/* galleries: crop marks frame the whole set; every card in a gallery shares one ratio */
.gallery-frame { padding: 12px; margin: 0 -10px; }
@media (min-width: 720px) { .gallery-frame { padding: 18px; margin: 0 -18px; } }
.gallery { display: grid; gap: 32px 24px; grid-template-columns: minmax(0, 1fr); }
/* six tracks: stills take two (three per row), the wide clips take three (two per row) */
@media (min-width: 560px) {
  .gallery { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .gallery > * { grid-column: span 2; }
  .gallery > .wide { grid-column: span 3; }
}
.art { margin: 0; min-width: 0; }
.art a { display: block; text-decoration: none; }
.art img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
/* landscape source: keep the mole and the rat in the 4:5 crop */
.art img.focus-r { object-position: 80% 50%; }

.more { display: flex; flex-wrap: wrap; gap: 4px 28px; padding-top: 8px; padding-bottom: 40px; font: .85rem var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.more a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; border-bottom: 1px solid currentColor; }

/* closing band + footer */
.cta-inner { padding-top: 88px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 32px; }
.cta h2 { font-size: clamp(2.4rem, 6vw, 5rem); line-height: .92; max-width: 15ch; }
.foot { border-top: 0; }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; padding-bottom: 40px; border-top: 1px solid var(--band-rule); font: .74rem/1.6 var(--mono); color: var(--band-muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- video modal (native <dialog>) ---------- */
.vmodal-lock, .vmodal-lock body { overflow: hidden; }
.vmodal {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: #F2F2EE; overflow: hidden;
}
.vmodal[open] { display: flex; align-items: center; justify-content: center; animation: vmodal-in .18s ease-out; }
.vmodal::backdrop { background: rgba(18, 19, 20, .85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@keyframes vmodal-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .vmodal[open] { animation: none; } }
.vmodal-box {
  /* largest 16:9 that fits: 24px side margins, and room above/below for the close button and caption */
  width: min(92vw, calc(100vw - 48px), calc((100vh - 152px) * 16 / 9));
  width: min(92vw, calc(100vw - 48px), calc((100dvh - 152px) * 16 / 9));
}
@media (orientation: portrait) and (max-width: 600px) { .vmodal-box { width: 100vw; } .vmodal-cap { padding: 10px 16px 0; } }
@media (orientation: landscape) and (max-height: 500px) {
  .vmodal-box { width: min(calc(100vw - 136px), calc((100vh - 56px) * 16 / 9)); width: min(calc(100vw - 136px), calc((100dvh - 56px) * 16 / 9)); }
}
.vmodal-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.vmodal-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.vmodal-cap {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-top: 1px solid #3A3C40; margin-top: 10px; padding-top: 10px;
  font: .78rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: #F2F2EE;
}
.vmodal-title { font-weight: 600; }
.vmodal-yt { color: #F2F2EE; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; margin-top: -12px; }
.vmodal-yt:hover { color: var(--accent); }
.vmodal-close {
  position: absolute; top: 12px; right: 12px; width: 48px; height: 48px;
  display: grid; place-items: center; cursor: pointer;
  background: #F2F2EE; color: #121314; border: 0; border-radius: 0; z-index: 1;
}
.vmodal-close:hover { background: var(--accent); }
.vmodal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vmodal :focus-visible { outline-color: var(--accent); }

/* ---------- illustration cards with an animation ---------- */
.art-media { position: relative; }
.anim-play {
  position: absolute; left: 10px; bottom: 10px; width: 48px; height: 48px; padding: 0;
  background: var(--accent); border: 0; border-radius: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: transform .15s;
}
.anim-play svg { fill: #121314; }
.anim-play:hover, .anim-play:focus-visible { transform: scale(1.08); }
.anim-play:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 0 14px; min-width: 0; }
.art-anim .tags { flex-wrap: nowrap; justify-content: space-between; gap: 12px; }
.art-anim .tag { letter-spacing: .04em; }
.art .tag-link { display: inline-flex; }
.tag-link {
  min-height: 44px; display: inline-flex; align-items: center; margin: 0;
  background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none;
}
.tag-link:hover { color: var(--accent-text); }
.anim-link { color: var(--accent-text); }
/* self-hosted square animations in the modal */
.vmodal-box.is-square { width: min(92vw, calc(100vw - 48px), calc(100vh - 152px)); width: min(92vw, calc(100vw - 48px), calc(100dvh - 152px)); }
@media (orientation: portrait) and (max-width: 600px) { .vmodal-box.is-square { width: 100vw; } }
@media (orientation: landscape) and (max-height: 500px) { .vmodal-box.is-square { width: calc(100vh - 56px); width: calc(100dvh - 56px); } }
.vmodal-box.is-square .vmodal-frame { aspect-ratio: 1 / 1; }
.vmodal-frame video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
