/* ============================================================
   DONDA — Terms of Service / Privacy Policy
   Loaded after style.css, which supplies the fonts, the colour
   tokens, the masthead, the button and the footer. This file is
   only the long-form prose layout, so the landing page never
   pays for it.
   ============================================================ */

/* ── page header ─────────────────────────────────────────── */

/*
 * Same folded-paper cut as the landing hero, so a legal page still
 * reads as part of the site rather than a bare document dumped on a
 * subpath. The crease is the same trick: clip-path makes the section
 * a stacking context, so a -1 pseudo-element sits above the section
 * background and below its content.
 */
.legal-head {
    background: var(--field);
    position: relative;
    padding-top: clamp(2.5rem, 5vw, 4rem);
    /* shorter than the landing hero: there is no figure here to fill the band,
       so the full height would just be an empty red field */
    padding-bottom: calc(var(--band-y) * .55 + 5vw);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 5vw), 0 100%);
}

.legal-head::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--deep);
    pointer-events: none;
    z-index: -1;
    clip-path: polygon(0 100%, 100% calc(100% - 5vw),
                       100% calc(100% - 6.1vw), 0 calc(100% - 1.1vw));
}

.legal-head-inner { max-width: var(--measure); margin-inline: auto; }

.legal-title { font-size: clamp(2.3rem, 1.2rem + 4.4vw, 4.2rem); }

.legal-head .lede {
    color: var(--bone);
    font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem);
    max-width: 40rem;
    margin: 1.4rem 0 0;
}

.legal-stamp {
    font-family: var(--mono);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--bone-70);
    margin: 1.6rem 0 0;
}

/* ── body layout ─────────────────────────────────────────── */

.legal-body {
    background: var(--void);
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
    max-width: var(--measure);
    margin-inline: auto;
    padding-bottom: clamp(3rem, 6vw, 5rem);
}

.legal-toc { position: sticky; top: 2rem; }

.legal-toc ol {
    list-style: none;
    margin: .9rem 0 0;
    padding: 0;
    counter-reset: toc;
}

.legal-toc li { counter-increment: toc; }

.legal-toc a {
    display: block;
    padding: .3rem 0;
    font-size: .9rem;
    line-height: 1.35;
    color: var(--bone-70);
    text-decoration: none;
}

.legal-toc a::before {
    content: counter(toc, decimal-leading-zero) '  ';
    font-family: var(--mono);
    font-size: .78rem;
    color: var(--bone-42);
    white-space: pre;
}

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

.legal-prose { counter-reset: sec; max-width: 44rem; }

.legal-section {
    counter-increment: sec;
    border-top: 1px solid var(--bone-16);
    padding-top: 1.5rem;
    margin-top: clamp(2.4rem, 4vw, 3.2rem);
    /* clear the sticky-adjacent anchor jump */
    scroll-margin-top: 1.5rem;
}

.legal-section:first-child { margin-top: 0; }

.legal-section h2 {
    font-family: var(--display);
    font-weight: 700;
    font-stretch: 88%;
    font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem);
    line-height: 1.12;
    letter-spacing: .005em;
    text-transform: uppercase;
    margin: 0;
    text-wrap: balance;
}

.legal-section h2::before {
    content: counter(sec, decimal-leading-zero);
    display: block;
    font-family: var(--mono);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .16em;
    color: var(--bone-42);
    margin-bottom: .55rem;
}

.legal-section h3 {
    font-family: var(--display);
    font-weight: 700;
    font-stretch: 88%;
    font-size: 1.05rem;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .01em;
    margin: 1.8rem 0 0;
}

.legal-section p,
.legal-section li { color: var(--bone-70); }

.legal-section p { margin: 1rem 0 0; }

.legal-section strong { color: var(--bone); font-weight: 600; }

.legal-section a {
    color: var(--bone);
    text-decoration-color: var(--bone-42);
    text-underline-offset: .18em;
}

.legal-section ul {
    margin: 1rem 0 0;
    padding-left: 1.1rem;
    list-style: none;
}

.legal-section ul li { position: relative; margin-top: .5rem; }

.legal-section ul li::before {
    content: '';
    position: absolute;
    left: -1.1rem;
    top: .68em;
    width: .38rem;
    height: .38rem;
    background: var(--field);
}

/* the one thing on the section that should not be skimmed past */
.legal-note {
    background: var(--void-2);
    border-left: 3px solid var(--field);
    padding: 1.1rem 1.3rem 1.2rem;
    margin: 1.5rem 0 0;
}

.legal-note p { margin: 0; color: var(--bone); }
.legal-note p + p { margin-top: .7rem; }

/* what's stored / what isn't — same hairline grid as the landing page */
.data-grid {
    display: grid;
    grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
    gap: 1px;
    background: var(--bone-16);
    border: 1px solid var(--bone-16);
    margin: 1.5rem 0 0;
}

.data-grid dt,
.data-grid dd {
    background: var(--void);
    margin: 0;
    padding: .85rem 1rem;
}

.data-grid dt {
    font-family: var(--mono);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--bone);
    align-content: center;
}

.data-grid dd { color: var(--bone-70); font-size: .96rem; }

/* ── footer links ────────────────────────────────────────── */

.legal-cta {
    background: var(--void);
    text-align: center;
    padding-top: 0;
}

.legal-cta .microcopy { margin-inline: auto; }

@media (max-width: 940px) {
    .legal-body { grid-template-columns: minmax(0, 1fr); }
    .legal-toc {
        position: static;
        border-bottom: 1px solid var(--bone-16);
        padding-bottom: 1.4rem;
    }
    .legal-toc ol {
        columns: 2;
        column-gap: 2rem;
    }
}

@media (max-width: 620px) {
    .legal-head { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7vw), 0 100%); }
    .legal-head::after {
        clip-path: polygon(0 100%, 100% calc(100% - 7vw),
                           100% calc(100% - 8.4vw), 0 calc(100% - 1.4vw));
    }
    .legal-toc ol { columns: 1; }
    .data-grid { grid-template-columns: minmax(0, 1fr); }
    .data-grid dt { padding-bottom: .2rem; }
    .data-grid dd { padding-top: .2rem; }
}
