/*
 * Trinovar Tech design tokens.
 * Light is the default theme. Dark applies when <html data-theme="dark"> is set by
 * js/theme.js, or from the system preference when JavaScript is unavailable.
 */
:root {
    color-scheme: light;

    /* Palette */
    --color-ink: #0e1a24;
    --color-ink-raised: #16242f;
    --color-paper: #f4f1ea;
    --color-surface: #fbf9f5;
    --color-text: var(--color-ink);
    --color-text-muted: #4f5a64;
    --color-line: #e2dccf;
    --color-line-strong: #cbc3b3;
    /* Form control boundaries need 3:1 against their background (WCAG 1.4.11). */
    --color-control-border: #8c8372;
    --color-accent: #9e3011;
    --color-accent-hover: #7f260d;
    --color-accent-soft: #f6e0d4;
    --color-on-accent: #ffffff;
    --color-on-ink: #f4f1ea;
    --color-on-ink-muted: #a8b3bd;
    --color-accent-on-ink: #ff7448;
    --color-error: #b42318;
    --color-error-soft: #fdecea;
    --color-success: #1f7a4d;
    --color-success-soft: #e7f4ed;
    --color-focus: var(--color-accent);
    /* Button fills: deep flamboyán with white text (5.19:1). The vivid #e2512a is reserved for non-text accents. */
    --color-cta: #c2401c;
    --color-cta-hover: #a93714;
    --color-on-cta: #ffffff;
    --color-ocean: #0f4c81;
    --color-header-bg: rgb(244 241 234 / 0.86);
    --color-band: var(--color-ink);

    /* Hero backdrop while the 3D scene loads */
    --scene-atmosphere: #b9dbe4;

    /* Typography */
    --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --step--1: clamp(0.833rem, 0.81rem + 0.1vw, 0.889rem);
    --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
    --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.333rem);
    --step-2: clamp(1.35rem, 1.22rem + 0.65vw, 1.75rem);
    --step-3: clamp(1.65rem, 1.42rem + 1.15vw, 2.35rem);
    --step-4: clamp(2rem, 1.6rem + 2vw, 3.2rem);
    --step-5: clamp(2.35rem, 1.75rem + 3vw, 4.25rem);
    --leading-tight: 1.1;
    --leading-snug: 1.3;
    --leading-normal: 1.6;
    --tracking-tight: -0.025em;
    --tracking-wide: 0.12em;

    /* Spacing (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;
    --space-10: 8rem;
    --section-space: clamp(4rem, 2.75rem + 5vw, 7.5rem);

    /* Layout */
    --container: 74rem;
    --container-narrow: 46rem;
    --gutter: clamp(1.25rem, 0.75rem + 2.5vw, 2.5rem);
    --header-height: 4.25rem;

    /* Shape & depth */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --radius-pill: 999px;
    --border: 1px solid var(--color-line);
    --shadow-sm: 0 1px 2px rgb(14 23 38 / 0.06);
    --shadow-md: 0 1px 2px rgb(14 23 38 / 0.04), 0 8px 24px -12px rgb(14 23 38 / 0.18);

    /* Motion */
    --duration: 150ms;
    --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* Dark theme: explicit choice made with the theme toggle (js/theme.js). */
:root[data-theme="dark"] {
    color-scheme: dark;
    --color-ink: #121e2a;
    --color-paper: #0a121b;
    --color-surface: #101b27;
    --color-text: #eef0f3;
    --color-text-muted: #a3adb8;
    --color-line: #1e2a38;
    --color-line-strong: #2e3d50;
    --color-control-border: #6b7a90;
    --color-accent: #ff7448;
    --color-accent-hover: #ff9472;
    --color-accent-soft: #3a1a10;
    --color-on-accent: #0a121b;
    --color-error: #f97066;
    --color-error-soft: #2c1414;
    --color-success: #5fd39a;
    --color-success-soft: #0f2a1e;
    --color-header-bg: rgb(10 18 27 / 0.82);
    --color-cta: #ff7448;
    --color-cta-hover: #ff9472;
    --color-on-cta: #0a121b;
    --color-ocean: #7db4e8;
    --color-band: #101b27;

    --scene-atmosphere: #0b1527;
}

/* Without JavaScript, follow the system preference. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --color-ink: #121e2a;
        --color-paper: #0a121b;
        --color-surface: #101b27;
        --color-text: #eef0f3;
        --color-text-muted: #a3adb8;
        --color-line: #1e2a38;
        --color-line-strong: #2e3d50;
        --color-control-border: #6b7a90;
        --color-accent: #ff7448;
        --color-accent-hover: #ff9472;
        --color-accent-soft: #3a1a10;
        --color-on-accent: #0a121b;
        --color-error: #f97066;
        --color-error-soft: #2c1414;
        --color-success: #5fd39a;
        --color-success-soft: #0f2a1e;
        --color-header-bg: rgb(10 18 27 / 0.82);
    --color-cta: #ff7448;
    --color-cta-hover: #ff9472;
    --color-on-cta: #0a121b;
    --color-ocean: #7db4e8;
        --color-band: #101b27;

        --scene-atmosphere: #0b1527;
    }
}
