/* ==========================================================================
   THEME — 02 base
   --------------------------------------------------------------------------
   Reset, document defaults, font loading, layout primitives and the
   accessibility primitives (focus ring, skip link, screen-reader text).
   ========================================================================== */

/* ---- Font: Plus Jakarta Sans (SIL Open Font License 1.1) ----
   One variable file serves the whole 200-800 weight range. font-display:
   swap keeps text visible while it loads, and size-adjust on the fallback
   stops the swap from shifting the layout. */
@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/plus-jakarta-sans-var-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: local("Plus Jakarta Sans");
    size-adjust: 100%;
}

@font-face {
    font-family: "Plus Jakarta Sans Fallback";
    src: local("Arial");
    size-adjust: 107%;
    ascent-override: 90%;
    descent-override: 22%;
    line-gap-override: 0%;
}

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

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* Anchors and the sticky header must not collide. */
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--text-body);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    /* Guard against a stray wide child creating a horizontal scrollbar.
       `clip` (not `hidden`) keeps position:sticky working inside. */
    overflow-x: clip;
    transition: background-color var(--dur-base) var(--ease-in-out),
                color var(--dur-base) var(--ease-in-out);
}

img,
picture,
svg,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

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

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

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

a:hover {
    color: var(--brand-hover);
}

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

/* ---- Headings ---- */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-strong);
    font-weight: 800;
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
}

h1 { font-size: clamp(2.125rem, 5.2vw, var(--fs-5xl)); }
h2 { font-size: clamp(1.75rem, 3.8vw, var(--fs-4xl)); }
h3 { font-size: clamp(1.25rem, 2.4vw, var(--fs-2xl)); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-base); }

p {
    text-wrap: pretty;
}

::selection {
    background: var(--c-blue-500);
    color: #fff;
}

/* ---- Accessibility primitives ---- */
:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

/* Remove the default ring only where we replace it with :focus-visible. */
:focus:not(:focus-visible) {
    outline: none;
}

.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;
    top: 0;
    left: 50%;
    transform: translate(-50%, -110%);
    z-index: calc(var(--z-header) + 10);
    padding: var(--sp-3) var(--sp-5);
    background: var(--brand);
    color: var(--text-on-brand);
    font-weight: 700;
    border-radius: 0 0 var(--r-md) var(--r-md);
    transition: transform var(--dur-base) var(--ease-out);
}

.skip-link:focus {
    transform: translate(-50%, 0);
    color: var(--text-on-brand);
}

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

.container--narrow {
    max-width: var(--container-narrow);
}

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

.section--tight {
    padding-block: var(--sp-12);
}

.section--alt {
    background: var(--bg-surface);
    border-block: 1px solid var(--border-subtle);
}

.section-head {
    max-width: 44rem;
    margin-inline: auto;
    margin-bottom: var(--sp-12);
    text-align: center;
}

.section-head p {
    margin-top: var(--sp-3);
    font-size: var(--fs-md);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-1) var(--sp-3);
    margin-bottom: var(--sp-4);
    border-radius: var(--r-pill);
    background: var(--brand-soft);
    color: var(--brand-soft-text);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.eyebrow--onbrand {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .3);
}

/* Gradient headline, matching the reference's signature treatment. */
.grad-text {
    background: var(--grad-text);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: grad-pan 6s var(--ease-in-out) infinite;
}

@keyframes grad-pan {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---- Grid helpers ---- */
.grid {
    display: grid;
    gap: var(--sp-6);
}

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

@media (max-width: 767.98px) {
    :root {
        --section-y: 3.25rem;
    }

    .container {
        padding-inline: var(--sp-4);
    }
}
