/*
 * Design tokens. This is the ONLY file in the application that may contain a
 * colour literal; everything else reads custom properties from here
 * (build-plan.yml conventions.styling / colour_rules).
 *
 * Contrast, measured (WCAG 2.x ratios; AA body text needs 4.5:1):
 *   white on navy-900 .... 17.38     gold-500 on navy-900 ... 7.24
 *   white on navy-700 .... 14.43     gold-300 on navy-900 ... 10.15
 *   ink-600 on white ...... 7.53     navy-900 on gold-500 ... 7.24
 *   ink-500 on mist ....... 5.54     gold-700 on white ...... 5.05
 *   gold-500 on white ..... 2.40  ← FAILS. Gold is never text on white.
 *
 * So: gold-500/300 are for accents, fills and text ON NAVY; gold-700 is the
 * only gold that may be text on a light background.
 */
@layer tokens {
  :root {
    color-scheme: light;

    /* ── Brand ─────────────────────────────────────────────────────────── */
    --navy-950: #06111F;
    --navy-900: #0A1A33;
    --navy-800: #0E2241;
    --navy-700: #12294F;
    --navy-600: #1C3A6B;
    --navy-200: #B8C2D6;
    --navy-100: #DCE2EE;
    --navy-50:  #EEF1F7;

    --gold-700: #8A6A1F;
    --gold-500: #C9A24A;
    --gold-400: #D6B262;
    --gold-300: #E3C27A;
    --gold-100: #F6EDD6;

    --white: #FFFFFF;
    --mist:  #F7F8FA;
    --ink-900: #0F172A;
    --ink-600: #4A5568;
    --ink-500: #5B6576;
    --line: #E3E7EE;
    --line-strong: #C9D0DC;

    --danger: #B42318;
    --danger-bg: #FEF3F2;
    --success: #067647;
    --success-bg: #ECFDF3;

    /* ── Semantic: light surfaces (the default) ─────────────────────────── */
    --color-bg: var(--white);
    --color-bg-alt: var(--mist);
    --color-surface: var(--white);
    --color-text: var(--ink-900);
    --color-heading: var(--navy-900);
    --color-text-muted: var(--ink-600);
    --color-border: var(--line);
    --color-border-strong: var(--line-strong);
    --color-link: var(--navy-700);
    --color-link-hover: var(--navy-900);
    --color-eyebrow: var(--gold-700);
    --color-accent-line: var(--gold-500);   /* decorative rules, never text */
    --color-focus: var(--gold-500);
    --color-focus-ring: var(--navy-900);    /* inner ring so gold reads on white */

    /* ── Semantic: dark (navy) surfaces, applied by .surface-dark ───────── */
    --dark-bg: var(--navy-900);
    --dark-bg-raised: var(--navy-800);
    --dark-text: var(--white);
    --dark-text-muted: var(--navy-200);
    --dark-border: rgb(255 255 255 / 0.12);
    --dark-eyebrow: var(--gold-300);

    /* ── Buttons ────────────────────────────────────────────────────────── */
    --btn-primary-bg: var(--navy-900);
    --btn-primary-bg-hover: var(--navy-700);
    --btn-primary-text: var(--white);
    --btn-accent-bg: var(--gold-500);
    --btn-accent-bg-hover: var(--gold-400);
    --btn-accent-text: var(--navy-900);

    /* ── Typography ─────────────────────────────────────────────────────── */
    --font-heading: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Fluid scale: phone value → desktop value. Base body is 18px. */
    --text-xs:   0.8125rem;                                   /* 13 */
    --text-sm:   0.9375rem;                                   /* 15 */
    --text-base: 1.125rem;                                    /* 18 */
    --text-lg:   clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);  /* 19 → 22 */
    --text-xl:   clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);    /* 22 → 28 */
    --text-2xl:  clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);      /* 28 → 40 */
    --text-3xl:  clamp(2.25rem, 1.6rem + 3vw, 3.75rem);       /* 36 → 60 */

    --leading-tight: 1.15;
    --leading-snug: 1.3;
    --leading-body: 1.65;
    --tracking-eyebrow: 0.14em;
    --tracking-heading: -0.02em;

    /* ── Space (4px base) ───────────────────────────────────────────────── */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;
    --space-9: 6rem;
    --section-y: clamp(4rem, 3rem + 5vw, 7.5rem);

    /* ── Frame ──────────────────────────────────────────────────────────── */
    --container: 75rem;           /* 1200px */
    --container-narrow: 48rem;
    --gutter: clamp(1rem, 0.5rem + 2.5vw, 2rem);
    --header-height: 4.5rem;

    /* ── Shape and depth ────────────────────────────────────────────────── */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgb(10 26 51 / 0.06);
    --shadow: 0 4px 16px rgb(10 26 51 / 0.08);
    --shadow-lg: 0 18px 40px rgb(10 26 51 / 0.14);

    /* ── Motion ─────────────────────────────────────────────────────────── */
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --duration: 180ms;
    --duration-slow: 600ms;
  }
}
