/* Self-hosted so visitors' IPs never reach a font CDN */
@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url('/fonts/archivo-latin-var.woff2') format('woff2');
}

:root {
    --paper: #F1F4F3;
    --surface: #FFFFFF;
    --sunken: #E7ECEB;
    --ink: #12243A;
    --ink-2: #47586A;
    --ink-3: #6B7A89;
    --line: #D3DCDD;
    --line-soft: #E3E9E9;
    --indigo: #4C55D6;
    --indigo-hover: #3E46C0;
    --on-indigo: #FFFFFF;
    --teal: #0B7A72;
    --teal-soft: #D6EEEA;
    --amber: #A35F00;
    --amber-soft: #F6E7CF;
    --rose: #B4304A;

    --band: #12243A;
    --band-ink: #EAF0F2;
    --band-ink-2: #A9B8C6;
    --band-line: #2A3E57;
    --band-chip: #1B3150;

    --d1: #12243A;
    --d2: #4C55D6;
    --d3: #8D95E6;
    --d4: #5E7387;
    --d5: #B9BFF1;
    --d6: #2F7F92;

    --focus: #4C55D6;
    --wrap: 1180px;
    --gutter: clamp(16px, 4vw, 40px);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #0C1724;
        --surface: #122236;
        --sunken: #0F1D2E;
        --ink: #EAF0F2;
        --ink-2: #A9B8C6;
        --ink-3: #8193A5;
        --line: #24384F;
        --line-soft: #1B2D42;
        --indigo: #8A92F2;
        --indigo-hover: #A3AAF5;
        --on-indigo: #0C1724;
        --teal: #4CC7B9;
        --teal-soft: #113A3A;
        --amber: #F0B45A;
        --amber-soft: #3A2C14;
        --rose: #F07A90;

        --band: #08111C;
        --band-ink: #EAF0F2;
        --band-ink-2: #A9B8C6;
        --band-line: #22364C;
        --band-chip: #12243A;

        --d1: #B7C2CF;
        --d2: #8A92F2;
        --d3: #4C55D6;
        --d4: #7F95AA;
        --d5: #C5CAF7;
        --d6: #4CC7B9;

        --focus: #8A92F2;
        color-scheme: dark;
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 1.0625rem;
    line-height: 1.6;
    font-stretch: 100%;
    color: var(--ink);
    background: var(--paper);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img, svg { display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip {
    position: absolute;
    left: 16px;
    top: -60px;
    background: var(--ink);
    color: var(--paper);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    z-index: 100;
}
.skip:focus { top: 12px; }

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.money { font-variant-numeric: tabular-nums; }

/* Display type: Archivo's width axis carries the voice */
.display {
    overflow-wrap: break-word;
    hyphens: auto;
    font-stretch: 118%;
    font-weight: 720;
    letter-spacing: -0.02em;
    line-height: 1.04;
}

h2.display { font-size: clamp(2rem, 4.2vw, 3.25rem); }
h3 { font-size: 1.25rem; font-weight: 650; font-stretch: 108%; line-height: 1.25; }

.lead {
    font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
    color: var(--ink-2);
    max-width: 34em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 600;
    font-stretch: 105%;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--indigo); color: var(--on-indigo); }
.btn-primary:hover { background: var(--indigo-hover); }
.btn-quiet { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-quiet:hover { border-color: var(--ink-3); }

/* Navigation */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 68px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
    font-stretch: 112%;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}
.brand svg { width: 30px; height: 30px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    padding: 0;
}
.nav-links a:not(.btn) {
    text-decoration: none;
    color: var(--ink-2);
    font-size: 0.9375rem;
    font-weight: 500;
}
.nav-links a:not(.btn):hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-links .btn { min-height: 40px; padding: 0 16px; font-size: 0.9375rem; }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    height: 40px;
    padding: 0 14px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}

/* Generic section rhythm */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-head { display: grid; gap: 16px; max-width: 46rem; margin-bottom: clamp(40px, 5vw, 64px); }

.faq-list { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary {
    list-style: none;
    cursor: pointer;
    padding: 22px 40px 22px 0;
    position: relative;
    font-weight: 600;
    font-size: 1.0625rem;
    font-stretch: 105%;
}
summary::-webkit-details-marker { display: none; }
summary::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--ink-2);
    border-bottom: 2px solid var(--ink-2);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.2s ease;
}
details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
details p { padding: 0 40px 24px 0; color: var(--ink-2); max-width: 40rem; }

/* Closing */
.closing { padding: clamp(72px, 10vw, 128px) 0; border-top: 1px solid var(--line); }
.closing-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 32px; align-items: end; }
.closing h2 { font-size: clamp(2.25rem, 5.4vw, 4.25rem); max-width: 12em; }
.closing p { margin-top: 16px; color: var(--ink-2); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 48px 0 40px; font-size: 0.9375rem; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer p { color: var(--ink-2); max-width: 26rem; margin-top: 12px; }
.footer h2 { font-size: 0.9375rem; font-weight: 650; margin-bottom: 12px; }
.footer ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.footer ul a { color: var(--ink-2); text-decoration: none; }
.footer ul a:hover { color: var(--ink); text-decoration: underline; }
.footer-base { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line-soft); color: var(--ink-3); font-size: 0.875rem; }
@media (max-width: 960px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .footer-inner > :first-child { grid-column: 1 / -1; }
    .closing-inner { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
    .nav-toggle { display: inline-flex; align-items: center; }
    .nav-links {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px var(--gutter) 20px;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
    }
    .nav-links.is-open { display: flex; }
    .nav-links li a:not(.btn) { display: block; padding: 12px 0; font-size: 1.0625rem; }
    .nav-links .btn { margin-top: 8px; width: 100%; min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Inner pages: header block shared by docs, legal and privacy pages */
.page-head { padding: clamp(48px, 7vw, 96px) 0 clamp(32px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2rem, 6vw, 4.75rem); max-width: 14em; }
.page-head .lead { margin-top: 20px; }
.page-meta { margin-top: 20px; color: var(--ink-3); font-size: 0.9375rem; }

/* Long-form reading layout: optional sticky contents rail + prose column */
.doc {
    display: grid;
    grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 80px);
    padding-block: clamp(40px, 6vw, 72px) clamp(72px, 10vw, 120px);
    align-items: start;
}
.doc.no-rail { grid-template-columns: minmax(0, 1fr); }
.rail { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; font-size: 0.9375rem; padding-bottom: 24px; }
.rail-title { font-weight: 650; font-stretch: 108%; margin-bottom: 10px; }
.rail ol, .rail ul { list-style: none; padding: 0; display: grid; gap: 2px; }
.rail li ol, .rail li ul { padding-left: 12px; margin: 2px 0 10px; }
.rail a { display: block; padding: 5px 10px; border-left: 2px solid var(--line); color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.rail a:hover { color: var(--ink); border-left-color: var(--ink-3); }
.rail a.is-current { color: var(--ink); border-left-color: var(--indigo); font-weight: 600; }
.rail-group { font-weight: 600; color: var(--ink); padding: 12px 0 4px; font-size: 0.875rem; }
.rail-group:first-child { padding-top: 0; }
.rail-toggle { display: none; }

.prose { max-width: 44rem; font-size: 1.0625rem; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 {
    font-size: clamp(1.625rem, 3vw, 2.125rem);
    font-stretch: 115%;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.15;
    margin-top: 2.6em;
    padding-top: 1.1em;
    border-top: 1px solid var(--line);
    scroll-margin-top: 88px;
}
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 1.25rem; margin-top: 2em; scroll-margin-top: 88px; }
.prose h4 { font-size: 1.0625rem; font-weight: 650; margin-top: 1.6em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.6em; }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose a { color: var(--indigo); text-underline-offset: 3px; }
.prose a:hover { color: var(--indigo-hover); }
.prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: 0.45em; }
.prose li::marker { color: var(--ink-3); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.875em;
    background: var(--sunken);
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    padding: 0.1em 0.35em;
    color: var(--ink);
}
.prose pre {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    background: var(--sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    overflow-x: auto;
    color: var(--ink);
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose blockquote { border-left: 3px solid var(--indigo); padding: 4px 0 4px 18px; color: var(--ink-2); }

/* Callouts carry meaning by tone: note (neutral), good (privacy win), caution */
.callout {
    border: 1px solid var(--line);
    border-left: 4px solid var(--ink-3);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 16px 20px;
}
.callout > * + * { margin-top: 0.6em; }
.callout p, .callout li { color: var(--ink-2); }
.callout-title { font-weight: 650; color: var(--ink); font-stretch: 105%; }
.callout.good { border-left-color: var(--teal); background: color-mix(in srgb, var(--teal-soft) 55%, var(--surface)); }
.callout.caution { border-left-color: var(--amber); background: color-mix(in srgb, var(--amber-soft) 55%, var(--surface)); }
.callout.note { border-left-color: var(--indigo); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table-wrap th, .table-wrap td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table-wrap thead th { font-weight: 650; color: var(--ink); background: var(--sunken); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-wrap tbody tr:last-child > * { border-bottom: 0; }
.table-wrap td { color: var(--ink-2); }
.table-wrap tbody th { font-weight: 600; color: var(--ink); }
.yes { color: var(--teal); font-weight: 600; }
.no { color: var(--rose); font-weight: 600; }

/* Two-column "kept vs. collected" style comparisons */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.split > div { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); padding: 20px; }
.split > div > * + * { margin-top: 0.6em; }
.split h3, .split h4 { margin-top: 0; font-size: 1.0625rem; }

.contact-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; list-style: none; padding: 0 !important; }
.contact-list li { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); padding: 18px 20px; }
.contact-list b { display: block; color: var(--ink); font-weight: 650; margin-bottom: 4px; }

.doc-cta { margin-top: 3em; padding: 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 14px; justify-items: start; }
.doc-cta h2 { margin: 0; padding: 0; border: 0; font-size: 1.5rem; }

/* Error pages */
.error-page { min-height: calc(100vh - 68px); display: grid; align-content: center; padding: clamp(48px, 8vw, 96px) 0; }
.error-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.error-code {
    font-size: clamp(6rem, 22vw, 15rem);
    font-stretch: 125%;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.85;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.error-page h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); margin-top: 20px; }
.error-page .lead { margin-top: 16px; }
.error-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.error-aside { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: clamp(20px, 3vw, 32px); display: grid; gap: 14px; }
.error-aside h2 { font-size: 1.125rem; font-weight: 650; font-stretch: 108%; }
.error-aside p, .error-aside li { color: var(--ink-2); font-size: 0.9375rem; }
.status-rows { list-style: none; padding: 0; display: grid; }
.status-rows li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.status-rows li:first-child { border-top: 0; }
.status-rows span:first-child { color: var(--ink-2); }
.status-rows span:last-child { color: var(--ink); font-weight: 600; text-align: right; }
.status-rows .ok { color: var(--teal); }
.status-rows .bad { color: var(--rose); }

@media (max-width: 960px) {
    .doc { grid-template-columns: minmax(0, 1fr); }
    .rail { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); padding: 0; }
    .rail > :not(.rail-toggle) { margin-left: 16px; margin-right: 16px; }
    .rail > :last-child { margin-bottom: 16px; }
    /* site.js adds the toggle; without JS the full list simply stays visible */
    .rail-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        min-height: 48px;
        padding: 0 16px;
        background: none;
        border: 0;
        font-weight: 650;
        font-stretch: 108%;
        cursor: pointer;
        text-align: left;
    }
    .rail-toggle::after {
        content: '';
        width: 9px;
        height: 9px;
        border-right: 2px solid var(--ink-2);
        border-bottom: 2px solid var(--ink-2);
        transform: translateY(-30%) rotate(45deg);
    }
    .rail.is-open .rail-toggle::after { transform: translateY(20%) rotate(-135deg); }
    .rail.has-toggle:not(.is-open) > :not(.rail-toggle) { display: none; }
    .rail.has-toggle .rail-title { display: none; }
    .error-grid { grid-template-columns: minmax(0, 1fr); }
}
