* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-hanken);
    -webkit-font-smoothing: antialiased;
}

/* --- topbar --- */

.legal-topbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 20rem;
    border-bottom: 1px solid var(--color-border-base);
    background: var(--color-bg-aa);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.legal-topbar .logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-text);
}

.legal-topbar .logo img {
    height: 1.75rem;
    width: 1.75rem;
}

.legal-topbar .logo b {
    font-size: 1.25rem;
    font-family: var(--font-space);
}

.legal-topbar .options {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.legal-topbar .options a {
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: 0.15s;
}

.legal-topbar .options a.secondary {
    color: var(--color-text);
    opacity: 0.8;
}

.legal-topbar .options a.secondary:hover {
    opacity: 1;
}

.legal-topbar .options a.primary {
    color: var(--color-black);
    background: var(--color-accent);
    font-weight: 600;
}

.legal-topbar .options a.primary:hover {
    background: var(--color-accent-88);
}

/* --- layout --- */

.legal-wrap {
    display: flex;
    flex-direction: row;
    gap: 4rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

/* --- table of contents --- */

.legal-toc {
    flex: 0 0 240px;
    position: sticky;
    top: 6rem;
    align-self: flex-start;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}

.legal-toc .toc-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-mono);
    color: var(--color-muted);
    margin-bottom: 1rem;
}

.legal-toc a {
    display: block;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.35rem 0;
    opacity: 0.7;
    transition: 0.15s;
    line-height: 1.4;
}

.legal-toc a:hover {
    opacity: 1;
    color: var(--color-accent);
}

/* --- article --- */

.legal-content {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 760px;
}

.legal-content .eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    margin: 0 0 0.75rem;
}

.legal-content h1 {
    font-family: var(--font-space);
    font-size: 2.5rem;
    line-height: 1.1;
    margin: 0 0 0.75rem;
}

.legal-content .meta {
    color: var(--color-muted);
    font-size: 0.875rem;
    margin: 0 0 2.5rem;
}

.legal-content .meta span {
    color: var(--color-text);
    opacity: 0.8;
}

.legal-content h2 {
    font-family: var(--font-space);
    font-size: 1.4rem;
    margin: 3rem 0 1rem;
    padding-top: 1rem;
    scroll-margin-top: 6rem;
}

.legal-content h3 {
    font-size: 1.1rem;
    margin: 2rem 0 0.75rem;
    scroll-margin-top: 6rem;
}

.legal-content p,
.legal-content li {
    font-size: 0.975rem;
    line-height: 1.7;
    color: var(--color-text);
    opacity: 0.92;
}

.legal-content ul,
.legal-content ol {
    padding-left: 1.25rem;
}

.legal-content li {
    margin: 0.4rem 0;
}

.legal-content a {
    color: var(--color-accent);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-content strong {
    font-weight: 600;
}

.legal-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--color-surface);
    border: 1px solid var(--color-border-base);
    border-radius: 0.35rem;
    padding: 0.1rem 0.35rem;
}

.legal-content .lead {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.legal-content .callout {
    background: var(--color-accent-1a);
    border: 1px solid var(--color-accent-55);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin: 2rem 0;
}

.legal-content .callout p {
    margin: 0;
    font-size: 0.9rem;
}

/* --- tables --- */

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.legal-table th,
.legal-table td {
    text-align: left;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--color-border-base);
    vertical-align: top;
    line-height: 1.5;
}

.legal-table th {
    background: var(--color-surface);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
}

.legal-table td {
    opacity: 0.92;
}

/* --- footer --- */

.legal-footer {
    border-top: 1px solid var(--color-border-base);
    background: var(--color-bg-aa);
    padding: 2rem 20rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.legal-footer p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

.legal-footer .links {
    display: flex;
    flex-direction: row;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.legal-footer .links a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.8;
    transition: 0.15s;
}

.legal-footer .links a:hover {
    opacity: 1;
}

/* --- responsive --- */

@media (max-width: 1600px) {
    .legal-topbar {
        padding: 1.25rem 12.5rem;
    }
    .legal-footer {
        padding: 2rem 12.5rem;
    }
}

@media (max-width: 1100px) {
    .legal-topbar {
        padding: 1.25rem 2rem;
    }
    .legal-footer {
        padding: 2rem 2rem;
    }
    .legal-wrap {
        flex-direction: column;
        gap: 2rem;
        padding-top: 2.5rem;
    }
    .legal-toc {
        position: static;
        max-height: none;
        flex-basis: auto;
    }
    .legal-toc a {
        display: inline-block;
        margin-right: 1rem;
    }
}

@media (max-width: 480px) {
    .legal-content h1 {
        font-size: 2rem;
    }
    .legal-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .legal-table {
        display: block;
        overflow-x: auto;
    }
}
