/* Long reading pages (Yoon Studio guidelines, service terms): a quiet document layout
   with a contents list that follows the reader, and a clean printout. */

.doc-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding-block: 1.2rem;
    font-family: var(--font-label);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.doc-crumbs b {
    color: var(--charcoal);
    font-weight: 600;
}

.doc-head {
    display: grid;
    gap: 1.2rem;
    max-width: 860px;
    padding-block: clamp(32px, 5vw, 72px) clamp(36px, 5vw, 64px);
}

.doc-head .display {
    font-size: clamp(2.8rem, 6vw, 5rem);
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.8rem;
    font-size: 0.88rem;
    color: var(--ink-muted);
}

.doc-meta .btn {
    padding: 0.7em 1.3em;
}

.doc {
    display: grid;
    grid-template-columns: minmax(200px, 0.32fr) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 110px);
    align-items: start;
    padding-bottom: clamp(72px, 9vw, 140px);
    border-top: 1px solid var(--line);
    padding-top: clamp(36px, 4vw, 56px);
}

/* Contents: sticks beside the text and marks where the reader is */
.toc {
    position: sticky;
    top: calc(var(--header-h) + 28px);
    display: grid;
    gap: 0.2rem;
}

.toc .eyebrow {
    margin-bottom: 0.8rem;
}

.toc a {
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: 0.4rem;
    padding: 0.45rem 0 0.45rem 0.9rem;
    border-left: 1px solid var(--line);
    font-size: 0.9rem;
    color: var(--ink-muted);
    transition: color 0.3s, border-color 0.3s, padding 0.45s var(--ease-brand);
}

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

.toc a[aria-current='true'] {
    border-color: var(--telang);
    color: var(--telang);
    padding-left: 1.2rem;
}

.toc a .num {
    padding-top: 0.15rem;
}

.doc-body {
    display: grid;
    gap: clamp(44px, 5vw, 72px);
    max-width: 70ch;
}

.doc-section {
    display: grid;
    gap: 0.9rem;
    scroll-margin-top: calc(var(--header-h) + 28px);
}

.doc-section + .doc-section {
    padding-top: clamp(44px, 5vw, 72px);
    border-top: 1px solid var(--line);
}

.doc-section > header {
    display: grid;
    gap: 0.5rem;
}

.doc-section h2 {
    margin: 0;
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: clamp(1.7rem, 2.6vw, 2.2rem);
    letter-spacing: -0.015em;
    line-height: 1.15;
}

.doc-section h4 {
    margin: 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.45rem;
    color: var(--telang);
}

.doc-section p,
.doc-section li {
    color: var(--ink-muted);
    line-height: 1.7;
}

.doc-section p {
    margin: 0;
}

.doc-section ul {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.3rem;
}

.doc-section ul li::marker {
    color: var(--telang);
}

/* Numbered clauses: 1.1, 1.2… in a quiet column */
.doc-section ol {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

.doc-section ol li {
    display: grid;
    grid-template-columns: 3rem 1fr;
}

.doc-section ol li b {
    font-family: var(--font-label);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--telang);
    padding-top: 0.2rem;
}

.doc-section .link-arrow {
    justify-self: start;
    margin-top: 0.4rem;
}

/* Copy the brand still has to give us, so nobody misses it */
.placeholder {
    padding: 0.05em 0.45em;
    border-radius: 3px;
    background: rgb(180 35 24 / 0.1);
    color: var(--danger);
    font-style: normal;
    font-weight: 700;
    font-size: 0.92em;
}

.doc-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line);
    border-block: 1px solid var(--line);
}

.doc-next a {
    display: grid;
    gap: 0.6rem;
    padding: clamp(28px, 4vw, 48px) var(--gutter);
    background: var(--ivory);
    transition: background-color 0.45s var(--ease-brand);
}

.doc-next a:hover {
    background: var(--ivory-deep);
}

.doc-next .title {
    font-size: clamp(1.5rem, 2.4vw, 2rem);
}

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

    .toc {
        position: static;
        padding-bottom: 1.2rem;
        border-bottom: 1px solid var(--line);
    }

    .doc-next {
        grid-template-columns: 1fr;
    }
}

@media print {
    .header,
    .footer,
    .proto-bar,
    .toc,
    .doc-crumbs,
    .doc-next,
    .doc-meta .btn,
    .curtain,
    .toasts {
        display: none !important;
    }

    .page {
        margin: 0 !important;
    }

    .doc {
        display: block;
        border: 0;
        padding: 0;
    }

    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
    }

    .doc-section {
        break-inside: avoid;
    }
}
