
/* Global Link Colors & Reset - Prevent Visited Purple */
a,
a:visited,
a:hover,
a:active,
a:focus {
    color: inherit;
    text-decoration: none;
}

.nav-logo,
.nav-logo:visited,
.nav-logo:hover,
.nav-logo:active,
.nav-logo:focus {
    color: var(--text-main) !important;
    text-decoration: none !important;
}

.nav-link,
.nav-link:visited,
.nav-link:hover,
.nav-link:active,
.nav-link:focus {
    text-decoration: none !important;
}

.nav-buy-btn,
.nav-buy-btn:visited,
.nav-buy-btn:hover,
.nav-buy-btn:active,
.nav-buy-btn:focus {
    text-decoration: none !important;
}

/* Цвета живут в токенах, а не в правилах: светлая тема — это
   подмена этого блока, а не вторая копия всех стилей.
   --tint — канал для полупрозрачных подложек и линий: в тёмной теме
   это белый, в светлой — чернильный, поэтому rgba(var(--tint), .08)
   везде означает «чуть светлее/темнее фона», а не конкретный цвет. */
:root {
    color-scheme: dark;

    --bg-dark: #07070b;
    --text-main: #f4f4fa;
    --text-muted: #a3a3b4;
    --text-strong: #f7f8fc;
    --text-body: #c4c7d8;
    --accent: #ff3b4b;
    --accent-hover: #ff5260;
    --accent-rgb: 255, 59, 75;
    --on-accent: #0b0b10;
    --glass-bg: rgba(30, 32, 46, 0.5);
    --glass-border: rgba(255, 255, 255, 0.12);
    --font-main: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Geist Mono', monospace;
    --font-serif: 'Instrument Serif', serif;

    --tint: 255, 255, 255;
    --shadow-k: 1;

    /* Стеклянные поверхности: шапка/карточки — верх и низ градиента */
    --surface-top: rgba(30, 32, 46, 0.6);
    --surface-bottom: rgba(16, 17, 26, 0.5);
    --panel-top: rgba(30, 32, 46, 0.7);
    --panel-bottom: rgba(16, 17, 26, 0.6);
    --panel-solid-top: rgba(30, 32, 46, 0.9);
    --panel-solid-bottom: rgba(16, 17, 26, 0.9);
    --chip-bg: rgba(7, 7, 11, 0.72);

    --input-bg: rgba(0, 0, 0, 0.4);
    --input-bg-focus: rgba(0, 0, 0, 0.6);
    --grid-line: rgba(255, 255, 255, 0.035);

    /* Верхняя грань стекла бликует белым в обеих темах — это свет,
       а не цвет поверхности, поэтому через --tint её гонять нельзя */
    --edge-hi: rgba(255, 255, 255, 0.1);

    --error: #ff5566;
    --success: #4ade80;

    /* Кривые: встроенные CSS-easing слишком слабые для UI */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-card: cubic-bezier(0.2, 0.8, 0.2, 1);

    /* Высота липкой шапки — обновляется из JS, служит основой
       для scroll-margin-top вместо подобранных вручную чисел */
    --nav-h: 140px;
}

/* Светлая тема. Красный акцент притемнён: #ff3b4b на белом даёт
   контраст ~2.8:1 и не читается в тексте и на кнопках. */
[data-theme="light"] {
    color-scheme: light;

    --bg-dark: #f2f3f8;
    --text-main: #16171f;
    --text-muted: #61647a;
    --text-strong: #0d0e14;
    --text-body: #3e4152;
    --accent: #dd1f30;
    --accent-hover: #c11a29;
    --accent-rgb: 221, 31, 48;
    --on-accent: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(18, 20, 32, 0.12);

    --tint: 18, 20, 32;
    --shadow-k: 0.26;

    --surface-top: rgba(255, 255, 255, 0.82);
    --surface-bottom: rgba(246, 247, 252, 0.72);
    --panel-top: rgba(255, 255, 255, 0.86);
    --panel-bottom: rgba(245, 246, 251, 0.78);
    --panel-solid-top: rgba(255, 255, 255, 0.97);
    --panel-solid-bottom: rgba(244, 245, 251, 0.97);
    --chip-bg: rgba(255, 255, 255, 0.86);

    --input-bg: rgba(255, 255, 255, 0.75);
    --input-bg-focus: rgba(255, 255, 255, 0.95);
    --grid-line: rgba(18, 20, 32, 0.045);

    --edge-hi: rgba(255, 255, 255, 0.7);

    --error: #d32338;
    --success: #17864a;
}

/* Спиннер: раньше keyframes rotate нигде не был определён,
   и индикаторы загрузки на входе/регистрации стояли неподвижно */
@keyframes rotate {
    to { transform: rotate(360deg); }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

#features {
    scroll-margin-top: 140px;
}

#pricing {
    /* Привязка к реальной высоте шапки, а не к числу, которое устаревает */
    scroll-margin-top: calc(var(--nav-h) + 20px);
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Background Atmosphere */
.atmosphere {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    z-index: -1;
    overflow: hidden;
    /* Подложка на случай отсутствия assets/bg.png — раньше файла не было
       и на страницах без onerror висела иконка битой картинки */
    background:
        radial-gradient(120% 80% at 20% 0%, rgba(var(--accent-rgb), 0.10) 0%, transparent 55%),
        radial-gradient(100% 70% at 85% 15%, rgba(96, 110, 255, 0.07) 0%, transparent 60%),
        var(--bg-dark);
}

.atmosphere img {
    position: absolute;
    top: -20px;
    left: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    object-fit: cover;
    filter: blur(8px) saturate(120%);
    opacity: 0.6;
}

/* Затемняющие слои атмосферы в светлой теме гасятся до нуля:
   иначе поверх светлого фона лежит серая плёнка. */
.atmosphere-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 8, 14, 0.1) 0%, rgba(7, 8, 14, 0.2) 34%, rgba(7, 8, 14, 0.6) 64%, rgba(7, 7, 11, 0.95) 100%);
}

.atmosphere-radial {
    position: absolute;
    inset: 0;
    background: radial-gradient(130% 92% at 50% 40%, transparent 40%, rgba(7, 7, 11, 0.8) 100%);
}

[data-theme="light"] .atmosphere-overlay {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 40%, rgba(255, 255, 255, 0.5) 100%);
}

[data-theme="light"] .atmosphere-radial {
    background: radial-gradient(130% 92% at 50% 40%, transparent 45%, rgba(226, 228, 240, 0.7) 100%);
}

/* Фон вместо чёрной пустоты: свечение, сетка и дрейфующие частицы */
.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(42% 36% at 18% 12%, rgba(var(--accent-rgb), 0.10), transparent 70%),
        radial-gradient(46% 40% at 84% 30%, rgba(255, 122, 89, 0.07), transparent 70%),
        radial-gradient(50% 44% at 55% 92%, rgba(var(--accent-rgb), 0.09), transparent 72%);
    animation: glowDrift 14s ease-in-out infinite alternate;
}

/* На светлом фоне то же свечение читается как грязь — ослабляем */
[data-theme="light"] .bg-glow {
    opacity: 0.55;
}

@keyframes glowDrift {
    from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
    to   { transform: translate3d(1.5%, 1%, 0) scale(1.06); }
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.5;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 20%, transparent 75%);
    pointer-events: none;
}

.bg-particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.bg-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0;
    filter: blur(1px);
    animation: particleRise linear infinite;
}

@keyframes particleRise {
    0%   { transform: translate3d(0, 0, 0); opacity: 0; }
    10%  { opacity: 0.5; }
    90%  { opacity: 0.4; }
    100% { transform: translate3d(24px, -110vh, 0); opacity: 0; }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

/* Navigation Bar */
/* Navigation Bar (System Client Style: blur(8px) saturate(1.3), no outline) */
header {
    display: flex;
    justify-content: center;
    padding-top: 32px;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: padding 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    animation: dropDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

header.scrolled {
    padding-top: 14px;
}

.nav-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(8px) saturate(1.3);
    -webkit-backdrop-filter: blur(8px) saturate(1.3);
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 20px;
    padding: 10px 10px 10px 20px;
    transition: background 0.3s ease;
}

header.scrolled .nav-bar {
    background: rgba(8, 8, 12, 0.65);
}

@keyframes dropDown {
    from { margin-top: -30px; opacity: 0; }
    to { margin-top: 0; opacity: 1; }
}

.nav-logo {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
    color: var(--text-main) !important;
    font-family: var(--font-main) !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    letter-spacing: -0.01em !important;
    line-height: 1 !important;
    padding-right: 20px !important;
    margin-right: 4px !important;
    border-right: 1px solid rgba(var(--tint), 0.14) !important;
    height: 32px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.nav-logo img,
.nav-logo svg {
    display: block !important;
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
}

.nav-logo svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 12px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .nav-link:hover {
        color: var(--text-main);
        background: rgba(var(--tint), 0.06);
    }
}

.nav-link span.material-symbols-rounded {
    font-size: 18px;
    opacity: 0.8;
}

.nav-buy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: rgba(var(--tint), 0.08);
    border: 1px solid rgba(var(--tint), 0.14);
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 14px;
    transition: transform 0.16s var(--ease-out), background-color 0.2s ease;
    box-shadow: 0 4px 18px rgba(0, 0, 0, calc(0.2 * var(--shadow-k))), inset 0 1px 0 var(--edge-hi);
}

/* Переключатель темы. Иконка одна: показываем то состояние, в которое
   кнопка переведёт, — так понятнее, чем рисовать текущее. */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: none;
    background: rgba(var(--tint), 0.08);
    border: 1px solid rgba(var(--tint), 0.14);
    border-radius: 14px;
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.16s var(--ease-out), background-color 0.2s ease;
    box-shadow: inset 0 1px 0 var(--edge-hi);
}

.theme-toggle .material-symbols-rounded {
    font-size: 22px;
    line-height: 1;
    /* Иконка подменяется мгновенно, а поворот прячет саму подмену */
    transition: transform 0.24s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .theme-toggle:hover {
        background: rgba(var(--tint), 0.14);
    }

    .theme-toggle:hover .material-symbols-rounded {
        transform: rotate(-18deg);
    }
}

.theme-toggle:active {
    transform: scale(0.94);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Страницы без шапки (вход, регистрация, 404) — кнопка висит в углу сама.
   Стекло здесь своё: под ней нет панели, на которую можно опереться. */
.theme-toggle.is-floating {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 900;
    background: linear-gradient(180deg, var(--surface-top), var(--surface-bottom));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, calc(0.35 * var(--shadow-k))), inset 0 1px 0 var(--edge-hi);
}

@media (max-width: 600px) {
    .theme-toggle.is-floating {
        top: 16px;
        right: 16px;
    }
}

@media (hover: hover) and (pointer: fine) {
    .nav-buy-btn:hover {
        background: rgba(var(--tint), 0.13);
        transform: translateY(-1px);
    }
}

.nav-buy-btn:active {
    transform: scale(0.97);
}

/* Акцентная кнопка в шапке (админ-панель) — заметнее обычной,
   но не сплошная заливка: она не главное действие на странице */
.nav-buy-btn.is-tinted {
    background: rgba(var(--accent-rgb), 0.14);
    border-color: rgba(var(--accent-rgb), 0.4);
}

.nav-buy-btn.is-tinted .material-symbols-rounded {
    color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
    .nav-buy-btn.is-tinted:hover {
        background: rgba(var(--accent-rgb), 0.22);
    }
}

/* Второстепенное действие в шапке (выход): контур вместо заливки.
   Раньше стояло инлайном и в светлой теме белый текст исчезал. */
.nav-buy-btn.is-ghost {
    background: transparent;
    border: 1px solid rgba(var(--accent-rgb), 0.5);
    color: var(--accent);
    box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
    .nav-buy-btn.is-ghost:hover {
        background: rgba(var(--accent-rgb), 0.1);
        border-color: var(--accent);
    }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 100px 0 80px;
}

.hero-title {
    /* Жидкая типографика: на десктопе то же 72px, на телефоне
       плавно сжимается без отдельного правила под каждую ширину */
    font-size: clamp(30px, 7vw, 72px);
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-strong);
    margin: 0 auto;
    text-shadow: 0 2px 36px rgba(0, 0, 0, calc(0.6 * var(--shadow-k)));
    animation: fadeUp 0.6s ease-out both 0.1s;
}

.hero-title .highlight {
    background: linear-gradient(100deg, var(--accent) 0%, #ff8a5b 52%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent); /* фолбэк */
}

/* Плашка «Активно и обновляется» убрана из разметки — вместе с ней
   ушли .hero-badge, .dot и анимация livePulse. */

.hero-subtitle {
    font-size: clamp(15px, 2.1vw, 18px);
    line-height: 1.5;
    color: var(--text-body);
    max-width: 700px;
    margin: 24px auto 0;
    font-weight: 400;
    text-shadow: 0 1px 14px rgba(0, 0, 0, calc(0.5 * var(--shadow-k)));
    animation: fadeUp 0.6s ease-out both 0.2s;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 40px;
    animation: fadeUp 0.6s ease-out both 0.3s;
}

/* Кнопка «Приобрести» в стиле красной кнопки «Выбрать» */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 16px;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: transform 0.16s var(--ease-out), filter 0.2s ease, box-shadow 0.25s ease;
    box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.25);
}

@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover {
        color: var(--on-accent);
        filter: brightness(1.1);
        transform: translateY(-2px);
        box-shadow: 0 14px 35px rgba(var(--accent-rgb), 0.35);
    }
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    display: flex;
    align-items: center;
    text-decoration: none;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--tint), 0.16);
    color: var(--text-main);
    font-size: 16px;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: 16px;
    transition: transform 0.16s var(--ease-out), background-color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .btn-secondary:hover {
        background: rgba(var(--tint), 0.11);
    }
}

.btn-secondary:active {
    transform: scale(0.97);
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    margin-top: 80px;
    flex-wrap: wrap;
    animation: fadeUp 0.6s ease-out both 0.4s;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-radius: 16px;
    background: var(--glass-bg);
    border: 1px solid rgba(var(--tint), 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.25s var(--ease-out), border-color 0.25s ease, background-color 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    .stat-item:hover {
        transform: translateY(-4px);
        border-color: rgba(var(--accent-rgb), 0.3);
        background: rgba(var(--accent-rgb), 0.06);
    }
}

.stat-item span.material-symbols-rounded {
    color: var(--accent);
    opacity: 0.8;
}

.stat-label {
    font-size: 17px;
    color: var(--text-muted);
}

.stat-value {
    font-size: 18px;
    color: var(--text-main);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@keyframes fadeUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Базовый класс для JS-reveal: задержки задаются из JS
   через transitionDelay — прерываемо и отзывчиво */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.fade-up.in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .fade-up,
    .fade-up.in {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Pricing Section */
.pricing-section {
    padding: 100px 0;
    position: relative;
}

.section-title {
    text-align: center;
    /* clamp: 42px на десктопе, плавно меньше на планшете и телефоне */
    font-size: clamp(26px, 4.5vw, 42px);
    font-weight: 700;
    margin-bottom: 60px;
    position: relative;
}

/* Подчёркивание-акцент под заголовком секции */
.section-title::after {
    content: '';
    display: block;
    width: 64px;
    height: 3px;
    margin: 18px auto 0;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.pricing-cards {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    perspective: 1400px;
}

/* Угол для вращающейся рамки — регистрируем как анимируемое свойство */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.pricing-card {
    /* Позиция курсора внутри карточки (задаётся из JS) */
    --mx: 50%;
    --my: 50%;
    /* Наклон по осям (JS) */
    --rx: 0deg;
    --ry: 0deg;
    /* Сдвиги: появление при скролле + подъём на ховере */
    --ty-enter: 0px;
    --ty-hover: 0px;
    --scale: 1;

    background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    width: 320px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, calc(0.4 * var(--shadow-k)));
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transform:
        rotateX(var(--rx))
        rotateY(var(--ry))
        translateY(calc(var(--ty-enter) + var(--ty-hover)))
        scale(var(--scale));
    transition:
        transform 0.25s var(--ease-card),
        opacity 0.28s var(--ease-card),
        border-color 0.3s ease,
        box-shadow 0.35s ease;
}

/* Слой поднимается только на время взаимодействия,
   а не висит в памяти постоянно */
.pricing-card:hover,
.pricing-card.is-tilting {
    will-change: transform;
}

/* Содержимое — над подсветкой */
.pricing-card > * {
    position: relative;
    z-index: 1;
}

/* Блик, следующий за курсором */
.pricing-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    background: radial-gradient(
        360px circle at var(--mx) var(--my),
        rgba(var(--accent-rgb), 0.20),
        rgba(var(--accent-rgb), 0.06) 40%,
        transparent 65%
    );
}

/* Ховер-эффекты только для мыши: на тач-устройствах состояние
   залипало после тапа — карточка оставалась приподнятой */
@media (hover: hover) and (pointer: fine) {
    .pricing-card:hover::after {
        opacity: 1;
    }
}

/* Вращающаяся градиентная рамка */
.card-border {
    /* Дубль на случай, если браузер не поддерживает @property —
       рамка отрисуется, просто без вращения */
    --angle: 0deg;
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: 24px;
    padding: 1.5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    background: conic-gradient(
        from var(--angle),
        transparent 0%,
        rgba(var(--accent-rgb), 0.95) 10%,
        rgba(255, 158, 90, 0.8) 18%,
        transparent 32%,
        transparent 100%
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
}

@keyframes spinBorder {
    to { --angle: 360deg; }
}

@media (hover: hover) and (pointer: fine) {
    .pricing-card:hover .card-border {
        opacity: 1;
        animation: spinBorder 3s linear infinite;
    }

    .pricing-card:hover {
        --ty-hover: -12px;
        --scale: 1.02;
        border-color: rgba(var(--accent-rgb), 0.35);
        box-shadow:
            0 40px 70px rgba(0, 0, 0, calc(0.55 * var(--shadow-k))),
            0 0 60px rgba(var(--accent-rgb), 0.18);
    }
}

.pricing-card.popular {
    --scale: 1.04;
    border-color: rgba(var(--accent-rgb), 0.5);
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.12), var(--panel-bottom));
}

@media (hover: hover) and (pointer: fine) {
    .pricing-card.popular:hover {
        --scale: 1.06;
    }
}

/* Бейдж стал реальным элементом: псевдоэлемент не может иметь
   собственный псевдоэлемент, а пульсу нужен отдельный слой */
.pricing-card.popular > .popular-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 100px;
}

/* Пульс: раньше анимировался box-shadow — layout/paint на каждом кадре,
   бесконечно. Теперь отдельный слой на transform + opacity.
   inset: 0 берёт размер у бейджа, без хардкода */
.pricing-card.popular > .popular-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 100px;
    background: var(--accent);
    animation: badgePulse 2.6s var(--ease-out) infinite;
}

@keyframes badgePulse {
    0%   { transform: scale(1);    opacity: 0.5; }
    70%  { transform: scale(1.3);  opacity: 0; }
    100% { transform: scale(1.3);  opacity: 0; }
}

.plan-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    transform: translateZ(0);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.plan-price {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 30px;
    transform: translateZ(0);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Слои приподнимаются в 3D — эффект глубины при наклоне */
@media (hover: hover) and (pointer: fine) {
    .pricing-card:hover .plan-name { transform: translateZ(28px); }
    .pricing-card:hover .plan-price { transform: translateZ(44px); }
    .pricing-card:hover .plan-features { transform: translateZ(18px); }
    .pricing-card:hover .btn-buy { transform: translateZ(34px); }
}

/* Появление карточек при скролле */
.pricing-card.reveal-init {
    opacity: 0;
    --ty-enter: 34px;
}

.pricing-card.reveal-in {
    opacity: 1;
    --ty-enter: 0px;
}

/* Покрытие reduced-motion: раньше блок гасил только карточки тарифов,
   а glowDrift, livePulse, badgePulse, dropDown, fadeUp и частицы
   продолжали двигаться. Прозрачность и цвет сохраняем — убираем движение */
@media (prefers-reduced-motion: reduce) {
    html,
    body {
        scroll-behavior: auto;
    }

    .bg-glow,
    .bg-particle,
    .nav-bar,
    .hero-title,
    .hero-subtitle,
    .hero-badge,
    .hero-cta,
    .stats,
    .hero-badge .dot::after,
    .pricing-card.popular > .popular-badge::after,
    .pricing-card:hover .card-border,
    .pricing-card:hover .btn-buy::before {
        animation: none !important;
    }

    /* Частицы просто не показываем — их смысл только в движении */
    .bg-particles {
        display: none;
    }

    .pricing-card,
    .pricing-card .plan-name,
    .pricing-card .plan-price,
    .pricing-card .plan-features,
    .pricing-card .btn-buy,
    .stat-item,
    .compare-img-top,
    .compare-handle,
    .compare-grip,
    .compare-tag,
    .theme-toggle,
    .theme-toggle .material-symbols-rounded,
    .modal-content {
        transition: none;
    }

    .pricing-card.reveal-init { opacity: 1; --ty-enter: 0px; }

    /* Ховер оставляем читаемым, но без сдвига и масштаба */
    .pricing-card:hover,
    .pricing-card.popular:hover,
    .stat-item:hover {
        --ty-hover: 0px;
        --scale: 1;
        transform: none;
    }

    .theme-toggle:hover .material-symbols-rounded {
        transform: none;
    }

    /* Слайдер остаётся рабочим: перетаскивание — это прямое управление,
       а не украшение. Убрали только доводку среза, срез следует за
       пальцем ровно так же. */
}

.plan-price span {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 500;
}

.plan-features {
    list-style: none;
    margin-bottom: 40px;
    flex: 1;
    transform: translateZ(0);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 15px;
    color: var(--text-body);
}

.plan-features li span.material-symbols-rounded {
    color: var(--accent);
    font-size: 20px;
}

.btn-buy {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.2s ease;
}

/* Блик, пробегающий по кнопке при наведении на карточку */
.btn-buy::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent,
        rgba(255, 255, 255, 0.35),
        transparent
    );
    transform: skewX(-20deg);
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .pricing-card:hover .btn-buy::before {
        animation: btnShine 0.9s var(--ease-out);
    }
}

@keyframes btnShine {
    to { left: 140%; }
}

.btn-buy.primary {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
}

.btn-buy.secondary {
    background: rgba(var(--tint), 0.06);
    color: var(--text-main);
    border: 1px solid rgba(var(--tint), 0.12);
}

@media (hover: hover) and (pointer: fine) {
    .btn-buy:hover {
        filter: brightness(1.1);
    }
}

/* Нажатие: до этого ни одна кнопка на сайте не реагировала на клик */
.btn-buy:active {
    transform: scale(0.97);
}

.btn-buy:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: none;
}

/* Footer */
footer {
    border-top: 1px solid rgba(var(--tint), 0.07);
    padding: 40px 0;
    margin-top: 100px;
    text-align: center;
    color: var(--text-muted);
}

/* Global Form Input Styling */
.login-input {
    width: 100%;
    background: var(--input-bg);
    border: 1.5px solid rgba(var(--tint), 0.14);
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: 14px;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, calc(0.3 * var(--shadow-k)));
}

.login-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.25), inset 0 2px 4px rgba(0, 0, 0, calc(0.4 * var(--shadow-k)));
    background: var(--input-bg-focus);
}

.login-input[aria-invalid="true"] {
    border-color: var(--error);
}

.login-input::placeholder {
    color: rgba(var(--tint), 0.45);
    font-weight: 400;
}

/* Метки полей: раньше placeholder был единственной подписью */
.field-label {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Подпись только для скринридера: поле без видимой метки
   всё равно должно быть названо вслух */
.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;
}

/* Видимая обводка для клавиатурной навигации */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* .error-msg жил только во встроенных <style> логина и регистрации,
   поэтому в дашборде пустой блок занимал место в вёрстке */
.error-msg {
    display: none;
    color: var(--error);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
}

.error-msg.is-success {
    color: var(--success);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    header {
        padding-top: 16px;
    }
    
    .nav-bar {
        padding: 8px 12px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .nav-logo {
        padding-right: 12px;
        font-size: 16px;
    }
    
    .nav-link {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .nav-buy-btn {
        padding: 8px 14px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }

    .hero {
        padding: 60px 0 40px;
    }
    
    .hero-title {
        /* размер отдаём clamp() — тут только боковые поля */
        padding: 0 10px;
    }

    .hero-subtitle {
        padding: 0 20px;
        margin-top: 16px;
    }
    
    .hero-cta {
        flex-direction: column;
        padding: 0 20px;
        gap: 12px;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    .stats {
        margin-top: 40px;
        gap: 30px;
        flex-direction: column;
    }
    
    .stat-item {
        justify-content: center;
    }

    .pricing-section {
        padding: 60px 0;
    }
    
    .section-title {
        margin-bottom: 40px;
    }
    
    .pricing-cards {
        gap: 20px;
        perspective: none;
    }

    .pricing-card {
        width: 100%;
        max-width: 340px;
        /* На тач-устройствах наклон только мешает */
        --rx: 0deg;
        --ry: 0deg;
        --scale: 1;
    }

    .pricing-card.popular,
    .pricing-card.popular:hover,
    .pricing-card:hover {
        --scale: 1;
    }
    
    .login-container {
        padding: 10px;
    }
    
    .login-card {
        padding: 24px 20px;
        max-width: 100%;
    }
}

/* Телефоны. clamp() уже сжал заголовки — здесь убираем лишние поля,
   уплотняем шапку и растягиваем статистику на всю ширину, чтобы на
   узком экране ничего не казалось слишком крупным и не переполняло строку. */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 40px 0 32px;
    }

    .hero-cta {
        margin-top: 28px;
    }

    /* Шапка: логотип без вертикального разделителя, кнопка входа снова
       по содержимому (а не на всю строку) — навигация умещается в два
       ряда вместо четырёх */
    .nav-bar {
        padding: 8px;
        gap: 6px;
    }

    .nav-logo {
        border-right: none;
        padding-right: 0;
    }

    .nav-link {
        font-size: 12px;
        padding: 7px 9px;
        gap: 5px;
    }

    .nav-link span.material-symbols-rounded {
        font-size: 16px;
    }

    .nav-buy-btn {
        width: auto;
    }

    .stats {
        margin-top: 32px;
        gap: 12px;
    }

    .stat-item {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }

    .stat-label { font-size: 15px; }
    .stat-value { font-size: 16px; }

    .section-title {
        margin-bottom: 32px;
    }

    .showcase-subtitle {
        font-size: 14px;
        padding: 0 12px;
    }
}

/* Purchase Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    /* Вход 240ms, выход 160ms — асимметрия, закрытие не тянется */
    transition:
        opacity 0.24s var(--ease-out),
        visibility 0s 0.24s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
    transition:
        opacity 0.24s var(--ease-out),
        visibility 0s;
}

.modal-overlay.hiding {
    pointer-events: none;
}

.modal-content {
    background: linear-gradient(180deg, var(--panel-solid-top), var(--panel-solid-bottom));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    position: relative;
    /* Модалка не привязана к триггеру — origin остаётся центральным */
    transform: translateY(20px) scale(0.96);
    transition: transform 0.16s var(--ease-out);
    box-shadow: 0 30px 60px rgba(0, 0, 0, calc(0.5 * var(--shadow-k)));
}

.modal-overlay.show .modal-content {
    transform: translateY(0) scale(1);
    transition: transform 0.24s var(--ease-out);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(var(--tint), 0.1);
    border: none;
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.16s var(--ease-out), background-color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .modal-close:hover {
        background: rgba(var(--tint), 0.2);
        transform: scale(1.08);
    }
}

.modal-close:active {
    transform: scale(0.94);
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 30px;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(var(--tint), 0.04);
    border: 1px solid rgba(var(--tint), 0.12);
    border-radius: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .payment-method:hover {
        background: rgba(var(--tint), 0.08);
        border-color: rgba(var(--tint), 0.22);
    }
}

.payment-method.selected {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.payment-method span.material-symbols-rounded {
    color: var(--accent);
}

/* Showcase Section */
.showcase-section {
    padding: 80px 0;
    text-align: center;
}

.showcase-subtitle {
    color: var(--text-muted);
    font-size: 16px;
    margin-top: -30px;
    margin-bottom: 40px;
}

/* Сравнение «с визуалами / без»: два кадра друг над другом,
   верхний обрезается по clip-path. Двигается только линия среза —
   ни один кадр не переливается и не масштабируется. */
.compare {
    max-width: 1000px;
    margin: 0 auto;
    background: linear-gradient(180deg, var(--surface-top), var(--surface-bottom));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, calc(0.6 * var(--shadow-k))), 0 0 60px rgba(var(--accent-rgb), 0.15);
}

.compare-frame {
    position: relative;
    aspect-ratio: 1600 / 841;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    touch-action: pan-y;
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
}

.compare-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    pointer-events: none;
}

/* Верхний слой — «с визуалами». Обрезаем справа: видна левая половина. */
.compare-img-top {
    clip-path: inset(0 50% 0 0);
    transition: clip-path 0.18s var(--ease-out);
}

.compare.is-dragging .compare-img-top,
.compare.is-dragging .compare-handle {
    transition: none;
}

/* --- Подписи ------------------------------------------------------ */
/* Подписи и ручка лежат поверх скриншота, а он не меняется вместе
   с темой — поэтому здесь намеренно фиксированные тёмные плашки
   и белая линия, а не токены. В светлой теме они читаются так же. */
.compare-tag {
    position: absolute;
    top: 14px;
    z-index: 2;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: rgba(7, 7, 11, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f4f4fa;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.compare-tag-left {
    left: 14px;
    border-color: rgba(255, 59, 75, 0.45);
    color: #ffd9dd;
}

.compare-tag-right {
    right: 14px;
}

/* --- Ручка -------------------------------------------------------- */
.compare-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    margin-left: -1px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
    transform: translate3d(0, 0, 0);
    transition: transform 0.18s var(--ease-out);
}

.compare-grip {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(7, 7, 11, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #f4f4fa;
    cursor: ew-resize;
    touch-action: none;
    transition: transform 0.14s var(--ease-out), box-shadow 0.2s ease,
                border-color 0.2s ease;
}

.compare-grip .material-symbols-rounded {
    font-size: 20px;
    margin: 0 -4px;
}

@media (hover: hover) and (pointer: fine) {
    .compare-grip:hover {
        transform: scale(1.06);
        border-color: var(--accent);
        box-shadow: 0 0 20px rgba(255, 59, 75, 0.35);
    }
}

.compare-grip:active {
    transform: scale(0.97);
}

.compare-grip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .showcase-section {
        padding: 40px 0;
    }
    .compare {
        padding: 10px;
        border-radius: 16px;
    }
    .compare-frame {
        border-radius: 10px;
    }
    .compare-tag {
        top: 10px;
        padding: 5px 10px;
        font-size: 12px;
    }
    .compare-tag-left { left: 10px; }
    .compare-tag-right { right: 10px; }
    .compare-grip {
        width: 38px;
        height: 38px;
        margin: -19px 0 0 -19px;
    }
}

/* ---------------------------------------------------------------
   Юридические страницы
   --------------------------------------------------------------- */
.legal-page {
    position: relative;
    z-index: 2;
    max-width: 780px;
    margin: 80px auto 0;
    padding: 0 24px;
}

.legal-page h1 {
    font-size: clamp(32px, 5vw, 44px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.legal-meta {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 48px;
}

.legal-page h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 40px 0 14px;
}

.legal-page p,
.legal-page li {
    color: var(--text-body);
    font-size: 16px;
    line-height: 1.7;
    max-width: 65ch;
}

.legal-page p + p {
    margin-top: 14px;
}

.legal-page ul {
    margin: 14px 0 0 22px;
}

.legal-page li {
    margin-bottom: 10px;
}

.legal-page code {
    font-family: monospace;
    font-size: 14px;
    background: rgba(var(--tint), 0.07);
    border: 1px solid rgba(var(--tint), 0.1);
    padding: 2px 6px;
    border-radius: 6px;
}

.legal-note {
    margin-top: 56px;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    background: rgba(var(--accent-rgb), 0.07);
    font-size: 14px !important;
}

.legal-footer {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(var(--tint), 0.07);
    margin-top: 80px;
    padding: 40px 24px;
    position: relative;
    z-index: 2;
}

.legal-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .legal-footer a:hover { color: var(--text-main); }
}

/* ---------------------------------------------------------------
   Скелетоны загрузки — вместо текста «Загрузка...»
   --------------------------------------------------------------- */
.skeleton {
    border-radius: 10px;
    background: linear-gradient(
        90deg,
        rgba(var(--tint), 0.05) 25%,
        rgba(var(--tint), 0.11) 37%,
        rgba(var(--tint), 0.05) 63%
    );
    background-size: 400% 100%;
    animation: skeletonShimmer 1.4s ease-in-out infinite;
}

@keyframes skeletonShimmer {
    from { background-position: 100% 50%; }
    to   { background-position: 0 50%; }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 10px;
}

.skeleton-row {
    height: 68px;
    margin-bottom: 12px;
}

@media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; }
}

/* ---------------------------------------------------------------
   Пустые состояния
   --------------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 24px;
    border: 1px dashed rgba(var(--tint), 0.14);
    border-radius: 16px;
    background: rgba(var(--tint), 0.03);
}

.empty-state .material-symbols-rounded {
    font-size: 40px;
    color: var(--text-muted);
    opacity: 0.6;
    margin-bottom: 14px;
}

.empty-state h4 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    max-width: 42ch;
}

/* ---------------------------------------------------------------
   Тосты — замена alert()
   --------------------------------------------------------------- */
.toast-stack {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 360px;
    padding: 14px 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, var(--panel-solid-top), var(--panel-solid-bottom));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 18px 40px rgba(0, 0, 0, calc(0.5 * var(--shadow-k)));
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    pointer-events: auto;
    /* Транзишен, а не keyframes: тосты появляются пачками
       и анимация должна прерываться, а не начинаться с нуля */
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.24s var(--ease-out), transform 0.24s var(--ease-out);
}

.toast[data-enter] {
    opacity: 0;
    transform: translateY(12px);
}

.toast .material-symbols-rounded {
    font-size: 20px;
    flex: 0 0 auto;
}

.toast.is-success { border-color: rgba(74, 222, 128, 0.4); }
.toast.is-success .material-symbols-rounded { color: var(--success); }
.toast.is-error { border-color: rgba(255, 85, 102, 0.45); }
.toast.is-error .material-symbols-rounded { color: var(--error); }
.toast.is-info .material-symbols-rounded { color: var(--text-muted); }

@media (max-width: 768px) {
    .toast-stack {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    .toast { transition: opacity 0.2s ease; }
    .toast[data-enter] { transform: none; }
}

/* ---------------------------------------------------------------
   Диалог подтверждения — замена confirm()
   --------------------------------------------------------------- */
.confirm-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.confirm-actions button {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.16s var(--ease-out), background-color 0.2s ease;
}

.confirm-actions .btn-cancel {
    background: rgba(var(--tint), 0.08);
    border: 1px solid rgba(var(--tint), 0.14);
    color: var(--text-main);
}

.confirm-actions .btn-confirm {
    background: var(--accent);
    border: none;
    color: var(--on-accent);
}

.confirm-actions .btn-confirm.is-danger {
    background: var(--error);
    color: #fff;
}

.confirm-actions button:active {
    transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
    .confirm-actions .btn-cancel:hover { background: rgba(var(--tint), 0.14); }
    .confirm-actions .btn-confirm:hover { filter: brightness(1.1); }
}

/* ---------------------------------------------------------------
   Иконочный шрифт: до загрузки лигатуры рендерятся текстом
   («shopping_cart», «logout»), поэтому прячем до готовности
   --------------------------------------------------------------- */
.material-symbols-rounded {
    visibility: hidden;
}

.fonts-ready .material-symbols-rounded,
.fonts-failed .material-symbols-rounded {
    visibility: visible;
}

.fonts-failed .material-symbols-rounded {
    font-size: 0 !important;
}

/* Right-hand Navbar Controls Alignment */
.nav-bar .nav-buy-btn {
    height: 46px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: rgba(var(--tint), 0.08);
    border-radius: 14px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    transition: transform 0.16s var(--ease-out), background-color 0.2s ease;
}
.nav-bar .nav-buy-btn:hover {
    background: rgba(var(--tint), 0.14);
    transform: translateY(-1px);
}
.nav-bar .nav-buy-btn:active {
    transform: scale(0.97);
}

.nav-bar .theme-toggle {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: rgba(var(--tint), 0.08);
    border-radius: 14px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.16s var(--ease-out), background-color 0.2s ease;
}
.nav-bar .theme-toggle:hover {
    background: rgba(var(--tint), 0.14);
}
.nav-bar .theme-toggle:active {
    transform: scale(0.94);
}

.shader-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: none;
    background: rgba(var(--tint), 0.08);
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 14px;
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.16s var(--ease-out), background-color 0.2s ease, color 0.2s ease;
}
.shader-toggle:hover {
    background: rgba(var(--tint), 0.14);
    color: var(--accent);
}
.shader-toggle:active {
    transform: scale(0.94);
}
.shader-toggle.is-off {
    color: rgba(var(--tint), 0.28);
}
.shader-toggle .material-symbols-rounded {
    font-size: 22px;
    line-height: 1;
}

/* ==========================================================================
   Compare Card Hover & 3D Interactive Animation
   ========================================================================== */
.compare {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}
@media (hover: hover) and (pointer: fine) {
    .compare:hover {
        transform: translateY(-8px) scale(1.008);
        box-shadow: 0 44px 110px rgba(0, 0, 0, calc(0.75 * var(--shadow-k))), 0 0 80px rgba(var(--accent-rgb), 0.28);
        border-color: rgba(var(--accent-rgb), 0.45);
    }
}

/* ==========================================================================
   Entrance Animations (System Client Smooth Blur Entrances)
   ========================================================================== */
.hero-title {
    animation: heroBlurEntrance 0.85s cubic-bezier(0.16, 1, 0.3, 1) both 0.1s !important;
}
.hero-subtitle {
    animation: heroBlurEntrance 0.85s cubic-bezier(0.16, 1, 0.3, 1) both 0.22s !important;
}
.hero-cta {
    animation: heroBlurEntrance 0.85s cubic-bezier(0.16, 1, 0.3, 1) both 0.34s !important;
}
.stats {
    animation: heroBlurEntrance 0.85s cubic-bezier(0.16, 1, 0.3, 1) both 0.46s !important;
}

@keyframes heroBlurEntrance {
    0% {
        opacity: 0;
        filter: blur(14px);
        transform: translateY(22px);
    }
    100% {
        opacity: 1;
        filter: blur(0px);
        transform: translateY(0);
    }
}

/* Scroll reveal helper for sections (excluding .pricing-card) */
.scroll-reveal {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(24px);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.75s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, filter, transform;
}
.scroll-reveal.is-revealed {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0);
}

/* Button physics */
.btn-press {
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
                background-color 0.2s ease,
                color 0.2s ease,
                box-shadow 0.2s ease;
}
.btn-press:active {
    transform: translateY(1px) scale(0.98);
}

/* 3D WebGL Background Canvas */
.cursor-shader-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
html.app-ready .cursor-shader-canvas {
    opacity: var(--shader-target-opacity, 0.45);
}

/* ==========================================================================
   Light Theme (Белая тема: чистый frosted glass, аккуратный контраст)
   ========================================================================== */
[data-theme="light"] .nav-bar {
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(24px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(160%) !important;
    border: 1px solid rgba(18, 20, 32, 0.09) !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

[data-theme="light"] header.scrolled .nav-bar {
    background: rgba(255, 255, 255, 0.88) !important;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

[data-theme="light"] header.scrolled .nav-bar {
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .nav-logo {
    color: #0d0e14 !important;
    border-right: 1px solid rgba(18, 20, 32, 0.12) !important;
}

[data-theme="light"] .nav-link {
    color: #4b4f63 !important;
}
[data-theme="light"] .nav-link:hover {
    color: #0d0e14 !important;
    background: rgba(18, 20, 32, 0.06) !important;
}

[data-theme="light"] .nav-bar .nav-buy-btn {
    background: rgba(18, 20, 32, 0.06) !important;
    color: #0d0e14 !important;
}
[data-theme="light"] .nav-bar .nav-buy-btn:hover {
    background: rgba(18, 20, 32, 0.12) !important;
}

[data-theme="light"] .nav-bar .theme-toggle,
[data-theme="light"] .shader-toggle {
    background: rgba(18, 20, 32, 0.06) !important;
    color: #0d0e14 !important;
}
[data-theme="light"] .nav-bar .theme-toggle:hover,
[data-theme="light"] .shader-toggle:hover {
    background: rgba(18, 20, 32, 0.12) !important;
}

[data-theme="light"] .shader-toggle.is-off {
    color: rgba(18, 20, 32, 0.28) !important;
}

/* В светлой теме шейдер делаем едва уловимым (4%), чтобы не пачкать белый фон */
[data-theme="light"] .cursor-shader-canvas {
    opacity: 0.04 !important;
    mix-blend-mode: multiply;
}

[data-theme="light"] .compare {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 246, 251, 0.85));
    border: 1px solid rgba(18, 20, 32, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 0 40px rgba(var(--accent-rgb), 0.08);
}
[data-theme="light"] .compare:hover {
    border-color: rgba(var(--accent-rgb), 0.35);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.12), 0 0 50px rgba(var(--accent-rgb), 0.15);
}
