:root {
    --bg: #070709;
    --text: #f7f7f9;
    --muted: #a1a1aa;
    --gold: #d4af37;
    --gold-bright: #f7d768;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Manrope', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Красивые переносы текста без висячих строк */
h1, h2, h3, .hero-badge, .tpl-label {
    text-wrap: balance;
}

p, li {
    text-wrap: pretty;
}

/* Главный фон сайта */
.site-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('assets/hero-bg.jpg') center/cover no-repeat;
    z-index: -3;
    transform: scale(1.03);
    pointer-events: none;
}

.site-dimmer {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 20%, rgba(7, 7, 10, 0.7) 0%, rgba(7, 7, 10, 0.93) 80%);
    z-index: -2;
    pointer-events: none;
}

/* Слой с летящими искорками */
#sparks-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Шапка */
.header {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(7, 7, 9, 0.82);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
    white-space: nowrap;
}

.logo span {
    color: var(--gold-bright);
}

.header-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    font-family: var(--font-heading);
    font-weight: 700;
    border: 1px solid rgba(247, 215, 104, 0.75);
    color: var(--gold-bright);
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    line-height: 1;
    white-space: nowrap;
    transition: 0.3s;
    animation: softPulseBorder 2.4s infinite ease-in-out;
}

.header-btn:hover {
    background: var(--gold-bright);
    color: #000;
}

/* Главный экран */
.hero {
    padding: 100px 0 75px;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 8px 22px;
    border-radius: 50px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(247, 215, 104, 0.45);
    color: var(--gold-bright);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 24px;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.2);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.3rem;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.02em;
    max-width: 900px;
    margin: 0 auto 24px;
    color: #ffffff;
}

.hero-title span {
    background: linear-gradient(135deg, #ffe88c 0%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-style: normal;
}

.hero-desc {
    color: #c4c4cc;
    font-size: 1.15rem;
    max-width: 680px;
    margin: 0 auto 42px;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

/* Кнопки с надежным кликом, пульсацией свечения и световым бликом */
.btn-gold {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #f7d768 0%, #c89b27 100%);
    color: #09090b;
    font-family: var(--font-heading);
    font-weight: 800;
    padding: 18px 38px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 1.02rem;
    letter-spacing: 0.3px;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    z-index: 5;
}

.btn-pulse-shine {
    animation: goldPulse 2.2s infinite ease-in-out;
}

.btn-pulse-shine::after,
.btn-animated::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 45%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.65) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    animation: shineSweep 3.2s infinite ease-in-out;
    pointer-events: none;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 45px rgba(247, 215, 104, 0.65);
}

.btn-glass {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 18px 38px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.3px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 5;
}

.btn-glass:hover {
    border-color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.18);
    transform: translateY(-2px);
}

.full-width {
    width: 100%;
}

/* Безопасная пульсация свечения (без смещения области клика) */
@keyframes goldPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(247, 215, 104, 0.6), 0 10px 30px rgba(212, 175, 55, 0.4);
    }
    50% {
        box-shadow: 0 0 0 14px rgba(247, 215, 104, 0), 0 14px 40px rgba(247, 215, 104, 0.7);
    }
}

@keyframes softPulseBorder {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(247, 215, 104, 0.4);
    }
    50% {
        box-shadow: 0 0 18px 3px rgba(247, 215, 104, 0.35);
    }
}

@keyframes shineSweep {
    0% { left: -60%; }
    35%, 100% { left: 130%; }
}

/* Секции */
.section {
    padding: 75px 0;
}

.section-head {
    text-align: center;
    margin-bottom: 50px;
}

.section-head h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.section-head p {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 660px;
    margin: 0 auto;
    font-weight: 500;
}

/* Кликабельные окошки шаблонов */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.tpl-card {
    display: block;
    position: relative;
    height: 330px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.32);
    background: #121318;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65);
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tpl-card:active {
    transform: scale(0.96);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
}

.tpl-card::after {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.18), transparent);
    transform: skewX(-25deg);
    transition: 0.75s;
    pointer-events: none;
}

.tpl-card:hover::after {
    left: 150%;
}

.tpl-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.12);
    transition: transform 0.6s ease;
}

.tpl-card:hover .tpl-img {
    transform: scale(1.18);
}

.tpl-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(7, 7, 10, 0.92) 100%);
    padding: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

/* Полупрозрачные изящные плашки на шаблонах */
.tpl-label {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    background: rgba(12, 12, 16, 0.45);
    border: 1px solid rgba(212, 175, 55, 0.35);
    padding: 8px 18px;
    border-radius: 50px;
    backdrop-filter: blur(6px);
    letter-spacing: 0.4px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.tpl-label-patriot {
    border-color: rgba(247, 215, 104, 0.55);
}

.shimmer-effect::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    animation: labelShimmer 3.5s infinite ease-in-out;
}

@keyframes labelShimmer {
    0%, 20% { left: -100%; }
    80%, 100% { left: 200%; }
}

/* Тарифы */
.tariffs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
    align-items: stretch;
}

.tariff-card {
    background: rgba(18, 19, 24, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    padding: 42px 36px;
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.tariff-hit {
    background: linear-gradient(180deg, rgba(36, 30, 18, 0.92) 0%, rgba(15, 16, 20, 0.96) 100%);
    border: 2px solid var(--gold);
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.25);
}

.hit-label {
    position: absolute;
    top: -15px;
    right: 30px;
    background: linear-gradient(90deg, #f7d768, #c89b27);
    color: #000;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.78rem;
    padding: 7px 18px;
    border-radius: 30px;
    letter-spacing: 1px;
}

.tariff-top {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 24px;
    margin-bottom: 26px;
}

.tariff-top h3 {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.tariff-top p {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 22px;
    font-weight: 500;
}

.tariff-price {
    font-family: var(--font-heading);
    font-size: 3.1rem;
    font-weight: 800;
    color: var(--gold-bright);
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.tariff-price span {
    font-size: 2.2rem;
    font-weight: 700;
}

.tariff-list {
    list-style: none;
    margin-bottom: 35px;
    flex-grow: 1;
}

.tariff-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 1rem;
    font-weight: 500;
    color: #ececf0;
}

.tariff-list li span {
    color: var(--gold-bright);
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1.5;
    flex-shrink: 0;
}

.gold-item {
    background: rgba(212, 175, 55, 0.12);
    border-left: 3px solid var(--gold-bright);
    padding: 10px 14px;
    border-radius: 0 10px 10px 0;
}

/* Контакты */
.contact-box {
    max-width: 780px;
    margin: 0 auto;
    background: rgba(18, 19, 24, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 24px;
    padding: 55px 40px;
    text-align: center;
    backdrop-filter: blur(16px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.contact-box h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.contact-box p {
    color: var(--muted);
    margin-bottom: 28px;
    font-size: 1.02rem;
}

.contact-phone {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gold-bright);
    text-decoration: none;
    margin-bottom: 34px;
    letter-spacing: -0.01em;
    transition: 0.3s;
    text-shadow: 0 0 25px rgba(247, 215, 104, 0.35);
    white-space: nowrap;
}

.contact-phone:hover {
    color: #fff;
    transform: scale(1.03);
}

.contact-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.messenger-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    text-decoration: none;
    text-align: left;
    transition: all 0.3s ease;
}

.messenger-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.messenger-logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.messenger-card strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.messenger-card small {
    color: var(--gold-bright);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Подвал и реквизиты */
.footer {
    text-align: center;
    padding: 35px 0;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.footer-copy {
    color: var(--text);
    font-weight: 500;
}

.footer-reqs {
    font-size: 0.8rem;
    color: var(--muted);
    max-width: 780px;
    line-height: 1.5;
}

.footer-reqs a {
    color: var(--gold-bright);
    text-decoration: none;
}

.footer-reqs a:hover {
    text-decoration: underline;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.footer-link-btn {
    background: none;
    border: none;
    color: var(--gold-bright);
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: opacity 0.2s ease;
}

.footer-link-btn:hover {
    opacity: 0.8;
}

.footer-sep {
    color: rgba(255, 255, 255, 0.2);
}

/* Всплывающие модальные окна документов */
.legal-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 8, 0.82);
    backdrop-filter: blur(10px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.legal-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.legal-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: 85vh;
    background: #121318;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.legal-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.legal-modal-close:hover {
    border-color: var(--gold-bright);
    color: var(--gold-bright);
}

.legal-modal-body {
    padding: 36px 32px;
    overflow-y: auto;
    font-size: 0.94rem;
    color: #dadade;
    line-height: 1.65;
}

.legal-modal-body h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 6px;
    padding-right: 40px;
}

.legal-sub {
    color: var(--gold-bright);
    font-size: 0.82rem;
    margin-bottom: 22px;
}

.legal-modal-body h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: #fff;
    margin: 22px 0 8px;
}

.legal-modal-body p {
    margin-bottom: 10px;
}

.legal-modal-body ul {
    margin: 8px 0 14px 20px;
}

.legal-modal-body li {
    margin-bottom: 6px;
}

/* Мобильный адаптив */
@media (max-width: 820px) {
    .header { padding: 14px 0; }
    .logo { font-size: 0.96rem; letter-spacing: 0.5px; }
    .header-btn { padding: 9px 15px; font-size: 0.8rem; }
    .hero { padding: 70px 0 55px; }
    .hero-badge { font-size: 0.72rem; padding: 7px 14px; }
    .hero-title { font-size: 2rem; }
    .section-head h2 { font-size: 1.85rem; }
    .templates-grid, .tariffs-grid, .contact-buttons { grid-template-columns: 1fr; }
    .tpl-card { height: 250px; }
    .tpl-label { font-size: 0.82rem; padding: 7px 14px; }
    .tariff-card { padding: 34px 24px; }
    .tariff-price { font-size: 2.5rem; }
    .contact-phone { font-size: 1.75rem; }
    .contact-box { padding: 35px 20px; }
    .legal-modal-body {
        padding: 26px 20px;
        font-size: 0.88rem;
    }
    .legal-modal-body h2 {
        font-size: 1.25rem;
    }
}