/**
 * scene-stage.css - "The Display": the scene sub-brand token sheet.
 *
 * The site is the Instrument (instrument.css, --in-*). Scenes are the DISPLAY set
 * into that instrument - the phosphor screen behind the glass - and they carry
 * their own token namespace, --sc-*, so the two systems can diverge on purpose.
 *
 * CONTRACT (viz/build/build-tokens.mjs parses this file mechanically):
 *   - Block 1, `:root`,                      is the LIGHT theme (in-prose embeds).
 *   - Block 2, `[data-scene-theme="dark"]`,  is the DARK theme (the stage - flagship).
 *   - Both blocks must declare the SAME set of --sc-* names; the build fails if
 *     they drift. Later rules in this file are chrome, and are not scraped.
 *
 * DARK IS THE BAKED-IN FALLBACK: sc('x') in scene code emits var(--sc-x, <dark>).
 * A context with this stylesheet resolves the page's theme; a context with no
 * stylesheet at all (OG capture, reader mode) renders the stage look.
 *
 * Light values deliberately mirror the --in-* values they replace, so a scene
 * embedded in prose sits flush with the page it interrupts.
 */

:root {
   /* housing */
   --sc-bezel: #E9E8E3;            /* outer housing (mirrors --in-panel) */
   --sc-bezel2: #DFDDD7;           /* raised elements, inactive cells */
   --sc-stage: #F8F7F4;            /* the screen surface (mirrors --in-well) */
   --sc-stage-edge: #D6D4CD;
   --sc-hairline: #C9C7C0;
   --sc-recess: #2A2A26;           /* code/display wells (the blackface module) */
   --sc-recess-ink: #F0EEE4;       /* ink on recess - same phosphor in both themes */
   --sc-face: #F8F7F4;             /* the LIT cell face - the surface under active values */

   /* ink ramp */
   --sc-ink: #232320;
   --sc-ink2: #45443E;
   --sc-ink3: #67665F;             /* glanced labels only */
   --sc-ink4: #94938B;             /* decorative / >=18px */
   --sc-ink5: #B5B4AC;

   /* accent - the beam.
      Tints sit a legible step off the panel greys: at the old near-neutral values a
      state-tinted housing read as the same surface, and states carried by tint were
      invisible in both themes. */
   --sc-accent: #E55A12;
   --sc-accent-text: #C24A0B;
   --sc-accent-tint: #F5D3B8;
   --sc-halo: rgba(229,90,18,.3);

   /* signal lamps: fill / text / tint */
   --sc-gr: #2E9E6B;
   --sc-gr-text: #256E4C;
   --sc-gr-tint: #C7E2D1;
   --sc-am: #D9A013;
   --sc-am-text: #7D5A0B;
   --sc-am-tint: #F1E0AE;
   --sc-re: #C4442E;
   --sc-re-text: #9E3D2B;
   --sc-re-tint: #F6CBBD;

   /* furniture */
   --sc-graticule: rgba(35,35,32,.05);
   --sc-graticule-major: rgba(35,35,32,.08);
   --sc-glass-edge: rgba(255,255,255,.7);
   --sc-vignette: rgba(35,35,32,.04);    /* near-invisible: embeds sit flush with the page */

   /* shadows (web chrome only - never inside scene SVG) */
   --sc-lift: 0 1px 0 rgba(255,255,255,.7) inset, 0 10px 24px -16px rgba(35,35,32,.35);
   --sc-inset: inset 0 2px 4px rgba(35,35,32,.09);
}

[data-scene-theme="dark"] {
   /* housing */
   --sc-bezel: #24211E;
   --sc-bezel2: #2E2A26;
   --sc-stage: #1B1917;
   --sc-stage-edge: #3A342E;
   --sc-hairline: #35312B;
   --sc-recess: #141210;
   --sc-recess-ink: #F0EEE4;
   --sc-face: #332E28;

   /* ink ramp - phosphor on glass */
   --sc-ink: #F0EEE4;
   --sc-ink2: #C9C4B6;
   --sc-ink3: #9A9488;
   --sc-ink4: #6F6A60;
   --sc-ink5: #4C463E;

   /* accent - warmed for dark, matches the labs' on-dark orange.
      Tints sit a full elevation step above bezel2 (#2E2A26): at the old values a
      state-tinted housing was invisible on the dark stage - the doctor's own
      channel threshold proved it - and the luminance ladder collapsed. */
   --sc-accent: #F06A24;
   --sc-accent-text: #F29A69;
   --sc-accent-tint: #4A2C18;
   --sc-halo: rgba(240,106,36,.5);

   /* signal lamps */
   --sc-gr: #3FB27C;
   --sc-gr-text: #7FD6AC;
   --sc-gr-tint: #1E3629;
   --sc-am: #E2AC2C;
   --sc-am-text: #EBC46A;
   --sc-am-tint: #3B2F15;
   --sc-re: #D9573F;
   --sc-re-text: #EF8D77;
   --sc-re-tint: #44221B;

   /* furniture */
   --sc-graticule: rgba(240,238,228,.05);
   --sc-graticule-major: rgba(240,238,228,.09);
   --sc-glass-edge: rgba(240,238,228,.07);
   --sc-vignette: rgba(0,0,0,.28);       /* light pools centre stage, falls off at the housing */

   /* shadows */
   --sc-lift: 0 1px 0 rgba(255,252,245,.06) inset, 0 14px 32px -20px rgba(0,0,0,.85);
   --sc-inset: inset 0 2px 6px rgba(0,0,0,.5);
}

/*
 * Chrome seam: a dark figure's caption bar, controls and border (lts-scene.css)
 * read var(--in-*), so re-scope just those variables INSIDE the dark figure and
 * the chrome flips without a single chrome rule being rewritten. Fonts are left
 * alone (family lists are theme-neutral). Scoped to .lts-scene so nothing outside
 * the figure changes - the page around it stays the Instrument's daylight panel.
 * NOT scraped by build-tokens.mjs (it only reads the two --sc-* blocks above).
 */
.lts-scene[data-scene-theme="dark"] {
   --in-panel: #2E2A26;      /* button faces */
   --in-well: #24211E;       /* the chrome bar */
   --in-hairline: #3A342E;   /* border + dividers */
   --in-ink: #F0EEE4;
   --in-ink2: #C9C4B6;       /* live caption */
   --in-ink3: #9A9488;       /* step count */
   --in-orange: #F06A24;     /* hover accents + autoplay progress */
   --in-lift: 0 1px 0 rgba(255,252,245,.06) inset, 0 14px 32px -20px rgba(0,0,0,.85);
}
