:root {
  /* Brand Palette v1.1.0 — Growth Platform (2026-03-10) */
  /* Four-colour accent system. All accents pass WCAG AA against white. */
  /* Canonical source: brand/reference/palette/brand-palette.json */

  /* ── Accent: Orange — Primary action (CTAs, buttons, nav highlights) ── */
  --color-accent-orange: #E8862A;
  --color-accent-orange-dark: #C96B20;
  --color-accent-orange-hover: #C96B20;         /* alias — legacy compat */
  --color-accent-orange-tint: rgba(232, 134, 42, 0.08);

  /* ── Neutral accent aliases (used by shared components) ──
     Resolves unqualified `var(--color-accent, …)` / `var(--color-accent-hover, …)` /
     `var(--color-accent-tint, …)` references in components.css. Removes reliance on
     hardcoded hex fallbacks and lets the accent be retuned from a single point. */
  --color-accent: var(--color-accent-orange);
  --color-accent-hover: var(--color-accent-orange-dark);
  --color-accent-tint: var(--color-accent-orange-tint);

  /* ── Accent: Ivy Green — Positive/success (growth metrics, approvals) ── */
  --color-accent-green: #3A8F3F;
  --color-accent-green-dark: #2D7A32;
  --color-accent-teal: #3A8F3F;                 /* alias — legacy compat */
  --color-accent-teal-hover: #2D7A32;           /* alias — legacy compat */
  --color-accent-green-tint: rgba(58, 143, 63, 0.08);

  /* ── Accent: Dark Gold — Value emphasis (key figures, highlights) ── */
  --color-accent-gold: #A67B1A;
  --color-accent-gold-dark: #8B6914;
  --color-green: #A67B1A;                       /* alias — legacy compat */
  --color-gold-dark: #8B6914;                   /* alias — legacy compat */
  --color-accent-gold-tint: rgba(166, 123, 26, 0.08);
  --color-gold-tint: rgba(166, 123, 26, 0.08); /* alias — legacy compat */

  /* ── Accent: Royal Blue — Information/trust (links, sub-nav, charts) ── */
  --color-accent-blue: #2B5EA7;
  --color-accent-blue-dark: #1E4A85;
  --color-accent-blue-light: #3A7BD5;
  --color-purple: #2B5EA7;                      /* alias — legacy compat */
  --color-blue-dark: #1E4A85;                   /* alias — legacy compat */
  --color-blue-light: #3A7BD5;                  /* alias — legacy compat */
  --color-accent-blue-tint: rgba(43, 94, 167, 0.08);
  --color-blue-tint: rgba(43, 94, 167, 0.08);  /* alias — legacy compat */

  /* Dark backgrounds (header, footer, hero) */
  --color-primary-dark: #141413;

  /* Brand wordmark colour — logo wordmark on light backgrounds, deck headlines.
     Distinct from --color-accent-navy (Opagio Method "Optimise" phase, #1A1A2E).
     See brand/opagio-deck-system.md and brand/assets/logos/README.md. */
  --color-brand-navy: #082058;

  /* Neutrals — warm tone */
  --color-charcoal: #141413;
  --color-charcoal-light: #5c5c5a;
  --color-white: #ffffff;
  --color-bg-light: #faf9f5;
  --color-bg-alt: #F5F4EF;
  --color-bg-card: #ffffff;
  --color-border: #e5e4df;
  --color-border-light: #eeeee9;
  --color-text-muted: #5c5c5a;
  --color-text-light: #8c8c8a;

  /* Text aliases */
  --color-text-primary: #141413;      /* Alias for --color-charcoal */
  --color-text-secondary: #5c5c5a;    /* Alias for --color-charcoal-light */

  /* Surface tokens */
  --color-surface: #ffffff;            /* Alias for --color-bg-card */
  --color-surface-alt: #fafafa;        /* Slightly cooler alt surface */
  --color-surface-dark: #1a1a1a;       /* Dark surface for compare tables etc. */
  --color-surface-warm: #fff9f0;       /* Warm cream for celebration/quiz gradients */

  /* Semantic aliases — referenced by components.css, pricing.css */
  --color-primary: var(--color-accent-orange);
  --color-blue: var(--color-accent-blue);

  /* Semantic */
  --color-error: #C0392B;
  --color-error-tint: rgba(192, 57, 43, 0.08);
  --color-error-dark: #c62828;
  --color-success: #4caf50;
  --color-success-tint: #f6fdf6;
  --color-success-dark: #2e7d32;
  --color-success-border: #c8e6c9;
  --color-success-bg: #fafff9;
  --color-info: #2196f3;

  /* ── Accent: Navy — Opagio Method "Optimise" phase ── */
  --color-accent-navy: #1A1A2E;
  --color-accent-navy-tint: rgba(26, 26, 46, 0.08);

  /* ── Explore zone tints (gradient backgrounds) ── */
  --color-accent-orange-tint-light: #fdf6ee;
  --color-accent-orange-tint-lighter: #fef9f3;
  --color-accent-orange-50: #fff7ed;
  --color-accent-orange-warm: #f5a623;
  --color-accent-blue-tint-light: #f0f7ff;
  --color-accent-blue-tint-lighter: #f5f9ff;

  /* ── Neutral greys (warm-tone scale for UI chrome) ── */
  --color-neutral-50: #fafafa;
  --color-neutral-100: #f5f5f5;
  --color-neutral-150: #f0f0f0;
  --color-neutral-200: #e8e8e5;
  --color-neutral-300: #e0e0e0;
  --color-neutral-400: #d0d0d0;
  --color-neutral-bg-warm: #f9f9f7;
  --color-neutral-bg-cool: #f0f0ed;

  /* ── Certificate grades ── */
  --color-cert-gold: #D4AF37;
  --color-cert-gold-text: #1a1708;
  --color-cert-silver: #C0C0C0;
  --color-cert-silver-text: #121215;
  --color-cert-pass: #2E8B8B;

  /* ── Semantic state axis — VDR Unification (May 2026) ─────────
     Three states applied to asset metadata rows and breakdown counts.
     Colour carries MEANING (state), not identity. Driver identity is
     conveyed by icon + label only. See
     spec/platform/ux/DESIGN-SYSTEM-COLOUR-PHILOSOPHY.md
     ──────────────────────────────────────────────────────────── */

  /* Accounting-eligible — subtype maps to IFRS 3 / IAS 38 capitalisation.
     Aliases existing --color-accent-blue. WCAG AAA on white (5.9:1). */
  --colour-state-accounting-eligible: var(--color-accent-blue);
  --colour-state-accounting-eligible-tint: var(--color-accent-blue-tint);

  /* Emerging — lender-recognised but not yet IFRS-eligible.
     Aliases existing --color-accent-gold. WCAG AA on white (4.7:1). */
  --colour-state-emerging: var(--color-accent-gold);
  --colour-state-emerging-tint: var(--color-accent-gold-tint);

  /* Strategic-only — analytically valuable but not capitalisable.
     Aliases existing --color-text-muted. WCAG AAA on white (6.8:1). */
  --colour-state-strategic: var(--color-text-muted);
  --colour-state-strategic-tint: rgba(92, 92, 90, 0.08);

  /* ── Confidence axis — Discovery classifier confidence pills ─── */
  --colour-confidence-high: var(--color-accent-green);
  --colour-confidence-high-tint: var(--color-accent-green-tint);
  --colour-confidence-medium: var(--color-accent-blue);
  --colour-confidence-medium-tint: var(--color-accent-blue-tint);
  --colour-confidence-review: var(--color-accent-gold);
  --colour-confidence-review-tint: var(--color-accent-gold-tint);

  /* ── Methodology-pending status ────────────────────────────────
     Asset added with subtype: 'other' — taxonomy expansion pending.
     Reuses gold; hourglass icon disambiguates from emerging state. */
  --colour-status-pending: var(--color-accent-gold);
  --colour-status-pending-tint: var(--color-accent-gold-tint);

  /* ── Relevance accent ─────────────────────────────────────────
     Top-N drivers for the user's archetype × stage carry a 3px
     left-border accent + star marker. */
  --colour-relevance-accent: var(--color-accent-orange);
  --colour-relevance-accent-tint: var(--color-accent-orange-tint);

  /* ── Opagio Method 5-step colour mapping (canonical — consumed by explore.css, method pages)
     Mirrors strategy/brand/opagio-method-staircase-visuals.html.
     Tints use rgba so they compose correctly over any surface (light, warm, dark). */
  --method-discover: #2B5EA7;   /* blue */
  --method-assess:   #3A8F3F;   /* green */
  --method-value:    #E8862A;   /* orange */
  --method-position: #A67B1A;   /* gold */
  --method-optimise: #1A1A2E;   /* navy */

  --method-discover-tint: rgba(43, 94, 167, 0.08);
  --method-assess-tint:   rgba(58, 143, 63, 0.08);
  --method-value-tint:    rgba(232, 134, 42, 0.08);
  --method-position-tint: rgba(166, 123, 26, 0.08);
  --method-optimise-tint: rgba(26, 26, 46, 0.08);

  /* Animation tokens */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-celebration: 600ms;
  --duration-reveal: 350ms;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.625rem;
  --font-size-4xl: 3rem;

  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-section: 5rem;               /* Default vertical padding for `.section` (matches --space-20) */

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 800px;
  --container-wide: 1400px;

  /* Borders */
  --border-radius-sm: 4px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;
  --border-radius-full: 50%;
  --border-radius-pill: 999px;
  --radius-lg: 12px;                   /* Alias for --border-radius-lg */

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Z-indices */
  --z-dropdown: 100;
  --z-header: 200;
  --z-overlay: 300;
  --z-modal: 400;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Dark Mode Token Architecture ──────────────────────────────
   Token structure for future theme switching.
   Dark mode is NOT active — this defines the variable overrides
   that will apply when [data-theme="dark"] is set on <html>.
   Implementation: add a theme toggle that sets the attribute.
   ─────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  /* Backgrounds */
  --color-bg-light: #1a1a1a;
  --color-bg-alt: #222222;
  --color-bg-card: #252525;
  --color-surface: #252525;
  --color-surface-alt: #2a2a2a;
  --color-surface-warm: #2d2318;

  /* Text */
  --color-charcoal: #e8e8e5;
  --color-text-primary: #e8e8e5;
  --color-text-secondary: #a0a0a0;
  --color-text-muted: #8c8c8a;
  --color-text-light: #6c6c6a;

  /* Borders */
  --color-border: #3a3a3a;
  --color-border-light: #333333;

  /* Neutrals */
  --color-neutral-50: #2a2a2a;
  --color-neutral-100: #333333;
  --color-neutral-150: #3a3a3a;
  --color-neutral-200: #444444;
  --color-neutral-300: #555555;
  --color-neutral-400: #666666;
  --color-neutral-bg-warm: #222222;
  --color-neutral-bg-cool: #1e1e1e;

  /* Accents stay the same (high-contrast brand colours) */
  /* --color-accent-orange: #E8862A; (unchanged) */
  /* --color-accent-green: #3A8F3F; (unchanged) */
  /* --color-accent-gold: #A67B1A; (unchanged) */
  /* --color-accent-blue: #2B5EA7; (unchanged) */

  /* Tints darken instead of lighten */
  --color-accent-orange-tint: rgba(232, 134, 42, 0.15);
  --color-accent-orange-tint-light: #2a2015;
  --color-accent-orange-tint-lighter: #2d2318;
  --color-accent-blue-tint-light: #1a2030;
  --color-accent-blue-tint-lighter: #1d2535;

  /* Shadows deepen */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.6);
}
