/* Outword design system docs. Documented in its own language: the game's two grounds, Arial Black
   display against a monospace utility face, the lit tile as the one accent. The docs keep the
   system's rules too: text never uses the faint ink, every control clears 44px, one focus ring,
   and status labels are square tags, because pills are for live values. */
:root {
  --bg: #202845; --bg-deep: #1B2240; --raise: rgba(242,240,234,.06); --raise-2: rgba(242,240,234,.1);
  --ink: #F2F0EA; --ink-soft: #A5ABC4; --line: rgba(242,240,234,.13); --line-2: rgba(242,240,234,.22);
  --accent: #7E9BE0; --earned: #7BE0A3; --danger: #F2B8BC; --tile: #F2F0EA; --tile-ink: #202845; --mark-dot: #9698A0;
  --display: 'Arial Black', 'Archivo Black', 'Helvetica Neue', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --top: 60px; --side: 256px; --toc: 208px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F2F0EA; --bg-deep: #EAE7DF; --raise: rgba(32,40,69,.04); --raise-2: rgba(32,40,69,.08);
  --ink: #202845; --ink-soft: #5F6987; --line: rgba(32,40,69,.13); --line-2: rgba(32,40,69,.24);
  --accent: #2F58D0; --earned: #276A43; --danger: #8E2430; --tile: #202845; --tile-ink: #F2F0EA; --mark-dot: #686D7D;
  color-scheme: light;
}
@media (prefers-color-scheme: light) { :root:not([data-theme]) {
  --bg: #F2F0EA; --bg-deep: #EAE7DF; --raise: rgba(32,40,69,.04); --raise-2: rgba(32,40,69,.08);
  --ink: #202845; --ink-soft: #5F6987; --line: rgba(32,40,69,.13); --line-2: rgba(32,40,69,.24);
  --accent: #2F58D0; --earned: #276A43; --danger: #8E2430; --tile: #202845; --tile-ink: #F2F0EA; --mark-dot: #686D7D;
  color-scheme: light; } }

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 24px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--accent); color: var(--bg); }
a { color: var(--ink); text-decoration-color: var(--line-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code { font: 13px/1.5 var(--mono); background: var(--raise-2); border-radius: 4px; padding: 1px 5px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 10px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 50; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px) saturate(150%); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.brand svg { width: 30px; height: 30px; }
.brand span { font: 21px/1 var(--display); letter-spacing: -.02em; margin-left: -3px; }
.mk-d { fill: var(--ink); } .mk-l circle { fill: var(--mark-dot); } .mk-t { fill: none; stroke: var(--bg); stroke-width: 3.9; stroke-linecap: round; stroke-linejoin: round; }
.crumb { font: 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); padding-left: 14px; border-left: 1px solid var(--line); }
.crumb a { text-decoration: none; color: inherit; }
.sp { flex: 1; }
.ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.ver { display: inline-flex; align-items: center; height: 44px; font: 12px/1 var(--mono); letter-spacing: .06em; color: var(--accent); border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; text-decoration: none; }
.ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: none; color: var(--ink-soft); cursor: pointer; }
.ic .fill { fill: currentColor; stroke: none; }
.ic:hover { color: var(--ink); border-color: var(--line-2); }
/* With a mouse the top bar's controls are 36px, the search's height (ask.css); touch keeps 44px. */
@media (hover: hover) and (pointer: fine) { .ver { height: 36px; } .ic { width: 36px; height: 36px; border-radius: 8px; } }
.menu { display: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); max-width: 1440px; }
.side { position: sticky; top: var(--top); align-self: start; height: calc(100dvh - var(--top)); overflow-y: auto; scrollbar-width: none;
  padding: 28px 14px 48px; border-right: 1px solid var(--line); }
.side::-webkit-scrollbar { display: none; }
.grp { margin-bottom: 22px; }
.grp-h { display: block; margin: 0 0 6px 12px; font: 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.side a { position: relative; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 5px 12px; border-radius: 8px; color: var(--ink-soft); font-size: 14.5px; font-weight: 500; text-decoration: none; line-height: 1.3; }
.side a:hover { color: var(--ink); background: var(--raise); }
/* the page you're on: one bar at the item's edge, like "On this page", and bold ink; no fill. docs.js
   draws the bar as one piece (.ind) that glides from the page you left to the page you opened, on the
   system's move curve; without the script it's the item's own edge. */
.side a.on { color: var(--ink); font-weight: 650; background: none; }
html:not(.js) .side a.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent); }
.side .ind { position: absolute; left: 0; top: 0; width: 3px; height: 0; border-radius: 2px; background: var(--accent); pointer-events: none;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), height .5s cubic-bezier(.2,.8,.2,1); }
.side .ind.now { transition: none; }
.side a.on:hover { background: var(--raise); }
.side .full { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 16px; font-size: 13.5px; }
.st { font: 600 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; font-style: normal; padding: 4px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ink-soft); }
/* the docs follow the system: green is for a verdict that passed (a contrast grade, a do), never for a label */
.st-stable { color: var(--ink); border-color: var(--line-2); }
.st-trial { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.st-deprecated { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }

/* ---------- page ---------- */
.doc { display: grid; grid-template-columns: minmax(0, 760px) var(--toc); gap: 56px; padding: 48px clamp(20px, 4vw, 64px) 96px; }
.doc-h { padding-bottom: 28px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.kick { font: 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 14px 0 0; font: clamp(36px, 5vw, 54px)/1.02 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.lede { margin: 18px 0 0; font-size: 19px; line-height: 1.55; color: var(--ink-soft); max-width: 60ch; text-wrap: pretty; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 18px; font: 12px var(--mono); color: var(--ink-soft); letter-spacing: .04em; }
article p, article li { max-width: 68ch; }
article p { margin: 0 0 16px; }
article strong { font-weight: 700; }
h2 { position: relative; margin: 56px 0 16px; padding-top: 20px; border-top: 1px solid var(--line); font: 26px/1.15 var(--display); letter-spacing: -.02em; }
h3 { position: relative; margin: 34px 0 10px; font-size: 17px; font-weight: 700; letter-spacing: -.005em; }
.doc-h + h2, .doc-h + p + h2 { border-top: 0; }
.anchor { position: absolute; left: -22px; color: var(--ink-soft); text-decoration: none; opacity: 0; font-family: var(--mono); font-weight: 400; }
h2 .anchor { top: 21px; } h3 .anchor { top: 0; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
ul, ol { padding-left: 22px; } li { margin: 4px 0; } li::marker { color: var(--ink-soft); }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
pre { background: var(--bg-deep); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; }
pre code { background: none; padding: 0; }
.dim { color: var(--ink-soft); font-size: 13.5px; }
.src { font: 12px/1.5 var(--mono); color: var(--ink-soft); margin-top: -4px; }

/* tables */
.tbl code { white-space: nowrap; }
.tbl { overflow-x: auto; margin: 16px 0 22px; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font: 600 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--raise); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td .sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 7px; box-shadow: inset 0 0 0 1px var(--line-2); }
.g { display: inline-block; margin-left: 8px; font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.g-aaa, .g-aa { color: var(--earned); } .g-aa-large, .g-ui-only { color: var(--ink-soft); } .g-decorative { color: var(--danger); }
.pill-s { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }

/* callouts */
.call { margin: 22px 0; padding: 16px 18px 6px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); border-left: 3px solid var(--line-2); }
.call-k { display: block; margin-bottom: 6px; font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.call-why { border-left-color: var(--accent); } .call-why .call-k { color: var(--accent); }
.call-rule { border-left-color: var(--ink); } .call-rule .call-k { color: var(--ink); }
.call-avoid { border-left-color: var(--danger); } .call-avoid .call-k { color: var(--danger); }
.call-evidence { border-left-color: var(--ink-soft); } .call-evidence .call-k { color: var(--ink); }
.call-note { border-left-color: var(--line-2); background: none; } .call-note .call-k { color: var(--ink-soft); }

/* specimens: the game's shipping CSS, both grounds */
.specimen { margin: 22px 0 26px; }
.spec-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spec-pair > div { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.spec-m { position: absolute; top: 10px; left: 12px; z-index: 1; font: 600 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #A5ABC4; pointer-events: none; }
.spec-pair > div + div .spec-m { color: #5F6987; }
.spec-f { display: block; width: 100%; border: 0; background: transparent; }
.specimen figcaption { margin-top: 10px; font: 12px/1.5 var(--mono); color: var(--ink-soft); letter-spacing: .02em; }
.specimen figcaption span { opacity: .85; }
.figure { margin: 22px 0; }
.figure img { width: 100%; display: block; border-radius: 14px; border: 1px solid var(--line); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 20px 0; }
.shots figure { margin: 0; } .shots img { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }
.shots figcaption { margin-top: 6px; font: 11px/1.4 var(--mono); letter-spacing: .06em; color: var(--ink-soft); }

/* cards, stats, do/don't */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 18px 0 24px; }
.card { display: grid; align-content: start; gap: 6px; min-height: 132px; padding: 16px 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--raise); text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s; }
.card:hover { border-color: var(--line-2); background: var(--raise-2); }
.card-k { font: 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.card b { font: 18px/1.2 var(--display); letter-spacing: -.015em; }
.card span:last-child { font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px 0 26px; border-top: 1px solid var(--line); }
.stats div { padding: 16px 14px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.stats div:nth-child(4n+1) { border-left: 0; padding-left: 0; }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats div:nth-child(4n+1) { border-left: 1px solid var(--line); padding-left: 14px; } .stats div:nth-child(2n+1) { border-left: 0; padding-left: 0; } }
.stats dt { font: 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.stats dd { margin: 6px 0 0; font: 30px/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.dd { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.dd > div { border-radius: 14px; border: 1px solid var(--line); padding: 14px 16px; }
.dd .k { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.dd .do .k { color: var(--earned); } .dd .dont .k { color: var(--danger); }
.dd p { margin: 6px 0 0; font-size: 14.5px; }
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 28px; margin: 8px 0; }
.checks li::before { content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-2); }

/* the build flow: five stages joined by the trace */
.flow { margin: 22px 0 28px; }
.flow ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; position: relative; }
.flow ol::before { content: ""; position: absolute; left: 8%; right: 8%; top: 50%; border-top: 2px solid var(--line-2); }
.flow li { position: relative; margin: 0; display: grid; gap: 4px; align-content: start; padding: 14px 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.flow li:first-child { background: var(--tile); color: var(--tile-ink); border-color: var(--tile); }

.flow b { font: 17px/1.15 var(--display); letter-spacing: -.015em; }
.flow li > span:last-child { font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
.flow li:first-child > span, .flow li:first-child > span:last-child { color: inherit; opacity: .78; }
.fl-k { font: 10.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.fl-check { margin-top: 10px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line-2); font-size: 14px; color: var(--ink-soft); }
.fl-check .fl-k { color: var(--accent); margin-right: 8px; }
@media (max-width: 900px) { .flow ol { grid-template-columns: 1fr; } .flow ol::before { left: 22px; right: auto; top: 12px; bottom: 12px; border-top: 0; border-left: 2px solid var(--line-2); } }
kbd { font: 12px var(--mono); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }

/* prev / next, toc */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 72px; }
.pn a { display: grid; gap: 4px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); text-decoration: none; font-weight: 650; }
.pn a:hover { border-color: var(--line-2); background: var(--raise); }
.pn a span { font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 400; }
.pn .nx { text-align: right; grid-column: 2; }
.toc { position: sticky; top: calc(var(--top) + 48px); align-self: start; display: grid; gap: 2px; font-size: 13.5px; }
.toc-h { font: 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 1px solid var(--line); color: var(--ink-soft); text-decoration: none; }
.toc a:hover, .toc a.on { color: var(--ink); border-left-color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .doc { grid-template-columns: minmax(0, 760px); } .toc { display: none; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; top: var(--top); left: 0; width: min(320px, 86vw); background: var(--bg); transform: translateX(-102%); transition: transform .22s cubic-bezier(.22,1,.36,1); box-shadow: 0 0 0 100vmax transparent; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(10,14,34,.5); }
  .menu { display: grid; } .crumb { display: none; }
  .doc { padding-top: 32px; }
  .spec-pair, .dd { grid-template-columns: 1fr; }
  .anchor { display: none; }
}
@media (max-width: 480px) { .ver { display: none; } .top { gap: 8px; padding: 0 12px; } h2 { font-size: 23px; } }
@media (prefers-reduced-motion: reduce) { .side, .card, .side .ind { transition: none; } }
