/* ==========================================================================
   02 · BASE — reset, typography, global elements
   ========================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
    /* On iOS, overflow-x on body (not html) breaks scrolling and fixed layers. */
    overflow-x: hidden;
}

body {
    margin: 0;
    padding-bottom: var(--footer-bar-h, 44px);   /* room for the fixed footer bar */
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color .4s ease, color .4s ease;
}

img, video { display: block; max-width: 100%; height: auto; }
/* A canvas has an intrinsic ratio. max-width:100% makes iOS Safari
   resize it from the bitmap and can cover or freeze the page. */
canvas { display: block; max-width: none; }
/* Inline icons must not inherit max-width:100%. Safari then draws every
   arrow at the full width of its row. */
svg.icon {
    display: inline-block;
    vertical-align: -0.2em;
    max-width: none;
}

h1, h2, h3, h4 {
    margin: 0 0 .5em;
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -.025em;
}
p { margin: 0 0 1.1em; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
code, pre { font-family: var(--font-mono); }

::selection { background: var(--brand); color: var(--black); }

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

/* Accessibility: skip link */
.skip-link {
    position: fixed; top: 10px; left: 10px; z-index: 1000;
    padding: .6rem 1rem; border-radius: 8px;
    background: var(--accent); color: var(--black); font-weight: 600;
    transform: translateY(-150%); transition: transform .2s;
}
.skip-link:focus { transform: none; }

/* Generic helpers */
.muted { color: var(--text-muted); }
.icon { width: 1.4em; height: 1.4em; flex-shrink: 0; }
.icon-sm { width: 1em; height: 1em; }

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
