:root {
    --bg-color: #0b0a12;
    --surface: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.12);
    --text-primary: #f9fafb;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent: #9061F9;
    --accent-hover: #8048FF;
    --accent-soft: #c4b0fc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    font-family: 'Bricolage Grotesque', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-color);
    background-image: radial-gradient(ellipse at top, rgba(144, 97, 249, 0.18), transparent 60%);
    background-repeat: no-repeat;
    min-height: 100vh;
    line-height: 1.7;
}

/* Header */
.legal-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 32px;
    background: rgba(11, 10, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.legal-brand {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
    text-decoration: none;
}

.lang-switch {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 9999px;
}

.lang-switch button {
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 9999px;
    padding: 4px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-switch button[aria-pressed="true"] {
    background: var(--accent);
    color: #fdf2f8;
}

/* Content */
.legal {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

.legal article[hidden] {
    display: none;
}

.legal h1 {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 8px;
}

.legal .updated {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.legal h2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 40px 0 12px;
}

.legal h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 20px 0 6px;
}

.legal p,
.legal ul {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.legal ul {
    padding-left: 22px;
}

.legal li {
    margin-bottom: 6px;
}

.legal strong {
    color: var(--text-primary);
}

.legal a {
    color: var(--accent-soft);
}

.legal a:hover {
    color: #ffffff;
}

.summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 32px;
}

.summary p:last-child,
.summary ul:last-child {
    margin-bottom: 0;
}

/* Table of contents */
.toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.toc h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin: 0 0 10px;
}

.toc ol {
    padding-left: 22px;
    color: var(--text-secondary);
    columns: 2;
    column-gap: 32px;
}

.toc li {
    break-inside: avoid;
    margin-bottom: 4px;
}

.toc a {
    text-decoration: none;
}

.toc a:hover {
    text-decoration: underline;
}

/* Footer */
.legal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    padding: 24px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.legal-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.legal-footer a:hover,
.legal-footer a[aria-current="page"] {
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .legal-header {
        padding: 12px 16px;
    }

    .legal-brand {
        font-size: 24px;
    }

    .legal {
        padding: 32px 16px 48px;
    }

    .legal h1 {
        font-size: 34px;
    }

    .toc ol {
        columns: 1;
    }
}
