/* LA PRESA — design tokens (T22 «Claro y al grano», TICKETS/T22).
   Light by default; night = html[data-tema="noche"] (LP.app.tema()).
   Text pairs ≥ 4.5:1, indicators ≥ 3:1 in both themes (tests/run.js
   T12 reads this file). Mood colour never carries text (p19); the
   chrome keeps --brand, never the mood (p5, p20). Stable logo. */

:root {
  color-scheme: light;

  /* ---- Ground and ink (light) ---- */
  --bg: #F7F8F3;
  --bg-sobrio: #F3F4F3;
  --surface: #FFFFFF;
  --soft: #E8EEDC;
  --line: #D7DFD0;
  --line-sobria: #CAD1D4;
  --line-campo: #7C8B78; /* form field edge, 3.6:1 */
  --ink: #203629;
  --ink-strong: #203629; /* in-phone titles = the ink (#162D30 is the deck's own page type) */
  --ink-dim: #52634F;
  --ink-muted: #52634F; /* in-phone captions (#526766 is the deck's) */
  --brand: #344B24;
  --on-brand: #FFFFFF;
  --accent: #344B24; /* brand as text: links, selected, focus */
  --peligro: #A3343F;
  --cr-asfalto: #303B3E;
  --cr-carril: #F0E3A0;
  --frame: #E2E7DA; /* around the canvas, wide screens */
  --scrim: rgba(22, 45, 48, .42);

  /* Mood fills (Direction A; indicators only, never under text) */
  --mood-dormida: #2F7867;
  --mood-mansa: #63813D;
  --mood-inquieta: #B38722;
  --mood-brava: #CB692E;
  --mood-furiosa: #AE3F4F;
  --mood-apocaliptica: #703AA0;
  --mood-sobria: #687276;

  /* Ink on a mood fill (the creature's face inks) */
  --on-dormida: #FFFFFF;
  --on-mansa: #151E1D;
  --on-inquieta: #151E1D;
  --on-brava: #FFFFFF;
  --on-furiosa: #FFFFFF;
  --on-apocaliptica: #FFFFFF;
  --on-sobria: #FFFFFF;

  /* Sober register palette (p6 #3) */
  --sobrio-ink: #293438;
  --sobrio-dim: #5B696F;
  --sobrio-soft: #E5E8E9;
  --sobrio-brand: #485257;

  /* ---- Type ---- */
  --font-sans: "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", Consolas, "SF Mono", monospace;

  /* ---- Scale ---- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
  --r-sm: 12px; --r-md: 18px; --r-lg: 24px; --r-btn: 18px; --r-pill: 14px; --r-full: 999px;
  --shadow-2: 0 12px 32px rgba(22, 45, 48, .16);

  /* Stable logo (p20), no tracking (p5/p6): mirror of core.WORDMARK_EM */
  --wm-track: 0em;

  /* ---- Motion ---- */
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* Mood of the route on show ([data-mood] on #app) */
  --mood: var(--mood-mansa);
}

/* ============ Night theme ============ */
html[data-tema="noche"] {
  color-scheme: dark;
  --bg: #101714;
  --bg-sobrio: #141818;
  --surface: #18211D;
  --soft: #212C27;
  --line: #2E3B35;
  --line-sobria: #3C4B44;
  --line-campo: #6E8175;
  --ink: #EEF2EC;
  --ink-strong: #F5F8F3;
  --ink-dim: #B4C2B8;
  --ink-muted: #94A59A;
  --brand: #4A6633;
  --on-brand: #FFFFFF;
  --accent: #A9CC85;
  --peligro: #F78185;
  --cr-asfalto: #46545A;
  --cr-carril: #F0E3A0;
  --frame: #070A09;
  --scrim: rgba(0, 0, 0, .6);

  /* Night indicators (Direction B's dark palette) */
  --mood-dormida: #55C0B0;
  --mood-mansa: #A1D16B;
  --mood-inquieta: #EDCA5A;
  --mood-brava: #F39A50;
  --mood-furiosa: #F78185;
  --mood-apocaliptica: #CCA1F2;
  --mood-sobria: #B7C0CB;

  /* Ink on a night indicator (the sprite keeps its own face inks) */
  --on-dormida: #101714;
  --on-mansa: #101714;
  --on-inquieta: #101714;
  --on-brava: #101714;
  --on-furiosa: #101714;
  --on-apocaliptica: #101714;
  --on-sobria: #101714;

  --sobrio-ink: #EEF2EC;
  --sobrio-dim: #B7C0CB;
  --sobrio-soft: #232A2B;
  --sobrio-brand: #4F5A5F;

  --shadow-2: 0 12px 32px rgba(0, 0, 0, .55);
  --lane-yellow: var(--cr-carril); /* legacy: the paint itself reads at night */
}

/* ============ [data-mood]: the indicator colour only ============ */
[data-mood="dormida"]      { --mood: var(--mood-dormida); }
[data-mood="mansa"]        { --mood: var(--mood-mansa); }
[data-mood="inquieta"]     { --mood: var(--mood-inquieta); }
[data-mood="brava"]        { --mood: var(--mood-brava); }
[data-mood="furiosa"]      { --mood: var(--mood-furiosa); }
[data-mood="apocaliptica"] { --mood: var(--mood-apocaliptica); }

/* ============ Sober register (sev-3): overrides everything ============
   On #app (the route on show) or on a screen (the cover, for another
   route of the person's). */
[data-sober="true"] {
  --mood: var(--mood-sobria);
  --bg: var(--bg-sobrio);
  --soft: var(--sobrio-soft);
  --line: var(--line-sobria);
  --ink: var(--sobrio-ink);
  --ink-strong: var(--sobrio-ink);
  --ink-dim: var(--sobrio-dim);
  --ink-muted: var(--sobrio-dim);
  --brand: var(--sobrio-brand);
  --accent: var(--sobrio-ink);
  --cr-asfalto: #485257;
}
html[data-tema="noche"] [data-sober="true"] {
  --lane-yellow: var(--cr-carril);
  --ink-muted: #A3ADB8;
  --accent: #C5CDD6;
  --cr-asfalto: #5A666C;
}

/* ============ Legacy names (comun.js fallbacks, brand/preview, tools/mesa) ============
   Declared on :root AND on sober elements: a custom property is resolved
   where it is declared, so each follows the ground it sits on. */
:root, [data-sober="true"] {
  --surface-2: var(--soft);
  --line-strong: var(--line);
  --ink-faint: var(--ink-muted);
  --mood-text: var(--accent);
  --mood-dormida-text: var(--ink);
  --mood-mansa-text: var(--ink);
  --mood-inquieta-text: var(--ink);
  --mood-brava-text: var(--ink);
  --mood-furiosa-text: var(--ink);
  --mood-apocaliptica-text: var(--ink);
  --mood-sobria-text: var(--ink-dim);
  /* old screens use it as TEXT (placa, the desk page): a text-safe gold */
  --lane-yellow: #876510;
}
