/* ============================================================
   base.css — reset, typography, layout primitives, utilities
   Token-only: never raw hex (see tokens.css). Inter for body,
   Orbitron for display/brand/.mono per design-system.md.
   ============================================================ */

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) and (min-width: 99999px) { /* forced off: animations stay on for cross-browser parity (see reduceMotion in main.js) */
    html { scroll-behavior: auto; }
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

img, svg { display: block; max-width: 100%; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--accent-strong); }

button { font-family: inherit; cursor: pointer; }

input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* ---------- Typography ---------- */
h1, h2, h3, .brand, .mono {
    font-family: "Orbitron", sans-serif;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); }

p { color: var(--text-secondary); }

.mono {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.lead {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    line-height: 1.55;
    color: var(--text-secondary);
}

/* ---------- Layout primitives ---------- */
.container {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.section {
    padding-block: clamp(4.5rem, 9vw, 8rem);
    position: relative;
}

.section-head { max-width: 660px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head.center { margin-inline: auto; text-align: center; }

/* ---------- Eyebrow / kicker ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    font-family: "Orbitron", sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.1rem;
}
.eyebrow::before {
    content: "";
    width: 1.6rem;
    height: 1px;
    background: var(--accent);
    opacity: 0.6;
}
.eyebrow.center::before { display: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.8rem 1.5rem;
    border-radius: var(--r-pill);
    border: 1px solid transparent;
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: transform 0.18s ease, background-color 0.2s ease,
                border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: translateY(1px); }

.btn-accent {
    background: var(--accent);
    color: var(--accent-contrast);
    box-shadow: 0 6px 20px var(--accent-tint-10);
}
.btn-accent:hover {
    background: var(--accent-strong);
    color: var(--accent-contrast);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px var(--accent-tint-10);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border-hard);
}
.btn-ghost:hover {
    background: var(--ink-04);
    color: var(--text);
    border-color: var(--text-secondary);
}

.btn-sm { padding: 0.55rem 1.05rem; font-size: 0.86rem; }
.btn-lg { padding: 0.95rem 1.9rem; font-size: 1rem; }

/* ---------- Pill / badge ---------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    padding: 0.35rem 0.85rem;
    border-radius: var(--r-pill);
    border: 1px solid var(--ink-10);
    background: var(--ink-03);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.pill .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--positive);
    box-shadow: 0 0 0 3px var(--accent-tint-08);
}

/* ---------- Surfaces ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--ink-08);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
}

/* ---------- Financial value helpers ---------- */
.val-pos { color: var(--positive); }
.val-neg { color: var(--negative); }

/* ---------- Scroll-reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) and (min-width: 99999px) { /* forced off: animations stay on for cross-browser parity (see reduceMotion in main.js) */
    .reveal { opacity: 1; transform: none; transition: none; }
    .btn, a, .card { transition: none !important; }
}

/* ---------- Utilities ---------- */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
