/* Miaw Works: site styles.
   One file, no framework. Tokens first, then layout, then components, then pages. */

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

/* ---------- Tokens ---------- */
:root {
  --paper: #f1ede3;
  --paper-2: #e8e2d4;
  --card: #fbf9f4;
  --ink: #15130f;
  --ink-2: #3b372f;
  --muted: #6e685c;
  --line: #d6cfbf;
  --line-strong: #15130f;
  --accent: #ff4a1c;        /* vermilion: the studio colour */
  --accent-ink: #15130f;    /* text on accent */
  --accent-soft: #ffd9cc;
  --grid: rgba(21, 19, 15, 0.07);

  /* Priority chips, straight from QA Lab's P1–P4 */
  --p1: #e5262a;
  --p2: #ff7a1a;
  --p3: #e8b000;
  --p4: #8c8577;

  /* Dark band (used for contrast sections in both themes) */
  --band: #15130f;
  --band-2: #211e18;
  --band-ink: #f1ede3;
  --band-muted: #a39c8d;
  --band-line: #3a352c;

  --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .1, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12110e;
    --paper-2: #1b1915;
    --card: #1a1814;
    --ink: #efe9dc;
    --ink-2: #cfc8b9;
    --muted: #9a9384;
    --line: #2f2b24;
    --line-strong: #efe9dc;
    --accent-soft: #3a1a10;
    --grid: rgba(239, 233, 220, 0.05);
    --band: #0a0907;
    --band-2: #17150f;
    --band-line: #2f2b24;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12110e;
  --paper-2: #1b1915;
  --card: #1a1814;
  --ink: #efe9dc;
  --ink-2: #cfc8b9;
  --muted: #9a9384;
  --line: #2f2b24;
  --line-strong: #efe9dc;
  --accent-soft: #3a1a10;
  --grid: rgba(239, 233, 220, 0.05);
  --band: #0a0907;
  --band-2: #17150f;
  --band-line: #2f2b24;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); line-height: 1; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code, kbd, samp, pre { font-family: var(--font-mono); font-size: .88em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

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

/* Section labels look like log fields: `// 02 · what we do` */
.kicker {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .04em; text-transform: lowercase;
  color: var(--muted);
}
.kicker::before { content: ""; width: 8px; height: 8px; background: var(--accent); }

.display {
  font-weight: 860;
  font-stretch: 118%;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: .9;
}
.h2 { font-size: clamp(34px, 5.4vw, 68px); }
.h3 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 760; font-stretch: 108%; letter-spacing: -0.01em; line-height: 1.08; }
.lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--ink);
  display: inline-flex; align-items: center; gap: .55em;
  padding: 14px 20px;
  font: 700 15px/1 var(--font-body); font-stretch: 110%; letter-spacing: .01em; text-transform: uppercase;
  color: var(--paper); background: var(--b); border: 2px solid var(--b);
  border-radius: var(--radius); text-decoration: none; cursor: pointer;
  box-shadow: 4px 4px 0 var(--accent);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s;
}
.btn:hover { color: var(--paper); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--accent); }
.btn--ghost { color: var(--ink); background: transparent; box-shadow: none; }
.btn--ghost:hover { color: var(--ink); background: var(--paper-2); box-shadow: none; transform: none; }
.btn--accent { --b: var(--accent); color: var(--accent-ink); box-shadow: 4px 4px 0 var(--ink); }
.btn--accent:hover { color: var(--accent-ink); box-shadow: 6px 6px 0 var(--ink); }
.btn .arr { transition: transform .2s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.band .btn { --b: var(--band-ink); color: var(--band); }
.band .btn--ghost { color: var(--band-ink); background: transparent; }
.band .btn--ghost:hover { background: var(--band-2); }
.band .btn--accent { --b: var(--accent); color: var(--accent-ink); box-shadow: 4px 4px 0 var(--band-ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand-word { font-family: var(--font-display); font-weight: 880; font-stretch: 122%; font-size: 19px; letter-spacing: -0.01em; text-transform: uppercase; line-height: 1; }
.brand-word span { color: var(--accent); }
.brand:hover .cat-eye { animation: blink .5s steps(1) 1; }
@keyframes blink { 50% { transform: scaleY(.1); } }
.cat-eye { transform-origin: center; transform-box: fill-box; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; }
.nav-links a {
  display: inline-block; padding: 8px 12px; text-decoration: none;
  font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-2); border-radius: var(--radius);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }
.nav-links a[aria-current="page"]::before { content: "▸ "; color: var(--accent); }
.nav-links .nav-cta, .nav-links .nav-cta:hover { color: var(--paper); background: var(--ink); }
.nav-cta { margin-left: 8px; padding: 10px 14px !important; font-size: 13px !important; box-shadow: 3px 3px 0 var(--accent) !important; }
.nav-cta:hover { box-shadow: 4px 4px 0 var(--accent) !important; }
.theme-toggle {
  width: 38px; height: 38px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: var(--radius); cursor: pointer;
}
.theme-toggle:hover { background: var(--paper-2); }
.theme-toggle svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

@media (max-width: 1080px) {
  .nav { gap: 10px; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
    height: 38px; padding: 0 12px; border: 1px solid var(--line); background: transparent; color: var(--ink);
    font: 600 13px var(--font-mono); border-radius: var(--radius); cursor: pointer;
  }
  .nav-links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px; background: var(--paper); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .2s var(--ease);
  }
  .nav-links.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav-links a { padding: 14px 4px; font-size: 16px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-links li:last-child a { border-bottom: 0; }
  .nav-cta { margin: 14px 0 0; justify-content: center; }
}

/* ---------- Sections ---------- */
section { position: relative; }
.sec { padding: clamp(72px, 10vw, 140px) 0; }
.sec-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); max-width: 880px; }
.band { background: var(--band); color: var(--band-ink); }
.band .kicker, .band .muted { color: var(--band-muted); }
.band .lead { color: var(--band-muted); }
.band a:hover { color: var(--accent); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Level grid background (the bot's 4 m cells) */
.gridbg {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

/* ---------- Hero ---------- */
.hero { padding: clamp(36px, 6vw, 72px) 0 clamp(56px, 7vw, 96px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: start; margin-top: clamp(28px, 4vw, 48px); }
.hero h1 { font-size: clamp(38px, 7.1vw, 96px); font-stretch: 110%; }
.hero-copy { padding-top: 6px; }
.hero-tags { list-style: none; margin: 36px 0 0; padding: 0; border-top: 1px solid var(--line); font: 400 13px var(--font-mono); color: var(--ink-2); }
.hero-tags li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hero-tags b { color: var(--accent); font-weight: 600; }
.hero h1 .line { display: block; }
.hero h1 .hl { position: relative; display: inline-block; isolation: isolate; color: var(--ink); }
.hero h1 .hl::after {
  content: ""; position: absolute; left: -3%; right: -3%; bottom: .04em; height: .36em; background: var(--accent); z-index: -1;
  transform: scaleX(0); transform-origin: left; animation: strike .7s .6s var(--ease) forwards;
}
@keyframes strike { to { transform: scaleX(1); } }
.hero .lead { margin: 0 0 30px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.status {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px;
  padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font: 500 12.5px var(--font-mono); color: var(--ink-2); text-decoration: none;
}
.status:hover { color: var(--ink); border-color: var(--ink); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--p3); box-shadow: 0 0 0 0 var(--p3); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--p3) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* Game viewport: the bot-cat explorer */
.viewport {
  position: relative;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  background: var(--band);
  color: var(--band-ink);
  box-shadow: 10px 10px 0 var(--accent);
  overflow: hidden;
}
.vp-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--band-line); font: 500 11.5px var(--font-mono); color: var(--band-muted);
}
.vp-bar .lights { display: flex; gap: 6px; }
.vp-bar .lights i { width: 9px; height: 9px; border-radius: 50%; background: var(--band-line); }
.vp-bar .lights i:first-child { background: var(--accent); }
.vp-bar .ttl { color: var(--band-ink); }
.vp-bar .rec { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.vp-bar .rec::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: recblink 1.2s steps(1) infinite; }
@keyframes recblink { 50% { opacity: .2; } }
.vp-stage { position: relative; aspect-ratio: 16 / 10; }
.vp-stage canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.vp-hud {
  position: absolute; left: 10px; right: 10px; top: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none;
  font: 600 10.5px var(--font-mono); letter-spacing: .03em; text-transform: uppercase;
}
.vp-hud span { background: rgba(10, 9, 7, .78); border: 1px solid var(--band-line); padding: 3px 7px; border-radius: 3px; color: var(--band-ink); }
.vp-hud b { color: var(--accent); font-weight: 700; }
.vp-log {
  height: 118px; margin: 0; padding: 8px 12px; list-style: none; overflow: hidden;
  border-top: 1px solid var(--band-line); background: var(--band-2);
  font: 400 11.5px/1.6 var(--font-mono); color: var(--band-muted);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.vp-log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: logIn .25s var(--ease); }
.vp-log .k-action { color: #9fc7ff; }
.vp-log .k-detector { color: var(--accent); font-weight: 600; }
.vp-log .k-metric { color: var(--band-muted); }
.vp-log .k-shot { color: #c9b6ff; }
@keyframes logIn { from { opacity: 0; transform: translateY(6px); } }
.vp-caption { margin-top: 18px; font: 400 12.5px/1.5 var(--font-mono); color: var(--muted); }

/* ---------- Spec strip (run.json) ---------- */
.specstrip { border-top: 2px solid var(--line-strong); border-bottom: 2px solid var(--line-strong); background: var(--card); }
.specstrip dl { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; }
.specstrip div { padding: 16px 18px; border-left: 1px solid var(--line); min-width: 0; }
.specstrip div:first-child { border-left: 0; }
.specstrip dt { font: 500 11px var(--font-mono); color: var(--muted); text-transform: lowercase; margin-bottom: 4px; }
.specstrip dt::before { content: '"'; } .specstrip dt::after { content: '":'; }
.specstrip dd a { text-decoration: none; white-space: nowrap; font-family: var(--font-mono); font-size: 13.5px; }
.specstrip dd { margin: 0; font-weight: 700; font-stretch: 108%; font-size: 15px; overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .specstrip dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .specstrip div:nth-child(4) { border-left: 0; }
  .specstrip div:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .specstrip dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .specstrip div { border-left: 1px solid var(--line) !important; border-top: 1px solid var(--line); }
  .specstrip div:nth-child(odd) { border-left: 0 !important; }
  .specstrip div:nth-child(-n+2) { border-top: 0; }
}

/* ---------- Triage demo ---------- */
.triage { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); gap: 0; align-items: stretch; }
.panel { border: 2px solid var(--band-line); border-radius: 6px; background: var(--band-2); min-width: 0; display: flex; flex-direction: column; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--band-line); font: 500 12px var(--font-mono); color: var(--band-muted);
}
.panel-head strong { color: var(--band-ink); font-weight: 600; }
.lines { list-style: none; margin: 0; padding: 8px 0; font: 400 12px/1.75 var(--font-mono); max-height: 560px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--band-line) transparent; }
.ln { display: grid; grid-template-columns: 30px 44px 74px minmax(0, 1fr); gap: 8px; padding: 0 14px; color: var(--band-muted); transition: opacity .4s, background .4s, color .4s; }
.ln-seq { opacity: .55; }
.ln-t { opacity: .7; text-align: right; }
.ln-m { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln--exception .ln-k, .ln--error .ln-k { color: #ff8f73; }
.ln--warning .ln-k { color: #f5c84b; }
.ln--detector .ln-k { color: var(--accent); }
.ln[data-c] { color: var(--band-ink); }
.triage.is-run .ln:not([data-c]) { opacity: .22; }
.triage.is-run .ln[data-c] { background: color-mix(in srgb, var(--cc) 16%, transparent); box-shadow: inset 3px 0 0 var(--cc); }
.ln.is-hot { background: color-mix(in srgb, var(--cc, var(--accent)) 34%, transparent) !important; }

.arrowcol { display: grid; place-items: center; }
.arrowcol button {
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--band-ink); background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; cursor: pointer; transition: transform .2s var(--ease);
}
.arrowcol button:hover { transform: scale(1.08) rotate(-8deg); }
.arrowcol svg { width: 22px; height: 22px; }

.bugs { list-style: none; margin: 0; padding: 10px; display: grid; gap: 8px; counter-reset: bug; }
.bug {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px; border: 1px solid var(--band-line); border-radius: 4px; background: var(--band);
  box-shadow: inset 4px 0 0 var(--cc);
  transition: transform .45s var(--ease), opacity .45s var(--ease), border-color .2s;
  cursor: default;
}
.bug:hover, .bug.is-hot { border-color: var(--cc); }
.js .triage:not(.is-run) .bug { opacity: 0; transform: translateX(-18px); }
.bug-p { font: 700 12px var(--font-mono); padding: 4px 7px; border-radius: 3px; color: #15130f; background: var(--pc); }
.bug-t { min-width: 0; }
.bug-t b { display: block; font-size: 14.5px; font-weight: 700; font-stretch: 104%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bug-t span { display: block; font: 400 11.5px var(--font-mono); color: var(--band-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bug-n { font: 600 12px var(--font-mono); color: var(--band-muted); }
.p1 { --pc: var(--p1); } .p2 { --pc: var(--p2); } .p3 { --pc: var(--p3); } .p4 { --pc: var(--p4); }

.triage-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 28px; border-top: 1px solid var(--band-line); }
.triage-foot div { padding: 18px 18px 0 0; }
.triage-foot b { display: block; font: 860 clamp(30px, 4vw, 46px)/1 var(--font-display); font-stretch: 118%; }
.triage-foot span { font: 400 12.5px var(--font-mono); color: var(--band-muted); }
.cmd {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 26px; padding: 12px 14px;
  border: 1px dashed var(--band-line); border-radius: 4px; font: 400 12.5px var(--font-mono); color: var(--band-muted); overflow-wrap: anywhere;
}
.cmd code { color: var(--band-ink); font-size: 1em; }
.cmd--light { border-color: var(--line-strong); color: var(--muted); margin-top: 6px; }
.cmd--light code { color: var(--ink); }
.cmd span code::before { content: none; }
.cmd code::before { content: "> "; color: var(--accent); }

@media (max-width: 960px) {
  .triage { grid-template-columns: 1fr; gap: 14px; }
  .arrowcol { padding: 4px 0; }
  .arrowcol svg { transform: rotate(90deg); }
  .lines { max-height: 340px; }
  .ln { grid-template-columns: 26px 40px 66px minmax(0, 1fr); padding: 0 10px; font-size: 11.5px; }
}
@media (max-width: 560px) {
  .triage-foot { grid-template-columns: 1fr; }
  .ln-t { display: none; }
  .ln { grid-template-columns: 26px 62px minmax(0, 1fr); }
}

/* ---------- What we do: three "worlds" ---------- */
.worlds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 2px solid var(--line-strong); border-radius: 6px; overflow: hidden; background: var(--card); }
.world { padding: clamp(24px, 3vw, 36px); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; min-width: 0; position: relative; }
.world:first-child { border-left: 0; }
.world-n { font: 600 12px var(--font-mono); color: var(--muted); display: flex; justify-content: space-between; }
.world-n em { font-style: normal; color: var(--accent); }
.world-ico { width: 56px; height: 56px; }
.world p { color: var(--ink-2); margin: 0; }
.world ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font: 400 13px var(--font-mono); color: var(--ink-2); }
.world li::before { content: "+ "; color: var(--accent); }
.world .more { margin-top: auto; padding-top: 10px; font: 600 13px var(--font-mono); text-decoration: none; }
.world .more::after { content: " →"; }
.world::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.world:hover::after { transform: scaleX(1); }
@media (max-width: 960px) {
  .worlds { grid-template-columns: 1fr; }
  .world { border-left: 0; border-top: 1px solid var(--line); }
  .world:first-child { border-top: 0; }
}

/* ---------- Pipeline / level map ---------- */
.map { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; counter-reset: lvl; position: relative; }
.map::before { content: ""; position: absolute; left: 0; right: 0; top: 27px; border-top: 2px dashed var(--line-strong); opacity: .35; }
.stage { position: relative; padding-right: 18px; counter-increment: lvl; min-width: 0; }
.stage-node {
  position: relative; width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 18px;
  background: var(--card); border: 2px solid var(--line-strong); border-radius: 6px;
  font: 800 13px var(--font-mono); transition: background .2s, transform .2s var(--ease);
}
.stage-node::after { content: "1-" counter(lvl); }
.stage:hover .stage-node { background: var(--accent); transform: translateY(-4px) rotate(-3deg); }
.stage h3 { font-size: 18px; font-weight: 800; font-stretch: 112%; text-transform: uppercase; margin-bottom: 8px; }
.stage p { font-size: 14.5px; color: var(--ink-2); margin: 0 0 10px; }
.stage code { display: inline-block; font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 1060px) {
  .map { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 40px; }
  .map::before { display: none; }
}
@media (max-width: 600px) {
  .map { grid-template-columns: 1fr; row-gap: 0; }
  .stage { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 18px; padding: 0 0 28px; }
  .stage-node { grid-row: span 3; margin: 0; }
  .stage::before { content: ""; position: absolute; left: 27px; top: 56px; bottom: 0; border-left: 2px dashed var(--line-strong); opacity: .35; }
  .stage:last-child::before { display: none; }
}

/* ---------- House rules ---------- */
.rules { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--band-line); }
.rule-row {
  display: grid; grid-template-columns: 70px minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: baseline;
  padding: 26px 0; border-bottom: 1px solid var(--band-line); transition: padding .3s var(--ease);
}
.rule-row:hover { padding-left: 10px; }
.rule-row .n { font: 600 13px var(--font-mono); color: var(--accent); }
.rule-row h3 { font-size: clamp(22px, 2.8vw, 34px); font-weight: 820; font-stretch: 114%; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.02; }
.rule-row p { margin: 0; color: var(--band-muted); font-size: 15.5px; }
.rule-row p code { color: var(--band-ink); }
@media (max-width: 800px) {
  .rule-row { grid-template-columns: 44px minmax(0, 1fr); gap: 10px 14px; }
  .rule-row p { grid-column: 2; }
}

/* ---------- Roadmap ---------- */
.roadmap { width: 100%; border-collapse: collapse; font-size: 15px; }
.roadmap th, .roadmap td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.roadmap th { font: 500 11.5px var(--font-mono); color: var(--muted); text-transform: lowercase; border-bottom: 2px solid var(--line-strong); }
.roadmap td:first-child { font: 700 14px var(--font-mono); white-space: nowrap; }
.roadmap tr:hover td { background: var(--card); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font: 600 11.5px var(--font-mono); white-space: nowrap; border: 1px solid var(--line); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--built { color: #1f8a4c; border-color: color-mix(in srgb, #1f8a4c 40%, transparent); }
.pill--pc { color: #b67d00; border-color: color-mix(in srgb, #b67d00 40%, transparent); }
.pill--next { color: var(--muted); }
:root[data-theme="dark"] .pill--built { color: #4cd38a; }
:root[data-theme="dark"] .pill--pc { color: #f5c84b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill--built { color: #4cd38a; } :root:not([data-theme="light"]) .pill--pc { color: #f5c84b; } }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 4px; }
@media (max-width: 700px) {
  .roadmap thead { display: none; }
  .roadmap tr { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .roadmap td { padding: 0; border: 0; }
  .roadmap td:nth-child(3) { grid-column: 1 / -1; }
  .roadmap td:nth-child(4) { grid-column: 1 / -1; }
}

/* ---------- Founder ---------- */
.founder { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.idcard {
  position: relative; border: 2px solid var(--line-strong); border-radius: 6px; background: var(--card); padding: 22px;
  box-shadow: 8px 8px 0 var(--ink);
}
.idcard-top { display: flex; justify-content: space-between; font: 600 11px var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.idcard-face { margin: 18px 0; aspect-ratio: 1; background: var(--band); border-radius: 4px; display: grid; place-items: center; overflow: hidden; }
.idcard-face svg { width: 62%; height: auto; }
.idcard dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.idcard dt { font: 500 11.5px var(--font-mono); color: var(--muted); padding-top: 2px; }
.idcard dd { margin: 0; font-weight: 600; }
.quote { font-size: clamp(22px, 2.6vw, 32px); line-height: 1.25; font-weight: 600; font-stretch: 104%; letter-spacing: -0.01em; margin: 0 0 28px; text-wrap: balance; }
.quote::before { content: "“"; color: var(--accent); }
.quote::after { content: "”"; color: var(--accent); }
@media (max-width: 860px) { .founder { grid-template-columns: 1fr; } .idcard { max-width: 380px; } }

/* ---------- Contact ---------- */
.contact { padding: clamp(80px, 12vw, 160px) 0; text-align: left; overflow: hidden; }
.contact .big {
  display: inline-block; font-size: clamp(26px, 7.2vw, 104px); font-weight: 860; font-stretch: 100%; letter-spacing: -0.035em; line-height: 1.05;
  text-decoration: none; color: var(--band-ink); white-space: nowrap; margin: 26px 0 30px;
  background: linear-gradient(var(--accent), var(--accent)) left 100% / 0 .1em no-repeat; transition: background-size .45s var(--ease);
}
.contact .big:hover { color: var(--band-ink); background-size: 100% .1em; }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--band-line); margin-top: 48px; }
.contact-grid > div { padding: 22px 22px 0 0; }
.contact-grid h3 { font: 600 12px var(--font-mono); color: var(--accent); text-transform: lowercase; margin-bottom: 8px; }
.contact-grid p { color: var(--band-muted); font-size: 15px; margin: 0; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--band-line); border-radius: var(--radius);
  background: transparent; color: var(--band-ink); font: 500 13px var(--font-mono); cursor: pointer;
}
.copy-btn:hover { border-color: var(--band-ink); }
.copy-btn.is-done { border-color: var(--accent); color: var(--accent); }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--band); color: var(--band-muted); border-top: 1px solid var(--band-line); position: relative; overflow: hidden; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 32px; padding: 56px 0 40px; }
.footer-grid h2 { font: 600 12px var(--font-mono); color: var(--band-ink); text-transform: lowercase; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; }
.footer-grid a { text-decoration: none; color: var(--band-muted); }
.footer-grid a:hover { color: var(--accent); }
.footer-brand .brand { color: var(--band-ink); }
.footer-brand p { font-size: 14.5px; margin: 14px 0 0; max-width: 34ch; }
.footer-base { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; padding: 18px 0 26px; border-top: 1px solid var(--band-line); font: 400 12px var(--font-mono); }
.footer-wordmark {
  font: 900 clamp(60px, 17vw, 260px)/.8 var(--font-display); font-stretch: 125%; letter-spacing: -0.04em; text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1px var(--band-line); white-space: nowrap; margin: 0 0 -0.12em; user-select: none;
  text-align: center;
}
.walker { position: absolute; bottom: 12px; left: -40px; width: 32px; height: 24px; image-rendering: pixelated; animation: walk 26s linear infinite; }
@keyframes walk { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 80px)); } }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Generic content (product + about pages) ---------- */
.page-hero { padding: clamp(48px, 8vw, 110px) 0 clamp(40px, 6vw, 80px); border-bottom: 2px solid var(--line-strong); }
.page-hero h1 { font-size: clamp(44px, 8vw, 120px); margin: 18px 0 26px; }
.crumbs { font: 400 12.5px var(--font-mono); color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs span { margin: 0 6px; }

.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

.card { border: 2px solid var(--line-strong); border-radius: 6px; background: var(--card); padding: clamp(20px, 2.4vw, 28px); min-width: 0; }
.card h3 { margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }
.card .tag { font: 600 11.5px var(--font-mono); color: var(--accent); margin-bottom: 12px; display: block; }

.filelist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.filelist li { display: grid; grid-template-columns: minmax(190px, .5fr) minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.filelist code { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.filelist span { color: var(--ink-2); font-size: 15.5px; }
@media (max-width: 600px) { .filelist li { grid-template-columns: 1fr; gap: 4px; } }

.term { border: 2px solid var(--line-strong); border-radius: 6px; background: var(--band); color: var(--band-ink); overflow: hidden; }
.term-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--band-line); font: 500 11.5px var(--font-mono); color: var(--band-muted); }
.term pre { margin: 0; padding: 16px; overflow-x: auto; font-size: 13px; line-height: 1.75; }
.term .c { color: var(--band-muted); }
.term .p { color: var(--accent); user-select: none; }
.term-copy { background: transparent; border: 1px solid var(--band-line); color: var(--band-muted); font: 500 11px var(--font-mono); padding: 4px 8px; border-radius: 3px; cursor: pointer; }
.term-copy:hover { color: var(--band-ink); border-color: var(--band-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li { font: 500 12.5px var(--font-mono); padding: 6px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); }
.chips li b { color: var(--accent); font-weight: 700; }

.faq { border-top: 2px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  font-size: clamp(18px, 2vw, 22px); font-weight: 720; font-stretch: 106%;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font: 400 26px var(--font-mono); color: var(--accent); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq .ans { padding: 0 0 22px; color: var(--ink-2); max-width: 72ch; }

.prose { max-width: 70ch; }
.prose p, .prose li { color: var(--ink-2); }
.prose h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 820; font-stretch: 112%; text-transform: uppercase; margin: 1.6em 0 .6em; line-height: 1.05; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--accent); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 2px solid var(--line-strong); }
.facts div { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.facts dt { font: 500 11.5px var(--font-mono); color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }

.logo-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.logo-tile { border: 2px solid var(--line-strong); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; }
.logo-tile .art { position: relative; aspect-ratio: 16 / 9; }
.logo-tile .art img { position: absolute; inset: 0; margin: auto; max-width: 80%; max-height: 56%; width: auto; height: auto; }
.logo-tile .meta { padding: 10px 12px; border-top: 2px solid var(--line-strong); font: 500 12px var(--font-mono); display: flex; justify-content: space-between; background: var(--card); color: var(--ink); }
.logo-tile:hover .meta { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 760px) { .logo-tiles { grid-template-columns: 1fr; } }

.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.swatch { border: 2px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.swatch i { display: block; height: 70px; }
.swatch span { display: block; padding: 8px 10px; font: 500 11.5px var(--font-mono); background: var(--card); }
@media (max-width: 600px) { .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Reveal on scroll (only when JS is on) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* 404 */
.lost { min-height: 72vh; display: grid; align-items: center; }
.lost h1 { font-size: clamp(90px, 22vw, 300px); }

/* ---------- Logo mark ---------- */
.mk-head { fill: var(--ink); }
.mk-head--band, .band .mk-head { fill: var(--band-ink); }
.mk-eye { fill: var(--accent); }
.mk-mouth { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* Footer walker: two leg frames */
.walker .legs-b { opacity: 0; }
.walker .legs-a { animation: legA .36s steps(1) infinite; }
.walker .legs-b { animation: legB .36s steps(1) infinite; }
@keyframes legA { 50% { opacity: 0; } }
@keyframes legB { 0% { opacity: 0; } 50% { opacity: 1; } }

/* Cluster colours: link log lines to the report they end up in */
[data-c="1"] { --cc: #ff4a1c; }
[data-c="2"] { --cc: #4cc9f0; }
[data-c="3"] { --cc: #f5c84b; }
[data-c="4"] { --cc: #a78bfa; }
[data-c="5"] { --cc: #4cd38a; }
[data-c="6"] { --cc: #ff7ab6; }
[data-c="7"] { --cc: #9a9384; }
[data-c="8"] { --cc: #7dd3c0; }

@media (max-width: 560px) {
  .vp-bar .sub { display: none; }
  .bug-t b, .bug-t span { white-space: normal; }
  .bug { align-items: start; }
}

/* ---------- Product page parts ---------- */
.arch { display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr) 36px minmax(0, 1fr) 36px minmax(0, 1fr); align-items: stretch; }
.arch-box { border: 2px solid var(--band-line); border-radius: 6px; padding: 18px; background: var(--band-2); min-width: 0; }
.arch-box--file { border-style: dashed; border-color: var(--band-muted); }
.arch-box--out { border-color: var(--accent); }
.arch-tag { display: block; font: 600 11px var(--font-mono); color: var(--accent); text-transform: lowercase; margin-bottom: 10px; }
.arch-box h3 { font: 700 15px var(--font-mono); margin-bottom: 12px; overflow-wrap: anywhere; }
.arch-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 14px; color: var(--band-muted); }
.arch-box li::before { content: "· "; color: var(--accent); }
.arch-arrow { display: grid; place-items: center; font: 700 20px var(--font-mono); color: var(--accent); }
@media (max-width: 1000px) {
  .arch { grid-template-columns: 1fr; }
  .arch-arrow { transform: rotate(90deg); padding: 6px 0; }
}

.vlabels { display: grid; gap: 0; border-top: 2px solid var(--line-strong); }
.vl { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.vl i { grid-row: span 2; width: 44px; height: 44px; border-radius: 4px; }
.vl b { font: 700 15px var(--font-mono); }
.vl span { font-size: 14px; color: var(--muted); }
.vl-overflow { background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 9px) left center / 140% 8px no-repeat, var(--paper-2); border: 1px solid var(--line); }

.prov { border: 1px solid var(--band-line); border-radius: 4px; padding: 16px; }
.prov b { display: block; font: 700 15px var(--font-mono); color: var(--accent); margin-bottom: 6px; }
.prov span { font-size: 14px; color: var(--band-muted); }
@media (max-width: 900px) { .providers .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

.note { margin-top: 22px; padding: 14px 16px; border-left: 4px solid var(--p3); background: var(--card); font-size: 15px; color: var(--ink-2); }
.card--band { background: var(--band-2); border-color: var(--band-line); color: var(--band-ink); }
.card--band p { color: var(--band-muted); }

/* ---------- AI under the hood ---------- */
.aiw { border: 2px solid var(--line-strong); border-radius: 6px; background: var(--card); overflow: hidden; }
.ai-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 2px solid var(--line-strong); }
.ai-tabs button {
  text-align: left; padding: 16px 18px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--ink);
  font: 700 17px var(--font-body); font-stretch: 110%; text-transform: uppercase; cursor: pointer; position: relative; min-width: 0;
}
.ai-tabs button:first-child { border-left: 0; }
.ai-tabs button b { font: 600 12px var(--font-mono); color: var(--accent); margin-right: 6px; }
.ai-tabs button span { display: block; font: 400 12px var(--font-mono); text-transform: none; color: var(--muted); margin-top: 4px; }
.ai-tabs button:hover { background: var(--paper-2); }
.ai-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.ai-tabs button[aria-selected="true"] span { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.ai-panel { padding: clamp(18px, 3vw, 30px); animation: logIn .35s var(--ease); }
.ai-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font: 500 13px var(--font-mono); margin-bottom: 18px; }
.chip-k { font: 600 11px var(--font-mono); text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: 2px 6px; border-radius: 3px; }
.ai-io { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ai-io pre { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-note { margin: 18px 0 0; color: var(--ink-2); max-width: 75ch; }
.rag { border: 1px solid var(--line); border-radius: 4px; padding: 16px; }
.rag-q { font: 500 13px var(--font-mono); margin-bottom: 14px; overflow-wrap: anywhere; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rag-hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rag-hits li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; position: relative; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.rag-hits b { font: 700 13.5px var(--font-mono); position: relative; }
.rag-hits span { font-size: 14px; color: var(--ink-2); position: relative; }
.rag-hits i { position: absolute; inset: 0 auto 0 0; width: calc(var(--s) * 100%); background: var(--accent-soft); transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease); }
.ai-panel:not([hidden]) .rag-hits i { transform: scaleX(1); }
.frames { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fr { margin: 0; }
.fr-img { display: block; aspect-ratio: 16 / 9; border-radius: 4px; border: 2px solid var(--line-strong); position: relative; overflow: hidden;
  background: linear-gradient(#7fb4d9 0 55%, #5d7d4a 55%); }
.fr-img::after { content: ""; position: absolute; left: 30%; bottom: 20%; width: 18%; height: 28%; background: #8a6a4a; box-shadow: 70px -6px 0 -4px #8a6a4a; }
.fr-mag::after { background: #ff00ff; }
.fr-blk { background: #050505; }
.fr-blk::after { left: 4%; bottom: 6%; width: 22%; height: 8%; background: #fff; box-shadow: none; }
.fr-ui::after { display: none; }
.fr-ui span { position: absolute; left: 10%; top: 38%; width: 52%; padding: 4px 6px; background: #15130f; color: #f1ede3; font: 700 9px var(--font-mono); white-space: nowrap; overflow: visible; outline: 2px solid var(--accent); }
.fr figcaption { font: 500 11.5px var(--font-mono); color: var(--muted); margin-top: 6px; }
.fr.is-vlm .fr-img { border-color: var(--accent); box-shadow: 4px 4px 0 var(--accent); }
.fr.is-vlm figcaption { color: var(--accent); }
.guard { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--line); }
.guard li { display: grid; grid-template-columns: 26px minmax(0, 260px) minmax(0, 1fr); gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.guard li::before { content: "·"; font: 700 15px var(--font-mono); color: var(--muted); text-align: center; }
.guard li span { color: var(--muted); }
.guard.is-done li[data-ok="1"]::before { content: "✓"; color: #1f8a4c; }
.guard.is-done li[data-ok="0"]::before { content: "✗"; color: var(--p1); }
.guard.is-done li[data-ok="0"] code { text-decoration: line-through; text-decoration-color: var(--p1); text-decoration-thickness: 2px; }
.guard.is-done li[data-ok="0"] span { color: var(--p1); }
.guard li { transition: background .3s; }
.guard li.is-checking { background: var(--accent-soft); }
.guard-run { color: var(--ink); border-color: var(--line-strong); }
@media (max-width: 900px) {
  .ai-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-tabs button:nth-child(3) { border-left: 0; }
  .ai-tabs button:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ai-io, .frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .ai-io { grid-template-columns: 1fr; }
  .guard li { grid-template-columns: 22px minmax(0, 1fr); }
  .guard li span { grid-column: 2; }
}

/* ---------- Cinematics ---------- */
.cine { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 36px); align-items: start; }
.cine-screen { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; border: 2px solid var(--band-line); background: #000; box-shadow: 10px 10px 0 var(--accent); }
.cine-screen canvas { width: 100%; height: 100%; }
.cine-bars::before, .cine-bars::after { content: ""; position: absolute; left: 0; right: 0; height: 12.3%; background: #000; transition: transform .5s var(--ease); }
.cine-bars::before { top: 0; } .cine-bars::after { bottom: 0; }
.cine:not(.has-bars) .cine-bars::before { transform: translateY(-100%); }
.cine:not(.has-bars) .cine-bars::after { transform: translateY(100%); }
.cine-thirds { position: absolute; inset: 0; opacity: 0; transition: opacity .3s; pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(33.33% - 1px), rgba(255,255,255,.5) 0 calc(33.33% + 1px), transparent 0 calc(66.66% - 1px), rgba(255,255,255,.5) 0 calc(66.66% + 1px), transparent 0),
    linear-gradient(transparent calc(33.33% - 1px), rgba(255,255,255,.5) 0 calc(33.33% + 1px), transparent 0 calc(66.66% - 1px), rgba(255,255,255,.5) 0 calc(66.66% + 1px), transparent 0); }
.cine.has-thirds .cine-thirds { opacity: 1; }
.cine-hud { position: absolute; left: 12px; right: 12px; top: 14%; display: flex; gap: 12px; flex-wrap: wrap; font: 600 11px var(--font-mono); color: #fff; text-shadow: 0 1px 2px #000; pointer-events: none; }
.cine:not(.has-bars) .cine-hud { top: 12px; }
.cine-hud .rec { color: #ff3b30; animation: recblink 1.2s steps(1) infinite; }
.cine-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cine-shots button { text-align: left; padding: 12px; border: 1px solid var(--band-line); border-radius: 4px; background: var(--band-2); color: var(--band-ink); cursor: pointer; }
.cine-shots button b { display: block; font: 800 15px var(--font-body); font-stretch: 112%; text-transform: uppercase; }
.cine-shots button span { font: 400 11.5px var(--font-mono); color: var(--band-muted); }
.cine-shots button:hover { border-color: var(--band-ink); }
.cine-shots button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cine-shots button[aria-checked="true"] span { color: var(--accent-ink); }
.cine-slider { display: grid; gap: 8px; margin: 22px 0 16px; font: 500 12.5px var(--font-mono); color: var(--band-muted); }
.cine-slider b { color: var(--band-ink); }
.cine-slider input { width: 100%; accent-color: var(--accent); }
.cine-toggles { display: grid; gap: 8px; font: 500 13px var(--font-mono); }
.cine-toggles input { accent-color: var(--accent); margin-right: 8px; }
.cine-note { font-size: 14px; margin-top: 20px; }
@media (max-width: 960px) { .cine { grid-template-columns: 1fr; } }

/* ---------- Easter eggs ---------- */
.miaw-bubble { position: fixed; z-index: 90; pointer-events: none; font: 800 16px var(--font-body); font-stretch: 115%; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 4px 10px; border-radius: 4px; animation: miaw 1s var(--ease) forwards; }
@keyframes miaw { from { opacity: 0; transform: translateY(6px) scale(.8); } 20% { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-30px); } }
html.debug * { outline: 1px solid rgba(255, 74, 28, .35) !important; }
.debug-hud { position: fixed; right: 12px; bottom: 12px; z-index: 95; background: #000; color: #4cd38a; font: 500 12px/1.5 var(--font-mono); padding: 8px 12px; border: 1px solid #4cd38a; border-radius: 4px; display: none; }
html.debug .debug-hud { display: block; }

/* ---------- Open source ---------- */
.repo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: clamp(20px, 3vw, 30px); border: 2px solid var(--line-strong); border-radius: 6px; background: var(--card); text-decoration: none; color: var(--ink); box-shadow: 8px 8px 0 var(--ink); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.repo:hover { color: var(--ink); transform: translate(-3px, -3px); box-shadow: 11px 11px 0 var(--accent); }
.repo-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.repo-top b { font: 700 clamp(18px, 2.2vw, 24px) var(--font-mono); overflow-wrap: anywhere; }
.repo-go { margin-left: auto; font: 600 13px var(--font-mono); color: var(--accent); }
.repo-desc { color: var(--ink-2); font-size: 16px; }
.repo-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; font: 500 13px var(--font-mono); color: var(--muted); }
.repo-stats i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.repo-clone code { display: block; padding: 10px 12px; background: var(--band); color: var(--band-ink); border-radius: 4px; font-size: 13px; overflow-x: auto; white-space: nowrap; }
.docmap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--line-strong); }
.docmap a { display: grid; gap: 4px; padding: 14px 14px 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; min-width: 0; }
.docmap a code { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.docmap a code::after { content: " ↗"; color: var(--accent); }
.docmap a span { font-size: 14px; color: var(--muted); }
.docmap a:hover code { color: var(--accent); }
@media (max-width: 900px) { .docmap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .docmap { grid-template-columns: 1fr; } }
