
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

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

:root {
    --ink: #d0e8f8;
    --ink-soft: #a0bedb;
    --ink-muted: #4a7ea8;
    --surface: #011928;
    --surface-warm: #021e30;
    --surface-el: #032840;
    --accent: #7AD8FF;
    --accent-soft: rgba(122,216,255,0.08);
    --accent-glow: rgba(122,216,255,0.2);
    --accent-dark: #0A7EC1;
    --accent-bright: #079AF8;
    --accent2: #5BBEF5;
    --accent2-soft: rgba(91,190,245,0.08);
    --highlight: #a78bfa;
    --highlight-soft: rgba(167,139,250,0.08);
    --warm: #fb923c;
    --warm-soft: rgba(251,146,60,0.08);
    --border: rgba(122,216,255,0.06);
    --border-light: rgba(122,216,255,0.03);
    --card-bg: rgba(3,40,64,0.7);
    --card-border: rgba(122,216,255,0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
    --shadow-xl: 0 24px 60px rgba(0,0,0,0.5);
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--surface);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
    z-index: 2; /* Базовый слой для правильного стека */
}

.serif { font-family: var(--font-display); }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #a8e6ff; }

/* ─── GRAIN OVERLAY ─── */
body::after {
    content: ''; position: fixed; inset: 0; z-index: 9998; pointer-events: none;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
}

/* ─── STARS ─── */
.stars {
    position: fixed; inset: 0;
    z-index: 0; /* Звезды на самом дне */
    pointer-events: none;
}
.star {
    position: absolute; width: 2px; height: 2px; background: white;
    border-radius: 50%; animation: twinkle 4s ease-in-out infinite;
}
.star:nth-child(odd) { animation-duration: 3s; }
.star:nth-child(3n) { width: 1px; height: 1px; animation-duration: 5s; }
@keyframes twinkle { 0%,100% { opacity: 0.15; } 50% { opacity: 0.6; } }

/* ─── AURORA BACKGROUND ─── */
.aurora-bg {
    position: fixed; inset: 0;
    z-index: 1; /* Аврора поверх звезд */
    overflow: hidden; pointer-events: none;
    mask-image: linear-gradient(to bottom, black 0%, rgba(0,0,0,0.6) 50%, transparent 85%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, rgba(0,0,0,0.6) 50%, transparent 85%);
}

.aurora-wave {
    position: absolute;
    width: 140%;
    height: 60%;
    left: -20%;
    top: -10%;

    /* Реально разные цвета: лед, неон, синий, фиолетовый, розовый */
    background: linear-gradient(
        120deg,
        transparent 10%,
        rgba(122,216,255,0.05) 20%,
        rgba(0,255,180,0.12) 35%,
        rgba(7,154,248,0.14) 50%,
        rgba(167,139,250,0.12) 65%,
        rgba(255,80,200,0.08) 75%,
        transparent 90%
    );

    filter: blur(40px);

    /* Подкрученный blend-mode */
    mix-blend-mode: color-dodge;
    opacity: 0.4;

    animation: auroraFlow 30s ease-in-out infinite;
}

/* Глубокое свечение через ::before */
.aurora-wave::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    filter: blur(80px);
    opacity: 0.6;
}

.aurora-wave:nth-child(1) { top: -15%; animation-duration: 32s; }
.aurora-wave:nth-child(2) { top: 0%; animation-duration: 40s; animation-delay: -10s; opacity: 0.25; }
.aurora-wave:nth-child(3) { top: 10%; animation-duration: 50s; animation-delay: -20s; opacity: 0.2; }
.aurora-wave:nth-child(4) { top: -5%; animation-duration: 36s; animation-delay: -5s; opacity: 0.3; }

/* skewY во всех ключевых кадрах анимации */
@keyframes auroraFlow {
    0% { transform: skewY(-5deg) translateX(-10%) translateY(0) scaleY(1); }
    25% { transform: skewY(-5deg) translateX(5%) translateY(-20px) scaleY(1.2); }
    50% { transform: skewY(-5deg) translateX(-5%) translateY(10px) scaleY(0.9); }
    75% { transform: skewY(-5deg) translateX(10%) translateY(-10px) scaleY(1.1); }
    100% { transform: skewY(-5deg) translateX(-10%) translateY(0) scaleY(1); }
}

/* ─── AURORA STRIP ─── */
.aurora-strip {
    height: 3px; width: 100%; position: fixed; top: 0; z-index: 10001;
    background: linear-gradient(90deg, #7AD8FF, #079AF8, #0A7EC1, #a78bfa, #7AD8FF);
    background-size: 300% 100%; animation: auroraStrip 8s ease-in-out infinite;
}
@keyframes auroraStrip { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }


/* ─── LAYOUT ─── */
/* Поднимаем контент над авророй и звездами */
.container, .container-narrow, .section, .footer {
    position: relative;
    z-index: 10;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }

/* ─── HEADER ─── */
.header {
    position: fixed; top: 3px; left: 0; right: 0; z-index: 1000;
    padding: 14px 0; background: rgba(1,25,40,0.85);
    backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border); transition: all 0.4s;
}
.header.scrolled { background: rgba(1,25,40,0.95); }
.header__inner { display: flex; align-items: center; justify-content: space-between; }

.header__logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.05rem;
}
.logo-icon {
    width: 42px; height: 42px; border-radius: 12px;
    background: rgba(122,216,255,0.06);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(15px); border: 1px solid rgba(122,216,255,0.12);
    transition: all 0.3s;
    box-shadow: 0 0 20px var(--accent-glow);
    position: relative; overflow: visible;
}
.logo-icon img { width: 98px; height: 98px; filter: drop-shadow(0 2px 8px rgba(7,154,248,0.3)); transition: all 0.3s; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.header__logo:hover .logo-icon { box-shadow: 0 0 30px var(--accent-glow); border-color: rgba(122,216,255,0.25); }
.header__logo:hover .logo-icon img { transform: translate(-50%, -50%) scale(1.1); }

.header__nav { display: flex; align-items: center; gap: 28px; }
.header__nav a { text-decoration: none; color: var(--ink-muted); font-size: 0.88rem; font-weight: 500; transition: color 0.2s; }
.header__nav a:hover { color: var(--ink); }

.header__cta {
    padding: 9px 20px; border-radius: 100px;
    background: var(--accent); color: #011928;
    text-decoration: none; font-size: 0.85rem; font-weight: 600;
    transition: all 0.3s; border: none; cursor: pointer;
}
.header__cta:hover { background: #a8e6ff; color: #011928; box-shadow: 0 0 30px var(--accent-glow); }

/* Burger */
.header__burger {
    display: none; background: none; border: none; cursor: pointer;
    width: 32px; height: 32px; position: relative; z-index: 1001;
}
.header__burger span {
    display: block; width: 22px; height: 2px; background: var(--ink);
    position: absolute; left: 5px; transition: all 0.3s;
}
.header__burger span:nth-child(1) { top: 10px; }
.header__burger span:nth-child(2) { top: 15px; }
.header__burger span:nth-child(3) { top: 20px; }
.header__burger.active span:nth-child(1) { top: 15px; transform: rotate(45deg); }
.header__burger.active span:nth-child(2) { opacity: 0; }
.header__burger.active span:nth-child(3) { top: 15px; transform: rotate(-45deg); }

.mobile-nav {
    display: none; position: fixed; inset: 0; z-index: 999;
    background: rgba(1,25,40,0.97); backdrop-filter: blur(30px);
    flex-direction: column; align-items: center; justify-content: center; gap: 28px;
    opacity: 0; visibility: hidden; transition: all 0.35s;
}
.mobile-nav.active { opacity: 1; visibility: visible; }
.mobile-nav a { text-decoration: none; color: var(--ink); font-size: 1.4rem; font-weight: 600; font-family: var(--font-display); }

/* ─── BUTTONS ─── */
.btn-primary {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 15px 30px; border-radius: 100px;
    background: var(--accent); color: #011928;
    text-decoration: none; font-size: 0.93rem; font-weight: 600;
    transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
    border: none; cursor: pointer; font-family: var(--font-body);
}
.btn-primary:hover { background: #a8e6ff; color: #011928; transform: translateY(-2px); box-shadow: 0 16px 50px var(--accent-glow); }
.btn-primary svg { transition: transform 0.3s; }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 15px 26px; border-radius: 100px;
    background: transparent; text-decoration: none; font-size: 0.93rem; font-weight: 600;
    border: 1.5px solid var(--border); color: var(--ink);
    transition: all 0.3s; font-family: var(--font-body);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--accent); font-weight: 600; font-size: 0.9rem;
    text-decoration: none; transition: gap 0.3s;
}
.btn-ghost:hover { gap: 10px; }
.btn-ghost svg { transition: transform 0.3s; }
.btn-ghost:hover svg { transform: translateX(3px); }

/* ─── BADGES ─── */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 5px 12px; border-radius: 100px;
    background: var(--accent-soft); color: var(--accent);
}
.badge--blue { background: var(--accent2-soft); color: var(--accent2); }
.badge--purple { background: var(--highlight-soft); color: var(--highlight); }
.badge--warm { background: var(--warm-soft); color: var(--warm); }

/* ─── SECTION ─── */
.section { padding: clamp(80px, 10vw, 120px) 0; }
.section--alt { background: var(--surface-warm); }
.section__label {
    font-size: 0.73rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 14px;
}
.section__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.8vw, 2.8rem);
    line-height: 1.15; font-weight: 400; margin-bottom: 14px; max-width: 620px;
}
.section__subtitle { font-size: 1rem; color: var(--ink-muted); max-width: 500px; line-height: 1.7; }

/* ─── CARDS ─── */
.card {
    padding: 36px; border-radius: var(--radius-lg);
    background: var(--card-bg); border: 1px solid var(--card-border);
    transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
    backdrop-filter: blur(12px);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 50px rgba(7,154,248,0.08); border-color: rgba(122,216,255,0.15); }

/* ─── CTA SECTION ─── */
.cta-section {
    padding: clamp(80px, 10vw, 120px) 0;
    background: rgba(1,15,24,0.9); position: relative; overflow: hidden;
}
.cta-section::before {
    content: ''; position: absolute; top: -200px; right: -200px;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
}

/* ─── CONTACT FORM ─── */
.contact-form { max-width: 520px; margin: 0 auto; display: grid; gap: 14px; }
.contact-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form__field {
    width: 100%; padding: 14px 18px; border-radius: 12px;
    background: rgba(122,216,255,0.04); border: 1.5px solid rgba(122,216,255,0.1);
    color: white; font-size: 0.93rem; font-family: inherit; transition: all 0.3s; outline: none;
}
.contact-form__field::placeholder { color: rgba(208,232,248,0.3); }
.contact-form__field:focus { border-color: var(--accent); background: rgba(122,216,255,0.06); }
.contact-form textarea.contact-form__field { resize: vertical; min-height: 110px; }

.contact-form__captcha { display: flex; align-items: center; gap: 14px; justify-content: center; padding: 10px 0; }
.contact-form__captcha-q { color: rgba(208,232,248,0.6); font-size: 0.93rem; font-weight: 600; }
.contact-form__captcha-q span { color: white; font-size: 1.05rem; }

.contact-form__submit {
    width: 100%; padding: 16px; border-radius: 100px; border: none;
    background: var(--accent); color: #011928;
    font-size: 0.95rem; font-weight: 700; cursor: pointer;
    font-family: var(--font-body); transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
}
.contact-form__submit:hover { background: #a8e6ff; box-shadow: 0 12px 40px var(--accent-glow); transform: translateY(-2px); }
.contact-form__note { text-align: center; color: rgba(208,232,248,0.3); font-size: 0.78rem; margin-top: 6px; }
.hp-field { position: absolute; left: -9999px; }

/* ─── FOOTER ─── */
.footer { padding: 56px 0 36px; background: #010e18; border-top: 1px solid var(--border); }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer__brand-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 10px; }
.footer__brand-desc { color: var(--ink-muted); font-size: 0.87rem; line-height: 1.7; }
.footer__col-title { font-weight: 700; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 14px; }
.footer__links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer__links a { text-decoration: none; color: var(--ink-soft); font-size: 0.87rem; transition: color 0.2s; }
.footer__links a:hover { color: var(--accent); }
.footer__bottom {
    border-top: 1px solid var(--border-light); padding-top: 20px;
    display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--ink-muted);
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; transform: translateY(24px); transition: all 0.7s cubic-bezier(0.16,1,0.3,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { opacity: 0; transform: translateY(16px); transition: all 0.6s cubic-bezier(0.16,1,0.3,1); }
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.04s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.12s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.16s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.24s; }
.reveal-stagger.visible > * { opacity: 1; transform: translateY(0); }

/* ─── ALERTS ─── */
.alert { padding: 12px 18px; border-radius: 10px; text-align: center; font-size: 0.88rem; font-weight: 500; display: none; }
.alert--success { background: var(--accent-soft); color: var(--accent); display: block; }
.alert--error { background: rgba(255,85,85,0.1); color: #ef4444; display: block; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .header__nav { display: none; }
    .header__burger { display: block; }
    .mobile-nav { display: flex; }
    .contact-form__row { grid-template-columns: 1fr; }
    .footer__grid { grid-template-columns: 1fr; }
    .footer__bottom { flex-direction: column; gap: 10px; text-align: center; }
}
@media (max-width: 480px) {
    .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
}
