/* Global cascade-layer order. Declared once, here, because light.css is
   the first stylesheet linked in base.njk's <head> (the site's sole HTML
   entry point) and is loaded unconditionally on every page, before any
   other layered stylesheet. This declaration only fixes the precedence
   order between layers already in use across the codebase; it does not
   move any existing rule into a different layer. */
@layer tokens, reset, base, layout, components, pages, utilities, overrides;

@layer tokens {
  /* ===================================================
     Light Theme – The Gnostic Key (Global Base)
     Version: 2.5  Luxe Light Refresh (2026) — REVISED
     Changes:
     • Full aliasing of legacy --gold-* tokens for system compatibility
     • Consistent token usage and structure with all pillar themes + global dark base
     • Minor clean-up of redundant declarations
     • Maintained warm parchment base with luminous mystical gold accents
     • Full token parity with Indigo, Lightgold, Obsidian, Plum Wine, Teal, Vault, Tyrian Purple & global dark base
     =================================================== */

  html[data-theme="light"] {
    /* ✦ Core */
    --bg-opacity: 0.33;
    --bg-primary: #f9f5eb;
    --bg-secondary: #f0e9d8;
    --bg-wash: rgba(255, 255, 255, 0.93);
    --bg-color: var(--bg-primary);
    --bg: var(--bg-primary);

    --text-primary: #1f1c16;
    --text-secondary: #524c42;
    --text-muted: #6d6658;
    --text-base: var(--text-primary);

    /* ✦ Accents (warm mystical gold with subtle violet undertones) */
    --text-accent: #8f6f24;
    --accent: var(--text-accent);
    --accent-page: #a37d29;
    --highlight: #d6ad55;

    --glyph-color: #9f7b2a;
    --strong-text: #8f6f24;
    --cite-color: #8f6f24;

    /* ✦ Shadows & Glows (premium modern feel) */
    --shadow-glow: rgba(217, 177, 79, 0.24);
    --page-shadow-soft: 0 12px 28px rgba(0,0,0,0.09);
    --page-box-shadow: 0 0 20px rgba(217, 177, 79, 0.20);
    --glow-soft: 0 10px 22px rgba(217, 177, 79, 0.18);
    --glow-strong: 0 18px 32px rgba(217, 177, 79, 0.26);

    /* ✦ Sections & Surfaces */
    --section-bg-top: #f0e9d8;
    --section-bg-bottom: #e8dfc8;
    --section-border: rgba(143, 111, 36, 0.42);
    --divider-border: rgba(143, 111, 36, 0.48);
    --divider-border-soft: rgba(143, 111, 36, 0.34);
    --section-subtitle-color: var(--text-secondary);

    --bg-alt: #f6f1e4;
    --bg-surface: var(--bg-primary);
    --surface-elevated: #fffaf0;
    --card-surface: color-mix(in srgb, var(--bg-surface) 94%, var(--highlight) 6%);

    /* ✦ Gradients */
    --card-gradient: color-mix(in srgb, var(--bg-secondary) 94%, var(--highlight) 6%);

    /* ✦ Borders & Helpers */
    --border-accent: rgba(143, 111, 36, 0.36);
    --border-soft: rgba(143, 111, 36, 0.26);

    /* Legacy gold token aliases (full system compatibility) */
    --gold-border: var(--border-accent);
    --gold-tone: var(--glyph-color);
    --soft-gold: var(--highlight);
    --golden-blaze: #ead6a0;

    --accent-soft: rgba(143, 111, 36, 0.20);
    --accent-soft-glow: rgba(143, 111, 36, 0.28);
    --accent-glow: rgba(214, 173, 85, 0.34);

    /* ✦ Links */
    --link-color: var(--text-accent);
    --link-hover: var(--accent-page);
    --link-active: #6f551b;
    --link-visited: #735c1e;

    /* ✦ Inputs & Forms */
    --input-bg: #f0e9d8;
    --input-bg-focus: #f9f5eb;
    --input-border: rgba(31, 28, 22, 0.24);
    --input-focus-border: var(--text-accent);
    --input-text: var(--text-primary);
    --input-placeholder: rgba(31, 28, 22, 0.52);
    --input-disabled-bg: rgba(232, 223, 200, 0.72);
    --input-disabled-text: rgba(31, 28, 22, 0.62);

    /* ✦ Badges */
    --badge-bg: rgba(255, 244, 210, 0.82);
    --badge-text: #735c1e;
    --badge-border: rgba(217, 177, 79, 0.45);
    --badge-shadow: 0 2px 8px rgba(217, 177, 79, 0.20);

    /* ✦ Footer & Overlay */
    --footer-opacity: 0.93;
    --overlay-bg-gradient: linear-gradient(
      to right,
      rgba(249, 245, 235, 0.38),
      rgba(230, 200, 120, 0.28)
    );

    --bg-gradient: var(--overlay-bg-gradient);

    /* ✦ Quiz & Special Elements */
    --quiz-wrong-bg: rgba(255, 90, 60, 0.12);
    --quiz-wrong-text: #c0392b;
    --quiz-outline-selected: rgba(255, 244, 210, 0.35);
    --quiz-reveal-text: var(--text-secondary);

    /* Compatibility aliases */
    --text-light: var(--text-primary);
    --text-primary-dark: var(--text-primary);
    --text-accent-dark: var(--text-accent);

    /* Table helpers */
    --table-head-bg: rgba(255, 232, 184, 0.12);
    --table-row-odd: rgba(255, 255, 255, 0.65);
    --table-row-even: rgba(255, 255, 255, 0.35);
    --highlight-dark: rgba(255, 232, 184, 0.16);
  }
}
