/* =========================================================
   TERMS OF SERVICE PAGE STYLES
   Self-contained. Built only on the website design system
   (System A) tokens. No section design shared with other pages.
========================================================= */

/* =========================================================
   HERO
========================================================= */
.terms-hero {
    padding: var(--space-32) var(--space-8) var(--space-16);
    background: radial-gradient(circle at 50% -20%, var(--color-primary-soft), transparent 60%);
    border-bottom: 1px solid var(--border-primary);
}

.terms-hero-inner {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.terms-eyebrow {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: var(--font-semi-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.terms-title {
    font-size: clamp(var(--text-4xl), 4vw, 3.5rem);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

.terms-updated {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.terms-lead {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
    max-width: 640px;
}

/* =========================================================
   BODY LAYOUT  (sticky TOC + document)
========================================================= */
.terms-body {
    padding: var(--space-16) var(--space-8) var(--space-32);
}

.terms-layout {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: var(--space-16);
    align-items: start;
}

/* =========================================================
   TABLE OF CONTENTS
========================================================= */
.terms-toc {
    position: sticky;
    top: var(--space-24);
    align-self: start;
}

.terms-toc-title {
    font-size: var(--text-xs);
    font-weight: var(--font-semi-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.terms-toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    border-left: 1px solid var(--border-primary);
}

.terms-toc-list a {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    margin-left: -1px;
    border-left: 2px solid transparent;
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.terms-toc-num {
    font-size: var(--text-xs);
    color: var(--text-disabled);
    font-variant-numeric: tabular-nums;
}

.terms-toc-list a:hover {
    color: var(--text-primary);
}

.terms-toc-list a.is-active {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    font-weight: var(--font-semi-bold);
}

.terms-toc-list a.is-active .terms-toc-num {
    color: var(--color-primary);
}

/* =========================================================
   DOCUMENT
========================================================= */
.terms-doc {
    max-width: 720px;
}

.terms-section {
    scroll-margin-top: 90px; /* clear the fixed navbar when jumping to anchors */
    padding-bottom: var(--space-10);
    margin-bottom: var(--space-10);
    border-bottom: 1px solid var(--border-subtle);
}

.terms-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.terms-section h2 {
    font-size: var(--text-2xl);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
}

.terms-num {
    color: var(--color-primary);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    font-variant-numeric: tabular-nums;
}

.terms-section p {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.terms-section p:last-child {
    margin-bottom: 0;
}

.terms-section a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.terms-section a:hover {
    color: var(--color-primary-hover);
}

.terms-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
}

.terms-list li {
    position: relative;
    padding-left: var(--space-6);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
}

.terms-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 960px) {
    .terms-layout {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    /* TOC becomes a static summary card above the document */
    .terms-toc {
        position: static;
        background: var(--surface-secondary);
        border: 1px solid var(--border-primary);
        border-radius: 14px;
        padding: var(--space-6);
    }

    .terms-toc-list {
        border-left: none;
    }

    .terms-doc {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .terms-hero {
        padding: var(--space-24) var(--space-5) var(--space-12);
    }

    .terms-body {
        padding: var(--space-10) var(--space-5) var(--space-24);
    }
}
