/* ============================================================
   EOD Design Tokens
   Source of truth: brand/DESIGN.md
   Drop this file into the app and reference tokens only.
   Never hardcode hex values in components.
   ============================================================ */

:root {
  /* ---- Core neutrals ---- */
  --eod-nightfall: #16211B;   /* ink. green-black, never pure #000 */
  --eod-chalk:     #F5F1E6;   /* paper. light surface, Cloud Dancer register */
  --eod-plytop:    #D9C79E;   /* light wood. secondary surface, table texture */
  --eod-barrel:    #8A6238;   /* dark wood. borders on wood, small accents */

  /* ---- Terrain (muted by rule: terrain recedes) ---- */
  --eod-field:     #4A7444;   /* land hex */
  --eod-deepwater: #27607A;   /* water hex */
  --eod-ridge:     #7C7666;   /* stone or neutral hex, also disabled states */

  /* ---- Factions (vivid by rule: pieces advance) ----
     CVD-checked set anchored on Okabe-Ito and Tol vibrant.
     Always pair faction color with its glyph. Color alone
     never carries ownership information. */
  --eod-ember:  #CC3311;      /* red faction */
  --eod-gold:   #E8B008;      /* yellow faction */
  --eod-cobalt: #0072B2;      /* blue faction */
  --eod-sedge:  #009E73;      /* green faction */

  /* ---- Faction ink variants (text-safe on chalk, >= 4.5:1) ---- */
  --eod-ember-ink:  #B8300F;
  --eod-gold-ink:   #876704;
  --eod-cobalt-ink: #005E94;
  --eod-sedge-ink:  #007C5A;

  /* ---- Semantic aliases (always icon + text, never color alone) ---- */
  --eod-success: var(--eod-sedge-ink);
  --eod-warning: var(--eod-gold-ink);
  --eod-danger:  var(--eod-ember-ink);
  --eod-info:    var(--eod-cobalt-ink);

  /* ---- Surfaces and text (light theme default) ---- */
  --eod-surface:        var(--eod-chalk);
  --eod-surface-raised: #FFFCF4;
  --eod-surface-sunken: #EAE4D4;
  --eod-text:           var(--eod-nightfall);
  --eod-text-muted:     #4C574F;
  --eod-border:         #C9C2B0;
  --eod-focus:          var(--eod-cobalt);

  /* ---- Type ---- */
  --eod-font-display: "Chakra Petch", "Segoe UI", sans-serif;
  --eod-font-body: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --eod-font-mono: "JetBrains Mono", ui-monospace, monospace;

  --eod-size-hero: clamp(2.2rem, 6vw, 3.4rem);
  --eod-size-h1: 1.75rem;
  --eod-size-h2: 1.35rem;
  --eod-size-h3: 1.1rem;
  --eod-size-body: 1rem;      /* 16px minimum, rulebook readability */
  --eod-size-small: 0.875rem;
  --eod-lh-body: 1.55;
  --eod-lh-tight: 1.15;
  --eod-tracking-display: 0.04em;
  --eod-tracking-label: 0.12em;

  /* ---- Space (4px base) ---- */
  --eod-space-1: 4px;
  --eod-space-2: 8px;
  --eod-space-3: 12px;
  --eod-space-4: 16px;
  --eod-space-5: 24px;
  --eod-space-6: 32px;
  --eod-space-7: 48px;

  /* ---- Shape ---- */
  --eod-radius: 6px;          /* chamfered feel, keep tight */
  --eod-radius-lg: 12px;
  --eod-hex-stroke: 2px;

  /* ---- Elevation (flat brand: shadows stay quiet) ---- */
  --eod-shadow: 0 1px 3px rgba(22, 33, 27, 0.18);
  --eod-shadow-raised: 0 4px 14px rgba(22, 33, 27, 0.22);

  /* ---- Motion (fast, physical, no bounce) ---- */
  --eod-ease: cubic-bezier(0.2, 0, 0, 1);
  --eod-dur-fast: 120ms;
  --eod-dur-base: 200ms;
}

/* ---- Dark theme: table at night ---- */
[data-theme="dark"] {
  --eod-surface:        #101914;
  --eod-surface-raised: #182420;
  --eod-surface-sunken: #0B120E;
  --eod-text:           var(--eod-chalk);
  --eod-text-muted:     #A9B3AB;
  --eod-border:         #2C3A31;

  /* On dark, vivid faction colors are already text-safe except
     Ember and Cobalt at small sizes; use them at 700+ weight or 18px+. */
  --eod-success: var(--eod-sedge);
  --eod-warning: var(--eod-gold);
  --eod-danger:  #E85C3A;    /* ember lifted for dark surfaces */
  --eod-info:    #3D9AD1;    /* cobalt lifted for dark surfaces */
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --eod-dur-fast: 0ms;
    --eod-dur-base: 0ms;
  }
}
