/**
 * Compliance, Privacy Policy and Terms of Service.
 *
 * One stylesheet for all three. They previously used two: terms.css was a
 * byte-identical copy of privacy.css, and compliance.html linked privacy.css
 * rather than having one of its own — three pages, two files, one a duplicate.
 *
 * The legal text itself is untouched by this work. What changes is that it
 * becomes navigable and readable:
 *
 *  - Privacy and Terms carry fifteen numbered sections each, previously in one
 *    unbroken column with no way to reach a section except scrolling past every
 *    section before it. A sticky rail, built by legal.js from the document's
 *    own headings, fixes that.
 *
 *  - The body ran the full container width — around 110 characters a line at a
 *    desktop size, well past the 45-75 that prose is comfortable at. Capping
 *    the column at 70ch is most of the readability gain here, independent of
 *    anything else.
 *
 * The banner is the shared .hero from tokens.css, the same one the status page,
 * About and the FAQ open with.
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Two columns: a rail that stays put, and the document ─────────────── */
.legal {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 56px;
    max-width: 1080px;
    margin: 0 auto;
    padding: 56px 24px 84px;
    align-items: start;
}

/* Hidden until legal.js fills it, so a page without scripting shows the
   document rather than an empty "On this page" heading. */
.legal-toc[hidden] { display: none; }

.legal-toc {
    position: sticky;
    top: 20px;
}

.legal-toc h2 {
    margin: 0 0 12px;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.legal-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--line);
}

.legal-toc a {
    display: block;
    padding: 7px 0 7px 15px;
    margin-left: -1px;
    font-size: var(--text-sm);
    line-height: 1.45;
    color: var(--ink-3);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}

.legal-toc a:hover { color: var(--ink-2); }

.legal-toc a:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

.legal-toc a[aria-current="true"] {
    color: var(--ink);
    border-left-color: var(--ink);
    font-weight: 600;
}

/* ── The document ─────────────────────────────────────────────────────── */
.legal-doc { max-width: 70ch; }

.legal-doc .last-updated {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}

.legal-doc h2 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--ink);
    margin: 38px 0 12px;
    /* Clears the sticky site header when an anchor lands on it. */
    scroll-margin-top: 90px;
}

.legal-doc h3 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
    margin: 24px 0 8px;
}

.legal-doc p {
    margin: 0 0 14px;
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 1.75;
}

.legal-doc ul {
    margin: 0 0 14px;
    padding-left: 20px;
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 1.75;
}

.legal-doc li { margin-bottom: 6px; }
.legal-doc strong { color: var(--ink); }

.legal-doc a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* The callout, in the accent-rule shape About and the FAQ use, rather than a
   grey slab that reads as a different kind of content. */
.legal-doc .note {
    border-left: 2px solid var(--ink);
    padding: 3px 0 3px 17px;
    margin: 0 0 20px;
}

.legal-doc .note p {
    margin: 0;
    color: var(--ink);
    font-size: var(--text-base);
}

/* ── Get in touch ─────────────────────────────────────────────────────────
   Compliance ends by pointing at "our support channels" without naming one.
   This is the Help Center's block, the same one About and the FAQ end with. */
.legal-doc .channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin: 18px 0 0;
}

.legal-doc .channel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    font-size: 13.5px;
    text-decoration: none;
    transition: border-color var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}

.legal-doc .channel:hover {
    border-color: var(--ink);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.legal-doc .channel svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--ink-2);
}

.legal-doc .channel:hover svg { color: var(--ink); }

/* ── Entrance ─────────────────────────────────────────────────────────────
   reveal.js drives this; only the direction differs from the default rise. */
@media (prefers-reduced-motion: no-preference) {
    .legal [data-reveal] { transform: translateX(-22px); }
    .legal [data-reveal].is-revealed { transform: none; }
}

/* ── Narrow ───────────────────────────────────────────────────────────────
   The rail stops being sticky and becomes a two-column index above the text:
   at this width a sticky rail would eat a third of the screen. */
@media (max-width: 880px) {
    .legal {
        grid-template-columns: 1fr;
        gap: 0;
        padding-top: 40px;
    }

    .legal-toc {
        position: static;
        margin-bottom: 34px;
        padding-bottom: 26px;
        border-bottom: 1px solid var(--line);
    }

    .legal-toc ol { columns: 2; column-gap: 22px; }
}

@media (max-width: 560px) {
    .legal { padding: 32px 16px 64px; }
    .legal-toc ol { columns: 1; }
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.footer {
    background: var(--surface-sunken);
    color: var(--ink);
    padding: 40px 24px;
    border-top: 1px solid var(--line);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 32px;
}

.footer-section h4 {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink);
}

.footer-link {
    color: var(--ink-2);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 8px;
    display: block;
    transition: color var(--dur) var(--ease-out);
}

.footer-link:hover { color: var(--ink); }

.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 24px;
    text-align: center;
    color: var(--ink-3);
    font-size: 13px;
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}
