/* =============================================
   LEGAL PAGES — Unified Design
   Landing page layout + App TOC style
   ============================================= */

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Nav ── */
.l-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: var(--s-4) 0;
    background: hsla(0, 0%, 100%, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.l-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--s-8);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.l-brand {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 1.125rem;
    color: var(--text);
    text-decoration: none;
}

.l-brand svg,
.l-brand i {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.l-back {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.l-back:hover {
    color: var(--primary);
}

.l-back svg,
.l-back i {
    width: 15px;
    height: 15px;
}

/* ── Header / Hero ── */
.l-header {
    padding: var(--s-16) 0 var(--s-10);
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
    text-align: left;
}

.l-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--s-8);
}

.l-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-dim);
    border: 1px solid hsla(247, 72%, 58%, 0.15);
    border-radius: var(--r-full);
    padding: 5px 12px;
    margin-bottom: var(--s-5);
}

.l-chip svg,
.l-chip i {
    width: 12px;
    height: 12px;
}

.l-header h1 {
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: var(--s-3);
}

.l-meta {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
}

.l-meta svg,
.l-meta i {
    width: 13px;
    height: 13px;
}

/* ── Two-column layout ── */
.l-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--s-12) var(--s-8) var(--s-24);
    width: 100%;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 56px;
    align-items: start;
    flex: 1;
}

/* ── TOC sidebar (app style) ── */
.l-toc {
    position: sticky;
    top: 80px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--s-5);
    box-shadow: var(--shadow-sm);
}

.l-toc-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.5625rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--s-3);
    padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--border);
}

.l-toc ol {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.l-toc li a {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 5px var(--s-2);
    border-radius: var(--r-md);
    transition: color 0.15s, background 0.15s;
    line-height: 1.4;
}

.l-toc li a:hover {
    color: var(--primary);
    background: var(--primary-dim);
}

.l-toc-num {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.5625rem;
    color: var(--primary);
    opacity: 0.5;
    min-width: 18px;
    flex-shrink: 0;
}

/* ── Content ── */
.l-content {
    min-width: 0;
}

.l-section {
    padding: var(--s-8) 0;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 90px;
}

.l-section:first-child {
    padding-top: 0;
}

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

.l-section-header {
    display: flex;
    align-items: baseline;
    gap: var(--s-3);
    margin-bottom: var(--s-4);
}

.l-num {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--primary);
    opacity: 0.4;
    min-width: 22px;
    padding-top: 3px;
    flex-shrink: 0;
}

.l-section h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.l-section p {
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.l-section p+p {
    margin-top: var(--s-3);
}

.l-section ul,
.l-section ol {
    padding-left: var(--s-5);
    margin: var(--s-3) 0;
}

.l-section li {
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: var(--s-1);
}

.l-section a {
    color: var(--primary);
    text-underline-offset: 3px;
}

.l-section strong {
    color: var(--text);
    font-weight: 600;
}

/* ── Contact box ── */
.l-contact-box {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    background: var(--primary-dim);
    border: 1px solid hsla(247, 72%, 58%, 0.15);
    border-radius: var(--r-xl);
    padding: var(--s-5) var(--s-6);
    margin-top: var(--s-5);
}

.l-contact-icon {
    width: 40px;
    height: 40px;
    background: hsla(247, 72%, 58%, 0.1);
    border: 1px solid hsla(247, 72%, 58%, 0.2);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}

.l-contact-icon svg,
.l-contact-icon i {
    width: 16px;
    height: 16px;
}

.l-contact-box p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.l-contact-box strong {
    font-size: 0.9375rem;
    color: var(--text);
}

.l-contact-box a {
    color: var(--primary);
    font-weight: 500;
    text-underline-offset: 3px;
}

/* ── Footer ── */
.l-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
    padding: var(--s-6) var(--s-8);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.l-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--s-3);
}

.l-footer-links {
    display: flex;
    align-items: center;
    gap: var(--s-6);
}

.l-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.l-footer a:hover {
    color: var(--primary);
}

/* ── Responsive ── */
@media (max-width: 760px) {
    .l-layout {
        grid-template-columns: 1fr;
        padding: var(--s-8) var(--s-5) var(--s-16);
        gap: var(--s-8);
    }

    .l-toc {
        position: static;
    }

    .l-toc ol {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--s-1) var(--s-4);
    }

    .l-header-inner,
    .l-nav-inner {
        padding: 0 var(--s-5);
    }

    .l-footer {
        padding: var(--s-5);
    }

    .l-footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--s-4);
    }
}