/*
 * theme.css - the ONLY file that holds colour, font and logo literals.
 *
 * Every other file (framework CSS, page CSS, inline SVG) references these
 * tokens through var(--...). The release gate `tools/verify-site.js colors`
 * fails on any colour literal outside this file, so keep them all here.
 *
 * TELKOM THEME - working placeholder palette (Telkom red family).
 * Not yet confirmed against official Telkom brand guidelines; replace the
 * literals here when approved assets arrive and nothing else changes.
 *
 * Contrast (WCAG 2.1, verified):
 *   white on --color-primary #d32018 ............ 5.26:1 (AA normal)
 *   white on hero base #0e0f13 .................. 19.1:1
 *   --color-accent-on-dark #ff5a4f on hero ...... 6.23:1 (AA) accent words on dark heroes
 *   --color-accent #ffb81c (amber) on hero ...... 11.1:1
 *   --hero-text-muted #c7ccd6 on hero ........... 11.9:1
 *   --hero-text-subtle #9aa3b2 on hero .......... 7.5:1
 *   text #1f2328 on white ....................... 15.8:1
 *   muted #5b5f66 on page bg #f7f7f8 ............ 5.99:1
 *   link #b71c1c on white ....................... 6.57:1
 *   dark theme: accent #ff6b63 on #121214 ....... 6.71:1 ; text #f2f3f5 on #1b1b1f 15.5:1
 */
:root {
  /* ---- Brand reds ---- */
  --color-brand: #ee2e24;              /* vivid red, decoration only */
  --color-primary: #d32018;            /* buttons, bars, red text (white on it = AA) */
  --color-primary-strong: #a8140f;     /* hover / pressed */
  --color-primary-soft: #f6d8d6;       /* soft red fill for tints on light surfaces */
  --color-on-primary: #ffffff;
  --color-accent-on-dark: #ff5a4f;     /* lighter red for accent words on dark heroes (AA) */
  --hero-eyebrow: #ffb3ae;             /* small mono eyebrow/caption on the hero: 6:1+ even at the peak of the red glow */

  /* ---- Secondary accent (amber) ---- */
  --color-accent: #ffb81c;
  --color-accent-strong: #e0a000;
  --color-on-accent: #1a1a1a;

  /* ---- Surfaces and text (light) ---- */
  --color-bg: #f7f7f8;
  --color-surface: #ffffff;
  --color-surface-alt: #eceef0;
  --color-surface-tint: #fbf4f3;       /* faint red-tinted card wash */
  --color-text: #1f2328;
  --color-text-muted: #5b5f66;
  --color-border: #d0d3d8;
  --color-border-strong: #b9bdc4;
  --color-link: #b71c1c;
  --color-link-hover: #8e1410;
  --color-focus: #d32018;

  /* ---- Hero (dark charcoal gradient with a red glow) ---- */
  --hero-base: #0e0f13;
  --hero-base-2: #16181d;
  --hero-glow: rgba(211, 32, 24, 0.40);   /* red radial glow */
  --hero-glow-2: rgba(211, 32, 24, 0.14);
  --hero-rule: #d32018;                     /* red bottom rule */
  --hero-text: #ffffff;
  --hero-text-muted: #c7ccd6;
  --hero-text-subtle: #9aa3b2;
  --hero-chip-bg: rgba(255, 255, 255, 0.08);
  --hero-chip-border: rgba(255, 255, 255, 0.18);
  --hero-card-bg: rgba(255, 255, 255, 0.05);
  --hero-card-border: rgba(255, 255, 255, 0.12);

  /* ---- Card icon tiles + gradient tints ---- */
  --tile-red-a: rgba(211, 32, 24, 0.16);
  --tile-red-b: rgba(211, 32, 24, 0.04);
  --tile-amber-a: rgba(255, 184, 28, 0.20);
  --tile-amber-b: rgba(255, 184, 28, 0.05);
  --card-tint-top: rgba(211, 32, 24, 0.05);
  --card-tint-bottom: rgba(211, 32, 24, 0.00);

  /* ---- Tab bar ---- */
  --tab-bg: rgba(255, 255, 255, 0.92);
  --tab-border: #d0d3d8;
  --tab-text: #5b5f66;
  --tab-text-active: #d32018;
  --tab-num-bg: #eceef0;
  --tab-num-text: #5b5f66;
  --tab-num-active-bg: #d32018;
  --tab-num-active-text: #ffffff;
  --tab-rule: #d32018;

  /* ---- Tables ---- */
  --table-head-bg: #1f2328;
  --table-head-text: #ffffff;
  --table-row-alt: #f4f5f6;
  --table-border: #d9dce0;

  /* ---- Callouts ---- */
  --callout-info-bg: #eef5ff;
  --callout-info-border: #1f6feb;
  --callout-info-text: #16325c;
  --callout-note-bg: #fff8e8;
  --callout-note-border: #ffb81c;
  --callout-note-text: #5a4300;

  /* ---- Header / footer bands ---- */
  --color-header-bg: #ffffff;
  --color-header-text: #1f2328;
  --color-footer-bg: #0e0f13;
  --color-footer-text: #c7ccd6;

  /* ---- Status ---- */
  --color-success: #1e6b3a;
  --color-warning: #9a5b00;
  --color-danger: #b3261e;

  /* ---- Token-chip palette for the tokenizer playground (distinct hues, light fills) ---- */
  --tok-1-bg: #ffe0dd; --tok-1-text: #7a160f;
  --tok-2-bg: #e2ecff; --tok-2-text: #163a7a;
  --tok-3-bg: #e3f6e6; --tok-3-text: #185029;
  --tok-4-bg: #fff0d6; --tok-4-text: #6a4800;
  --tok-5-bg: #ece4fb; --tok-5-text: #3f2a78;
  --tok-6-bg: #d9f4f6; --tok-6-text: #0f4f55;

  /* ---- Data-viz accents (embedding maps, gauges) ---- */
  --viz-connectivity: #d32018;
  --viz-platform: #1f6feb;
  --viz-security: #6b4fbb;
  --viz-sales: #9a5b00;
  --viz-operations: #1e6b3a;
  --viz-track: #d0d3d8;
  --viz-link: #5b5f66;
  --viz-gauge-fill: #d32018;
  --viz-gauge-track: #e4e6e9;

  /* ---- Floating controls (dark glass, readable on the dark hero and on light pages) ---- */
  --fab-bg: rgba(14, 15, 19, 0.62);
  --fab-bg-hover: rgba(14, 15, 19, 0.80);
  --fab-border: rgba(255, 255, 255, 0.22);
  --fab-icon: #ffffff;
  --fab-shadow: rgba(14, 15, 19, 0.28);
  /* Light glass for the fabs once the page has scrolled past the dark hero
     (light theme only; framework/shell.js sets html.fabs-past-hero).
     Icon #1f2328 on white at .86 over the #f7f7f8 page is 15:1. */
  --fab-light-bg: rgba(255, 255, 255, 0.86);
  --fab-light-bg-hover: rgba(255, 255, 255, 0.98);
  --fab-light-border: rgba(31, 35, 40, 0.14);
  --fab-light-icon: #1f2328;
  --fab-light-shadow: rgba(31, 35, 40, 0.10);
  /* ---- Home card tint palette: card wash a->b, icon tile, ink (icon + tag text), tag fill ----
     Ink on its tag fill, light theme: red 6.0:1, amber 5.6:1, slate 8.2:1, rose 6.3:1, stone 5.8:1 */
  --tint-red-a: rgba(211, 32, 24, 0.10);   --tint-red-b: rgba(211, 32, 24, 0.01);
  --tint-red-tile-a: rgba(211, 32, 24, 0.18); --tint-red-tile-b: rgba(211, 32, 24, 0.05);
  --tint-red-ink: #b31a13;                 --tint-red-tag: #fbe3e1;
  --tint-amber-a: rgba(255, 184, 28, 0.16); --tint-amber-b: rgba(255, 184, 28, 0.02);
  --tint-amber-tile-a: rgba(255, 184, 28, 0.30); --tint-amber-tile-b: rgba(255, 184, 28, 0.08);
  --tint-amber-ink: #7d5200;               --tint-amber-tag: #fff1cf;
  --tint-slate-a: rgba(55, 65, 81, 0.10);  --tint-slate-b: rgba(55, 65, 81, 0.01);
  --tint-slate-tile-a: rgba(55, 65, 81, 0.18); --tint-slate-tile-b: rgba(55, 65, 81, 0.05);
  --tint-slate-ink: #2f3846;               --tint-slate-tag: #e4e7ec;
  --tint-rose-a: rgba(219, 39, 119, 0.09); --tint-rose-b: rgba(219, 39, 119, 0.01);
  --tint-rose-tile-a: rgba(219, 39, 119, 0.17); --tint-rose-tile-b: rgba(219, 39, 119, 0.04);
  --tint-rose-ink: #a01750;                --tint-rose-tag: #fbe1ec;
  --tint-stone-a: rgba(120, 104, 88, 0.12); --tint-stone-b: rgba(120, 104, 88, 0.01);
  --tint-stone-tile-a: rgba(120, 104, 88, 0.22); --tint-stone-tile-b: rgba(120, 104, 88, 0.06);
  --tint-stone-ink: #5c4f42;               --tint-stone-tag: #efe9e3;
  /* ---- Tab pills ---- */
  --tab-pill-bg: #ffffff;
  --tab-pill-border: #d0d3d8;
  --tab-pill-hover-border: #d32018;
  --tab-pill-active-bg: #d32018;           /* white on it 5.26:1 */
  --tab-pill-active-text: #ffffff;
  --tab-pill-active-num-bg: #a8140f;      /* primary-strong: white on it 7.6:1 */
  --tab-pill-shadow: rgba(211, 32, 24, 0.28);
  /* ---- Hero illustrations (drawn on the dark hero in both themes) ---- */
  --hero-art-line: rgba(255, 255, 255, 0.22);
  --hero-art-node: rgba(255, 255, 255, 0.06);
  --hero-art-node-border: rgba(255, 255, 255, 0.24);
  --hero-art-core: #d32018;
  --hero-art-core-glow: rgba(211, 32, 24, 0.35);
  --hero-art-particle: #ff8a83;
  /* ---- 3D hero scenes (WebGL, drawn on the dark hero in both themes; three.js needs opaque hex) ---- */
  --h3-plate: #263044;
  --h3-plate-top: #34425b;
  --h3-edge: #98a4bd;
  --h3-dim: #4a566e;
  --h3-light: #ffffff;
  --h3-brand: #d32018;
  --h3-risk: #ff5a4f;
  --h3-ok: #5fd08a;
  --h3-user: #c7ccd6;
  --h3-label-bg: #1b2230;
  /* ---- Home workshop map (dark stage in both themes). Session 1 uses the brand red particle tone; Session 2 an amber. ---- */
  --cn-s2: #f0b35c;
  --cn-node: #171a22;
  --cn-star: #c7ccd6;
  /* ---- Pipeline diagram + footer rule ---- */
  --pl-glow: rgba(211, 32, 24, 0.22);
  --pl-track: #d0d3d8;
  --color-footer-rule: rgba(255, 255, 255, 0.08);
  --mask-solid: #000000;                /* alpha mask stop for faded scroll edges (not a visible colour) */
  /* ---- Effects ---- */
  --color-shadow: rgba(31, 35, 40, 0.10);
  --color-shadow-strong: rgba(31, 35, 40, 0.18);
  --color-overlay: rgba(14, 15, 19, 0.55);
  --ease: cubic-bezier(.4, 0, .2, 1);

  /* ---- Fonts (served locally via framework/fonts.css) ---- */
  --font-heading: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- Logo slot (none until an approved asset is supplied) ---- */
  --logo-width: 160px;
  --logo-height: 40px;
  --logo-width-mobile: 120px;
  --logo-height-mobile: 32px;
}

/* ================= Dark theme ================= */
.theme-dark {
  --color-brand: #ff5a4f;
  --color-primary: #ff6b63;
  --color-primary-strong: #ff8a83;
  --color-primary-soft: #3a1b19;
  --color-on-primary: #1b1b1f;
  --color-accent-on-dark: #ff8a83;
  --hero-eyebrow: #ffb3ae;

  --color-accent: #ffb81c;
  --color-accent-strong: #ffcb4d;
  --color-on-accent: #1a1a1a;

  --color-bg: #121214;
  --color-surface: #1b1b1f;
  --color-surface-alt: #2a2a30;
  --color-surface-tint: #241a1a;
  --color-text: #f2f3f5;
  --color-text-muted: #a9adb5;
  --color-border: #3c3c44;
  --color-border-strong: #4c4c55;
  --color-link: #ff8a83;
  --color-link-hover: #ffb3ae;
  --color-focus: #ffb81c;

  --hero-base: #09090b;
  --hero-base-2: #121318;
  --hero-glow: rgba(255, 90, 79, 0.34);
  --hero-glow-2: rgba(255, 90, 79, 0.12);
  --hero-rule: #ff6b63;
  --hero-text: #ffffff;
  --hero-text-muted: #c7ccd6;
  --hero-text-subtle: #9aa3b2;
  --hero-chip-bg: rgba(255, 255, 255, 0.07);
  --hero-chip-border: rgba(255, 255, 255, 0.16);
  --hero-card-bg: rgba(255, 255, 255, 0.04);
  --hero-card-border: rgba(255, 255, 255, 0.10);

  --tile-red-a: rgba(255, 107, 99, 0.22);
  --tile-red-b: rgba(255, 107, 99, 0.05);
  --tile-amber-a: rgba(255, 184, 28, 0.22);
  --tile-amber-b: rgba(255, 184, 28, 0.05);
  --card-tint-top: rgba(255, 107, 99, 0.07);
  --card-tint-bottom: rgba(255, 107, 99, 0.00);

  --tab-bg: rgba(18, 18, 20, 0.92);
  --tab-border: #3c3c44;
  --tab-text: #a9adb5;
  --tab-text-active: #ff8a83;
  --tab-num-bg: #2a2a30;
  --tab-num-text: #a9adb5;
  --tab-num-active-bg: #ff6b63;
  --tab-num-active-text: #1b1b1f;
  --tab-rule: #ff6b63;

  --table-head-bg: #2a2a30;
  --table-head-text: #f2f3f5;
  --table-row-alt: #202026;
  --table-border: #3c3c44;

  --callout-info-bg: #16233a;
  --callout-info-border: #6ea8ff;
  --callout-info-text: #cfe0ff;
  --callout-note-bg: #2e2714;
  --callout-note-border: #ffb81c;
  --callout-note-text: #ffe3a3;

  --color-header-bg: #1b1b1f;
  --color-header-text: #f2f3f5;
  --color-footer-bg: #09090b;
  --color-footer-text: #c7ccd6;

  --color-success: #5fd08a;
  --color-warning: #ffcb4d;
  --color-danger: #ff8a83;

  --tok-1-bg: #4a211d; --tok-1-text: #ffd5d1;
  --tok-2-bg: #1d2e4a; --tok-2-text: #cfe0ff;
  --tok-3-bg: #1b3a26; --tok-3-text: #cdf2d7;
  --tok-4-bg: #3e3115; --tok-4-text: #ffe3a3;
  --tok-5-bg: #2d2350; --tok-5-text: #ddd0ff;
  --tok-6-bg: #143a3e; --tok-6-text: #c6f0f4;

  --viz-connectivity: #ff6b63;
  --viz-platform: #6ea8ff;
  --viz-security: #b39dff;
  --viz-sales: #ffcb4d;
  --viz-operations: #5fd08a;
  --viz-track: #3c3c44;
  --viz-link: #a9adb5;
  --viz-gauge-fill: #ff6b63;
  --viz-gauge-track: #2a2a30;

  --fab-bg: rgba(27, 27, 31, 0.70);
  --fab-bg-hover: rgba(42, 42, 48, 0.90);
  --fab-border: rgba(255, 255, 255, 0.20);
  --fab-icon: #ffffff;
  --fab-shadow: rgba(0, 0, 0, 0.45);
  --tint-red-a: rgba(255, 107, 99, 0.12);  --tint-red-b: rgba(255, 107, 99, 0.01);
  --tint-red-tile-a: rgba(255, 107, 99, 0.24); --tint-red-tile-b: rgba(255, 107, 99, 0.06);
  --tint-red-ink: #ff8a83;                 --tint-red-tag: #3a1b19;
  --tint-amber-a: rgba(255, 184, 28, 0.11); --tint-amber-b: rgba(255, 184, 28, 0.01);
  --tint-amber-tile-a: rgba(255, 184, 28, 0.24); --tint-amber-tile-b: rgba(255, 184, 28, 0.06);
  --tint-amber-ink: #ffcb4d;               --tint-amber-tag: #3a2f12;
  --tint-slate-a: rgba(148, 163, 184, 0.12); --tint-slate-b: rgba(148, 163, 184, 0.01);
  --tint-slate-tile-a: rgba(148, 163, 184, 0.24); --tint-slate-tile-b: rgba(148, 163, 184, 0.06);
  --tint-slate-ink: #c3ccd9;               --tint-slate-tag: #262b33;
  --tint-rose-a: rgba(244, 114, 182, 0.11); --tint-rose-b: rgba(244, 114, 182, 0.01);
  --tint-rose-tile-a: rgba(244, 114, 182, 0.24); --tint-rose-tile-b: rgba(244, 114, 182, 0.06);
  --tint-rose-ink: #ff9ccb;                --tint-rose-tag: #3a1a2a;
  --tint-stone-a: rgba(214, 200, 184, 0.10); --tint-stone-b: rgba(214, 200, 184, 0.01);
  --tint-stone-tile-a: rgba(214, 200, 184, 0.22); --tint-stone-tile-b: rgba(214, 200, 184, 0.05);
  --tint-stone-ink: #ddd0c1;               --tint-stone-tag: #2f2a25;
  --tab-pill-bg: #1b1b1f;
  --tab-pill-border: #3c3c44;
  --tab-pill-hover-border: #ff8a83;
  --tab-pill-active-bg: #d32018;
  --tab-pill-active-text: #ffffff;
  --tab-pill-active-num-bg: #a8140f;      /* primary-strong: white on it 7.6:1 */
  --tab-pill-shadow: rgba(0, 0, 0, 0.45);
  --hero-art-core: #d32018;
  --hero-art-core-glow: rgba(255, 90, 79, 0.32);
  --hero-art-particle: #ff8a83;
  /* ---- 3D hero scenes (WebGL, drawn on the dark hero in both themes; three.js needs opaque hex) ---- */
  --h3-plate: #263044;
  --h3-plate-top: #34425b;
  --h3-edge: #98a4bd;
  --h3-dim: #4a566e;
  --h3-light: #ffffff;
  --h3-brand: #d32018;
  --h3-risk: #ff5a4f;
  --h3-ok: #5fd08a;
  --h3-user: #c7ccd6;
  --h3-label-bg: #1b2230;
  /* ---- Home workshop map (dark stage in both themes). Session 1 uses the brand red particle tone; Session 2 an amber. ---- */
  --cn-s2: #f0b35c;
  --cn-node: #171a22;
  --cn-star: #c7ccd6;
  --pl-glow: rgba(255, 107, 99, 0.22);
  --pl-track: #4c4c55;
  --color-footer-rule: rgba(255, 255, 255, 0.08);
  --color-shadow: rgba(0, 0, 0, 0.5);
  --color-shadow-strong: rgba(0, 0, 0, 0.65);
  --color-overlay: rgba(0, 0, 0, 0.6);
}

/* Flash-of-theme guard: pages set html[data-preset-dark] in <head> before
 * paint, and framework/theme.js keeps it in step with the live theme (it is
 * removed when the user toggles to light). The body rule only applies until
 * the theme class lands, so it can never outlive a toggle. */
html { background: #f7f7f8; }
html[data-preset-dark] { background: #09090b; color-scheme: dark; }
html[data-preset-dark] body:not(.theme-dark) { background: #0e0f13; }
.theme-dark { color-scheme: dark; }
