/* Layout: one reading column on graticule paper; sections keyed by scope channel colours; real screens from our units */
:root {
  /* Dark-first, like the scope's own screen; the same in every browser and theme */
  color-scheme: dark;
  --paper: #0f151b;
  --grid: #1c2731;
  --ink: #e3e9ee;
  --muted: #9aa8b4;
  --rule: #2a3742;
  --accent: #5cc8e4;
  --ch1: #e8c547; --ch2: #4fc6e2; --ch3: #e46bb4; --ch4: #7d9cff;
  --panel: #151d25;
  --scope: #0d1117;
  --good: #3ecf8e;
  --display: "Saira Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Literata", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --s-1: .82rem; --s0: 1.02rem; --s1: 1.3rem; --s2: 1.75rem; --s3: 2.6rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: var(--s0); line-height: 1.6;
  padding-inline: max(20px, env(safe-area-inset-left, 0px)); padding-block: env(safe-area-inset-top, 0px) calc(64px + env(safe-area-inset-bottom, 0px));
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
.wrap { max-width: 50rem; margin: 0 auto; display: grid; gap: 3.4rem; }
header { display: grid; gap: 1.1rem; padding-top: 2.4rem; }
.eyebrow { font-family: var(--mono); font-size: var(--s-1); color: var(--muted); letter-spacing: .04em; }
.eyebrow b { color: var(--good); font-weight: 600; }
h1 { font-family: var(--display); font-weight: 700; font-size: var(--s3); line-height: 1; margin: 0; letter-spacing: .01em; text-wrap: balance; }
h1 span { color: var(--accent); }
.lede { font-size: var(--s1); line-height: 1.45; margin: 0; max-width: 40rem; text-wrap: pretty; }
figure { margin: 0; }
.shot { border: 1px solid var(--rule); background: var(--scope); border-radius: 6px; overflow: hidden; }
.shot img { width: 100%; height: auto; aspect-ratio: 1024 / 600; }
figcaption { font-family: var(--mono); font-size: var(--s-1); color: var(--muted); padding: .5rem .2rem 0; }
.hero figcaption b { color: var(--ink); font-weight: 600; }
section { display: grid; gap: .95rem; }
h2 { font-family: var(--display); font-weight: 700; font-size: var(--s2); line-height: 1.1; margin: 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; text-wrap: balance; }
h2 .ch { font-family: var(--mono); font-size: .72rem; font-weight: 600; padding: .15rem .45rem; border-radius: 3px; color: var(--paper); letter-spacing: .03em; }
h3 { font-family: var(--display); font-weight: 700; font-size: var(--s1); margin: .5rem 0 0; }
.c1 { background: var(--ch1); } .c2 { background: var(--ch2); } .c3 { background: var(--ch3); } .c4 { background: var(--ch4); }
p { margin: 0; max-width: 42rem; }
ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; max-width: 42rem; }
code, .mono { font-family: var(--mono); font-size: .86em; }
.phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .8rem; }
.phase { border: 1px solid var(--rule); background: var(--panel); border-radius: 6px; padding: .9rem 1rem; display: grid; gap: .35rem; align-content: start; text-decoration: none; color: var(--ink); }
.phase .n { font-family: var(--mono); font-size: var(--s-1); color: var(--muted); }
.phase .t { font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.15; }
.phase .s { font-family: var(--mono); font-size: .72rem; justify-self: start; border-radius: 3px; padding: .05rem .4rem; border: 1px solid var(--rule); }
.phase.now { border-color: var(--good); box-shadow: inset 3px 0 0 var(--good); }
.phase.now .s { color: var(--good); border-color: var(--good); }
.phase p { font-size: .95rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .9rem; }
.gallery button { all: unset; cursor: zoom-in; display: grid; gap: .1rem; width: 100%; min-width: 0; }
.gallery button:focus-visible .shot { outline: 2px solid var(--accent); outline-offset: 2px; }
.tbl { overflow-x: auto; border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; vertical-align: top; padding: .55rem .75rem; border-bottom: 1px solid var(--rule); }
tr:last-child td { border-bottom: 0; }
th { font-family: var(--display); font-weight: 500; font-size: .95rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
td:first-child { white-space: nowrap; }
td b { font-family: var(--mono); font-weight: 600; color: var(--good); font-size: .92em; }
td code { color: var(--accent); }
.tag { font-family: var(--mono); font-size: .72rem; color: var(--muted); border: 1px solid var(--rule); border-radius: 3px; padding: 0 .35rem; white-space: nowrap; }
.note { border-left: 3px solid var(--ch3); padding: .2rem 0 .2rem .9rem; color: var(--ink); }
.ask { border: 1px solid var(--accent); border-radius: 6px; padding: 1rem 1.1rem; background: var(--panel); display: grid; gap: .6rem; }
.road { list-style: none; padding: 0; counter-reset: step; gap: .8rem; }
.road li { counter-increment: step; display: grid; grid-template-columns: 2rem 1fr; gap: .6rem; }
.road li::before { content: counter(step); font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: var(--accent); line-height: 1.3; }
.road li.done::before { color: var(--good); }
footer { font-family: var(--mono); font-size: var(--s-1); color: var(--muted); border-top: 1px solid var(--rule); padding-top: 1rem; display: grid; gap: .4rem; }
dialog { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1100px); }
dialog::backdrop { background: rgba(5, 8, 12, .86); }
dialog img { width: 100%; border-radius: 6px; }
dialog p { color: #e3e9ee; font-family: var(--mono); font-size: var(--s-1); padding: .5rem .2rem; max-width: none; }
dialog form { text-align: right; }
dialog form button { font-family: var(--mono); background: #151d25; color: #e3e9ee; border: 1px solid #2a3742; border-radius: 4px; padding: .3rem .7rem; cursor: pointer; }
@media (max-width: 480px) { h1 { font-size: 2.1rem; } .lede { font-size: 1.12rem; } td:first-child { white-space: normal; } }
nav.top { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; align-items: baseline; font-family: var(--mono); font-size: var(--s-1); padding-top: 1.2rem; }
nav.top a { color: var(--muted); text-decoration: none; }
nav.top a:hover, nav.top a[aria-current="page"] { color: var(--accent); }
nav.top .brand { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); margin-right: auto; }
nav.top .brand span { color: var(--accent); }
.crumbs { font-family: var(--mono); font-size: var(--s-1); color: var(--muted); }
details { border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); padding: .7rem .9rem; }
details summary { cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
details[open] summary { margin-bottom: .5rem; }
details p + p, details p + ul { margin-top: .5rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .8rem; }
.card { border: 1px solid var(--rule); background: var(--panel); border-radius: 6px; padding: .9rem 1rem; display: grid; gap: .35rem; text-decoration: none; color: var(--ink); }
.card .t { font-family: var(--display); font-weight: 700; font-size: 1.2rem; line-height: 1.15; }
.card p { font-size: .95rem; }
article { display: grid; gap: 1rem; }
article h2 { margin-top: 1rem; }
