/*
 * Nhật Thực Camera design tokens.
 * Three layers: primitive, semantic and component.
 *
 * Shape rule for the whole theme (one documented system):
 *   pills 999px · buttons and inputs --radius-sm · media and cards --radius-md
 *   large panels --radius-lg · chips and badges --radius-xs
 *
 * Heading rule: size comes from a role token (--heading-display … --heading-card),
 * never from an ad hoc clamp, so a long page keeps a readable hierarchy.
 *
 * Breakpoint scale, used by every stylesheet in the theme:
 *   390 small phone | 540 phone | 700 mobile/tablet edge | 960 tablet/desktop edge | 1180 nav
 * site.css, blog.css, popup.css and compliance-sections.css are desktop-first (max-width);
 * pages.css is mobile-first and uses the complements 701 and 961, so the tiers line up.
 */

/* ---------------------------------------------------------------- *
 * Layer 1: primitives
 * ---------------------------------------------------------------- */
:root {
    color-scheme: light;

    /* Brand blue */
    --brand-blue-50: #f5faff;
    --brand-blue-100: #eaf3fd;
    --brand-blue-200: #cfe3f8;
    --brand-blue-300: #8ed8ff;
    --brand-blue-400: #2b8cff;
    --brand-blue-500: #0a6ed1;
    --brand-blue-600: #095fb7;
    --brand-blue-700: #0857a8;
    --brand-blue-800: #123f6d;
    --brand-blue-900: #0b2545;

    /* Brand orange */
    --brand-orange-100: #fff0eb;
    --brand-orange-200: #ffd5c9;
    --brand-orange-300: #ffad98;
    --brand-orange-400: #ff8a5b;
    --brand-orange-500: #f26445;
    --brand-orange-600: #d94d30;
    --brand-orange-700: #bd3d23;
    --brand-orange-800: #9f321d;
    --brand-orange-900: #7d291a;
    --brand-orange-950: #561b12;

    /* Neutral, warmed toward the brand hue so greys never read cold-cyan */
    --neutral-0: #ffffff;
    --neutral-25: #fcfdfe;
    --neutral-50: #f4f7f9;
    --neutral-100: #eaf0f3;
    --neutral-200: #d6e1e7;
    --neutral-300: #b6c8d2;
    --neutral-400: #7f96a2;
    --neutral-500: #5f7785;
    --neutral-600: #4a6574;
    --neutral-700: #2e4a59;
    --neutral-800: #1d3645;
    --neutral-900: #102b3a;
    --neutral-950: #071f2e;
    --neutral-975: #061823;
    --neutral-1000: #041119;

    /* Status */
    --status-success-surface: #e8f3ed;
    --status-success-border: #4c805f;
    --status-success-ink: #245637;
    --status-danger-surface: #f9ebe6;
    --status-danger-border: #b15a3e;
    --status-danger-ink: #793c28;

    /* 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-32: 8rem;

    /* Fluid type scale, 375px viewport to 1440px */
    --font-size-2xs: 0.75rem;
    --font-size-xs: 0.8125rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: clamp(1.0625rem, 1.04rem + 0.1vw, 1.125rem);
    --font-size-lg: clamp(1.0625rem, 1.03rem + 0.18vw, 1.1875rem);
    --font-size-xl: clamp(1.125rem, 1.075rem + 0.28vw, 1.3125rem);
    --font-size-2xl: clamp(1.375rem, 1.25rem + 0.55vw, 1.75rem);
    --font-size-3xl: clamp(1.625rem, 1.45rem + 0.75vw, 2.125rem);
    --font-size-4xl: clamp(1.75rem, 1.53rem + 0.95vw, 2.375rem);
    --font-size-5xl: clamp(1.95rem, 1.68rem + 1.2vw, 2.75rem);
    --font-size-6xl: clamp(2.05rem, 1.35rem + 2.1vw, 3.25rem);

    /* Line heights, tuned a little loose for Vietnamese stacked diacritics */
    --leading-display: 1.08;
    --leading-heading: 1.18;
    --leading-snug: 1.35;
    --leading-body: 1.7;
    --leading-relaxed: 1.8;

    --tracking-display: -0.03em;
    --tracking-heading: -0.02em;
    --tracking-label: 0.09em;

    --weight-body: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* Shape */
    --radius-xs: 0.25rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.625rem;
    --radius-lg: 0.875rem;
    --radius-full: 999px;

    /* Elevation, tinted to the navy background hue */
    --shadow-xs: 0 1px 2px rgb(7 31 46 / 0.08);
    --shadow-sm: 0 4px 14px rgb(7 31 46 / 0.10);
    --shadow-md: 0 14px 34px rgb(7 31 46 / 0.13);
    --shadow-lg: 0 24px 64px rgb(7 31 46 / 0.17);
    --shadow-menu: var(--shadow-lg);
    --shadow-media: 0 24px 64px rgb(0 91 139 / 0.22);
    --shadow-dialog: 0 32px 96px rgb(7 31 46 / 0.28);
    --shadow-inverse-media: 0 28px 70px rgb(4 17 25 / 0.28);
    --shadow-mobile-bar: 0 -10px 30px rgb(7 31 46 / 0.14);

    --duration-fast: 160ms;
    --duration-base: 240ms;
    --duration-slow: 420ms;
    --ease-standard: cubic-bezier(0.2, 0.7, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------------------------------------------------------------- *
 * Layer 2: semantic (light)
 * ---------------------------------------------------------------- */
:root {
    --font-body: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
    --font-display: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;

    --color-brand: var(--brand-blue-500);
    --color-brand-bright: var(--brand-blue-400);
    --color-brand-hover: var(--brand-blue-700);
    --color-brand-deep: var(--brand-blue-900);
    --color-accent: var(--brand-orange-500);
    --color-accent-strong: var(--brand-orange-800);
    --color-accent-pressed: var(--brand-orange-900);
    --color-focus: var(--brand-orange-800);

    --color-ink: var(--neutral-950);
    --color-text: var(--neutral-700);
    --color-muted: var(--neutral-600);
    --color-faint: var(--neutral-500);
    --color-border: var(--neutral-200);
    --color-border-strong: var(--neutral-300);
    --color-surface: var(--neutral-50);
    --color-surface-sunken: var(--neutral-100);
    --color-surface-raised: var(--neutral-0);
    --color-surface-brand: var(--brand-blue-100);
    --color-surface-accent: var(--brand-orange-100);
    --color-on-brand: var(--neutral-0);
    --color-brand-panel: var(--brand-blue-700);

    /* Inverted surfaces: the footer, the readiness panel, the quote scope.
       These stay dark in both themes, so they carry their own scale. */
    --color-inverse-surface: var(--brand-blue-900);
    --color-inverse-surface-alt: #0f3157;
    --color-inverse-ink: var(--neutral-0);
    --color-inverse-text: #e3edf7;
    --color-inverse-muted: #bfd0e0;
    --color-inverse-faint: #9eb4c9;
    --color-inverse-border: #315a83;
    --color-inverse-border-strong: #527ca4;
    --color-inverse-brand: var(--brand-blue-300);
    --color-inverse-accent: var(--brand-orange-400);
    /* Small text on --color-inverse-panel needs the lighter step: the 400
       only reaches 3.9:1 there, the 300 clears 5.0:1. */
    --color-inverse-accent-bright: var(--brand-orange-300);
    --color-inverse-panel: #164b7a;
    --color-inverse-panel-hover: #1d5c94;
    --color-inverse-panel-translucent: rgb(22 75 122 / 0.82);
    --color-inverse-gradient-end: var(--brand-blue-800);
    --color-inverse-glow: rgb(43 140 255 / 0.24);
    --color-inverse-grid-dot: rgb(142 216 255 / 0.18);
    --color-accent-border: var(--brand-orange-300);
    --shadow-reference-card: 0 16px 30px rgb(4 17 25 / 0.12);
    --color-scrim: rgb(4 17 25 / 0.78);
    /* Lighter than the dialog scrim: the menu panel sits close to the page. */
    --color-scrim-soft: rgb(4 17 25 / 0.46);
    --color-scroll-shadow: rgb(7 31 46 / 0.18);
    --color-status-error: var(--status-danger-ink);

    /* Heading roles form one restrained hierarchy. The homepage display is
       the only 52px tier; inner-page titles stop at 44px and sections at 38px. */
    --heading-display: var(--font-size-6xl);
    --heading-page: var(--font-size-5xl);
    --heading-major: var(--font-size-4xl);
    --heading-section: var(--font-size-3xl);
    --heading-sub: var(--font-size-2xl);
    --heading-card: var(--font-size-xl);
    --heading-tight: var(--font-size-lg);

    /* Standalone figures, larger than any heading and always tabular. */
    --numeral-lg: clamp(2.25rem, 1.55rem + 3vw, 4rem);
    --numeral-xl: clamp(2.75rem, 1.9rem + 3.6vw, 4.75rem);
    --numeral-hero: clamp(3.25rem, 1.75rem + 6.4vw, 6rem);

    --content-max: 80rem;
    --content-reading: 68ch;
    /* Cap for section and page headlines. Wide enough that a headline only
       wraps when its column runs out, not at a fixed 16-24ch. */
    --headline-measure: 40ch;

    /* Vertical rhythm in three steps so a long page groups instead of
       repeating one identical gap fifteen times. */
    --section-space-sm: clamp(2.75rem, 4.5vw, 4rem);
    --section-space: clamp(4rem, 6.5vw, 6.5rem);
    --section-space-lg: clamp(5.25rem, 9vw, 9rem);

    /* Compatibility aliases kept for imported and first-pass theme styles. */
    --blue: var(--color-brand-bright);
    --blue-dark: var(--color-brand);
    --orange: var(--color-accent);
    --ink: var(--color-ink);
    --text: var(--color-text);
    --muted: var(--color-muted);
    --line: var(--color-border);
    --soft: var(--color-surface);
    --pale: var(--color-surface-brand);
    --white: var(--color-surface-raised);
    --radius: var(--radius-lg);
    --radius-button: var(--radius-sm);
    --radius-input: var(--radius-sm);
    --radius-panel: var(--radius-lg);
    --radius-media: var(--radius-md);
    --shadow: var(--shadow-media);
}

/* ---------------------------------------------------------------- *
 * Layer 3: component
 * ---------------------------------------------------------------- */
:root {
    --button-bg: var(--color-brand);
    --button-bg-hover: var(--color-brand-hover);
    --button-fg: var(--color-on-brand);
    --button-padding-x: 1.25rem;
    --button-height: 3rem;
    --button-radius: var(--radius-sm);

    --input-bg: var(--color-surface-raised);
    --input-border: var(--neutral-400);
    --input-focus-ring: var(--color-focus);
    --input-height: 3.25rem;
    --input-radius: var(--radius-sm);

    --panel-bg: var(--color-surface-raised);
    --panel-border: var(--color-border);
    --panel-radius: var(--radius-lg);
    --header-height: 4.75rem;
}

/* The public theme is intentionally light-only. Navy remains available as a
   component surface for authority bands, media captions and the footer. */
