/* ============================================================
   WOOD, WIRE & TONE — Design Tokens
   Stage / Smoke palette — v2.
   Charcoal stage, bone text, stage-cyan primary, magenta
   special-occasion accent. Reads as "venue with smoke and lights."
   ============================================================ */

:root {
  /* ---- Type scale (fluid, mobile-first) ---- */
  --text-xs:   clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl:  clamp(2.5rem, 1rem + 4vw, 5rem);

  /* ---- 4px spacing ---- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-7:  1.75rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* ---- Radius ---- */
  --radius-sm:   0.375rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-full: 9999px;

  /* ---- Motion ---- */
  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-reveal:      420ms cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- Content widths ---- */
  --content-narrow:  640px;
  --content-default: 960px;
  --content-wide:    1240px;

  /* ---- Fonts ---- */
  --font-display: 'Boska', 'Source Serif 4', Georgia, serif;
  --font-body:    'Satoshi', 'Inter', system-ui, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ============================================================
   DARK MODE — DEFAULT (signature look)
   Stage / Smoke — charcoal venue, stage cyan, smoke magenta, bone
   ============================================================ */
:root,
[data-theme='dark'] {
  /* Surfaces — venue charcoal & ash */
  --color-bg:               #0a0a0c;  /* coal black */
  --color-surface:          #15141a;  /* ash */
  --color-surface-2:        #1c1b22;  /* ash raised */
  --color-surface-offset:   #232229;  /* haze */
  --color-surface-offset-2: #2c2a32;
  --color-divider:          #1f1e25;
  --color-border:           #2a2730;
  --color-border-strong:    #3a3645;

  /* Text — bone white & smoke */
  --color-text:         #ecedf2;  /* bone */
  --color-text-muted:   #a4a3ad;  /* smoke */
  --color-text-faint:   #6a6975;
  --color-text-inverse: #0a0a0c;

  /* Primary accent — Stage Cyan (correct, primary CTAs, links) */
  --color-primary:           #4ec5d8;
  --color-primary-hover:     #6dd5e6;
  --color-primary-active:    #38a9bb;
  --color-primary-highlight: #1a3036;
  /* Legacy — several modules read --color-accent. Alias to primary so
     leaderboard rank, badge highlights, and admin chips inherit the
     stage palette instead of the brass fallback. */
  --color-accent:            #4ec5d8;

  /* Secondary accent — Smoke Magenta (toned for scale; grail / celebrate) */
  --color-secondary:           #c25aa0;
  --color-secondary-hover:     #d674b6;
  --color-secondary-highlight: #321c2a;

  /* Heritage red — errors, urgent, rare-tier callouts */
  --color-heritage-red:       #d65656;
  --color-heritage-red-hover: #e26b6b;

  /* Semantic */
  --color-success:           #5cc28d;
  --color-success-hover:     #74d2a0;
  --color-success-highlight: #18301f;
  --color-error:             #d65656;
  --color-error-hover:       #e26b6b;
  --color-error-highlight:   #2e1a1a;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 0 1px rgba(78, 197, 216, 0.4), 0 12px 32px rgba(78, 197, 216, 0.18);
}

/* ============================================================
   LIGHT MODE — daytime venue (paper-white with cool accents)
   ============================================================ */
[data-theme='light'] {
  --color-bg:               #f5f5f7;
  --color-surface:          #ffffff;
  --color-surface-2:        #fafafc;
  --color-surface-offset:   #ebebef;
  --color-surface-offset-2: #dcdce0;
  --color-divider:          #dcdce0;
  --color-border:           #c8c8d0;
  --color-border-strong:    #9d9da6;

  --color-text:         #15141a;
  --color-text-muted:   #5b5a64;
  --color-text-faint:   #8d8c97;
  --color-text-inverse: #ffffff;

  --color-primary:           #1a8a9d;
  --color-primary-hover:     #14707f;
  --color-primary-active:    #0e5663;
  --color-primary-highlight: #d6eef2;
  --color-accent:            #1a8a9d;

  --color-secondary:           #a13b80;
  --color-secondary-hover:     #832e67;
  --color-secondary-highlight: #f0d8e6;

  --color-heritage-red:       #b03a3a;
  --color-heritage-red-hover: #8c2828;

  --color-success:           #2f8a5a;
  --color-success-hover:     #226e47;
  --color-success-highlight: #d2ecdf;
  --color-error:             #b03a3a;
  --color-error-hover:       #8c2828;
  --color-error-highlight:   #f4d6d6;

  --shadow-sm: 0 1px 2px rgba(20, 20, 30, 0.06);
  --shadow-md: 0 6px 18px rgba(20, 20, 30, 0.08);
  --shadow-lg: 0 18px 48px rgba(20, 20, 30, 0.12);
  --shadow-glow: 0 0 0 1px rgba(26, 138, 157, 0.35), 0 12px 32px rgba(26, 138, 157, 0.18);
}
