/* RAGNAR — Nordic dawn vault.
   Lit slate-fjord navy · frost type · glacier ice · warm brass.
   Broadcast = :root; marketplace utility = .theme-utility */

:root {
  color-scheme: dark;

  /* Surfaces — lit Nordic slate (not near-black) */
  --color-bg-base: #1a2d42;
  --color-bg-mid: #243d56;
  --color-bg-lit: #2f4d68;
  --color-bg-elevated: #2a4158;
  --color-bg-panel: #324d66;
  --color-bg-panel-strong: #3a5872;
  --color-bg-glass: rgba(42, 65, 88, 0.72);
  --color-bg-glass-soft: rgba(38, 58, 78, 0.55);
  --color-bg-input: #2a4158;
  --color-bg-overlay: rgba(22, 36, 52, 0.65);
  --color-surface-deep: #152536;
  --color-bg-gradient: linear-gradient(
    165deg,
    #3a5f7d 0%,
    var(--color-bg-mid) 38%,
    var(--color-bg-base) 100%
  );

  /* Frost text — high contrast on lit surfaces */
  --color-text-primary: #f4f8fb;
  --color-text-secondary: #c5d4e2;
  --color-text-muted: #9eb3c7;
  --color-text-subtle: #849ab0;
  --color-text-disabled: #6a8094;
  --color-on-accent: #0f2433;
  --color-on-gold: #1f1608;
  --color-on-danger: #1a0808;

  /* Nordic brand */
  --color-accent-primary: #8ecae6;
  --color-accent-primary-strong: #b8dff0;
  --color-accent-gold: #d4a574;
  --color-accent-gold-strong: #e4bb8a;
  --color-accent-secondary: #a8bcc9;
  --color-accent-fallback: #6a9eb8;
  --color-glacier: #7eb8d4;
  --color-frost: #f8fbfd;
  --color-titanium: #b0c4d4;
  --color-crystal: #d4eaf5;
  --color-midnight: #152536;
  --color-ice-deep: #2a5068;
  --color-arctic: #1e3850;
  --color-birch: #e8eef3;

  --color-live: var(--color-accent-gold);
  --color-success: #6bc9a8;
  --color-warning: #d4b87a;
  --color-error: #e88a8e;
  --color-info: #9ed4f0;

  --color-border-subtle: rgba(212, 234, 245, 0.16);
  --color-border-default: rgba(212, 234, 245, 0.28);
  --color-border-strong: rgba(212, 180, 130, 0.42);
  --color-border-gold: rgba(212, 165, 116, 0.5);
  --color-focus: var(--color-accent-primary);
  --color-hover-surface: rgba(142, 202, 230, 0.12);
  --color-active-surface: rgba(142, 202, 230, 0.18);
  --color-disabled-surface: rgba(212, 234, 245, 0.06);

  --font-display: "Space Grotesk", "Helvetica Neue", system-ui, sans-serif;
  --font-body: "Inter", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: clamp(26px, 3.2vw, 32px);
  --text-3xl: clamp(34px, 4.5vw, 44px);
  --text-4xl: clamp(42px, 6vw, 64px);
  --leading-tight: 1.08;
  --leading-snug: 1.28;
  --leading-body: 1.62;
  --tracking-tight: -0.02em;
  --tracking-display: -0.025em;
  --tracking-label: 0.14em;
  --tracking-rune: 0.22em;

  --space-page-x: clamp(22px, 5vw, 52px);
  --space-page-y: clamp(32px, 5vw, 60px);
  --content-max: 1200px;
  --content-narrow: 720px;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(15, 28, 42, 0.2), 0 1px 2px rgba(15, 28, 42, 0.12);
  --shadow-md: 0 10px 28px rgba(15, 28, 42, 0.22);
  --shadow-lg: 0 20px 48px rgba(15, 28, 42, 0.28);
  --shadow-focus: 0 0 0 3px rgba(142, 202, 230, 0.35);
  --glow-ice: 0 0 32px rgba(142, 202, 230, 0.2);
  --glow-crystal: 0 0 48px rgba(184, 223, 240, 0.14);
  --glow-gold: 0 0 28px rgba(212, 165, 116, 0.25);

  --card-foil: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(212, 165, 116, 0.1) 24%,
    rgba(142, 202, 230, 0.12) 48%,
    rgba(255, 255, 255, 0.06) 72%,
    rgba(212, 165, 116, 0.08) 100%
  );
  --card-surface: linear-gradient(155deg, var(--color-bg-panel-strong), var(--color-bg-mid) 70%);
  --card-surface-live: linear-gradient(155deg, #3d6280 0%, var(--color-bg-mid) 55%, var(--color-bg-base) 100%);
  --card-surface-archive: linear-gradient(165deg, #3a5872 0%, #2a4158 50%, var(--color-bg-base) 100%);

  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 110ms;
  --duration-medium: 220ms;
  --duration-slow: 480ms;

  --crest-primary: #b0c4d4;
  --crest-accent: var(--color-accent-primary);
  --moment-fallback: var(--card-surface-archive);
  --store-accent: var(--color-accent-primary);

  --bg: var(--color-bg-base);
  --bg-2: var(--color-bg-elevated);
  --panel: var(--color-bg-glass);
  --panel-solid: var(--color-bg-panel);
  --border: var(--color-border-subtle);
  --border-strong: var(--color-border-default);
  --text: var(--color-text-primary);
  --text-soft: var(--color-text-secondary);
  --muted: var(--color-text-muted);
  --steel: var(--color-text-secondary);
  --ice: var(--color-accent-primary);
  --ice-strong: var(--color-accent-primary-strong);
  --gold: var(--color-accent-gold);
  --danger: var(--color-error);
  --ok: var(--color-success);
  --shadow: var(--shadow-md);
  --radius: var(--radius-md);
}

/* Nordic utility — birch & slate for reading */
.theme-utility {
  color-scheme: light;

  --color-bg-base: #eef2f6;
  --color-bg-mid: #e4eaf0;
  --color-bg-lit: #f8fafc;
  --color-bg-elevated: #ffffff;
  --color-bg-panel: #ffffff;
  --color-bg-panel-strong: #f4f7fa;
  --color-bg-glass: rgba(255, 255, 255, 0.94);
  --color-bg-glass-soft: rgba(248, 250, 252, 0.96);
  --color-bg-input: #ffffff;
  --color-bg-overlay: rgba(26, 45, 66, 0.4);
  --color-surface-deep: #dce4ec;

  --color-text-primary: #1a2d42;
  --color-text-secondary: #3d5266;
  --color-text-muted: #5c7084;
  --color-text-subtle: #7a8d9f;

  --color-border-subtle: rgba(26, 45, 66, 0.1);
  --color-border-default: rgba(26, 45, 66, 0.14);
  --color-border-strong: rgba(26, 45, 66, 0.2);

  --color-accent-primary: #2b6cb0;
  --color-accent-primary-strong: #1e5590;
  --color-accent-gold: #b8863a;

  --shadow-sm: 0 1px 3px rgba(26, 45, 66, 0.06), 0 4px 12px rgba(26, 45, 66, 0.04);
  --shadow-md: 0 8px 24px rgba(26, 45, 66, 0.08);
  --shadow-lg: 0 16px 40px rgba(26, 45, 66, 0.1);
  --shadow-focus: 0 0 0 3px rgba(43, 108, 176, 0.22);
  --glow-ice: 0 4px 16px rgba(43, 108, 176, 0.12);

  --card-surface: linear-gradient(165deg, #ffffff, #eef2f6);
  --card-foil: linear-gradient(125deg, rgba(255,255,255,0.95), rgba(228,234,240,0.7) 50%, rgba(255,255,255,0.9));

  --bg: var(--color-bg-base);
  --bg-2: var(--color-bg-mid);
  --panel: var(--color-bg-panel);
  --panel-solid: var(--color-bg-panel);
  --border: var(--color-border-subtle);
  --border-strong: var(--color-border-default);
  --text: var(--color-text-primary);
  --text-soft: var(--color-text-secondary);
  --muted: var(--color-text-muted);
  --ice: var(--color-accent-primary);
  --ice-strong: var(--color-accent-primary-strong);
  --gold: var(--color-accent-gold);
  --shadow: var(--shadow-md);
}
