/* ─────────────────────────────────────────────────────────────
   Cotrugli — Base
   Resets, root element setup, semantic element helpers, layout
   containers. Loaded after tokens.css.
   ───────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  font: var(--t-body);
  font-feature-settings: "tnum" 1;   /* tabular numerals, always */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Quiet, linear theme crossfade — no other page-load motion. */
body { transition: background-color var(--t-quick) var(--easing), color var(--t-quick) var(--easing); }

h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font-family: inherit; color: inherit; }
table { border-collapse: collapse; }
em { font-style: normal; }            /* italics are deliberate, opt-in only */
::selection { background: var(--signal); color: var(--signal-ink); }

/* Links — underline, never the signal color. Hover slightly muted. */
a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; transition: color var(--t-quick) var(--easing); }
a:hover { color: var(--text-muted); }

/* Visible focus ring for keyboard users — text color, square. */
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Visually hidden but available to AT / focusable (used by CSS-tab radios). */
.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;
}

/* ── Layout containers ── */
.container          { max-width: 1080px; margin: 0 auto; padding-left: var(--sp-8); padding-right: var(--sp-8); }
.container--reading { max-width: 720px;  margin: 0 auto; padding-left: var(--sp-8); padding-right: var(--sp-8); }
.container--wide    { max-width: 1280px; margin: 0 auto; }

/* ─────────────────────────────────────────────
   Semantic element helpers (shipped .cot-* set).
   Use directly, or as a reference for component CSS.
   ───────────────────────────────────────────── */
.cot-body    { font: var(--t-body); color: var(--text); background: var(--surface); font-feature-settings: "tnum" 1; }
.cot-display { font: var(--t-display); letter-spacing: var(--tr-display); color: var(--text); }
.cot-h1      { font: var(--t-h1);   letter-spacing: var(--tr-h1);   color: var(--text); }
.cot-h2      { font: var(--t-h2);   letter-spacing: var(--tr-h2);   color: var(--text); }
.cot-h3      { font: var(--t-h3);   letter-spacing: var(--tr-h3);   color: var(--text); }
.cot-p       { font: var(--t-body); color: var(--text-muted); }
.cot-p-sm    { font: var(--t-body-sm); color: var(--text-muted); }
.cot-mono    { font: var(--t-mono-data); color: var(--text); font-variant-numeric: tabular-nums; }
.cot-label   { font: var(--t-mono-label); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--text-subtle); }
.cot-micro   { font: var(--t-micro); color: var(--text-subtle); }
.cot-code    { font-family: var(--font-mono); font-size: 0.88em; color: var(--signal); background: var(--surface-elev); padding: 1px 6px; border-radius: var(--r-1); }
