/* ==========================================================================
   base.css — reset + element defaults. Loaded on every page, after tokens.
   ========================================================================== */

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

/* Constrain the media that actually overflows. Never `* { max-width: 100% }`. */
img,
svg,
video,
iframe {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Drop the UA figure margin; spacing is the layout's job. */
figure {
    margin: 0;
}

/* Root sizing lever. 1rem = 10px, then the root is scaled by the viewport at
   two bands so every rem-authored value scales with the page and needs no
   per-element media query. The 767–1024 band compresses to fit tablets; past
   1441 the layout grows with the viewport. See agency/development.md. */
html {
    font-size: 10px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    /* Anchored sections clear the sticky header. */
    scroll-padding-top: 9.6rem;
}

/* Lower bound is this design's desktop breakpoint, not the house default of
   767px: below 981px the layout is already the mobile one, and compressing it
   drops body text to ~11px. The band compresses the desktop layout only. */
@media only screen and (min-width: 981px) and (max-width: 1024px) {
    html {
        font-size: 0.85vw;
    }
}

@media only screen and (min-width: 1441px) {
    html {
        font-size: 0.6945759vw;
    }
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink-body);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
    line-height: var(--leading-snug);
    text-wrap: balance;
    /* A single long word (e.g. "Installations") at display size is wider than a
       narrow phone, and its min-content would otherwise force the grid track
       wider than the viewport. Let it break only when a line truly can't hold. */
    overflow-wrap: break-word;
}

h1 {
    font-size: var(--fs-1);
    font-weight: 800;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-display);
    text-transform: uppercase;
}

h2 {
    font-size: var(--fs-2);
    font-weight: 800;
    letter-spacing: var(--tracking-display);
}

h3 {
    font-size: var(--fs-3);
    font-weight: 700;
    letter-spacing: -0.015em;
}

h4 {
    font-size: var(--fs-4);
    font-weight: 700;
}

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

p:last-child {
    margin-bottom: 0;
}


a {
    color: var(--blue-text);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color var(--dur) var(--ease-out);
}

a:hover {
    color: var(--blue-fill-hover);
}

ul, ol {
    margin: 0;
    padding: 0;
}

strong {
    font-weight: 600;
    color: var(--ink);
}

/* Visible, consistent focus for every interactive element. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--blue-fill);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Screen-reader-only, still focusable. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -100%;
    z-index: var(--z-modal);
    padding: var(--space-3) var(--space-5);
    background: var(--ink);
    color: var(--ink-on-dark);
    border-radius: 0 0 var(--radius) var(--radius);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
    color: var(--ink-on-dark);
}

/* --------------------------------------------------------------------------
   Reduced motion. Applies site-wide, not per-component.
   -------------------------------------------------------------------------- */
/* Reduced motion means fewer and gentler animations, not zero. Colour and
   opacity transitions aid comprehension and stay; anything that moves an
   element through space is removed. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-property: opacity, color, background-color, border-color,
                             fill, stroke !important;
        transition-duration: var(--dur) !important;
        scroll-behavior: auto !important;
    }

    /* Nothing translates, scales, or rotates. Press feedback becomes a
       colour change, which the button already has. */
    [data-reveal],
    [data-stagger] > *,
    .hero__inner > *,
    .btn:active,
    .call-fab:active,
    .gallery-grid button:active,
    .nav__panel,
    .lightbox {
        transform: none !important;
        translate: none !important;
        scale: none !important;
    }
}
