/* Amour AI — Design System with Light/Dark Theme */

/* ===================== FONTS (self-hosted) ===================== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/Inter-Bold.woff2') format('woff2');
}

/* ===================== DESIGN TOKENS ===================== */
:root {
    /* Spacing */
    --space-xxs: 4px;
    --space-xs: 8px;
    --space-s: 12px;
    --space-m: 16px;
    --space-l: 20px;
    --space-xl: 24px;
    --space-xxl: 32px;
    --card-gap: 32px;
    --section-py: 60px;
    --container-px: 64px;

    /* Radius */
    --radius-s: 12px;
    --radius-m: 16px;
    --radius-l: 24px;

    /* Typography */
    --h1-size: 56px;
    --h2-size: 40px;
    --h4-size: 24px;
    --subtitle-size: 20px;
    --body-size: 18px;
    --body-regular: 17px;
    --small-size: 15px;

    --h1-height: 1.15;
    --body-height: 1.5;
    --subtitle-height: 1.3;

    --h1-spacing: -.03em;
    --h2-spacing: -.02em;
    --small-spacing: -.01em;
    --button-spacing: -.015em;

    /* Brand — Telegram-native palette */
    --brand-primary: #3390ec;
    --brand-blue: #3390ec;
    --brand-gradient: linear-gradient(135deg, #3390ec, #50a8eb);
    --brand-green: #4fae4e;
    --brand-red: #e53935;

}

/* ===================== DARK THEME (default) ===================== */
[data-theme="dark"] {
    --bg-primary: #0a0a0c;
    --bg-secondary: #111114;
    --bg-card: #16161a;
    --bg-card-hover: #1c1c21;

    --text-primary: #f5f5f7;
    --text-secondary: #8e8e93;
    --text-tertiary: #5d6c7b;

    --glass-bg: rgba(20, 20, 24, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.14);

    --header-glass: rgba(10, 10, 12, 0.7);
    --header-border: rgba(255, 255, 255, 0.06);

    --btn-bg: var(--brand-primary);
    --btn-color: #fff;
    --btn-tinted-bg: rgba(51, 144, 236, 0.12);
    --btn-tinted-color: var(--brand-primary);
    --btn-ghost-border: rgba(255, 255, 255, 0.12);
    --btn-ghost-hover: rgba(255, 255, 255, 0.05);

    --badge-bg: rgba(51, 144, 236, 0.1);
    --badge-border: rgba(51, 144, 236, 0.15);
    --icon-bg: rgba(51, 144, 236, 0.1);

    --success-bg: rgba(34, 197, 94, 0.1);
    --success-border: rgba(34, 197, 94, 0.25);
    --success-color: #22c55e;
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-border: rgba(239, 68, 68, 0.25);
    --error-color: #ef4444;

    --scrollbar-thumb: rgba(255, 255, 255, 0.08);
    --scrollbar-hover: rgba(255, 255, 255, 0.15);

    --theme-icon-sun: 0.5;
    --theme-icon-moon: 1;
    --theme-icon-auto: 0.5;

    color-scheme: dark;
}

/* ===================== LIGHT THEME — Telegram-native ===================== */
[data-theme="light"] {
    --bg-primary: #f4f4f5;
    --bg-secondary: #edeef0;
    --bg-card: #ffffff;
    --bg-card-hover: #f7f8f9;

    --text-primary: #000000;
    --text-secondary: #707579;
    --text-tertiary: #a2acb4;

    --glass-bg: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(0, 0, 0, 0.06);
    --glass-border-hover: rgba(0, 0, 0, 0.1);

    --header-glass: rgba(255, 255, 255, 0.78);
    --header-border: rgba(0, 0, 0, 0.06);

    --btn-bg: var(--brand-primary);
    --btn-color: #fff;
    --btn-tinted-bg: rgba(51, 144, 236, 0.08);
    --btn-tinted-color: var(--brand-blue);
    --btn-ghost-border: rgba(0, 0, 0, 0.08);
    --btn-ghost-hover: rgba(0, 0, 0, 0.03);

    --badge-bg: rgba(51, 144, 236, 0.06);
    --badge-border: rgba(51, 144, 236, 0.14);
    --icon-bg: rgba(51, 144, 236, 0.07);

    --success-bg: rgba(79, 174, 78, 0.08);
    --success-border: rgba(79, 174, 78, 0.2);
    --success-color: #4fae4e;
    --error-bg: rgba(229, 57, 53, 0.08);
    --error-border: rgba(229, 57, 53, 0.2);
    --error-color: #e53935;

    --scrollbar-thumb: rgba(0, 0, 0, 0.1);
    --scrollbar-hover: rgba(0, 0, 0, 0.18);

    --theme-icon-sun: 1;
    --theme-icon-moon: 0.5;
    --theme-icon-auto: 0.5;

    color-scheme: light;
}

/* ===================== BASE RESET ===================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--body-regular);
    line-height: var(--body-height);
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    transition: background-color .3s, color .3s;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

/* Container */
.container {
    max-width: 1328px;
    margin: 0 auto;
    padding: 0 var(--container-px);
}

/* ===================== HEADER (glassmorphism always) ===================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    height: 64px;
}

.header__bg {
    position: absolute;
    inset: 0;
    background: var(--header-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: background-color .3s, border-color .3s;
}

.header__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.header__logo {
    font-size: var(--h4-size);
    font-weight: 700;
    letter-spacing: var(--h2-spacing);
    color: var(--text-primary);
    text-decoration: none;
    transition: color .2s;
}

.header__right {
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

.header__cta {
    display: none;
}

/* ===================== LANGUAGE SWITCHER ===================== */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: var(--space-xs);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lang-btn {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color .2s, background-color .2s;
    letter-spacing: var(--small-spacing);
}

.lang-btn.active {
    color: var(--text-primary);
    background: var(--glass-border);
}

.lang-btn:hover:not(.active) {
    color: var(--text-secondary);
}

/* ===================== THEME SWITCHER ===================== */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: var(--space-xs);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.theme-btn {
    width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color .2s;
    color: var(--text-tertiary);
}

.theme-btn.active {
    background: var(--glass-border);
    color: var(--text-primary);
}

.theme-btn:hover:not(.active) {
    color: var(--text-secondary);
}

.theme-btn svg {
    width: 16px;
    height: 16px;
}

/* ===================== BUTTONS ===================== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    border-radius: var(--radius-s);
    background-color: var(--btn-bg);
    color: var(--btn-color);
    padding: 12px 24px 14px;
    font-size: var(--subtitle-size);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: var(--button-spacing);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity .2s, transform .2s, background-color .2s;
    white-space: nowrap;
}

.button:hover { opacity: .88; }
.button:active { transform: scale(0.98); }

.button_large { padding: 15px 40px 17px; }
.button_small { padding: 10px 16px 11px; font-size: var(--body-size); }

.button_tinted {
    background: var(--btn-tinted-bg);
    color: var(--btn-tinted-color);
}
.button_tinted:hover { opacity: 1; background: rgba(38, 147, 255, 0.18); }

.button_ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--btn-ghost-border);
}
.button_ghost:hover { opacity: 1; background: var(--btn-ghost-hover); }

/* ===================== HERO ===================== */
.hero {
    padding-top: 140px;
    padding-bottom: var(--section-py);
}

.hero__inner {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero__col { flex: 1; }

.hero__suptitle-wrapper {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-xl);
    padding: 6px 16px;
    border-radius: 100px;
    background: var(--badge-bg);
    border: 1px solid var(--badge-border);
}

.hero__suptitle {
    font-size: var(--small-size);
    font-weight: 600;
    color: var(--brand-primary);
    letter-spacing: var(--small-spacing);
}

.hero__title {
    font-size: var(--h1-size);
    font-weight: 700;
    line-height: var(--h1-height);
    letter-spacing: var(--h1-spacing);
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
    transition: color .3s;
}

.hero__title .text-accent {
    color: var(--brand-primary);
}

.hero__subtitle {
    font-size: var(--subtitle-size);
    font-weight: 400;
    line-height: var(--subtitle-height);
    color: var(--text-secondary);
    margin-bottom: var(--space-xxl);
    max-width: 520px;
    transition: color .3s;
}

.hero__btn-wrapper {
    display: flex;
    gap: var(--space-m);
    flex-wrap: wrap;
}

/* ===================== MAIN CARDS ===================== */
.main-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--card-gap);
    padding: var(--section-py) 0;
}

.main-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-m);
    padding: var(--space-xxl);
    border-radius: var(--radius-l);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    transition: background-color .25s, border-color .25s, transform .25s;
}

.main-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.main-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-s);
    background: var(--icon-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.main-card__icon svg {
    width: 24px;
    height: 24px;
    color: var(--brand-primary);
}

.main-card__title {
    font-size: var(--body-size);
    font-weight: 600;
    line-height: var(--subtitle-height);
    color: var(--text-primary);
    transition: color .3s;
}

.main-card__text {
    font-size: var(--small-size);
    line-height: var(--body-height);
    color: var(--text-secondary);
    transition: color .3s;
}

/* ===================== SECTION TITLE ===================== */
.section__title {
    font-size: var(--h2-size);
    font-weight: 700;
    line-height: var(--h1-height);
    letter-spacing: var(--h2-spacing);
    color: var(--text-primary);
    transition: color .3s;
}

/* ===================== CTA SECTION ===================== */
.cta-section {
    padding: var(--section-py) 0 80px;
}

.cta__inner {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 60px;
    border-radius: var(--radius-l);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    transition: background-color .3s, border-color .3s;
}

.cta__col { flex: 1; }

.cta__description {
    font-size: var(--body-size);
    line-height: var(--body-height);
    color: var(--text-secondary);
    margin-top: var(--space-l);
    margin-bottom: var(--space-xxl);
    transition: color .3s;
}

/* ===================== FOOTER ===================== */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--glass-border);
    transition: border-color .3s;
}

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

.footer__top {
    display: flex;
    justify-content: space-between;
    gap: var(--space-xxl);
}

.footer__logo {
    font-size: var(--h4-size);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: var(--h2-spacing);
    flex-shrink: 0;
    transition: color .3s;
}

.footer__nav {
    display: flex;
    gap: 80px;
}

.footer__nav-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
}

.footer__nav-heading {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    font-size: var(--small-size);
    transition: color .3s;
}

.footer__link {
    font-size: var(--small-size);
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .2s;
}

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

.footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-xxl);
    border-top: 1px solid var(--glass-border);
    transition: border-color .3s;
}

.footer__copyright {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 500;
    transition: color .3s;
}

.footer__bottom-links {
    display: flex;
    gap: var(--space-xl);
}

/* ===================== STATUS PAGES ===================== */
.status-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 64px;
}

.status-card {
    max-width: 440px;
    width: 100%;
    padding: 48px 40px;
    border-radius: var(--radius-l);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    text-align: center;
    transition: background-color .3s, border-color .3s;
}

.status-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-xl);
}

.status-icon svg { width: 36px; height: 36px; }

.status-icon_success {
    background: var(--success-bg);
    border: 1.5px solid var(--success-border);
}
.status-icon_success svg { color: var(--success-color); }

.status-icon_error {
    background: var(--error-bg);
    border: 1.5px solid var(--error-border);
}
.status-icon_error svg { color: var(--error-color); }

.status-card__title {
    font-size: var(--h4-size);
    font-weight: 700;
    letter-spacing: var(--h2-spacing);
    margin-bottom: var(--space-s);
    color: var(--text-primary);
    transition: color .3s;
}

.status-card__text {
    font-size: var(--body-regular);
    line-height: var(--body-height);
    color: var(--text-secondary);
    margin-bottom: var(--space-xxl);
    transition: color .3s;
}

.status-card__buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
}

/* ===================== LEGAL PAGES ===================== */
.legal {
    padding-top: 120px;
    padding-bottom: var(--section-py);
}

.legal__title {
    font-size: var(--h2-size);
    font-weight: 700;
    letter-spacing: var(--h2-spacing);
    line-height: var(--h1-height);
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
    transition: color .3s;
}

.legal__date {
    font-size: var(--small-size);
    color: var(--text-tertiary);
    margin-bottom: var(--space-xxl);
    transition: color .3s;
}

/* ===================== DOC HUB ===================== */
.doc-hub {
    padding-top: 140px;
    padding-bottom: var(--section-py);
}

.doc-hub__intro {
    text-align: center;
    margin-bottom: 48px;
}

.doc-hub__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-primary);
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--icon-bg);
    margin-bottom: var(--space-m);
}

.doc-hub__title {
    font-size: var(--h2-size);
    font-weight: 700;
    letter-spacing: var(--h2-spacing);
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: var(--space-s);
}

.doc-hub__subtitle {
    font-size: var(--body-regular);
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
}

.doc-hub__subtitle span {
    display: block;
    color: var(--text-tertiary);
    font-size: var(--small-size);
    margin-top: 4px;
}

.doc-hub__section {
    margin-bottom: 40px;
    scroll-margin-top: 100px;
}

.doc-hub__section:last-of-type {
    margin-bottom: 0;
}

.doc-hub__section-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 0 var(--space-s) var(--space-s);
    margin-bottom: var(--space-m);
    border-bottom: 1px solid var(--glass-border);
    transition: color .3s, border-color .3s;
}

.doc-hub__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-m);
}

.doc-hub__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-l);
    padding: var(--space-l) var(--space-xl);
    border-radius: var(--radius-l);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    text-decoration: none;
    transition: background-color .25s, border-color .25s, transform .25s;
}

.doc-hub__item:hover {
    background: var(--bg-card-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.doc-hub__item:hover .doc-hub__item-arrow {
    transform: translateX(4px);
    color: var(--brand-primary);
}

.doc-hub__item-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-s);
    background: var(--icon-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-hub__item-icon svg {
    width: 26px;
    height: 26px;
    color: var(--brand-primary);
}

.doc-hub__item-body {
    min-width: 0;
}

.doc-hub__item-title {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    font-size: var(--body-size);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.doc-hub__tags {
    display: inline-flex;
    gap: 6px;
}

.doc-hub__tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--text-tertiary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.doc-hub__item-desc {
    font-size: var(--small-size);
    line-height: 1.55;
    color: var(--text-secondary);
}

.doc-hub__item-arrow {
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: transform .25s, color .25s;
}

.doc-hub__item-arrow svg {
    width: 20px;
    height: 20px;
    display: block;
}

.doc-hub__foot {
    text-align: center;
    margin-top: 40px;
    font-size: var(--small-size);
    color: var(--text-tertiary);
    line-height: 1.6;
}

@media (max-width: 720px) {
    .doc-hub {
        padding-top: 100px;
    }
    .doc-hub__intro {
        margin-bottom: 32px;
    }
    .doc-hub__item {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: var(--space-m);
        padding: var(--space-m);
    }
    .doc-hub__item-icon {
        width: 44px;
        height: 44px;
    }
    .doc-hub__item-icon svg {
        width: 22px;
        height: 22px;
    }
    .doc-hub__item-arrow {
        grid-row: 1;
        grid-column: 2;
        justify-self: end;
        align-self: start;
    }
    .doc-hub__item-body {
        grid-column: 1 / -1;
    }
}

.legal__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--small-size);
    color: var(--text-tertiary);
    text-decoration: none;
    padding: 6px 10px;
    margin-left: -10px;
    margin-bottom: var(--space-l);
    border-radius: 8px;
    transition: color .2s, background-color .2s;
}

.legal__back:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.legal__back svg {
    width: 16px;
    height: 16px;
    transition: transform .2s;
}

.legal__back:hover svg {
    transform: translateX(-2px);
}

.legal__content {
    font-size: var(--body-regular);
    line-height: 1.8;
    color: var(--text-secondary);
    transition: color .3s;
}

.legal__content h2 {
    font-size: var(--h4-size);
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 40px;
    margin-bottom: var(--space-m);
}

.legal__content p { margin-bottom: var(--space-m); }

.legal__content ul, .legal__content ol {
    margin-bottom: var(--space-m);
    padding-left: var(--space-xl);
}

.legal__content li {
    margin-bottom: var(--space-xs);
}

.legal__content a {
    color: var(--accent);
    text-decoration: underline dashed;
    text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: text-decoration-color .2s, text-decoration-style .2s;
}

.legal__content a:hover {
    text-decoration-style: solid;
    text-decoration-color: var(--accent);
}

.legal__content a[target="_blank"]::after {
    content: "";
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-left: 3px;
    vertical-align: middle;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 2.5h-4v11h11v-4M9.5 2.5h4v4M13.5 2.5L7 9' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 2.5h-4v11h11v-4M9.5 2.5h4v4M13.5 2.5L7 9' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 0.5;
    transition: opacity .2s;
}

.legal__content a[target="_blank"]:hover::after {
    opacity: 0.8;
}

.legal__content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: var(--space-xl);
    font-size: var(--small-size);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-s);
    overflow: hidden;
    transition: border-color .3s;
}

.legal__content th,
.legal__content td {
    text-align: left;
    padding: var(--space-s) var(--space-m);
    border-bottom: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    transition: border-color .3s, background .3s;
}

.legal__content th:last-child,
.legal__content td:last-child {
    border-right: none;
}

.legal__content tr:last-child td {
    border-bottom: none;
}

.legal__content thead th {
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-card);
    border-bottom: 2px solid var(--glass-border-hover);
    white-space: nowrap;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legal__content td {
    color: var(--text-secondary);
}

.legal__content tbody tr:hover td {
    background: var(--bg-card);
}

.legal__content h3 {
    font-size: var(--body-size);
    font-weight: 600;
    color: var(--text-primary);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-s);
}

/* ===================== SCROLL REVEAL ===================== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .25s; }
.reveal-delay-4 { transition-delay: .35s; }

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* ===================== RESPONSIVE ===================== */

/* Tablet landscape */
@media (max-width: 1100px) {
    .main-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet */
@media (max-width: 991px) {
    :root {
        --h1-size: 40px;
        --h2-size: 32px;
        --container-px: 32px;
    }

    .hero {
        padding-top: 120px;
    }

    .hero__inner {
        flex-direction: column;
        gap: 40px;
    }

    .hero__subtitle {
        max-width: 100%;
    }

    .cta__inner {
        flex-direction: column;
        padding: 40px;
        gap: 24px;
    }

    .footer__top {
        flex-direction: column;
        gap: var(--space-xxl);
    }

    .footer__nav {
        gap: 40px;
        flex-wrap: wrap;
    }
}

/* Mobile landscape */
@media (max-width: 767px) {
    :root {
        --h1-size: 34px;
        --h2-size: 28px;
        --section-py: 40px;
        --container-px: 20px;
        --card-gap: 16px;
    }

    .header__cta { display: none !important; }

    .hero {
        padding-top: 100px;
    }

    .main-cards {
        grid-template-columns: 1fr;
    }

    .main-card {
        padding: var(--space-xl);
    }

    .hero__btn-wrapper {
        flex-direction: column;
    }

    .button_large {
        padding: 14px 32px 15px;
        width: 100%;
    }

    .cta__inner {
        padding: var(--space-xxl);
    }

    .footer__nav {
        flex-direction: column;
        gap: var(--space-xl);
    }

    .footer__bottom {
        flex-direction: column;
        gap: var(--space-m);
        text-align: center;
    }

    .footer__bottom-links {
        flex-direction: column;
        gap: var(--space-s);
        align-items: center;
    }

    .status-card {
        padding: 36px 24px;
        margin: 0 var(--container-px);
    }

    .legal {
        padding-top: 96px;
    }

    .legal__title {
        font-size: var(--h2-size);
        line-height: 1.2;
    }

    .legal__content {
        font-size: 15px;
        line-height: 1.7;
    }

    .legal__content h2 {
        font-size: 20px;
        margin-top: 32px;
    }

    /* Table: horizontal scroll wrapper on mobile */
    .legal__content .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: calc(-1 * var(--container-px));
        margin-right: calc(-1 * var(--container-px));
        padding-left: var(--container-px);
        padding-right: var(--container-px);
    }

    .legal__content table {
        min-width: 540px;
        font-size: 13px;
    }

    .legal__content th,
    .legal__content td {
        padding: 10px 12px;
    }

    .legal__content thead th {
        font-size: 11px;
    }

    .legal__content ul,
    .legal__content ol {
        padding-left: var(--space-m);
    }
}

/* Mobile portrait */
@media (max-width: 479px) {
    :root {
        --h1-size: 28px;
        --h2-size: 24px;
        --h4-size: 20px;
        --subtitle-size: 17px;
    }

    .header__logo {
        font-size: 20px;
    }

    .lang-switcher, .theme-switcher {
        padding: 2px;
    }

    .lang-btn {
        padding: 4px 8px;
        font-size: 12px;
    }

    .theme-btn {
        width: 28px;
        height: 26px;
    }

    .theme-btn svg {
        width: 14px;
        height: 14px;
    }

    .legal {
        padding-top: 80px;
    }

    .legal__title {
        font-size: 22px;
    }

    .legal__date {
        font-size: 13px;
        margin-bottom: var(--space-l);
    }

    .legal__content {
        font-size: 14px;
        line-height: 1.65;
    }

    .legal__content h2 {
        font-size: 18px;
        margin-top: 28px;
        margin-bottom: 12px;
    }

    .legal__content h3 {
        font-size: 16px;
    }

    .legal__content p {
        margin-bottom: 12px;
    }

    .legal__content table {
        min-width: 480px;
        font-size: 12px;
    }

    .legal__content th,
    .legal__content td {
        padding: 8px 10px;
    }

    .legal__content thead th {
        font-size: 10px;
    }
}

/* Tall phones (safe area) */
@supports (padding: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }
}

/* Desktop - show header CTA */
@media (min-width: 768px) {
    .header__cta {
        display: inline-flex;
    }
}
