/*
 * Legal pages (Terms of Service, Privacy Notice).
 *
 * Shared by the two English-only documents rendered from src/legal/*.template.html
 * by i18n/build.mjs. The tokens mirror the landing page so the documents read as
 * part of the same site while staying a single self-contained stylesheet - the
 * legal pages carry no scripts and are indexable on their own.
 */

:root {
    color-scheme: light dark;

    --ink: light-dark(oklch(0.21 0.006 264), oklch(0.93 0.005 264));
    --ink-soft: light-dark(oklch(0.36 0.008 264), oklch(0.78 0.006 264));
    --ink-mute: light-dark(oklch(0.52 0.008 264), oklch(0.68 0.006 264));
    --line: light-dark(oklch(0.89 0.005 264), oklch(0.36 0.008 264));
    --line-soft: light-dark(oklch(0.93 0.004 264), oklch(0.3 0.006 264));
    --surface: light-dark(oklch(1 0 0), oklch(0.21 0.006 264));
    --surface-soft: light-dark(oklch(0.965 0.002 264), oklch(0.25 0.004 264));
    --accent: light-dark(oklch(0.58 0.15 250), oklch(0.75 0.13 240));
    --accent-soft: light-dark(oklch(0.94 0.03 240), oklch(0.35 0.06 250));
    --warm: oklch(0.72 0.17 45);

    --font-text: 'Google Sans Text', Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-display: 'Google Sans Display', Inter, ui-sans-serif, system-ui, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --measure: 74ch;
    --radius: 12px;
}

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

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

body {
    font-family: var(--font-text);
    background: var(--surface);
    color: var(--ink);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent-soft);
    color: var(--ink);
}

/* Skip link: the TOC is the first thing a keyboard user would otherwise tab through. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: oklch(1 0 0);
    padding: 10px 16px;
    border-radius: 0 0 var(--radius) 0;
    z-index: 10;
}

.skip-link:focus {
    left: 0;
}

.bar {
    border-bottom: 1px solid var(--line-soft);
    background: light-dark(oklch(1 0 0 / 0.8), oklch(0.18 0.005 264 / 0.8));
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    backdrop-filter: blur(12px) saturate(1.3);
    position: sticky;
    top: 0;
    z-index: 5;
}

.bar__inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    color: var(--ink);
    text-decoration: none;
}

.brand svg {
    display: block;
    color: var(--accent);
}

.bar__links {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.bar__links a {
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.bar__links a:hover,
.bar__links a[aria-current='page'] {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

.layout {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
}

.toc {
    position: sticky;
    top: 88px;
    font-size: 13.5px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc__title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 12px;
}

.toc ol {
    list-style: none;
    counter-reset: toc;
}

.toc li {
    counter-increment: toc;
    margin-bottom: 7px;
}

.toc a {
    color: var(--ink-soft);
    text-decoration: none;
    display: block;
    padding-left: 22px;
    position: relative;
}

.toc a::before {
    content: counter(toc) '.';
    position: absolute;
    left: 0;
    color: var(--ink-mute);
    font-variant-numeric: tabular-nums;
}

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

article {
    max-width: var(--measure);
}

.doc-head {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 32px;
}

.doc-head h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.doc-head .meta {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 13.5px;
    color: var(--ink-mute);
}

.doc-head .meta strong {
    color: var(--ink-soft);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.lead {
    margin-top: 16px;
    color: var(--ink-soft);
    font-size: 15.5px;
}

section {
    margin-bottom: 36px;
    scroll-margin-top: 84px;
}

h2 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 14px;
}

h3 {
    font-size: 15.5px;
    font-weight: 600;
    margin: 22px 0 8px;
}

p {
    margin-bottom: 12px;
    color: var(--ink-soft);
}

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

strong {
    font-weight: 600;
    color: var(--ink);
}

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid light-dark(oklch(0.8 0.08 245), oklch(0.45 0.08 245));
}

a:hover {
    border-bottom-color: currentColor;
}

ul,
ol {
    margin: 0 0 12px;
    padding-left: 22px;
    color: var(--ink-soft);
}

li {
    margin-bottom: 7px;
}

li > ul,
li > ol {
    margin-top: 7px;
    margin-bottom: 0;
}

code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    padding: 1px 5px;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 16px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 480px;
}

caption {
    caption-side: top;
    text-align: left;
    font-size: 13px;
    color: var(--ink-mute);
    padding-bottom: 8px;
}

th,
td {
    text-align: left;
    vertical-align: top;
    padding: 9px 14px 9px 0;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink-soft);
    overflow-wrap: anywhere;
}

thead th {
    font-weight: 600;
    color: var(--ink);
    border-bottom-color: var(--line);
}

tbody th {
    font-weight: 600;
    color: var(--ink);
}

/* Definition-style tables (controller details, retention) read better without rules. */
table.plain th,
table.plain td {
    border-bottom: none;
    padding-top: 5px;
    padding-bottom: 5px;
}

table.plain th {
    width: 34%;
    padding-right: 20px;
}

.note {
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 18px 0;
}

.note p {
    margin-bottom: 8px;
    font-size: 14.5px;
}

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

.note__label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 6px;
}

.foot {
    border-top: 1px solid var(--line-soft);
    padding: 24px;
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--ink-mute);
}

.foot nav {
    display: flex;
    gap: 20px;
}

.foot a {
    color: var(--ink-soft);
    border-bottom: none;
}

.foot a:hover {
    color: var(--accent);
}

@media (max-width: 860px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
        padding-top: 28px;
    }

    .toc {
        position: static;
        max-height: none;
        border: 1px solid var(--line-soft);
        border-radius: var(--radius);
        padding: 18px 20px;
        background: var(--surface-soft);
    }
}

@media print {
    .bar,
    .toc,
    .skip-link {
        display: none;
    }

    .layout {
        display: block;
        padding: 0;
    }
}
