/* ============================================================================
   legal.css — public document pages: Privacy, Terms, Support.
   ----------------------------------------------------------------------------
   Consumes landing.css tokens ONLY (--ink/--surface/--line/--grad, Sora+Inter,
   and the :root[data-theme="dark"] overrides) so these pages inherit the site
   palette and both themes for free — no second design system.

   Why the top padding: .site-header is position:fixed and the landing hero
   clears it with its own 176px padding. Document pages need that offset too,
   or the first heading renders behind the header.
   ========================================================================== */

/* ── Document header band ─────────────────────────────────────────────────── */
.doc-head {
    padding: 132px 0 2.5rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
}
.doc-head-inner { max-width: 68ch; }
.doc-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.doc-eyebrow::before {
    content: "";
    width: 1.75rem;
    height: 2px;
    border-radius: 2px;
    background-image: var(--grad);
}
.doc-head h1 {
    margin: .75rem 0 0;
    font-size: clamp(2rem, 5vw, 3rem);
}
.doc-lede {
    margin-top: 1rem;
    font-size: clamp(1rem, 2.2vw, 1.12rem);
    color: var(--ink-2);
}
.doc-stamp {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1.5rem;
    padding: .4rem .85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: .82rem;
    color: var(--ink-3);
}
.doc-stamp b { color: var(--ink-2); font-weight: 600; }

/* ── Two-column document body: sticky rail + prose ───────────────────────── */
.doc-layout {
    display: grid;
    /* Cap the prose column at the measure so the rail+prose pair reads as one balanced
       block rather than text hugging the left of a very wide column. */
    grid-template-columns: 232px minmax(0, 68ch);
    justify-content: center;
    gap: clamp(2rem, 5vw, 4.5rem);
    padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3.5rem, 8vw, 6rem);
    align-items: start;
}

/* The rail is the signature element: legal pages are consulted for one clause
   at a time, so a persistent index with a live marker is real navigation. */
.doc-rail { position: sticky; top: 104px; }
.doc-rail-title {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: .9rem;
}
.doc-rail ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--line);
}
.doc-rail a {
    display: block;
    padding: .48rem 0 .48rem 1rem;
    margin-left: -2px;
    border-left: 2px solid transparent;
    font-size: .92rem;
    color: var(--ink-3);
    transition: color .18s ease, border-color .18s ease;
}
.doc-rail a:hover { color: var(--ink); }
.doc-rail a[aria-current="true"] {
    color: var(--ink);
    font-weight: 600;
    border-left-color: var(--indigo);
}

/* Grid children need min-width:0, or the rail's nowrap chip row (mobile) imposes a
   min-content floor and stretches the column past the container instead of scrolling. */
.doc-rail, .doc-body { min-width: 0; }

/* ── Prose ────────────────────────────────────────────────────────────────── */
.doc-body { max-width: 68ch; }
.doc-sec { scroll-margin-top: 104px; }
.doc-sec + .doc-sec { margin-top: clamp(2.25rem, 4vw, 3rem); }
.doc-sec > h2 {
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    margin-bottom: .85rem;
}
.doc-body p { color: var(--ink-2); margin-bottom: 1rem; }
.doc-body p:last-child { margin-bottom: 0; }
.doc-body a:not(.btn) {
    color: var(--indigo);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.doc-body a:not(.btn):hover { color: var(--violet); }
.doc-body strong { color: var(--ink); font-weight: 650; }

/* Definition-style lists: the term carries the meaning, so it leads the line */
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.doc-list > li {
    position: relative;
    padding-left: 1.4rem;
    color: var(--ink-2);
}
.doc-list > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-image: var(--grad);
}

/* Callout for the one thing people most need to know up front */
.doc-note {
    margin: 1.25rem 0;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--indigo);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--bg-soft);
}
.doc-note p { margin: 0; }

/* Footer links out of the document */
.doc-foot {
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1.5rem;
    font-size: .95rem;
}

/* ── Support page ─────────────────────────────────────────────────────────── */
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
    margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.support-card {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.support-card h2 { font-size: 1.05rem; margin-bottom: .5rem; }
.support-card p { color: var(--ink-2); font-size: .95rem; margin-bottom: 1rem; }
.support-card p:last-child { margin-bottom: 0; }
.support-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
    background-image: var(--grad);
    color: #fff;
}
.support-icon svg { width: 20px; height: 20px; }
.support-mail {
    font-weight: 600;
    word-break: break-word;
}

/* FAQ uses native <details> — keyboard-accessible and collapses on mobile
   without a line of JavaScript. */
.faq { display: grid; gap: .75rem; }
.faq-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "";
    flex: none;
    width: .55rem;
    height: .55rem;
    border-right: 2px solid var(--ink-3);
    border-bottom: 2px solid var(--ink-3);
    transform: rotate(45deg);
    transition: transform .2s ease;
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item summary:hover { color: var(--violet); }
.faq-answer {
    padding: 0 1.25rem 1.15rem;
    color: var(--ink-2);
    font-size: .96rem;
}
.faq-answer p { margin: 0; }

/* ── Responsive: single column, rail becomes a scrollable chip row ───────── */
@media (max-width: 900px) {
    /* minmax(0,1fr) + stretch: cancels the desktop centring, which would otherwise
       offset a column wider than the container. */
    .doc-layout { grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 1.75rem; }
    .doc-rail { position: static; }
    .doc-rail ol {
        display: flex;
        gap: .5rem;
        overflow-x: auto;
        border-left: 0;
        padding-bottom: .35rem;
        -webkit-overflow-scrolling: touch;
    }
    .doc-rail a {
        white-space: nowrap;
        padding: .4rem .8rem;
        margin-left: 0;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: var(--surface);
    }
    .doc-rail a[aria-current="true"] { border-color: var(--indigo); color: var(--indigo); }
    .doc-head { padding-top: 116px; }
}

@media (prefers-reduced-motion: reduce) {
    .faq-item summary::after,
    .doc-rail a { transition: none; }
}
