/* CABIN base — docs/design.md §4.0.
 *
 * Reset, fonts / body type, headings, links, code chips, focus, [hidden],
 * .sr-only, colour utilities, the theme toggle, reduced motion. Buttons, fields
 * and every other control live in components.css (§4.1–4.16).
 * Loads after tokens.css; before components.css and the area files.
 */

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }                       /* the dark token blocks set dark — §5.1 */
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 14px/1.55 var(--font-ui);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

/* The old universal `* { margin: 0; padding: 0 }` reset is gone (it also zeroed
 * controls); text-level elements keep the zeroed margins the layouts were built on. */
h1, h2, h3 { font-weight: 500; margin: 0; }
h4, h5, h6, p, ul, ol, dl, dd, figure, fieldset, legend, blockquote { margin: 0; padding: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Machine data is mono with tabular figures (§3.3) */
code, kbd, pre, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
code { font-size: 12px; background: var(--code-bg); border: 1px solid var(--rule); border-radius: var(--r-1); padding: 1px 4px; }

/* Focus rings everywhere (§4.0) */
:focus-visible { outline: 2px solid var(--focus-halo); outline-offset: 1px; }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); outline-offset: 0; }
a:focus-visible, .row:focus-visible, .nav-item:focus-visible, .dock-tab:focus-visible, .chip:focus-within { outline-offset: -2px; }
:focus:not(:focus-visible) { outline: none; }

/* Protects #videoEmpty / #videoSelected — the JS toggles `.hidden` */
[hidden] { display: none !important; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

::selection { background: var(--sel); color: var(--ink); }
* { scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }

/* Colour-only utilities — sizes come from the component that owns the text */
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.err { color: var(--err); }

.eyebrow { font: 500 12px/1.4 var(--font-ui); color: var(--muted); }
.num, .tc { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.help { font: 400 12px/1.45 var(--font-ui); color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.block { width: 100%; }

/* Theme toggle — #themeToggle, driven by js/theme.js (§5.3) */
.theme-toggle { font: 500 12px/1 var(--font-ui); min-width: 64px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
