/* Layout: one 1080px documentation column, header with page switch, sections separated by space not boxes.
   Cards only for the two products, the decision layers and the pupil-facing mock. */
/* Dark is the house theme for the console and guides (Al, 11 Oct 2026), whatever the system setting.
   Light stays available for print or a screenshot with <html data-theme="light">. */
:root {
  --bg: #0e141d; --surface: #161e2a; --ink: #e6ebf2; --muted: #9ba7b8; --line: #283344;
  --accent: #86a8ff; --accent-soft: #1d2a45; --on-accent: #0e141d;
  --block: #ff8a80; --block-soft: #3a1d1c; --alert: #f2c26b; --alert-soft: #382c16;
  --allow: #7fd3a1; --allow-soft: #17301f; --plan: #b3b6f0; --plan-soft: #25264a;
  --support: #6fd0da; --support-soft: #123236; --code-bg: #1d2735; --brand: #8fbbea;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --step--1: 0.875rem; --step-0: 1rem; --step-1: 1.2rem; --step-2: 1.5rem; --step-3: 2rem; --step-4: 2.75rem;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f6f9; --surface: #ffffff; --ink: #152030; --muted: #546072; --line: #dde3eb;
  --accent: #1f58c9; --accent-soft: #e6eefc; --on-accent: #ffffff;
  --block: #b8322a; --block-soft: #fbe9e7; --alert: #9a6412; --alert-soft: #fbf1df;
  --allow: #1f7a47; --allow-soft: #e3f3ea; --plan: #5b5f9e; --plan-soft: #ececf8;
  --support: #0e7480; --support-soft: #e0f2f3; --code-bg: #eef1f6; --brand: #2E6BA8;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--step-0)/1.6 var(--font-body); }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.88em; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }

.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 20px; }

/* Header */
.site-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.mark { font: 700 1.05rem/1 var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; display: flex; align-items: center; gap: 12px; }
.mark .logo { height: 34px; width: auto; display: block; border-radius: 8px; }
/* The logo is brand blue on transparent: give it a white plate in dark mode so it stays legible. */
:root:not([data-theme="light"]) .mark .logo { background: #fff; padding: 4px 8px; box-sizing: content-box; }
.mark .pname { padding-left: 12px; border-left: 1px solid var(--line); line-height: 1.1; }
.mark .pname small { display: block; font: 400 0.72rem/1.2 var(--font-body); color: var(--muted); letter-spacing: 0; }
.pages { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.pages a { text-decoration: none; color: var(--muted); padding: 6px 14px; border-radius: 999px; font-size: var(--step--1); font-weight: 700; }
.pages a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }

/* Type */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, var(--step-4)); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.2vw, var(--step-3)); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0; max-width: 68ch; }
.lede { font-size: var(--step-1); color: var(--muted); max-width: 60ch; }
.eyebrow { font: 700 0.75rem/1 var(--font-body); text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
.muted { color: var(--muted); }

/* Sections */
main { display: grid; gap: 72px; padding-block: 48px 96px; }
section { display: grid; gap: 20px; scroll-margin-top: 80px; }
.section-head { display: grid; gap: 8px; }

/* Hero */
.hero { display: grid; gap: 18px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: var(--step--1); color: var(--muted); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--allow); }

/* Two products */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.product { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.product .where { font-size: var(--step--1); color: var(--muted); }
.product ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 4px; }

/* Decision layers */
.layers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; counter-reset: layer; }
.layer { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.layer .code { font: 600 0.8rem/1 var(--font-mono); color: var(--muted); }
.layer p { font-size: var(--step--1); }
.rule { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 10px 10px 0; max-width: 72ch; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; font: 700 0.78rem/1.2 var(--font-body); padding: 3px 9px; border-radius: 999px; white-space: nowrap; width: fit-content; }
.chip.block { color: var(--block); background: var(--block-soft); }
.chip.alert { color: var(--alert); background: var(--alert-soft); }
.chip.allow { color: var(--allow); background: var(--allow-soft); }
.chip.plan { color: var(--plan); background: var(--plan-soft); }
.chip.support { color: var(--support); background: var(--support-soft); }
.chip.none { color: var(--muted); background: transparent; border: 1px dashed var(--line); }

/* Tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: var(--step--1); }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
thead th { font: 700 0.78rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--bg); }
tbody tr:last-child td { border-bottom: 0; }
td .note { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 3px; }

/* Block page mock */
.mock-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; }
.mock { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg); min-width: 0; }
.mock .bar { display: flex; gap: 6px; padding: 9px 12px; background: var(--surface); border-bottom: 1px solid var(--line); align-items: center; }
.mock .bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.mock .bar em { font: 400 0.75rem/1 var(--font-mono); color: var(--muted); margin-left: 8px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock .page { padding: 22px; display: grid; gap: 10px; }
.mock .card { background: var(--surface); border-radius: 12px; padding: 20px; display: grid; gap: 8px; box-shadow: 0 4px 20px rgb(0 0 0 / 0.06); }
.mock .card h4 { margin: 0; font: 700 1.1rem/1.2 var(--font-display); }
.mock .support { background: var(--support-soft); border: 1px solid color-mix(in srgb, var(--support) 40%, transparent); border-radius: 10px; padding: 12px; font-size: 0.85rem; }
.mock .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.mock .btns span { font-size: 0.82rem; font-weight: 700; padding: 7px 12px; border-radius: 8px; background: var(--accent); color: var(--on-accent); }
.mock .btns span.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.caption { font-size: var(--step--1); color: var(--muted); }

/* Lists of points */
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px 28px; margin: 0; padding: 0; list-style: none; }
.points li { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); min-width: 0; }
.points strong { font-family: var(--font-display); font-weight: 600; }

/* Status board */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.board > div { display: grid; gap: 10px; align-content: start; min-width: 0; }
.board ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; font-size: var(--step--1); }

/* Code with copy */
.code-block { position: relative; background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.code-block pre { margin: 0; padding: 16px 18px; overflow-x: auto; line-height: 1.5; }
.copy { position: absolute; top: 8px; right: 8px; font: 700 0.75rem/1 var(--font-body); padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.copy:hover { border-color: var(--accent); }

/* Steps */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 28px; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 6px 16px; }
.steps > li::before { content: counter(step); grid-row: span 3; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 0.95rem/32px var(--font-display); text-align: center; }
.steps > li > * { grid-column: 2; min-width: 0; }
.steps > li > h3 { margin-top: 4px; }
.step-body { display: grid; gap: 12px; }
.step-body ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }

/* Platform tabs */
.tabs { display: grid; gap: 12px; }
.tablist { display: flex; gap: 6px; flex-wrap: wrap; }
.tablist button { font: 700 var(--step--1)/1 var(--font-body); padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.tablist button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tabpanel { display: grid; gap: 10px; }

/* Jump links */
.jumps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.jumps a { display: grid; gap: 4px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.jumps a:hover { border-color: var(--accent); }
.jumps a span { color: var(--muted); font-size: var(--step--1); }
.jumps a strong { font-family: var(--font-display); font-size: var(--step-1); }

/* Callouts */
.callout { border-radius: 10px; padding: 14px 16px; font-size: var(--step--1); display: grid; gap: 4px; max-width: 76ch; }
.callout.warn { background: var(--alert-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--alert) 35%, transparent); }
.callout.info { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding-block: 14px; }
details summary { cursor: pointer; font: 600 var(--step-0)/1.4 var(--font-display); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details summary::after { content: "+"; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "–"; }
details > div { padding-top: 10px; display: grid; gap: 8px; color: var(--ink); }

/* System diagram (inline SVG, theme tokens) */
.diagram { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; overflow-x: auto; }
.diagram svg { width: 100%; height: auto; min-width: 640px; display: block; font-family: var(--font-body); }
.diagram .box { fill: var(--bg); stroke: var(--line); stroke-width: 1.2; }
.diagram .box.core { fill: var(--accent-soft); stroke: var(--accent); }
.diagram .box.store { fill: var(--support-soft); stroke: var(--support); }
.diagram .box.ext { fill: var(--surface); stroke: var(--line); stroke-dasharray: 4 3; }
.diagram .box.net { fill: var(--plan-soft); stroke: var(--plan); }
.diagram .t { fill: var(--ink); font-size: 13px; font-weight: 700; }
.diagram .s { fill: var(--muted); font-size: 11px; }
.diagram .l { fill: var(--muted); font-size: 10.5px; }
.diagram .arrow { stroke: var(--muted); stroke-width: 1.4; fill: none; marker-end: url(#arrowhead); }
.diagram .arrow.two { marker-start: url(#arrowtail); }
.diagram .arrow.accent { stroke: var(--accent); }
.diagram .arrow.support { stroke: var(--support); }
.diagram .arrow.plan { stroke: var(--plan); }
.diagram-key { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--step--1); color: var(--muted); }
.diagram-key span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line); background: var(--bg); }
.diagram-key .k-core::before { background: var(--accent-soft); border-color: var(--accent); }
.diagram-key .k-store::before { background: var(--support-soft); border-color: var(--support); }
.diagram-key .k-net::before { background: var(--plan-soft); border-color: var(--plan); }
.diagram-key .k-ext::before { border-style: dashed; }

/* Request flow */
.flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.flow .step { flex: 1 1 150px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; align-content: start; position: relative; }
.flow .step .code { font: 600 0.75rem/1 var(--font-mono); color: var(--muted); }
.flow .step strong { font-family: var(--font-display); font-size: 0.95rem; }
.flow .step p { font-size: 0.8rem; color: var(--muted); }
.flow .step.out { border-color: var(--accent); }

/* Component cards */
.components { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.component { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.component .where { font: 400 0.78rem/1.3 var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.component p { font-size: var(--step--1); }
.component .tests { font-size: 0.78rem; color: var(--allow); }

/* Scale table */
.scale td:first-child { white-space: nowrap; font-weight: 700; }

footer { border-top: 1px solid var(--line); padding-block: 24px; color: var(--muted); font-size: var(--step--1); }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (prefers-reduced-motion: no-preference) {
  .jumps a, .copy, .tablist button { transition: border-color 0.15s, background-color 0.15s; }
}
