/* =====================================================================================================================
   Base — reset, typography and layout helpers. Uses tokens only (tokens/tokens.css must be loaded first).
   ===================================================================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
}

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

/* Typography */

h1, h2, h3, h4 {
    margin: 0 0 var(--space-3);
    line-height: var(--leading-tight);
    font-family: var(--font-heading);
    font-weight: var(--weight-bold);
    letter-spacing: -0.01em;
    text-wrap: balance;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); letter-spacing: 0; }
h4 { font-size: var(--text-lg); letter-spacing: 0; }

p {
    margin: 0 0 var(--space-4);
    text-wrap: pretty;
}

a {
    color: var(--accent);
    text-underline-offset: 0.2em;
}

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

code, kbd, pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

code {
    padding: 0.1em 0.35em;
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
}

:focus-visible {
    /* An outline, not a shadow: it stays visible in forced-colors (high contrast) mode. */
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: var(--space-3);
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lead {
    color: var(--text-muted);
    font-size: var(--text-lg);
    line-height: var(--leading-snug);
}

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

.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Layout */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

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

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

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

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

.section__head {
    max-width: var(--container-narrow);
    margin-bottom: var(--space-8);
}

.section__head--center {
    margin-inline: auto;
    text-align: center;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

/* Auto-fit grid: as many columns of at least --min as fit, one column on a phone. */
.grid {
    --min: 16rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(var(--min), 100%), 1fr));
    gap: var(--space-6);
}

/* Theme-specific content (e.g. logo-dark.svg): shown only in that theme */
.theme-dark-only {
    display: none !important;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-light-only { display: none !important; }
    :root:not([data-theme="light"]) .theme-dark-only { display: revert !important; }
}

:root[data-theme="dark"] .theme-light-only { display: none !important; }
:root[data-theme="dark"] .theme-dark-only { display: revert !important; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (min-width: 48rem) {
    .container { padding-inline: var(--space-8); }
    .section { padding-block: var(--space-24); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* "Skip to content" link: hidden until focused with the keyboard */
.skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 100;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-text);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}
