/* ============================================================================
   BASE — reset, root typography, layout primitives, accessibility
   ============================================================================ */

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

* {
    margin: 0;
}
/* overflow-x on the root propagates to the viewport, clipping the fixed
   off-canvas nav when closed (clip on body would not, since the panel's
   containing block is the viewport). Vertical scroll & sticky header unaffected. */
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-relaxed);
    color: var(--color-text);
    font-weight: 400;
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img, picture, svg, video {
    display: block;
    max-width: 100%;
    /* pairs with max-width so intrinsic width/height attributes (kept for CLS)
       scale proportionally instead of stretching the image */
    height: auto;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
    padding: 0;
}

:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* a11y: white focus ring on blue surfaces where the blue ring is low-contrast (skill §1) */
.hero :focus-visible,
.section--invert :focus-visible,
.site-header:not([data-scrolled]) :focus-visible {
    outline-color: #fff;
}

/* Headings */
h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    color: var(--color-text-strong);
    line-height: var(--lh-heading);
}

h1 {
    font-size: var(--fs-h1);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-tight);
}

h2 {
    font-size: var(--fs-h2);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-tight);
    text-transform: capitalize;
}

h3 {
    font-size: var(--fs-h3);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-tight);
    text-transform: capitalize;
}

h4 {
    font-size: var(--fs-h4);
    font-weight: var(--fw-semibold);
    text-transform: capitalize;
}

h5 {
    font-size: var(--fs-h5);
    font-weight: var(--fw-semibold);
}

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

.section {
    padding-block: var(--section-pad-y);
}

.section--alt {
    background: var(--color-bg-alt);
}

.section__head {
    max-width: var(--container-narrow);
    margin-inline: auto;
    text-align: center;
    margin-bottom: var(--space-12);
}

    .section__head p {
        color: var(--color-text-secondary);
        font-size: var(--fs-body-lg);
        margin-top: var(--space-3);
    }

/* Eyebrow / overline */
.eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: var(--fs-overline);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: var(--space-6);
}

.lead {
    font-size: var(--fs-body-lg);
    color: var(--color-text-primary);
}

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

/* Visually hidden (screen-reader only) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -100px;
    z-index: 1000;
    background: var(--color-ink);
    color: var(--color-on-ink);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    transition: top var(--dur-base) var(--ease-out);
}

    .skip-link:focus {
        top: var(--space-4);
    }

/* Scroll-reveal animation primitive */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

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

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

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

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