/* ==========================================================================
   Lumoz AI — Design Tokens
   Single source of truth for site colors, both themes.
   Load this BEFORE styles.css. Style components with var(--token) only —
   never hardcode a hex in page CSS. See DESIGN.md for the rules.

   Theme model:
   - Dark is the default (bare :root).
   - Light applies when the OS prefers it (unless the page forces dark),
     or when <html data-theme="light"> is set by the toggle.
   - <html data-theme="dark"> forces dark and beats the OS setting.
   ========================================================================== */

:root {
  /* --- grounds & surfaces (dark) --- */
  --ground:        #0b1022;   /* page background */
  --ground-2:      #0e1430;   /* alternating section band */
  --surface:       #131a3a;   /* panels, tables */
  --card:          #161e42;   /* raised cards */
  --line:          #232c58;   /* default border */
  --line-2:        #2c3766;   /* stronger border, ghost-button border */

  /* --- ink (dark) --- */
  --ink:           #eef1fb;   /* headings, primary text */
  --ink-2:         #a9b2d4;   /* body text */
  --ink-3:         #6f7aa3;   /* captions, metadata */

  /* --- accent (same hue family in both themes) --- */
  --accent:        #8ea2ff;   /* headline accent word, chips, links */
  --accent-strong: #4f6df5;   /* saturated accent, glows, emphasis card */

  /* --- semantic status (hue constant across themes) --- */
  --ok:            #34d39b;
  --ok-bg:         #123c31;
  --warn:          #e8b34a;
  --warn-bg:       #3a2f14;
  --crit:          #f0647a;
  --crit-bg:       #3c1622;

  /* --- controls: primary button INVERTS across themes --- */
  --btn-bg:        #eef1fb;
  --btn-ink:       #0b1022;

  /* --- product-proof cards: theme-INVARIANT (light in both themes) --- */
  --proof-bg:      #f7f8fd;
  --proof-ink:     #1a2033;
  --proof-ink-2:   #3c4664;
  --proof-ink-3:   #7a839f;
  --proof-line:    #e6e9f4;
  --proof-ok-bg:   #e2f7ef;
  --proof-ok:      #0d7a55;
  --proof-crit-bg: #fde7ec;
  --proof-crit:    #c22745;

  /* --- atmosphere --- */
  --glow:          rgba(79, 109, 245, 0.16);  /* radial hero glow */
  --glow-2:        rgba(52, 211, 155, 0.07);
  --nav-bg:        rgba(11, 16, 34, 0.85);    /* sticky nav w/ blur */
  --shadow-card:   0 24px 60px rgba(0, 0, 0, 0.45);

  /* --- type --- */
  --font-display:  "Archivo", system-ui, sans-serif;        /* headings, buttons */
  --font-body:     "IBM Plex Sans", system-ui, sans-serif;  /* body */
  --font-mono:     "IBM Plex Mono", ui-monospace, monospace;/* chips, data, captions */

  /* --- shape & rhythm --- */
  --radius-card:   16px;
  --radius-btn:    10px;
  --radius-pill:   999px;
  --radius-badge:  6px;
  --max-width:     1120px;
  --section-pad:   96px;

  color-scheme: dark;
}

/* Light theme values (applied by the two rules below) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground:        #f4f6fc;
    --ground-2:      #edf0f9;
    --surface:       #ffffff;
    --card:          #ffffff;
    --line:          #e3e7f3;
    --line-2:        #cdd4ea;

    --ink:           #171b2e;
    --ink-2:         #4a5372;
    --ink-3:         #7d86a8;

    --accent:        #5e77f0;   /* same hue, deepened for contrast on light */
    --accent-strong: #3f5ae8;

    --ok:            #0d7a55;
    --ok-bg:         #e2f7ef;
    --warn:          #8a6410;
    --warn-bg:       #f8ecd2;
    --crit:          #c22745;
    --crit-bg:       #fde7ec;

    --btn-bg:        #12162b;   /* inverted: dark button on light ground */
    --btn-ink:       #ffffff;

    /* proof cards unchanged on purpose — they are the product, not the page */

    --glow:          rgba(94, 119, 240, 0.10);
    --glow-2:        rgba(52, 211, 155, 0.05);
    --nav-bg:        rgba(244, 246, 252, 0.85);
    --shadow-card:   0 18px 44px rgba(23, 27, 46, 0.14);

    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --ground:        #f4f6fc;
  --ground-2:      #edf0f9;
  --surface:       #ffffff;
  --card:          #ffffff;
  --line:          #e3e7f3;
  --line-2:        #cdd4ea;

  --ink:           #171b2e;
  --ink-2:         #4a5372;
  --ink-3:         #7d86a8;

  --accent:        #5e77f0;
  --accent-strong: #3f5ae8;

  --ok:            #0d7a55;
  --ok-bg:         #e2f7ef;
  --warn:          #8a6410;
  --warn-bg:       #f8ecd2;
  --crit:          #c22745;
  --crit-bg:       #fde7ec;

  --btn-bg:        #12162b;
  --btn-ink:       #ffffff;

  --glow:          rgba(94, 119, 240, 0.10);
  --glow-2:        rgba(52, 211, 155, 0.05);
  --nav-bg:        rgba(244, 246, 252, 0.85);
  --shadow-card:   0 18px 44px rgba(23, 27, 46, 0.14);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --ground:        #0b1022;
  --ground-2:      #0e1430;
  --surface:       #131a3a;
  --card:          #161e42;
  --line:          #232c58;
  --line-2:        #2c3766;

  --ink:           #eef1fb;
  --ink-2:         #a9b2d4;
  --ink-3:         #6f7aa3;

  --accent:        #8ea2ff;
  --accent-strong: #4f6df5;

  --ok:            #34d39b;
  --ok-bg:         #123c31;
  --warn:          #e8b34a;
  --warn-bg:       #3a2f14;
  --crit:          #f0647a;
  --crit-bg:       #3c1622;

  --btn-bg:        #eef1fb;
  --btn-ink:       #0b1022;

  --glow:          rgba(79, 109, 245, 0.16);
  --glow-2:        rgba(52, 211, 155, 0.07);
  --nav-bg:        rgba(11, 16, 34, 0.85);
  --shadow-card:   0 24px 60px rgba(0, 0, 0, 0.45);

  color-scheme: dark;
}

/* ==========================================================================
   Core component recipes — reuse these, don't restyle per page
   ========================================================================== */

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
}

/* Primary button (inverts with theme) */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  background: var(--btn-bg);
  color: var(--btn-ink);
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn.big { padding: 14px 28px; font-size: 16.5px; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn.ghost:hover { border-color: var(--accent); }

/* Mono pill chip that opens every section */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
}
.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Mono uppercase eyebrow above the H1 */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Panels and cards */
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

/* Status badges — semantics constant across themes */
.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-badge);
  white-space: nowrap;
}
.badge.ok   { background: var(--ok-bg);   color: var(--ok);   }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.crit { background: var(--crit-bg); color: var(--crit); }

/* Product-proof card — theme-invariant floating UI miniature */
.proof-card {
  background: var(--proof-bg);
  color: var(--proof-ink);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
