/*
 * The foundations every page built since the pivot of 2026-11-24 shares: the page itself, type, links,
 * focus, the page width, the gentle reveals, and still pictures for visitors who prefer less motion.
 * Pages from before the pivot (Company, Terms, Privacy) keep site.css instead until they are rewritten.
 * Spec: Design/pivot-2026-11-24/DESIGN.md, sections 3 and 4.
 */

/* ---------- The page ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Anything hidden stays hidden, even when a component gives it its own display */
[hidden] {
    display: none !important;
}

html {
    background: var(--color-ink);
    color: var(--color-text);
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--color-ink);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

img,
video,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

/* ---------- Type ---------- */

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-display);
    font-stretch: 108%;
    font-weight: 620;
    text-wrap: balance;
}

p,
ul,
ol,
dl,
dd {
    margin: 0;
}

/* ---------- Focus: one ring everywhere ---------- */

:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
}

/* The main area takes focus after the skip link, without a ring around the whole page */
.page-content:focus {
    outline: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- The page width: 1240 px of content inside the gutter ---------- */

.page-width {
    width: 100%;
    max-width: calc(var(--content-width) + 2 * var(--page-gutter));
    margin: 0 auto;
    padding: 0 var(--page-gutter);
}

/* ---------- Reveal on scroll, only when the script has run, so nothing is ever hidden without it ---------- */

.has-reveal [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 640ms var(--ease-out), transform 640ms var(--ease-out);
    transition-delay: calc(var(--reveal-order, 0) * 90ms);
}

.has-reveal [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* Items in one group arrive 90 ms apart, five at most (classes, since the content policy allows no inline styles) */
.reveal-order-1 {
    --reveal-order: 1;
}

.reveal-order-2 {
    --reveal-order: 2;
}

.reveal-order-3 {
    --reveal-order: 3;
}

.reveal-order-4 {
    --reveal-order: 4;
}

/* ---------- Reduced motion: still pictures, instant changes, nothing drifts ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        transition-delay: 0ms !important;
    }

    .has-reveal [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
