/* AariaSec — shared theme layer.
   Single source of truth for the light palette and the theme control.
   Loaded by every page whose CSS uses the --bg/--txt/--muted/--line family.
   Pages with their own colour systems (tour, sandbox, radar) are deliberately
   NOT wired to this — they are immersive, intentionally dark experiences. */
  /* Light theme. Overrides only what must change — accent, ok and radius are
     shared. --panel/--line invert from white overlays to black ones. */
  html[data-theme="light"]{
    --bg:#f7f9fc; --bg-2:#eef2f8;
    --panel:rgba(10,20,35,.035); --line:rgba(10,20,35,.10); --line-2:rgba(10,20,35,.18);
    --txt:#0d1520; --muted:#4a5768; --faint:#6b7889;
    --glow:rgba(255,159,10,.30);
    --net-dot:10,52,86; --net-link:12,44,104; --net-grid:58,70,88;
    --glass:rgba(255,255,255,.72);
    /* Low-alpha strokes tuned for light-on-dark disappear when inverted.
       Canvas code multiplies its alphas by this. Raised 3.4 -> 4.2 when light
       became the default (2026-09-20) — see the #net opacity note below. */
    --net-alpha:4.2;
    /* #3ddc97 is a mint tuned for dark ground; on white it fails contrast.
       This is the same hue at a weight that reads on paper. */
    --ok:#0d9b68;
    --star:30,41,56;
  }
  html[data-theme="light"] .veil{opacity:.35}
  /* The constellation is the page's only moving element and on white it was
     reading as grey dust rather than atmosphere: navy-on-white at low alpha
     loses far more perceived weight than light-on-black does, and .45 was
     compensating for a dark-ground assumption that no longer holds. Raised
     together with --net-alpha above; measured against the hero, not guessed. */
  html[data-theme="light"] #net{opacity:.72}

  /* The headline bloom is a dark-ground device. 60px of orange at 30% alpha
     reads as a glow on black and as a smudge on white — it softens the letter
     edges of the largest type on the page, so the headline looks slightly out
     of focus. On light ground the accent needs weight, not light: drop the
     bloom entirely and deepen the fill.

     #FF9F0A on #f7f9fc measures ~1.9:1 — under WCAG's 3:1 floor for large
     text. #d97300 measures ~3.1:1 and clears it while staying in the brand
     orange family. Scoped to the headline only: --accent itself is unchanged,
     so every fill, button and box-shadow keeps the exact brand orange. */
  html[data-theme="light"] h1 .grad{color:#d97300;text-shadow:none}
  /* Theme control. SVG rather than a glyph — ◐ and ☀ render at wildly
     different optical sizes across platforms and one of them is emoji on
     Windows. Sized to sit on the same baseline as the nav buttons. */
  .themebtn{background:var(--panel);border:1px solid var(--line-2);color:var(--muted);
    border-radius:999px;width:38px;height:38px;display:inline-flex;align-items:center;
    justify-content:center;cursor:pointer;flex:0 0 auto;padding:0;
    transition:border-color .18s,color .18s,background .18s}
  .themebtn svg{width:17px;height:17px;display:block}
  .themebtn:hover{border-color:var(--accent);color:var(--accent);background:var(--panel)}
  .themebtn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* Injected control sits in whatever nav the host page has. */
.themebtn{margin-left:10px}

/* ── Element fills that were written dark-only ─────────────────────────────
   These appear across docs/ and get-started/ with hardcoded values rather
   than variables, so they survive a palette swap and look broken on white.
   header:not(#hdr) — the homepage and get-started header is #hdr and is
   transparent until scrolled; docs uses a bare <header> with a solid fill. */
html[data-theme="light"] header:not(#hdr){background:rgba(255,255,255,.90)}
html[data-theme="light"] pre{background:#eef2f8;border-color:var(--line);color:var(--txt)}
html[data-theme="light"] code{background:rgba(10,20,35,.06);color:var(--txt)}
html[data-theme="light"] pre code{background:none}
html[data-theme="light"] th{background:rgba(10,20,35,.05)}
html[data-theme="light"] blockquote{background:rgba(10,20,35,.03)}
