/* ==========================================================================
   Scoriko Global Design Tokens — White-Label Ready Single Source of Truth
   --------------------------------------------------------------------------
   To rebrand for any institution or custom domain, override ONLY the --brand-*
   and --font-* variables below (or configure them in theme.config.js).
   Every button, card, pill, chart, active tab, and focus ring inherits from
   these tokens automatically across Light Mode, Dark Mode, Mobile & Desktop.
   ========================================================================== */

:root {
  /* ------------------------------------------------------------------------
     1. Brand Palette (Default Tenant: Scoriko — Deep Ocean Blue)
     ------------------------------------------------------------------------ */
  --brand-primary: #0c4a6e;           /* Deep Ocean Blue — primary CTAs, active tabs, logo */
  --brand-primary-hover: #08334e;     /* Abyssal Ocean — hover & pressed primary state */
  --brand-accent: #0284c7;            /* Ocean Sky — progress bars, links, secondary highlight */
  --brand-accent-soft: #38bdf8;       /* Bright Sky — focus rings & chart highlights */
  --brand-tint: #ecf8ff;              /* Ice Ocean — active card fills, soft badges */
  --brand-soft: rgba(12, 74, 110, 0.10);
  --brand-border: #bae2f8;            /* Crisp Ocean Border — selected cards & soft pills */
  --brand-ink: #0a3d5c;               /* Deep Ocean Ink — text on --brand-tint surfaces */
  --brand-contrast: #ffffff;          /* Text/icons on --brand-primary surfaces */

  /* Secondary Tonal Variations (for multi-track pillars — all harmonious blues) */
  --tone-steel-bg: #eef3f9;
  --tone-steel-border: #cfdceb;
  --tone-steel-ink: #1e4b7a;

  --tone-sky-bg: #eef7fb;
  --tone-sky-border: #c9e2ef;
  --tone-sky-ink: #0f5c82;

  /* ------------------------------------------------------------------------
     2. Neutral Surface & Text Scale (Light Mode Default)
     ------------------------------------------------------------------------ */
  --bg: #ffffff;
  --bg-canvas: #f7f9fc;
  --bg-subtle: #eff4fa;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --border: #e1e8f0;
  --border-strong: #c5d3e3;

  --text: #0b192c;                    /* Deep Navy Ink — high-contrast readable headings & body */
  --text-secondary: #43566e;          /* Slate Navy — subtitles, metadata, explanations */
  --text-muted: #647891;              /* Muted Slate — captions, timestamps, placeholders */

  /* ------------------------------------------------------------------------
     3. Semantic Status Colors (Independent of Brand Theme)
     ------------------------------------------------------------------------ */
  --status-success: #0f766e;          /* Deep Teal-Green — strictly for correct answers (+1.00) */
  --status-success-tint: #ecfdf8;
  --status-success-border: #a7e3d6;
  --status-success-contrast: #ffffff;

  --status-warning: #b45309;          /* Accessible Deep Amber — >= 4.5:1 contrast with white */
  --status-warning-tint: #fff8eb;
  --status-warning-border: #f7d89c;
  --status-warning-ink: #92400e;
  --status-warning-contrast: #ffffff;

  --status-danger: #dc2626;           /* Crisp Crimson — wrong answers (-0.33) & low-time alerts */
  --status-danger-tint: #fef2f2;
  --status-danger-border: #fecaca;
  --status-danger-contrast: #ffffff;

  --medal-gold: #b45309;
  --medal-silver: #475569;
  --medal-bronze: #9a3412;
  --scrim: rgba(11, 25, 44, 0.56);
  --shadow-top: 0 -8px 24px rgba(11, 25, 44, 0.08);

  /* ------------------------------------------------------------------------
     4. Unified Typography Scale (Consistent Single Sans + Tabular Figures)
     ------------------------------------------------------------------------ */
  --font-sans: 'Plus Jakarta Sans', 'Noto Sans Malayalam', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: var(--font-sans);
  --font-body: var(--font-sans);
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --text-xs: 0.75rem;                 /* 12px */
  --text-sm: 0.84rem;                 /* 13.5px */
  --text-base: 0.94rem;               /* 15px */
  --text-md: 1.04rem;                 /* 16.5px */
  --text-lg: 1.2rem;                  /* 19px */
  --text-xl: 1.5rem;                  /* 24px */
  --text-2xl: 2rem;                   /* 32px */
  --text-3xl: clamp(2.1rem, 4vw, 3.15rem);

  --tracking-tight: -0.025em;
  --tracking-display: -0.03em;

  /* ------------------------------------------------------------------------
     5. Shape, Spacing & Elevation Grammar
     ------------------------------------------------------------------------ */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 2px rgba(11, 25, 44, 0.04);
  --shadow-sm: 0 4px 12px -2px rgba(11, 25, 44, 0.06), 0 1px 2px rgba(11, 25, 44, 0.04);
  --shadow-md: 0 14px 32px -8px rgba(11, 25, 44, 0.10), 0 4px 12px -4px rgba(11, 25, 44, 0.04);
  --shadow-lg: 0 24px 48px -12px rgba(11, 25, 44, 0.16);
}

/* ==========================================================================
   Dark Mode Token Parity (Deep Abyssal Marine)
   ========================================================================== */
[data-mode="dark"] {
  --brand-primary: #38bdf8;
  --brand-primary-hover: #7dd3fc;
  --brand-accent: #38bdf8;
  --brand-accent-soft: #bae6fd;
  --brand-tint: rgba(56, 189, 248, 0.16);
  --brand-soft: rgba(56, 189, 248, 0.22);
  --brand-border: rgba(56, 189, 248, 0.35);
  --brand-ink: #bae6fd;
  --brand-contrast: #051e2c;

  --tone-steel-bg: rgba(59, 130, 246, 0.11);
  --tone-steel-border: rgba(96, 165, 250, 0.22);
  --tone-steel-ink: #93c5fd;

  --tone-sky-bg: rgba(14, 165, 233, 0.13);
  --tone-sky-border: rgba(56, 189, 248, 0.26);
  --tone-sky-ink: #7dd3fc;

  --bg: #07101d;
  --bg-canvas: #091423;
  --bg-subtle: #0f1f36;
  --surface: #0e1c30;
  --surface-elevated: #142640;
  --border: #1e3554;
  --border-strong: #2d4b73;

  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #8ea3be;

  --status-success: #2dd4bf;
  --status-success-tint: rgba(45, 212, 191, 0.14);
  --status-success-border: rgba(45, 212, 191, 0.32);
  --status-success-contrast: #042f2e;

  --status-warning: #f59e0b;
  --status-warning-tint: rgba(245, 158, 11, 0.15);
  --status-warning-border: rgba(245, 158, 11, 0.35);
  --status-warning-ink: #fcd34d;
  --status-warning-contrast: #1c1002;

  --status-danger: #f87171;
  --status-danger-tint: rgba(248, 113, 113, 0.16);
  --status-danger-border: rgba(248, 113, 113, 0.34);
  --status-danger-contrast: #2c0707;

  --medal-gold: #fbbf24;
  --medal-silver: #cbd5e1;
  --medal-bronze: #fdba74;
  --scrim: rgba(2, 6, 14, 0.76);
  --shadow-top: 0 -8px 24px rgba(0, 0, 0, 0.45);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 6px 16px -4px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 16px 36px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 28px 56px -14px rgba(0, 0, 0, 0.72);
}
