/* ==========================================================================
   КОМПОНЕНТЫ — кнопки, шапка, стекло, карточки, бегущая строка, футер.
   ========================================================================== */

/* ---------- Кнопки ---------- */

.btn {
    --btn-h: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: var(--btn-h);
    padding-inline: 26px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    cursor: pointer;
    transition:
        transform 0.22s var(--ease),
        box-shadow 0.22s var(--ease),
        background-color 0.22s var(--ease),
        border-color 0.22s var(--ease),
        color 0.22s var(--ease);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn--primary {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, var(--c-gold-2) 0%, var(--c-gold) 52%, var(--c-gold-3) 100%);
    border-color: color-mix(in srgb, var(--c-gold-2) 70%, transparent);
    color: #1b1207;
    box-shadow:
        0 12px 30px rgba(169, 124, 75, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -1px 0 rgba(90, 60, 30, 0.25);
}

.btn--primary:hover {
    box-shadow:
        0 16px 40px rgba(217, 173, 124, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        inset 0 -1px 0 rgba(90, 60, 30, 0.25);
}

:root[data-theme="light"] .btn--primary {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #b98a55 0%, #8a6234 58%, #6f4d27 100%);
    border-color: rgba(111, 77, 39, 0.55);
    color: #fff;
    box-shadow:
        0 12px 26px rgba(111, 77, 39, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

:root[data-theme="light"] .btn--primary:hover {
    box-shadow:
        0 16px 34px rgba(111, 77, 39, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.btn--ghost {
    background: rgba(255, 255, 255, 0.035);
    border-color: var(--c-line);
    color: var(--c-text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--c-line-gold);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

:root[data-theme="light"] .btn--ghost {
    background: rgba(255, 255, 255, 0.55);
}

:root[data-theme="light"] .btn--ghost:hover {
    background: #fff;
}

.btn--sm {
    --btn-h: 40px;
    padding-inline: 16px;
    border-radius: 10px;
    font-size: 13px;
}

.btn--lg {
    --btn-h: 58px;
    padding-inline: 30px;
    border-radius: 16px;
    font-size: 15.5px;
}

.btn--block {
    width: 100%;
}

.btn__icon {
    width: 18px;
    height: 18px;
    flex: none;
}

/* ---------- Шапка ---------- */

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 60;
    height: var(--header-h);
    border-bottom: 1px solid transparent;
    transition:
        background-color 0.3s var(--ease),
        border-color 0.3s var(--ease),
        backdrop-filter 0.3s var(--ease);
}

.site-header.is-scrolled {
    background: color-mix(in srgb, var(--c-bg) 78%, transparent);
    border-bottom-color: var(--c-line);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 100%;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex: none;
}

.logo__mark {
    width: 30px;
    height: 30px;
    color: var(--c-gold);
    filter: drop-shadow(0 0 10px rgba(217, 173, 124, 0.25));
}

.logo__text {
    display: flex;
    flex-direction: column;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1;
}

.logo__text small {
    margin-top: 4px;
    color: var(--c-muted);
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 400;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-inline: auto;
}

.nav a {
    position: relative;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--c-text-2);
    font-size: 13.5px;
    font-weight: 500;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav a:hover {
    color: var(--c-text);
    background: rgba(255, 255, 255, 0.04);
}

.nav a.is-active {
    color: var(--c-gold-2);
}

.nav a.is-active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 3px;
    height: 1px;
    background: currentColor;
    opacity: 0.6;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.header-actions .btn--ghost {
    margin-left: 2px;
}

/* ---------- Переключатели ---------- */

.switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--c-line);
    border-radius: 10px;
}

.switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: var(--c-muted);
    transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.switch button:hover {
    color: var(--c-text);
    background: rgba(255, 255, 255, 0.06);
}

.switch button[aria-pressed="true"] {
    color: var(--c-gold-2);
    background: color-mix(in srgb, var(--c-gold) 14%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-gold) 22%, transparent);
}

.switch svg {
    width: 15px;
    height: 15px;
}

.switch--text button {
    width: auto;
    min-width: 34px;
    padding-inline: 7px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

/* ---------- Бургер и мобильное меню ---------- */

.burger {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--c-line);
    border-radius: 10px;
    color: var(--c-text);
}

.burger span {
    display: block;
    width: 16px;
    height: 1.5px;
    margin: 4px auto;
    background: currentColor;
    transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
}

.burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    inset: var(--header-h) 0 auto;
    z-index: 55;
    padding: 18px 0 24px;
    background: color-mix(in srgb, var(--c-bg) 94%, transparent);
    border-bottom: 1px solid var(--c-line);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
}

.mobile-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-menu__nav {
    display: grid;
    gap: 2px;
    margin-bottom: 18px;
}

.mobile-menu__nav a {
    padding: 13px 4px;
    border-bottom: 1px solid var(--c-line-soft);
    font-size: 16px;
    font-weight: 500;
}

.mobile-menu__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mobile-menu__actions .btn:last-child {
    grid-column: 1 / -1;
}

.mobile-menu__prefs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--c-line-soft);
}

/* ---------- Стекло ---------- */

.glass {
    background: var(--c-panel);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        var(--c-shadow-sm);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    backdrop-filter: blur(18px) saturate(130%);
}

:root[data-theme="light"] .glass {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        var(--c-shadow-sm);
}

/* ---------- Бегущая строка ---------- */

.marquee {
    position: relative;
    overflow: hidden;
    padding-block: 18px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
    display: flex;
    align-items: center;
    gap: 56px;
    width: max-content;
    animation: marquee 34s linear infinite;
}

.marquee:hover .marquee__track {
    animation-play-state: paused;
}

.marquee__item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--c-muted);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.16em;
    white-space: nowrap;
    transition: color 0.2s var(--ease);
}

.marquee__item::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--c-line-gold);
}

.marquee__item:hover {
    color: var(--c-gold-2);
}

@keyframes marquee {
    to {
        transform: translateX(calc(-50% - 28px));
    }
}

/* ---------- Карточки ---------- */

.card {
    position: relative;
    padding: 26px;
    background: var(--c-panel);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition:
        transform 0.3s var(--ease),
        border-color 0.3s var(--ease),
        background-color 0.3s var(--ease);
}

.card:hover {
    transform: translateY(-3px);
    border-color: var(--c-line-gold);
    background: var(--c-panel-hover);
}

.card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 20px;
    border: 1px solid var(--c-line-gold);
    border-radius: 12px;
    color: var(--c-gold);
    background: color-mix(in srgb, var(--c-gold) 7%, transparent);
}

.card__icon svg {
    width: 22px;
    height: 22px;
}

.card h3 {
    margin-bottom: 10px;
}

.card p {
    color: var(--c-text-2);
    font-size: 14.5px;
    line-height: 1.65;
}

.card__num {
    position: absolute;
    top: 24px;
    right: 24px;
    color: var(--c-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    opacity: 0.7;
}

/* ---------- Появление при скролле ---------- */

.js [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.7s var(--ease),
        transform 0.7s var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* ---------- Адаптив шапки ---------- */

@media (max-width: 1180px) {
    .nav {
        display: none;
    }

    .burger {
        display: block;
    }

    .header-actions .btn--ghost {
        display: none;
    }
}

@media (max-width: 720px) {
    .header-actions .switch,
    .header-actions .btn--primary {
        display: none;
    }

    .header-inner {
        gap: 12px;
    }

    .logo {
        margin-right: auto;
    }
}

@media (max-width: 420px) {
    .logo__text small {
        display: none;
    }
}
