/* sax.llc — SPAN experiment layer. Loaded after modernist.css and site.css.
   Colour lives in the supergraphics only (src/span/). Type and controls stay ink on the
   chord's ground, so contrast holds whichever chord is active. The chord variables
   (--c1 … --mark) are written into <head> by Base.astro from span-tokens.json. */

/* :not(#span) outranks the light/dark theme blocks in site.css */
:root:not(#span) {
  --color-bg: var(--ground);
  --color-text: var(--on-ground);
  --color-surface: color-mix(in srgb, var(--on-ground) 7%, var(--ground));
  --color-accent: var(--on-ground);
  --color-accent-400: var(--on-ground);
  --color-accent-600: color-mix(in srgb, var(--on-ground) 82%, var(--ground));
  --color-accent-700: color-mix(in srgb, var(--on-ground) 70%, var(--ground));
  --color-divider: color-mix(in srgb, var(--on-ground) 40%, transparent);
  --ink-accent: var(--on-ground);
  --ink-muted: color-mix(in srgb, var(--on-ground) 74%, transparent);
  --on-accent: var(--ground);
  --poster-bg: var(--field);
  --poster-ink: var(--on-field);
  --shadow-sm: none; --shadow-md: none; --shadow-lg: none;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* .nav a { color: inherit } in modernist.css outranks .btn-primary: keep its label on the fill */
.site-nav .btn-primary { color: var(--on-accent); }

/* — type: Archivo 900 display, Archivo text, IBM Plex Mono annotation — */
.hero h1, .page-head h1, .poster h2, .closing h2 { font-weight: 900; letter-spacing: -0.02em; line-height: 0.9; }
.band h2 { font-weight: 900; letter-spacing: -0.02em; line-height: 0.95; }
.proof .num { font-weight: 900; }
.kicker, .door .k, .case .meta, .case .arrow, .essay .meta, .facts dt, .toc a, .site-foot,
.site-nav .nav-brand small, .hero-name span, .poster-fig figcaption, .chords {
  font-family: var(--font-mono); font-weight: 400; letter-spacing: 0.04em;
}
.kicker, .door .k, .case .arrow, .facts dt, .essay .meta { text-transform: uppercase; color: var(--ink-muted); }
.kicker { font-size: 12px; }
.poster .kicker { color: var(--poster-ink); opacity: 1; }
.site-foot { font-size: 12px; }

/* — strips: true size, cropped by the page — */
.sg { position: relative; overflow: hidden; height: calc(var(--h-sm) * 8px); background: var(--color-bg); }
@media (min-width: 720px) { .sg { height: calc(var(--h) * 8px); } }
.sg-layer { position: absolute; bottom: 0; display: block; max-width: none; }
.sg-left { left: 0; }
.sg-right { right: 0; }
.sg-center { left: 50%; transform: translateX(-50%); }
.sg text { font-family: "Archivo", system-ui, sans-serif; font-weight: 900; letter-spacing: -0.02em; }
.sg .f-c1 { fill: var(--c1); }
.sg .f-c2 { fill: var(--c2); }
.sg .f-c3 { fill: var(--c3); }
.sg .f-field { fill: var(--field); }
.sg .f-mark { fill: var(--mark); }
.sg .night { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sg .night { display: inline; }
  :root:not([data-theme="light"]) .sg .day { display: none; }
}
:root[data-theme="dark"] .sg .night { display: inline; }
:root[data-theme="dark"] .sg .day { display: none; }

/* where strips meet the page */
.page-head:has(> .sg) { padding-bottom: 0; border-bottom: 0; }
.page-head:has(> .sg) > .wrap { padding-bottom: 32px; }
@media (min-width: 720px) { .page-head:has(> .sg) > .wrap { padding-bottom: 48px; } }
.sg + .band, .sg + section { border-top: 0; }
.poster .sg { background: transparent; }
.poster .wrap { padding-bottom: 32px; }
.sg-foot + .site-foot { border-top: 0; }

/* — chord picker (experiment only) — */
.chords { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 16px; font-size: 12px; }
.chords button { font: inherit; letter-spacing: inherit; text-transform: uppercase; color: inherit; background: none; border: 1px solid var(--color-divider); padding: 4px 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chords button:hover { border-color: var(--color-text); }
.chords button[aria-pressed="true"] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.chords .sw { display: inline-flex; }
.chords .sw i { width: 8px; height: 8px; display: block; }
