/* ========== ОСНОВНЫЕ ПЕРЕМЕННЫЕ (КОСМИЧЕСКАЯ ПАЛИТРА) ========== */
:root {
    --space-dark: #04041a;
    --space-deep: #0a0a2a;
    --space-card: rgba(10, 10, 35, 0.75);
    --nebula-purple: #4a1d8c;
    --nebula-blue: #1e3b70;
    --accent-purple: #9b5de5;
    --accent-glow: #c99dff;
    --star-white: #f0eaff;
    --text-primary: #e8e6f0;
    --text-secondary: #b0adc0;
    --text-muted: #7a7794;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(155, 93, 229, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--space-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
    z-index: 0;
}

/* Туманности (градиентные пятна) – постоянный фон */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 120%;
    height: 140%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(72, 20, 120, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(20, 40, 100, 0.3) 0%, transparent 55%),
        radial-gradient(ellipse at 40% 80%, rgba(80, 20, 100, 0.2) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 20%, rgba(30, 60, 130, 0.25) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
    animation: nebulaDrift 20s ease-in-out infinite alternate;
}

@keyframes nebulaDrift {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.08) translate(-1%, 1%);
    }
}

/* ========== ФОНОВОЕ ЗВЁЗДНОЕ НЕБО ========== */
#bgStarsCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#spaceCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#spaceCanvas.dispersed {
    opacity: 0;
    transition: opacity 0.8s ease 0.2s;
}

/* ========== ШАПКА С ПЕРЕКЛЮЧАТЕЛЕМ ЯЗЫКА ========== */
.lang-switcher {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 100;
    background: rgba(10, 10, 35, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 40px;
    padding: 6px 12px;
    border: 1px solid var(--border-subtle);
    display: flex;
    gap: 8px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 30px;
    transition: all 0.2s ease;
}

.lang-btn.active {
    background: var(--accent-purple);
    color: white;
    box-shadow: 0 0 8px var(--accent-glow);
}

.lang-btn:hover:not(.active) {
    background: rgba(155, 93, 229, 0.3);
    color: white;
}

/* ========== ГЕРОЙ ТЕКСТ ========== */
.hero-text-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    z-index: 20;
    pointer-events: none;
    text-align: center;
    will-change: transform, opacity;
    transition: opacity 0.3s ease;
    width: 90vw;
    max-width: 900px;
}

.hero-text-overlay.faded {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hero-text-overlay .main-title {
    font-size: clamp(2.2rem, 5vw, 5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #ffffff;
    text-shadow: 0 0 80px rgba(155, 93, 229, 0.8), 0 0 160px rgba(100, 80, 220, 0.6), 0 0 30px rgba(180, 140, 255, 0.7);
    margin-bottom: 0.3em;
    line-height: 1.1;
}

.hero-text-overlay .sub-title {
    font-size: clamp(1rem, 1.8vw, 1.5rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    color: rgba(220, 210, 255, 0.8);
    text-shadow: 0 0 30px rgba(179, 127, 245, 0.5);
    text-transform: uppercase;
}

.accent-star {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    margin: 0 8px;
    vertical-align: middle;
    box-shadow: 0 0 16px #ffffff, 0 0 32px #c99dff, 0 0 48px #9b5de5;
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {

    0%,
    100% {
        box-shadow: 0 0 12px #fff, 0 0 24px #c99dff, 0 0 36px #9b5de5;
    }

    50% {
        box-shadow: 0 0 28px #fff, 0 0 56px #e0b0ff, 0 0 80px #b37ff5;
    }
}

/* ========== ОСНОВНОЙ КОНТЕНТ ========== */
.main-content {
    position: relative;
    z-index: 5;
    padding-top: 100vh;
}

.content-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 80px;
    background: transparent;
}

/* Секции */
.section {
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.section-header {
    margin-bottom: 40px;
}

.section-header .label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-purple);
    margin-bottom: 10px;
    padding: 5px 14px;
    border: 1px solid rgba(155, 93, 229, 0.4);
    border-radius: 20px;
    background: rgba(155, 93, 229, 0.08);
}

.section-header h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f0edf7;
    margin-top: 10px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-top: 8px;
    max-width: 600px;
}

/* Карточки */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: var(--space-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 32px 28px;
    transition: all 0.6s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(155, 93, 229, 0.08) 0%, transparent 55%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    border-color: var(--border-glow);
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(107, 47, 160, 0.2);
}

.card .card-icon {
    font-size: 2.2rem;
    margin-bottom: 16px;
    display: block;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #e0dbf0;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.card .card-tag {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--accent-purple);
    text-transform: uppercase;
}

/* Статистика */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin: 50px 0;
}

.stat-item {
    text-align: center;
    flex: 1 1 150px;
    min-width: 130px;
}

.stat-item .stat-number {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #c99dff, #5b3fb0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-item .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

/* ========== ФОТОГАЛЕРЕЯ ========== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    background: var(--space-card);
    border: 1px solid var(--border-subtle);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--border-glow);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Lightbox (модальное окно) */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s;
}

.lightbox.active {
    visibility: visible;
    opacity: 1;
}

.lightbox-content {
    max-width: 85vw;
    max-height: 85vh;
    position: relative;
}

.lightbox-content img {
    width: auto;
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: 0 0 50px rgba(155, 93, 229, 0.4);
    border: 1px solid var(--border-glow);
}

.close-lightbox {
    position: absolute;
    top: -40px;
    right: -10px;
    font-size: 36px;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: bold;
    text-shadow: 0 0 10px var(--accent-purple);
}

.close-lightbox:hover {
    color: var(--accent-glow);
}

/* CTA блок */
.cta-section {
    text-align: center;
    padding: 60px 20px;
    border-radius: var(--radius);
    background: radial-gradient(ellipse at center, rgba(107, 47, 160, 0.2) 0%, transparent 70%),
        var(--space-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
}

.btn {
    display: inline-block;
    padding: 14px 36px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.35s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #7b3fb0, #5c1d90);
    color: #fff;
    box-shadow: 0 8px 30px rgba(107, 47, 160, 0.5);
}

.btn-primary:hover {
    box-shadow: 0 14px 40px rgba(155, 93, 229, 0.7);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #d0c8e8;
    border: 1.5px solid rgba(155, 93, 229, 0.5);
    margin-left: 12px;
}

.btn-outline:hover {
    border-color: var(--accent-purple);
    background: rgba(155, 93, 229, 0.1);
}

/* Футер с соцсетями */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: 40px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.social-links a {
    display: inline-block;
    transition: transform 0.2s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
}

.social-links img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 4px rgba(155, 93, 229, 0.6));
}

.footer span {
    color: var(--accent-purple);
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 1760px) {
    .hero-text-overlay .main-title {
        font-size: 150px;
        left: -7px;
    }

    .main-info {
        max-width: 640px;
    }
}

@media (max-width: 1200px) {
    .main-info {
        max-width: 540px;
    }

    .main {
        padding: 111px 20px 20px;
    }

    .hero-text-overlay .main-title {
        font-size: 120px;
        left: -4px;
    }

    .main-title-ghost {
        font-size: 220px;
    }
}

@media (max-width: 1024px) {
    .hero-text-overlay .main-title {
        margin-top: 30px;
    }

    .main {
        flex-direction: column-reverse;
    }

    .main-image {
        max-width: 350px;
        position: absolute;
        left: 370px;
        top: 370px;
    }

    .main-info {
        max-width: 100%;
    }

    .main-actions {
        gap: 10px;
    }

    .main-actions .button {
        height: 50px;
        font-size: 14px;
        width: auto;
        max-width: 300px;
    }

    .main-description {
        max-width: 350px;
    }
}

@media (max-width: 570px) {
    .hero-text-overlay .main-title {
        font-size: 88px;
    }

    .main-description {
        max-width: 100%;
    }

    .main-actions {
        width: 100%;
    }

    .main-actions .button {
        width: 100%;
        max-width: 100%;
    }

    .main-image {
        max-width: 650px;
        position: absolute;
        left: 170px;
        top: 70px;
        opacity: 0.2;
    }
}

@media (max-width: 400px) {
    .hero-text-overlay .main-title {
        font-size: 70px;
    }
}

/* Оригинальная адаптивность (сохранена) */
@media (max-width: 768px) {
    .hero-text-overlay .main-title {
        font-size: clamp(1.8rem, 8vw, 3rem);
        white-space: normal;
    }

    .hero-text-overlay .sub-title {
        font-size: 0.9rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .btn-outline {
        margin-left: 0;
        margin-top: 10px;
    }

    .cta-section {
        padding: 40px 16px;
    }

    .content-inner {
        padding: 0 16px 60px;
    }

    .stats-row {
        gap: 18px;
    }

    .stat-item .stat-number {
        font-size: 2rem;
    }

    .lang-switcher {
        top: 12px;
        right: 12px;
        padding: 4px 8px;
    }

    .lang-btn {
        font-size: 0.75rem;
        padding: 2px 8px;
    }
}

@media (max-width: 480px) {
    .hero-text-overlay .main-title {
        font-size: 1.6rem;
    }

    .hero-text-overlay .sub-title {
        font-size: 0.75rem;
    }

    .card {
        padding: 22px 18px;
    }
}

/* ========== МОДАЛЬНОЕ ОКНО С ФОРМОЙ ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--space-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--accent-glow);
}

.modal-content h2 {
    margin-bottom: 24px;
    color: #fff;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: border 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.modal-content button {
    width: 100%;
    margin-top: 12px;
}

/* Уведомление */
.notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-purple);
    color: white;
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 600;
    z-index: 1200;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-align: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 20px rgba(155, 93, 229, 0.5);
}

.notification.show {
    opacity: 1;
}