/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    /* Anchor links land below the floating nav rather than under it. */
    scroll-padding-top: calc(var(--nav-height) + var(--nav-offset) + var(--space-md));
}

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
}

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

ul {
    list-style: none;
}

a,
a:link,
a:visited {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

h1, h2, h3 {
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.02;
}

h2 {
    font-size: clamp(1.875rem, 4vw, 3rem);
}

h3 {
    font-size: 1.25rem;
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.section-heading {
    text-align: center;
    max-width: 40rem;
    margin: 0 auto var(--space-2xl);
}

.section-heading p {
    color: var(--color-text-secondary);
    margin-top: var(--space-md);
    font-size: 1.125rem;
}

.eyebrow,
.overline {
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
}

/* Buttons */
.button,
.button:link,
.button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: 50px;
    padding: 0 var(--space-lg);
    border-radius: var(--radius-pill);
    background: var(--color-button);
    color: var(--color-button-contrast);
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.button:hover {
    background: var(--color-button-hover);
    color: var(--color-button-contrast);
}

.button:active {
    transform: scale(0.98);
}

.button-small,
.button-small:link,
.button-small:visited {
    min-height: 40px;
    padding: 0 var(--space-md) 0 0.875rem;
    font-size: 0.9375rem;
}

/* Navigation: a floating pill rather than a full-width bar. */
.site-header {
    position: fixed;
    top: var(--nav-offset);
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 var(--space-md);
}

.nav-pill {
    position: relative;
    max-width: var(--max-width);
    height: var(--nav-height);
    margin: 0 auto;
    padding: 0 10px 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    border-radius: var(--radius-pill);
    /* Solid while the page is at the top: a backdrop blur there samples the empty space above
       the document during rubber-banding and Safari's pull-to-refresh and shows a seam. The
       glass comes on once there is content to blur (see main.js). */
    background: var(--color-nav-bg-solid);
    box-shadow: var(--shadow-float);
    transition: background var(--transition-normal);
}

.site-header.is-scrolled .nav-pill {
    background: var(--color-nav-bg);
    backdrop-filter: var(--blur-nav);
    -webkit-backdrop-filter: var(--blur-nav);
}

.nav-logo,
.nav-logo:link,
.nav-logo:visited {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text);
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.nav-logo:hover {
    color: var(--color-text);
}

.nav-icon {
    border-radius: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-links a {
    display: block;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.9375rem;
    font-weight: 700;
    transition: background var(--transition-fast);
}

.nav-links a:hover {
    background: rgba(11, 16, 33, 0.06);
    color: var(--color-text);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0 10px;
    background: none;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Page header, for the legal pages */
.page-header {
    padding: calc(var(--nav-height) + var(--nav-offset) + var(--space-3xl)) 0 var(--space-xl);
    text-align: center;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
}

.footer-brand p {
    color: var(--color-text-secondary);
    margin-top: var(--space-md);
}

.social-links {
    display: flex;
    gap: var(--space-sm);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    opacity: 0.6;
    transition: opacity var(--transition-fast), background var(--transition-fast);
}

.social-links a:hover {
    opacity: 1;
    background: rgba(11, 16, 33, 0.06);
}

.social-links img {
    filter: var(--icon-filter);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    padding-top: var(--space-lg);
}

.footer-copyright {
    color: var(--color-text-tertiary);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 700;
}

.footer-links a:hover,
.footer-links a.active {
    color: var(--color-text);
}

/* Mobile */
@media (max-width: 768px) {
    .nav-pill {
        padding-left: var(--space-md);
    }

    .nav-toggle {
        display: flex;
    }

    /* Drops down from the pill as a card rather than taking the whole screen: the menu is
       three links, and the page behind it is what people came for. */
    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + var(--space-sm));
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-xs);
        padding: var(--space-sm);
        border-radius: var(--radius-lg);
        background: var(--color-surface);
        box-shadow: var(--shadow-float);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 0.75rem var(--space-md);
        font-size: 1.0625rem;
    }

    .page-header {
        padding-top: calc(var(--nav-height) + var(--nav-offset) + var(--space-2xl));
    }

    .footer-top {
        flex-direction: column;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}
