/* base.css — reset, root elements, typography baseline, utilities, motion primitives */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* offset anchored scroll so sticky header doesn't cover section tops */
    scroll-padding-top: calc(var(--header-h) + 1rem);
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: 1.65;
    color: var(--text-primary);
    background-color: var(--bg-deep);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
    position: relative;
    min-height: 100vh;
}

/* Fine film-grain overlay — preserved brand texture, sits above everything, inert */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.022;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
}

/* ---- Typography baseline ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--white);
    text-wrap: balance;
    /* never let a long word force horizontal scroll on small screens */
    overflow-wrap: anywhere;
    min-width: 0;
}

p { text-wrap: pretty; }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out);
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

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

::selection {
    background: var(--accent);
    color: var(--bg-deep);
}

/* ---- Accessible focus (outline renders instantly — never transitioned) ---- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ---- Layout helpers ---- */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--space-section);
    position: relative;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    font-family: var(--font-display);
    font-size: var(--text-label);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.eyebrow::before {
    content: '';
    width: 1.75rem;
    height: 1px;
    background: var(--accent);
    opacity: 0.7;
}

.section-head {
    max-width: 640px;
    margin-inline: auto;
    text-align: center;
    margin-bottom: var(--space-2xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.section-head h2 {
    font-size: var(--text-h2);
    font-weight: var(--weight-black);
}

.section-head p {
    color: var(--text-secondary);
    font-size: var(--text-lead);
    max-width: 52ch;
}

.text-accent { color: var(--accent); }

.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;
}

/* ---- Scroll-reveal primitive ---- */
.reveal {
    opacity: 0;
    transform: translateY(34px);
    transition:
        opacity var(--dur-slow) var(--ease-out),
        transform var(--dur-slow) var(--ease-out);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }

/* ---- Reduced motion: collapse spatial motion to a quiet fade ---- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
