/* IGW Contrast 0.1.0 — forced colours and a stronger-contrast preference, site-wide.
 *
 * Copyright © 2026 Interstellar Gateway. All rights reserved.
 *
 * Two media preferences the site never answered (access audit 2026-09-04,
 * "prefers-contrast and forced colours": no rule for either anywhere). One
 * sheet, loaded last in the site footer so it outranks every module sheet,
 * with an `html` prefix on each selector so it wins on specificity where a
 * page sheet loads after it.
 *
 * FORCED COLOURS (Windows contrast themes, Chromium's forced-colors)
 * The system chooses the palette and forces color, background-color and
 * border-color on every element. What it cannot do, this sheet does:
 *   - the Mission Control kicker painted only the tops of its glyphs: a
 *     later, positioned box in the same hero, transparent in IGW's palette,
 *     is opaque Canvas under forced colours and paints over the in-flow
 *     kicker (measured 2026-09-09 at 3x: the fill colour was suspected first
 *     and ruled out, since no Designer style sets one and Chromium resolves
 *     currentColor in that property against the unforced colour anyway);
 *     the kicker now stacks above it;
 *   - the brand mark is a white lockup, invisible on a white Canvas; the
 *     brand link keeps its own dark tile, which is allowed for a mark;
 *   - a control whose only boundary was a background wash or a hover has no
 *     boundary once backgrounds are the system's; those get a system border;
 *   - a pressed, selected or current state that was an accent wash gets the
 *     system's highlight as an inset outline;
 *   - the notice-kind swatches and the timeline dots carry meaning by colour
 *     (every one also carries a word), so they keep their colour;
 *   - the instruments (globes, the notices map, the Starship model) draw
 *     their own pixels and keep the dark palette; each gets the system's
 *     frame so it reads as an instrument on the system ground;
 *   - text laid over the globe on a translucent scrim sits on an opaque
 *     system ground instead; the notice-card overlay is opaque.
 *
 * MORE CONTRAST (prefers-contrast: more)
 * The palette stays IGW's. The secondary greys, which measure between 4.65
 * and 6.9 to 1 on the site's grounds (62 colour/class pairs across twelve
 * routes, measured 2026-09-09), rise to one grey that measures above 10:1 on
 * the darkest ground and above 8.5:1 on the raised panels; hairlines become
 * lines; dimmed states are dimmed less; the focus ring thickens. Done through
 * each module's own tokens where it has them, and by class where it does not.
 */

/* ------------------------------------------------------------ more contrast */
@media (prefers-contrast: more) {
  /* the modules' tokens */
  html .igwn { --n-muted: #CBD2D9; --n-cap: #BAC3CD; --n-hair: rgba(255,255,255,.32); --n-edge: rgba(255,255,255,.46); --n-edge-i: rgba(255,255,255,.72); --n-edge-h: #fff; }
  html .igw2-explore-hero, html [data-igw-module="mission-control"] { --mc-muted: #CBD2D9; --mc-cap: #BAC3CD; --mc-hair: rgba(255,255,255,.32); --mc-edge: rgba(255,255,255,.46); --mc-edge-i: rgba(255,255,255,.72); --mc-edge-h: #fff; }
  html .igwsky { --sky-muted: #CBD2D9; --sky-cap: #BAC3CD; --sky-hair: rgba(255,255,255,.32); --sky-edge: rgba(255,255,255,.46); --sky-edge-i: rgba(255,255,255,.72); --sky-edge-h: #fff; }
  html [data-igw-reference], html [data-igw-reference-slot] { --ref-muted: #CBD2D9; --ref-cap: #BAC3CD; --ref-hair: rgba(255,255,255,.32); --ref-edge: rgba(255,255,255,.46); --ref-edge-i: rgba(255,255,255,.72); --ref-edge-h: #fff; }
  html [data-igw-module="starbase-closures"] { --sb-muted: #CBD2D9; --sb-cap: #BAC3CD; --sb-hair: rgba(255,255,255,.32); --sb-edge: rgba(255,255,255,.46); --sb-edge-i: rgba(255,255,255,.72); --sb-edge-h: #fff; }
  /* the Designer's greys, the modules that set a grey by class, and the site
     footer block's !important greys (which this sheet, loading after it, outranks) */
  html .igw2-footer-meta, html .igw2-footer-label, html .igw2-footer-group-label, html .igw2-footer-copy,
  html .igw2-status-label, html .igw2-liveitem, html .igw2-starship-rail-label, html .igw2-still-note,
  html .igw2-utility-note, html [data-igw-hero-credit], html [data-igw-meta], html [data-igw-notice-geometry], html [data-igw-film-part="kicker"], html [data-igw-film-part="creator"], html [data-igw-film-part="context"],
  html .igwsf-pad, html .igwsf-approx, html .igwss3d-note,
  html .igwch-date, html .igwch-views, html .igwch-note,
  html .igwls-next-p, html .igwls-site, html .igwls-approx,
  html .igwvc-table em, html .igwvc-note,
  html .igwn-map .maplibregl-ctrl-attrib, html .igwn-map .maplibregl-ctrl-attrib a,
  html #igwmc dt, html #igwmc th, html #igwmc .igwmc-span, html #igwmc .igwmc-cd-none, html #igwmc .igwmc-tile-l,
  html .igwmc-asof, html .igwmc-as-of, html .igwmc-note, html .igwmc-foot, html .igwmc-table th { color: #BAC3CD !important; }
  /* dimmed states, dimmed less */
  html .igwn .igwn-chip[aria-pressed="false"] .igwn-sw { opacity: .7; }
  html .igwst .igwst-btn[aria-disabled="true"] { opacity: .7; }
  /* text over the live globe: brighter, on a denser scrim */
  html .igw2-earth-label, html .igw2-hero .igw2-eyebrow { color: #F5F5F5; background: rgba(4, 8, 12, .92); }
  /* the keyboard focus ring, thicker */
  html :focus-visible { outline-width: 3px; }
}

/* ----------------------------------------------------------- forced colours */
@media (forced-colors: active) {
  /* the kickers stack above the hero boxes that turn opaque */
  html .igw2-kicker, html .igw2-eyebrow { position: relative; z-index: 3; }
  /* the brand mark keeps its dark tile; a white lockup on a white Canvas is no mark at all */
  html a.igw2-brand { forced-color-adjust: none; background: #050505; }
  /* controls whose only boundary was a background or a hover */
  html .igwmc-mark, html .igw2-signup-submit, html .igwsky-row, html .igwn .igwn-row, html .igwmc-hbtn, html .igwsb-more { border: 1px solid ButtonText; }
  /* pressed, selected and current states that were an accent wash */
  html [aria-pressed="true"], html [aria-selected="true"], html [aria-current="true"], html [aria-current="page"] { outline: 2px solid Highlight; outline-offset: -2px; }
  /* colour that carries meaning keeps it; each of these also carries a word */
  html .igwn-sw, html .igwmc-mark-dot, html .igwsb-mark, html .igwsb-mark-derived { forced-color-adjust: none; }
  /* the instruments draw their own pixels; each gets the system's frame */
  html canvas, html .igwn-map .maplibregl-canvas { outline: 1px solid CanvasText; outline-offset: -1px; }
  /* text over the globe sits on the system ground, opaque */
  html .igw2-earth-label, html .igw2-hero .igw2-eyebrow { background: Canvas; color: CanvasText; border: 1px solid CanvasText; -webkit-backdrop-filter: none; backdrop-filter: none; }
  /* the notice-card overlay, opaque */
  html .igwn-dialog { background: Canvas; }
  /* the keyboard focus ring in the system's highlight */
  html :focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}
