@font-face {
    font-family: "Geist";
    src: url("./fonts/Geist[wght].woff2") format("woff2-variations");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-bg: #0e0e10;
    --color-surface: #1a1a1e;
    --color-surface-2: #242428;
    --color-surface-3: #2e2e34;
    --color-border: #38383f;

    --color-text: #f0f0f2;
    --color-text-muted: #8e8e99;
    --color-text-subtle: #5a5a64;

    --color-primary: #7c6af7;
    --color-primary-hover: #9182f9;
    --color-primary-dim: rgba(124, 106, 247, 0.15);

    --color-success: #4caf82;
    --color-success-dim: rgba(76, 175, 130, 0.12);

    --color-on-primary: #fff;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --font-sans:
        "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "SF Mono", "Fira Code", monospace;
    --font-display: "Creepster", var(--font-sans);

    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 15px;
    --text-md: 17px;
    --text-lg: 20px;
    --text-xl: 24px;
    --text-2xl: 30px;
    --text-3xl: 40px;
    --text-4xl: 52px;

    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semi: 600;
    --weight-bold: 700;

    --leading-tight: 1.2;
    --leading-normal: 1.6;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);

    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --duration-fast: 120ms;
    --duration-normal: 220ms;

    --max-width: 1080px;
}

@media (prefers-color-scheme: light) {
    :root {
        --color-bg: #f4f4f6;
        --color-surface: #ffffff;
        --color-surface-2: #f0f0f3;
        --color-surface-3: #e8e8ed;
        --color-border: #d8d8e0;

        --color-text: #111114;
        --color-text-muted: #6b6b78;
        --color-text-subtle: #a0a0ac;

        --color-primary: #5b4de0;
        --color-primary-hover: #6e5ff0;
        --color-primary-dim: rgba(91, 77, 224, 0.1);

        --color-success-dim: rgba(76, 175, 130, 0.1);

        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
        --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.14);
    }
}

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

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

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

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

img,
svg {
    display: block;
    max-width: 100%;
}

ul {
    list-style: none;
}

/* ── Layout helpers ─────────────────────────────────────────────────────── */

.wrap {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ── Top bar ────────────────────────────────────────────────────────────── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--color-bg) 80%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-5);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    letter-spacing: 0.5px;
    color: var(--color-text);
}

.brand:hover {
    color: var(--color-text);
}

.brand__logo {
    height: 28px;
    width: auto;
    filter: invert(1);
}

@media (prefers-color-scheme: light) {
    .brand__logo {
        filter: none;
    }
}

.nav {
    display: none;
    align-items: center;
    gap: var(--space-6);
}

.nav a {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text-muted);
    transition: color var(--duration-fast) var(--ease-out);
}

.nav a:hover {
    color: var(--color-text);
}

@media (min-width: 760px) {
    .nav {
        display: flex;
    }
}

/* ── Language switcher ─────────────────────────────────────────────────── */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.lang-switcher {
    display: flex;
    align-items: center;
}

.lang-switcher__select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    padding: var(--space-2) var(--space-4);
    padding-right: var(--space-6);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease-out);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
}

.lang-switcher__select:hover,
.lang-switcher__select:focus {
    border-color: var(--color-primary);
    outline: none;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    white-space: nowrap;
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
    background: var(--color-primary-hover);
    color: var(--color-on-primary);
}

.btn--ghost {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn--ghost:hover {
    border-color: var(--color-text-subtle);
    color: var(--color-text);
    background: var(--color-surface);
}

.btn--sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
    padding: var(--space-16) 0 var(--space-12);
    text-align: center;
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-4);
    border-radius: var(--radius-full);
    background: var(--color-primary-dim);
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: var(--space-6);
}

.hero__logo {
    height: 88px;
    width: auto;
    margin: 0 auto var(--space-4);
    filter: invert(1);
}

@media (prefers-color-scheme: light) {
    .hero__logo {
        filter: none;
    }
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(40px, 9vw, 72px);
    line-height: 1.1;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-4);
}

.hero__title span {
    color: var(--color-primary);
}

.hero__subtitle {
    max-width: 620px;
    margin: 0 auto var(--space-8);
    font-size: var(--text-md);
    color: var(--color-text-muted);
    line-height: var(--leading-normal);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-10);
}

.hero__diagram {
    max-width: 720px;
    margin: 0 auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
}

/* ── Sections ───────────────────────────────────────────────────────────── */

.section {
    padding: var(--space-12) 0;
    border-top: 1px solid var(--color-border);
}

.section--tight {
    padding: var(--space-10) 0;
}

.section__header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto var(--space-10);
}

.section__eyebrow {
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-3);
}

.section__title {
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    letter-spacing: -0.01em;
    margin-bottom: var(--space-3);
}

.section__lead {
    color: var(--color-text-muted);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
}

/* ── Cards / grid ───────────────────────────────────────────────────────── */

.grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid--2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .grid--4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
}

.card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--color-primary-dim);
    color: var(--color-primary);
    margin-bottom: var(--space-4);
}

.card__title {
    font-size: var(--text-md);
    font-weight: var(--weight-semi);
    margin-bottom: var(--space-2);
}

.card__text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: var(--leading-normal);
}

/* ── Steps ──────────────────────────────────────────────────────────────── */

.steps {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5);
    border-top: 1px solid var(--color-border);
}

.step:first-child {
    border-top: none;
}

.step__number {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-primary-dim);
    color: var(--color-primary);
    font-weight: var(--weight-semi);
    font-size: var(--text-sm);
}

.step__body__title {
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    margin-bottom: var(--space-1);
}

.step__body__desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: var(--leading-normal);
}

/* ── FAQ ────────────────────────────────────────────────────────────────── */

.faq {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 760px;
    margin: 0 auto;
}

.faq__item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq__item summary {
    cursor: pointer;
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.faq__item summary::-webkit-details-marker {
    display: none;
}

.faq__item summary::after {
    content: "+";
    color: var(--color-primary);
    font-size: var(--text-lg);
    flex-shrink: 0;
    transition: transform var(--duration-fast) var(--ease-out);
}

.faq__item[open] summary::after {
    transform: rotate(45deg);
}

.faq__item p {
    padding: 0 var(--space-5) var(--space-5);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

/* ── CTA banner ─────────────────────────────────────────────────────────── */

.cta {
    text-align: center;
    background: linear-gradient(
        180deg,
        var(--color-surface) 0%,
        var(--color-surface-2) 100%
    );
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-12) var(--space-6);
}

.cta__title {
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    margin-bottom: var(--space-3);
}

.cta__text {
    color: var(--color-text-muted);
    max-width: 480px;
    margin: 0 auto var(--space-6);
    font-size: var(--text-sm);
}

.cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.footer {
    border-top: 1px solid var(--color-border);
    padding: var(--space-10) 0;
}

.footer__inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

@media (min-width: 760px) {
    .footer__inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.footer__brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
}

.footer__logo {
    height: 22px;
    width: auto;
    filter: invert(1);
}

@media (prefers-color-scheme: light) {
    .footer__logo {
        filter: none;
    }
}

.footer__tagline {
    font-size: var(--text-sm);
    color: var(--color-text-subtle);
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
}

.footer__col {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer__col h3 {
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-subtle);
    margin-bottom: var(--space-1);
}

.footer__col a {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.footer__col a:hover {
    color: var(--color-text);
}

.footer__bottom {
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border);
    font-size: var(--text-xs);
    color: var(--color-text-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: space-between;
}

/* ── Legal pages ────────────────────────────────────────────────────────── */

.legal {
    padding: var(--space-10) 0 var(--space-16);
    overflow-x: hidden;
}

.legal__header {
    margin-bottom: var(--space-8);
}

.legal__header h1 {
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    margin-bottom: var(--space-2);
}

.legal__header p {
    color: var(--color-text-subtle);
    font-size: var(--text-sm);
}

.legal__content {
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.legal__content section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.legal__content h2 {
    font-size: var(--text-lg);
    font-weight: var(--weight-semi);
}

.legal__content h3 {
    font-size: var(--text-base);
    font-weight: var(--weight-semi);
    margin-top: var(--space-2);
}

.legal__content p,
.legal__content li {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: var(--leading-normal);
}

.legal__content ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-left: var(--space-5);
    list-style: disc;
}

.legal__content strong {
    color: var(--color-text);
    font-weight: var(--weight-medium);
}

.legal__content a {
    word-break: break-word;
}

.legal__toc {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
}

.legal__toc h2 {
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-subtle);
    margin-bottom: var(--space-3);
}

.legal__toc ol {
    list-style: decimal;
    padding-left: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.legal__toc a {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

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

/* Responsive two-column layout: stacks on mobile, row on wider screens */
.legal__layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    max-width: none;
}

.legal__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.legal__sidebar {
    flex-shrink: 0;
    width: 100%;
}

@media (min-width: 860px) {
    .legal__layout {
        flex-direction: row;
        gap: var(--space-10);
        align-items: flex-start;
    }

    .legal__sidebar {
        width: 220px;
        position: sticky;
        top: calc(var(--space-12) + 56px);
    }
}

.legal__content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 1px 5px;
}

/* ── Misc ───────────────────────────────────────────────────────────────── */

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    margin-top: var(--space-4);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    font-size: var(--text-xs);
    color: var(--color-text-subtle);
    font-family: var(--font-mono);
}
