/* Rooster Ops. Flat and content-first: whitespace and type do the work, and a rule appears only
   where it tells rows of a table apart. Light is the designed default; dark is its own set of
   steps, chosen by the toggle. No build: this file is served as it is. */
:root {
  --paper: #ffffff;
  --ink: #16162b;
  --muted: #5b5b73;
  --rule: #e3e3ee;
  --wash: #f5f5fb;
  --accent: #5546d6;
  --good: #0e7f68;
  --bad: #c53a26;
  --warn: #8a5a00;
  --s1: #5546d6; --s2: #eb6834; --s3: #17a889; --s4: #eda100;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #15151c;
  --ink: #ececf4;
  --muted: #a5a5bc;
  --rule: #2c2c3a;
  --wash: #1d1d27;
  --accent: #a59bff;
  --good: #4ccfb0;
  --bad: #ff8f7f;
  --warn: #e6b450;
  --s1: #9085e9; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.5rem; z-index: 5; }

.shell { display: grid; grid-template-columns: 13rem minmax(0, 1fr); max-width: 84rem; }
.side { padding: 1.5rem 1rem 3rem 1.5rem; position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; }
.brand { font-weight: 650; font-size: 1.05rem; letter-spacing: -0.01em; margin: 0 0 1.25rem; }
.brand a { color: inherit; text-decoration: none; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 0.3rem 0; color: var(--muted); text-decoration: none; }
.side li a:hover { color: var(--ink); }
.side li a[aria-current] { color: var(--ink); font-weight: 600; }
.side .count { color: var(--bad); font-weight: 600; }
.side form { margin-top: 1.5rem; }
.side .quiet { margin-top: 0.4rem; }
.menu { display: none; }
main { padding: 1.5rem 1.5rem 5rem; min-width: 0; }

h1 { font-size: 1rem; font-weight: 600; color: var(--muted); margin: 0 0 0.25rem; }
/* The one loud thing on each page: the answer to the page's question, as a sentence. */
.answer { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.1rem); line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 1.5rem; max-width: 32ch; text-wrap: balance; }
h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 1.75rem 0 0.4rem; }
p { margin: 0 0 0.9rem; max-width: 70ch; }
.note, .empty, small { color: var(--muted); font-size: 0.9rem; }
.empty { margin: 0.4rem 0 1rem; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.state { font-weight: 600; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.tabs a { color: var(--muted); text-decoration: none; padding: 0.2rem 0; display: inline-block; }
.tabs a[aria-current] { color: var(--ink); font-weight: 600; box-shadow: 0 2px 0 var(--accent); }
.range { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0 0 1.5rem; padding: 0; list-style: none; font-size: 0.95rem; }
.range a { text-decoration: none; color: var(--muted); }
.range a[aria-current] { color: var(--ink); font-weight: 600; }

/* Figures: a number and what it is, side by side in a row that wraps. No boxes. */
.figures { display: flex; flex-wrap: wrap; gap: 1.25rem 2.75rem; margin: 0 0 1.5rem; }
.figures div { min-width: 7rem; }
.figures dt { color: var(--muted); font-size: 0.9rem; }
.figures dd { margin: 0; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.figures dd small { display: block; font-size: 0.9rem; font-weight: 400; letter-spacing: 0; }

.scroll { overflow-x: auto; margin: 0 0 1.25rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
caption { text-align: left; color: var(--muted); font-size: 0.9rem; padding-bottom: 0.3rem; }
th, td { text-align: left; padding: 0.45rem 1.25rem 0.45rem 0; vertical-align: top; font-weight: 400; }
thead th { color: var(--muted); font-size: 0.85rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
tbody tr + tr th, tbody tr + tr td { border-top: 1px solid var(--rule); }
tbody th { font-weight: 500; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td form.act { margin: 0; }

.lines { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.lines li { padding: 0.55rem 0; }
.lines li + li { border-top: 1px solid var(--rule); }
.lines strong { font-weight: 600; }
dl.facts { display: grid; grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr); gap: 0.35rem 1.5rem; margin: 0 0 1.25rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

.flash { padding: 0.6rem 0.9rem; margin: 0 0 1.25rem; background: var(--wash); border-left: 3px solid var(--good); max-width: 70ch; }
.flash.bad { border-left-color: var(--bad); color: var(--ink); }

form.act, form.plain { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem 0.75rem; margin: 0 0 0.9rem; }
form.act label, form.plain label, .stack label { display: block; font-size: 0.85rem; color: var(--muted); width: 100%; margin-bottom: -0.3rem; }
form.act > label { width: auto; flex-basis: 100%; }
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=hidden]), select, textarea { background: var(--paper); border: 1px solid var(--muted); border-radius: 6px; padding: 0.45rem 0.6rem; min-width: 0; flex: 1 1 12rem; max-width: 26rem; }
textarea { flex-basis: 100%; max-width: 40rem; }
button { background: var(--ink); color: var(--paper); border: 0; border-radius: 6px; padding: 0.5rem 0.9rem; font-weight: 600; cursor: pointer; min-height: 2.5rem; }
button:hover { opacity: 0.86; }
form.danger button { background: var(--bad); color: var(--paper); }
:root[data-theme="dark"] form.danger button { color: #15151c; }
button.quiet { background: none; color: var(--muted); padding: 0.3rem 0; font-weight: 400; min-height: 0; text-decoration: underline; text-underline-offset: 0.15em; }
details { margin: 0 0 1rem; }
summary { cursor: pointer; color: var(--accent); width: fit-content; padding: 0.2rem 0; }
details > form, details > div, details > p, details > ul { margin-top: 0.75rem; }
.stack { max-width: 22rem; display: grid; gap: 0.9rem; }
.stack label { margin-bottom: 0.25rem; }
.stack input { max-width: none; width: 100%; }

figure.chart { margin: 0 0 1.5rem; max-width: 46rem; }
figcaption { font-weight: 600; margin-bottom: 0.25rem; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; padding: 0; margin: 0 0 0.25rem; color: var(--muted); font-size: 0.9rem; }
.key { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 2px; margin-right: 0.4rem; }
svg { display: block; width: 100%; height: auto; overflow: visible; }
.grid { stroke: var(--rule); stroke-width: 1; }
.tick, .endlabel { fill: var(--muted); font-size: 11px; }
.endlabel { fill: var(--ink); }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line.s1 { stroke: var(--s1); } .line.s2 { stroke: var(--s2); } .line.s3 { stroke: var(--s3); } .line.s4 { stroke: var(--s4); }
.bar.s1, .key.s1 { fill: var(--s1); background: var(--s1); } .bar.s2, .key.s2 { fill: var(--s2); background: var(--s2); }
.bar.s3, .key.s3 { fill: var(--s3); background: var(--s3); } .bar.s4, .key.s4 { fill: var(--s4); background: var(--s4); }
.hit { fill: transparent; }
.hit:hover { fill: var(--ink); fill-opacity: 0.06; }
svg.spark { width: 5rem; height: 1.5rem; }
table.dist { width: auto; min-width: min(26rem, 100%); }
table.dist th { white-space: nowrap; color: var(--muted); }
.barcell { width: 12rem; }
svg.hbar { height: 0.7rem; margin-top: 0.4rem; }
.mark { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
pre { background: var(--wash); padding: 0.75rem 1rem; overflow-x: auto; font-size: 0.85rem; border-radius: 6px; max-width: 100%; }
code { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: 0.9em; }
.doc { max-width: 70ch; }
.doc li { margin-bottom: 0.4rem; }
.doc li.cont { list-style: none; }
.media img { max-width: min(20rem, 100%); border-radius: 6px; display: block; margin-bottom: 0.5rem; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 0 3rem; }

@media (max-width: 54rem) {
  .shell { display: block; }
  .side { position: static; padding: 0.9rem 1rem 0; max-height: none; }
  .brand { margin: 0; display: inline-block; }
  .side nav, .side > form, .side > .quiet { display: none; }
  .menu { display: block; float: right; margin: 0; }
  .menu summary { color: var(--ink); font-weight: 600; }
  .menu[open] { float: none; }
  .menu[open] summary { float: right; }
  .menu ul { clear: both; columns: 2; padding-top: 0.75rem; }
  .menu li a { padding: 0.45rem 0; }
  main { padding: 1rem 1rem 4rem; }
  th, td { padding-right: 0.9rem; }
  dl.facts { grid-template-columns: 1fr; gap: 0; }
  dl.facts dd { margin-bottom: 0.6rem; }
  .barcell { width: 6rem; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print { .side, form, .tabs, .range { display: none; } .shell { display: block; } }
