/*
 * Website theme. Light by default; dark follows the device unless <html data-theme="light">,
 * and <html data-theme="dark"> forces it (the same rule as tokens.css, so both stay in step).
 *
 * Neutrals are an 11-step scale from the page background (--n0) to the text colour (--n10).
 * The site is monochrome (2026-11-05, "less AI-looking"): links, buttons and chapter labels use the
 * neutrals, and colour is kept only where it carries a state in the illustrations:
 *   ok    connected, confirmed, synchronised
 *   warn  offline, waiting
 *   error a broken connection
 * Those three are the design tokens' status colours mixed down towards the neutral grey.
 * --c-accent, --c-info and --c-vision remain as names for older rules and resolve to neutrals.
 */
:root {
  --n0: #ffffff;
  --n1: #f4f6f7;
  --n2: #eaeef0;
  --n3: #dfe5e8;
  --n4: #d0d8dc;
  --n5: #b3bfc5;
  --n6: #85939a;
  --n7: #56656d;
  --n8: #3b4950;
  --n9: #25313a;
  --n10: #0d1316;
  --c-accent: var(--n10);
  --c-info: var(--n8);
  --c-vision: var(--n8);
  --c-ok: color-mix(in srgb, var(--tw-color-ok) 55%, var(--n8));
  --c-warn: color-mix(in srgb, var(--tw-color-warning) 60%, var(--n8));
  --c-error: color-mix(in srgb, var(--tw-color-error) 60%, var(--n8));
  --c-shadow: #1b2a33;
  --logo-filter: none;
  --hover-glow: 20%;

  --site-paper: var(--n0);
  --site-ink: var(--n10);
  --site-secondary: var(--n8);
  --site-muted: var(--n2);
  --site-line: var(--n4);
  --site-night: var(--n0);
  --site-night-secondary: var(--n8);
  --site-on-night: var(--n10);
  --site-petrol: var(--c-accent);
  --site-shell: 1160px;
  --site-gutter: clamp(24px, 5vw, 80px);
  --site-section-space: clamp(96px, 12vw, 184px);
  --site-radius: 32px;
  --site-ease: cubic-bezier(.2,.75,.25,1);
  --site-header-height: 72px;
  --site-shadow: 0 28px 90px color-mix(in srgb, var(--c-shadow) 14%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --n0: #16191c;
    --n1: #1b1f23;
    --n2: #22272b;
    --n3: #2b3136;
    --n4: #394046;
    --n5: #4f585f;
    --n6: #66767f;
    --n7: #8e9ea7;
    --n8: #b4c0c6;
    --n9: #d5dde1;
    --n10: #f4f6f7;
    --c-shadow: #000000;
    --logo-filter: invert(1);
    --hover-glow: 22%;
    --hub-filter: brightness(1.4) contrast(.95);
    --site-shadow: 0 30px 90px rgba(0, 0, 0, .32);
  }
}

:root[data-theme="dark"] {
  --n0: #16191c;
  --n1: #1b1f23;
  --n2: #22272b;
  --n3: #2b3136;
  --n4: #394046;
  --n5: #4f585f;
  --n6: #66767f;
  --n7: #8e9ea7;
  --n8: #b4c0c6;
  --n9: #d5dde1;
  --n10: #f4f6f7;
  --c-shadow: #000000;
  --logo-filter: invert(1);
  --hover-glow: 22%;
  --hub-filter: brightness(1.4) contrast(.95);
  --site-shadow: 0 30px 90px rgba(0, 0, 0, .32);
}
