/* Commando site stylesheet. The layout follows the Xenon 2 site (dmnet.st/xe2); the palette comes from the arcade
 * game: dark jungle olive, the sand of the beaches and the title plank, and the HUD's red and yellow. Single dark
 * theme on purpose, like the game pages. */
:root {
  --bg: #0e130c;
  --bg-2: #131a10;
  --panel: #172015;
  --panel-2: #1f2a1b;
  --line: #2c3a26;
  --line-2: #3d4f34;
  --olive: #8a9a5b;
  --olive-2: #5d6b3f;
  --text: #f1eedf;
  --muted: #c3c0a8;
  --dim: #8d8f78;
  --sand: #d9c48a;
  --sand-2: #f0dfac;
  --plank: #bc9d70;
  --red: #e0442e;
  --yellow: #e8c35a;
  --yellow-2: #f6dc8c;
  --danger: #ff7a66;
  --font-display: "Black Ops One", "Impact", "Arial Black", system-ui, sans-serif;
  --font-pixel: "Press Start 2P", "Courier New", monospace;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --maxw: 1100px;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--yellow); }
a:hover { color: var(--yellow-2); }
img { max-width: 100%; height: auto; }
.pixel { image-rendering: pixelated; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); letter-spacing: .04em; color: var(--sand-2); }
h2 { font-size: clamp(1.35rem, 2.8vw, 1.8rem); color: var(--sand); letter-spacing: .04em; }
h3 { font-size: 1.12rem; letter-spacing: .04em; }
p { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--font-mono); }
code { background: var(--panel-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; overflow-wrap: anywhere; }
pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; overflow-x: auto; font-size: .85rem; line-height: 1.5; }
pre code { background: none; padding: 0; font-size: inherit; }
kbd {
  font-size: .8em;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--olive-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; margin: 0 0 1.2em; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--panel-2); color: var(--sand-2); font-weight: 600; }
.table-scroll { overflow-x: auto; margin: 0 0 1.2em; }
.table-scroll table { margin: 0; min-width: 34rem; }
th.n, td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 600; background: var(--panel-2); }
blockquote { margin: 0 0 1em; padding: .6em 1.1em; border-left: 3px solid var(--plank); color: var(--muted); background: var(--panel); }

.eyebrow {
  font-family: var(--font-pixel);
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--olive);
  margin: 0 0 .9em;
}
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.wrap { width: min(100% - 32px, var(--maxw)); margin-inline: auto; }
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section + .section { border-top: 1px solid var(--line); }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }

/* --- top navigation --- */
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: var(--panel); padding: 8px; z-index: 100; }
.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 16px;
  background: rgba(14, 19, 12, .95);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; width: 132px; height: auto; image-rendering: pixelated; }
.trail { display: inline-flex; align-items: center; gap: 10px; }
.site-home {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-pixel);
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-home:hover { color: var(--text); }
.trail-sep { color: var(--dim); }
.topnav nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; }
.topnav nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.topnav nav a:hover, .topnav nav a[aria-current] { color: var(--text); }
.topnav nav a[aria-current] { border-bottom: 2px solid var(--red); }
.topnav nav a.btn { color: #2a0d06; }
.topnav nav a.btn:hover { color: #000; }
@media (max-width: 480px) { .topnav { padding: 8px 12px; } .topnav nav { gap: 4px 12px; } .topnav nav a { font-size: .88rem; } }

/* --- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: #2a0d06;
  background: linear-gradient(180deg, var(--yellow-2), var(--yellow));
  border: 1px solid var(--yellow-2);
  border-radius: var(--radius);
  padding: 14px 26px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 4px 0 #7a5a16;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { color: #000; transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 5px 0 #7a5a16, 0 0 28px rgba(232,195,90,.35); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 2px 0 #7a5a16; }
.btn-red { background: linear-gradient(180deg, #ff7a5c, var(--red)); border-color: #ff8f73; color: #fff8ec; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 4px 0 #7a1d10; }
.btn-red:hover { color: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 5px 0 #7a1d10, 0 0 28px rgba(224,68,46,.4); }
.btn-small { padding: 7px 14px; font-size: .82rem; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 2px 0 #7a5a16; }
.btn-ghost { color: var(--text); background: transparent; border: 1px solid var(--olive-2); box-shadow: none; }
.btn-ghost:hover { color: var(--yellow); border-color: var(--yellow); box-shadow: none; }
.btn-big { padding: 16px 28px; font-size: 1.15rem; flex-direction: column; gap: 2px; line-height: 1.2; }
.btn-big small { font-family: var(--font-body); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: .8rem; opacity: .9; }

/* --- hero: one moment of play as arcade pixels and as a toy diorama, split by a slanted divider --- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--line);
  isolation: isolate;
  --split: 50%;
}
.hero-split, .hero-split > div { position: absolute; inset: 0; }
.hero-split { z-index: -1; }
.hero-split .arcade { background: url("art/hero-arcade.png") center 35% / max(100%, 672px) auto; image-rendering: pixelated; }
.hero-split .toy { background: url("art/hero-toy.jpg") center 35% / max(100%, 672px) auto;
  clip-path: polygon(calc(var(--split) + 8%) 0, 100% 0, 100% 100%, calc(var(--split) - 8%) 100%); }
.hero-split::after {
  /* darken behind the text, keep the edges bright */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 62% 70% at 50% 46%, rgba(14,19,12,.86) 30%, rgba(14,19,12,.35) 75%),
    linear-gradient(180deg, rgba(14,19,12,.25), rgba(14,19,12,.1) 60%, var(--bg));
}
@property --split { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@media (prefers-reduced-motion: no-preference) { .hero { animation: sweep 14s ease-in-out infinite alternate; } }
@keyframes sweep { from { --split: 30%; } to { --split: 70%; } }
.hero-label {
  position: absolute;
  bottom: 14px;
  font-family: var(--font-pixel);
  font-size: .55rem;
  letter-spacing: .1em;
  color: var(--sand-2);
  background: rgba(14,19,12,.75);
  padding: 6px 8px;
  border-radius: 4px;
}
.hero-label.left { left: 14px; }
.hero-label.right { right: 14px; }
.hero-logo { width: min(640px, 86vw); image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0,0,0,.55)) drop-shadow(0 0 30px rgba(0,0,0,.6)); margin-bottom: 1.4rem; }
.hero .eyebrow { color: var(--sand); }
.hero .lede { margin-inline: auto; margin-bottom: 1.8rem; color: var(--text); text-shadow: 0 1px 2px #000; }
.play-buttons { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-bottom: 1.2rem; }
.play-buttons .btn { min-width: 260px; }
.play-choice { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.watch-link { color: var(--muted); font-size: .9rem; }
.watch-link::before { content: "\25B6\FE0E"; color: var(--yellow); margin-right: .4em; font-size: .8em; }
.watch-link:hover { color: var(--yellow); }
.music-switch { display: inline-flex; align-items: center; gap: .55em; color: var(--text); font-size: .95rem; text-shadow: 0 1px 2px #000; }
.music-switch select {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: .3em 2em .3em .65em; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--yellow) 50%), linear-gradient(135deg, var(--yellow) 50%, transparent 50%);
  background-position: right 1em center, right .65em center; background-size: .35em .35em; background-repeat: no-repeat;
}
.music-switch select:hover { border-color: var(--yellow); }
.music-switch select:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.hero .fineprint { color: var(--muted); font-size: .85rem; max-width: 62ch; margin-inline: auto; text-shadow: 0 1px 2px #000; }
.hero .fineprint kbd { font-size: .75em; }

/* --- tiles --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.tile .art { display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.tile .art img { width: 192px; height: 192px; object-fit: cover; border: 1px solid var(--line-2); border-radius: 4px; }
.tile h3 { margin-bottom: .3em; color: var(--sand-2); }
.tile p { color: var(--muted); font-size: .92rem; margin: 0; }
.tile .links { margin-top: 14px; }

/* --- two columns, timeline, sources --- */
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line-2); }
.timeline li { position: relative; padding: 0 0 1.1rem 20px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .45em; width: 12px; height: 12px; border-radius: 2px; background: var(--red); box-shadow: 0 0 0 3px var(--bg); transform: rotate(45deg); }
.timeline .year { font-family: var(--font-display); color: var(--yellow); display: block; letter-spacing: .06em; }
.timeline p { margin: 0; color: var(--muted); font-size: .95rem; }
.sources { font-size: .9rem; color: var(--muted); padding-left: 1.2em; }
.sources li { margin-bottom: .35em; overflow-wrap: anywhere; }
.cite { font-size: .72em; vertical-align: super; text-decoration: none; color: var(--olive); margin-left: 1px; }
.listen { display: flex; flex-wrap: wrap; gap: 10px; margin: .6rem 0 1.2rem; }
.figure { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 1.2rem; }
.figure img { display: block; width: 100%; }
.figure p { margin: .6rem 0 0; font-size: .88rem; color: var(--muted); }

/* --- cards --- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--text); text-decoration: none; transition: border-color .12s ease, transform .12s ease; }
.card:hover { border-color: var(--yellow); transform: translateY(-2px); color: var(--text); }
.card h3 { margin-bottom: .35em; color: var(--sand-2); }
.card p { color: var(--muted); font-size: .92rem; margin: 0; }
.card .meta { display: block; margin-top: .6em; font-size: .75rem; color: var(--dim); font-family: var(--font-mono); }
.card.featured { border-color: var(--plank); background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.card.featured h3 { color: var(--yellow); }

/* --- verdict, teasers --- */
.verdict { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 1.5rem 0 2rem; }
.verdict-item { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--olive-2); border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 20px; }
.verdict-item.good { border-left-color: #7fc66b; }
.verdict-item.ok { border-left-color: var(--yellow); }
.verdict-item.bad { border-left-color: var(--red); }
.verdict-item.good h3 { color: #b4e3a5; }
.verdict-item.ok h3 { color: var(--yellow-2); }
.verdict-item.bad h3 { color: #ff9c8a; }
.verdict-item p { color: var(--muted); font-size: .95rem; margin: 0; }
.teasers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.teaser { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.teaser p { color: var(--muted); }
.teaser .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.memory { font-size: 1.08rem; border-left-color: var(--red); color: var(--text); }
.memory p:last-child { margin-bottom: 0; }

details.doclist { margin-top: 1.2rem; }
details.doclist summary { cursor: pointer; color: var(--yellow); font-family: var(--font-display); font-size: 1rem; letter-spacing: .05em; padding: 8px 0; }
details.doclist ul { columns: 2; column-gap: 32px; padding-left: 1.1em; margin: .6em 0; }
@media (max-width: 640px) { details.doclist ul { columns: 1; } }
details.doclist li { break-inside: avoid; margin-bottom: .3em; font-size: .92rem; }
details.doclist li span { color: var(--dim); overflow-wrap: anywhere; }

/* --- controls strip --- */
.controls { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: center; color: var(--text); font-size: .92rem; margin: 1.4rem 0 1rem; text-shadow: 0 1px 2px #000; }
.controls span { white-space: nowrap; }
.controls kbd { font-size: .78em; }

/* --- cross-links --- */
.crosslinks { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.crosslink { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.crosslink h3 { color: var(--sand-2); }
.crosslink p { color: var(--muted); }

/* --- pipeline diagram --- */
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 1.5rem 0; }
.pipeline .step { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font-size: .88rem; }
.pipeline .step b { display: block; font-family: var(--font-display); font-weight: 400; font-size: .9rem; letter-spacing: .05em; color: var(--yellow); margin-bottom: 4px; }
.pipeline .step span { color: var(--muted); }
.pipeline .step + .step::before { content: "\25B6"; position: absolute; left: -11px; top: 50%; transform: translateY(-50%); color: var(--olive-2); font-size: .7rem; }
@media (max-width: 640px) { .pipeline .step + .step::before { content: "\25BC"; left: 50%; top: -11px; transform: translateX(-50%); } }

/* --- AI errors summary --- */
.causes { padding-left: 1.2em; }
.causes li { margin-bottom: .6em; }
.errors { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 1rem 0 2.2rem; }
.error-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.error-card.critical { border-left: 4px solid var(--red); }
.error-card h3 { font-size: 1.02rem; color: var(--sand-2); margin-bottom: .45em; }
.error-card p { color: var(--muted); font-size: .93rem; margin-bottom: .6em; }
.error-card .id { font-family: var(--font-mono); font-size: .78rem; color: var(--dim); }
.error-card .chip { display: inline-block; font-family: var(--font-pixel); font-size: .5rem; letter-spacing: .08em; padding: 3px 6px; border-radius: 3px; background: var(--red); color: #fff; margin-left: 6px; vertical-align: middle; }

/* --- licences --- */
.licence pre { max-height: 420px; overflow: auto; white-space: pre-wrap; }

/* --- doc pages --- */
.doc-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 880px) { .doc-layout { grid-template-columns: 1fr; } }
.doc-toc { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; font-size: .85rem; padding-right: 8px; }
.doc-toc .eyebrow { margin-bottom: .6em; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; }
.doc-toc ul ul { padding-left: 12px; }
.doc-toc a { display: block; color: var(--muted); text-decoration: none; padding: 3px 0 3px 8px; border-left: 2px solid transparent; line-height: 1.35; }
.doc-toc a:hover { color: var(--text); border-left-color: var(--olive-2); }
.doc-toc .backlink { margin-top: 1rem; }
.doc-toc details > summary { list-style: none; cursor: default; }
.doc-toc details > summary::-webkit-details-marker { display: none; }
@media (max-width: 880px) {
  .doc-toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
  .doc-toc details > summary { list-style: disclosure-closed; cursor: pointer; }
  .doc-toc details[open] > summary { list-style: disclosure-open; }
  .doc-toc details > summary .eyebrow { display: inline; margin: 0; }
}
.doc-body { min-width: 0; }
.doc-body .doc-meta, .licence .doc-meta { color: var(--dim); font-family: var(--font-mono); font-size: .8rem; margin-bottom: 1rem; }
.doc-body .doc-note { color: var(--dim); font-size: .88rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4, [id] { scroll-margin-top: 72px; }
.doc-body h2 { margin-top: 2.2em; padding-top: .5em; border-top: 1px solid var(--line); }
.doc-body h3 { margin-top: 1.6em; color: var(--sand-2); }
.doc-body h4 { margin-top: 1.2em; color: var(--muted); font-size: .98rem; }
.doc-body h2 a.hl, .doc-body h3 a.hl, .doc-body h4 a.hl { color: inherit; text-decoration: none; }
.doc-body img { border: 1px solid var(--line); border-radius: var(--radius); background: #f4f1e6; }
.doc-body table { display: block; overflow-x: auto; }
.doc-body ul, .doc-body ol { padding-left: 1.4em; }
.doc-body li { margin-bottom: .25em; }
.repo-ref { color: var(--muted); border-bottom: 1px dotted var(--dim); }
.doc-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .92rem; }
.doc-nav a { text-decoration: none; }
.doc-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 1.5rem; }
.doc-filter input { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px 12px; min-width: 260px; }
.doc-filter .count { color: var(--dim); font-size: .85rem; }
.doc-body .entry-hidden { display: none; }

/* --- footer --- */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 3rem; }
.footer-inner { width: min(100% - 32px, var(--maxw)); margin-inline: auto; padding-block: 1.6rem; color: var(--dim); font-size: .85rem; }
.footer-inner p { margin: 0 0 .5em; }
.footer-inner strong { color: var(--muted); }
