/*
    base.css — element defaults and the handful of text helpers used everywhere.
    Everything here applies to bare HTML; named components live in their own files.
*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--canvas);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-2);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-tight);
    color: var(--text);
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }
h5, h6 { font-size: var(--text-base); }

p {
    margin: 0 0 var(--space-3);
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease);
}

a:hover {
    color: var(--brand-muted);
}

ul, ol {
    margin: 0;
    padding: 0;
}

img, svg {
    max-width: 100%;
}

hr {
    height: 1px;
    margin: var(--space-5) 0;
    border: 0;
    background: var(--border);
}

small {
    font-size: var(--text-sm);
}

::selection {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Scrollbars that match the surfaces they sit on. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--border-strong);
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-subtle);
    background-clip: content-box;
}

/* ---- Text helpers ---- */

.eyebrow {
    display: inline-block;
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--brand);
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-subtle {
    color: var(--text-subtle);
}

.numeric {
    font-family: var(--font-numeric);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* Running text that is not part of a form or a table. */
.prose {
    max-width: 72ch;
    color: var(--text-muted);
    line-height: 1.75;
}

/*
    A block that fades in as it is scrolled to. ui.js adds .is-visible; without
    JavaScript the block is simply there from the start.
*/
.reveal {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .45s var(--ease), transform .45s var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
