/* Retenra v2 design tokens.
   Built for the ground up platform on the project directive
   palette: midnight navy carries the brand, primary teal is the
   interactive color, electric teal is the bright accent for
   progress and focus moments, and achievement gold is reserved
   for accomplishments and nothing else. Success, warning, and
   error stay semantic. Color never carries meaning alone; text
   labels stay. Light is the canonical theme on Ice White; the
   dark theme is a full second design on Midnight Navy, reached
   by the theme control or the operating system preference.
   Every variable name from the previous design system is kept,
   so the ported engines and components inherit the new identity
   without a single computation change. */

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Directive palette, canonical values */
  --midnight: #0B1426;
  --deep-navy: #111E33;
  --slate-navy: #192940;
  --teal-primary: #0D9488;
  --teal-electric: #2DD4BF;
  --ice: #F8FAFC;
  --slate-muted: #94A3B8;
  --gold: #F5C451;
  --success: #22C55E;
  --warning: #F59E0B;
  --coral: #F87171;

  /* Roles, light theme */
  --navy: #111E33;          /* primary navy (Deep Navy) */
  --navy-2: #192940;        /* secondary navy (Slate Navy) */
  --navy-3: #192940;
  --blue: #0D9488;          /* interactive color: Primary Teal */
  --blue-dark: #0F766E;
  --blue-soft: #E2F4F1;
  --teal: #0D9488;          /* secondary accent */
  --teal-soft: #E2F4F1;
  --ink: #0B1426;           /* primary text (Midnight Navy) */
  --bg: #F8FAFC;            /* main background (Ice White) */
  --surface: #FFFFFF;       /* elevated surface */
  --surface-2: #E9EFF5;
  --line: #D9E2EC;          /* border */
  --muted: #52657A;         /* secondary text, contrast safe on ice */
  --faint: #8496AB;
  --green: #22C55E;         /* success */
  --green-strong: #15803D;
  --green-soft: #E2F6E9;
  --red: #DE4B4B;           /* error coral, deepened for light contrast */
  --red-dark: #B33737;
  --red-soft: #FDECEC;
  --amber: #F59E0B;         /* warning */
  --amber-dark: #9A6B14;
  --amber-soft: #FBF0DA;

  /* Depth. Quiet at rest on the ice background, clearly lifted
     for overlays and the largest surfaces. */
  --elev-1: 0 1px 2px rgba(11, 20, 38, 0.05), 0 2px 6px rgba(11, 20, 38, 0.05);
  --elev-2: 0 6px 20px rgba(11, 20, 38, 0.10);
  --elev-3: 0 10px 28px rgba(11, 20, 38, 0.12), 0 4px 10px rgba(11, 20, 38, 0.06);
  --elev-4: 0 18px 44px rgba(11, 20, 38, 0.14);
  --shadow-sm: var(--elev-2);
  --shadow: var(--elev-4);

  /* Gradients. Navy surfaces fall from Slate Navy into Midnight;
     progress fills run from Primary Teal into Electric Teal. */
  --grad-navy: linear-gradient(155deg, #192940 0%, #0B1426 72%);
  --grad-progress: linear-gradient(90deg, #0D9488, #2DD4BF);

  /* Glow. A soft teal halo for primary actions and focus. */
  --glow-primary: 0 8px 22px rgba(13, 148, 136, 0.32);
  --glow-primary-hover: 0 10px 26px rgba(13, 148, 136, 0.40);
  --glow-focus: 0 0 0 4px rgba(45, 212, 191, 0.28);

  /* Type. Inter throughout, self hosted. Heaviest weight 800. */
  --font: "Inter", system-ui, sans-serif;
  --text-caption: 0.72rem;
  --text-small: 0.85rem;
  --text-body: 0.95rem;
  --text-body-lg: 1.05rem;
  --text-h3: 1.2rem;
  --text-h2: 1.5rem;
  --text-display: 1.9rem;
  --leading-body: 1.55;
  --leading-tight: 1.2;

  /* Spacing. 4 point base. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-9: 36px;
  --space-12: 48px;

  /* Shape. */
  --radius-xs: 8px;
  --radius-sm: 14px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  /* Achievement accent. Directive gold, reserved for ranks,
     unlocked achievements, and celebrations. */
  --achievement: #F5C451;
  --achievement-soft: #FBF0D2;

  /* Touch */
  --tap-min: 44px;
}

/* Dark theme values, shared by the explicit theme and the OS
   preference fallback below. */
[data-theme="dark"] {
  --ink: #F8FAFC;
  --bg: #0B1426;
  --surface: #111E33;
  --surface-2: #192940;
  --line: #22344F;
  --muted: #94A3B8;
  --faint: #6E8098;
  --green-strong: #4ADE80;
  --green-soft: #0E2F26;
  --red: #F87171;
  --red-dark: #FCA5A5;
  --red-soft: #3D1418;
  --blue-soft: #0C2B33;
  --teal-soft: #0C2B33;
  --amber-soft: #2E2410;
  --achievement-soft: #2E2410;
  --elev-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
  --elev-2: 0 6px 20px rgba(0, 0, 0, 0.4);
  --elev-3: 0 10px 28px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.35);
  --elev-4: 0 18px 44px rgba(0, 0, 0, 0.5);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F8FAFC;
    --bg: #0B1426;
    --surface: #111E33;
    --surface-2: #192940;
    --line: #22344F;
    --muted: #94A3B8;
    --faint: #6E8098;
    --green-strong: #4ADE80;
    --green-soft: #0E2F26;
    --red: #F87171;
    --red-dark: #FCA5A5;
    --red-soft: #3D1418;
    --blue-soft: #0C2B33;
    --teal-soft: #0C2B33;
    --amber-soft: #2E2410;
    --achievement-soft: #2E2410;
    --elev-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
    --elev-2: 0 6px 20px rgba(0, 0, 0, 0.4);
    --elev-3: 0 10px 28px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.35);
    --elev-4: 0 18px 44px rgba(0, 0, 0, 0.5);
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.4);
  }
}
