/* ============================================================================
   doshaven.com — Design tokens (single source of truth)
   ----------------------------------------------------------------------------
   Visual direction: retro-futurism + Fallout vault terminal.
   Editing this file = changing the look of the whole site. Both pages
   (index.html / game.html) link only to this file plus site.css; component
   styles live in site.css. Hard-coding colors / sizes / fonts in HTML is
   not allowed.

   Design principles:
     · Dark base + amber phosphor monochrome; green only for status,
       red only for alerts
     · Structure is expressed with panels + brackets + rules — not with
       rounded corners or soft shadows
     · Retro but not actually old: terminal monospace + modern typographic
       rhythm + a few hazard stripes
     · Tokens come in three layers: raw palette → semantic → components
   ========================================================================== */

:root {
  /* --------------------------------------------------------------------------
     1. Spacing scale (4px grid)
     -------------------------------------------------------------------------- */
  --px: 4px;

  --sp-1: calc(var(--px) * 1);                 /*  4px */
  --sp-2: calc(var(--px) * 2);                 /*  8px */
  --sp-3: calc(var(--px) * 3);                 /* 12px */
  --sp-4: calc(var(--px) * 4);                 /* 16px */
  --sp-5: calc(var(--px) * 5);                 /* 20px */
  --sp-6: calc(var(--px) * 6);                 /* 24px */
  --sp-8: calc(var(--px) * 8);                 /* 32px */
  --sp-10: calc(var(--px) * 10);               /* 40px */
  --sp-12: calc(var(--px) * 12);               /* 48px */
  --sp-16: calc(var(--px) * 16);               /* 64px */

  /* --------------------------------------------------------------------------
     2. Raw palette — "Vault Terminal"
        Real hex values appear only in this layer; components use semantics.
     -------------------------------------------------------------------------- */
  --vault-void:      #0a0906;   /* page base: warm near-black */
  --vault-panel:     #12100b;   /* panel surface */
  --vault-panel-2:   #191610;   /* raised surface (cards / strips) */
  --vault-screen:    #080704;   /* CRT screen well */
  --vault-black:     #000000;   /* pure black (edges / shadows) */

  --vault-amber:     #ffb000;   /* primary phosphor: terminal main color */
  --vault-amber-hi:  #ffd166;   /* bright amber: headings / focus */
  --vault-amber-dim: #8a5f00;   /* dim amber: secondary emphasis */
  --vault-amber-mid: #a87800;   /* mid amber: brackets / dividers */

  --vault-green:     #9ee34b;   /* status OK */
  --vault-red:       #ff5a3c;   /* alert / HOT */

  --vault-ink:       #e6d8ba;   /* body text (warm white, readability first) */
  --vault-ink-hi:    #ffe7bd;   /* headings / emphasized text */
  --vault-ink-dim:   #a2916a;   /* secondary text */
  --vault-ink-faint: #6b5f45;   /* faint text (placeholders, notes) */

  --vault-edge:      #3d3218;   /* panel border */
  --vault-edge-soft: #241d10;   /* softer divider */

  /* --------------------------------------------------------------------------
     3. Semantic colors — components use only this layer
     -------------------------------------------------------------------------- */
  --bg-desktop:      var(--vault-void);      /* page base (sticky top bar must use this) */
  --bg-panel:        var(--vault-panel);     /* panel surface */
  --bg-panel-raised: var(--vault-panel-2);   /* raised surface */
  --bg-screen:       var(--vault-screen);    /* screen well */
  --bg-inset:        #060503;                /* inset slot (forms / progress bars) */

  --text-strong:     var(--vault-ink-hi);
  --text-body:       var(--vault-ink);
  --text-muted:      var(--vault-ink-dim);
  --text-faint:      var(--vault-ink-faint);

  --text-accent:     var(--vault-amber);     /* primary terminal text color */
  --text-accent-hi:  var(--vault-amber-hi);
  --text-ok:         var(--vault-green);
  --text-alert:      var(--vault-red);

  --accent:          var(--vault-amber);
  --accent-hi:       var(--vault-amber-hi);
  --accent-dim:      var(--vault-amber-mid);

  --edge:            var(--vault-edge);      /* panel border */
  --edge-soft:       var(--vault-edge-soft); /* divider */
  --edge-strong:     var(--vault-amber-mid); /* brackets / emphasis border */

  --btn-text:        var(--vault-amber);
  --btn-text-on:     var(--vault-void);      /* text on amber fills */
  --btn-face:        transparent;
  --btn-face-hover:  var(--vault-amber);

  --link:            var(--vault-amber);
  --link-hover:      var(--vault-amber-hi);

  --focus:           var(--vault-amber-hi);  /* focus ring */

  /* Translucent overlays (no color literals in site.css) */
  --tint-amber:      rgba(255, 176, 0, 0.08);
  --tint-amber-mid:  rgba(255, 176, 0, 0.16);
  --tint-amber-hard: rgba(255, 176, 0, 0.30);
  --tint-black:      rgba(0, 0, 0, 0.55);
  --tint-black-hard: rgba(0, 0, 0, 0.78);
  --screen-fade:     rgba(0, 0, 0, 0.92);

  /* --------------------------------------------------------------------------
     4. Font stacks — terminal monospace + geometric display
        All Latin glyphs (the site UI is English); system fallbacks keep it
        readable offline.
     -------------------------------------------------------------------------- */
  /* Display: brand, headings, buttons — angular sci-fi geometry */
  --font-display: "Oxanium", "Avenir Next Condensed", "Helvetica Neue", system-ui, sans-serif;
  /* Terminal monospace: body, labels, metadata */
  --font-mono: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --fs-display: clamp(30px, 7vw, 52px);
  --fs-h1: clamp(24px, 4.6vw, 34px);
  --fs-h2: 22px;
  --fs-h3: 17px;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-tiny: 11px;
  --fs-label: 12px;

  --lh-tight: 1.15;
  --lh-body: 1.72;

  --ls-wide: 0.18em;    /* letter-spacing for terminal labels */
  --ls-mid: 0.08em;

  /* --------------------------------------------------------------------------
     5. Borders / shadows
     -------------------------------------------------------------------------- */
  --bw: 1px;                 /* standard border */
  --bw-strong: 2px;          /* emphasis border / buttons */
  --radius: 0px;             /* terminals have no rounded corners */
  --radius-pill: 999px;      /* only for genuinely round elements like status dots */

  --shadow-hard: 4px 4px 0 var(--vault-black);   /* hard shadow (no blur) */
  --shadow-hard-sm: 2px 2px 0 var(--vault-black);
  --shadow-glow: 0 0 18px rgba(255, 176, 0, 0.12); /* in-screen glow */

  /* Panel brackets (L-shaped corners) for key "device panel" blocks */
  --bracket-size: 14px;
  --bracket-corners:
    linear-gradient(var(--edge-strong), var(--edge-strong)) left top / var(--bracket-size) var(--bw) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) left top / var(--bw) var(--bracket-size) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) right top / var(--bracket-size) var(--bw) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) right top / var(--bw) var(--bracket-size) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) left bottom / var(--bracket-size) var(--bw) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) left bottom / var(--bw) var(--bracket-size) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) right bottom / var(--bracket-size) var(--bw) no-repeat,
    linear-gradient(var(--edge-strong), var(--edge-strong)) right bottom / var(--bw) var(--bracket-size) no-repeat;

  /* Hazard stripes (Vault-Tec style), decoration only — never carries meaning */
  --hazard: repeating-linear-gradient(
    45deg,
    var(--vault-amber) 0 6px,
    transparent 6px 12px
  );

  /* --------------------------------------------------------------------------
     6. z-index layers
     -------------------------------------------------------------------------- */
  --z-window: 1;      /* panels / cards */
  --z-chrome: 10;     /* sticky top bar */
  --z-vignette: 38;   /* CRT vignette */
  --z-scanlines: 40;  /* CRT scanlines */
  --z-skip: 60;       /* skip link */

  /* --------------------------------------------------------------------------
     7. Focus state
     -------------------------------------------------------------------------- */
  --focus-outline: 2px solid var(--focus);
  --focus-offset: 2px;

  /* --------------------------------------------------------------------------
     8. Layout & breakpoints
     -------------------------------------------------------------------------- */
  --layout-max: 1180px;
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1180px;

  /* --------------------------------------------------------------------------
     9. CRT layer — ON by default (the vault terminal is the core of this look)
        Toggled via body.crt in site.js; state in localStorage: doshaven:crt = '1' | '0'
     -------------------------------------------------------------------------- */
  --crt-scan-alpha: 0.16;      /* scanline opacity */
  --crt-vignette-alpha: 0.42;  /* vignette opacity */
  --crt-glow: 0 0 6px rgba(255, 176, 0, 0.55), 0 0 14px rgba(255, 176, 0, 0.25);
  --crt-glow-soft: 0 0 4px rgba(255, 176, 0, 0.45);
  --crt-scan-line: rgba(0, 0, 0, var(--crt-scan-alpha));
  --crt-vignette: rgba(0, 0, 0, var(--crt-vignette-alpha));
}

/* --------------------------------------------------------------------------
   10. Accessibility fallbacks
   -------------------------------------------------------------------------- */

/* Reduced motion: no looping animations at all, fainter scanlines */
@media (prefers-reduced-motion: reduce) {
  :root {
    --crt-scan-alpha: 0.10;
    --crt-vignette-alpha: 0.26;
  }
}

/* High contrast: zero out scanlines and glow entirely instead of painting a
   fully transparent layer, and brighten panel borders to amber */
@media (prefers-contrast: more) {
  :root {
    --crt-scan-alpha: 0;
    --crt-vignette-alpha: 0;
    --crt-glow: none;
    --crt-glow-soft: none;
    --edge: var(--vault-amber-dim);
    --edge-strong: var(--vault-amber);
  }
}
