/* ===== ПЕРЕМЕННЫЕ И ТЕМЫ ===== */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --accent: #8b00ff;
    --border: #333333;
    --transition: 0.3s ease;
}
[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: #111111;
    --text-secondary: #555555;
    --accent: #6a0dad;
    --border: #dddddd;
}

/* ===== СБРОС И БАЗА ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Underdog', cursive, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== СПЛЭШ-ЭКРАН ===== */
.splash-screen {
    position: fixed; inset: 0; background: var(--bg-primary);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; transition: opacity 0.8s cubic-bezier(0.4,0,0.2,1), transform 0.8s cubic-bezier(0.4,0,0.2,1);
}
.splash-image { max-width: 70%; max-height: 70%; object-fit: contain; opacity: 0; animation: fadeInImg 1s ease forwards; }
@keyframes fadeInImg { to { opacity: 1; } }
.splash-screen.hide { opacity: 0; transform: translateY(-40px) scale(0.98); pointer-events: none; }
body.splash-active { overflow: hidden; }

/* ===== РАДУЖНЫЙ ТЕКСТ ===== */
.rainbow-text {
    background: linear-gradient(90deg, #ff0000, #ff7700, #ffff00, #00ff00, #0000ff, #8b00ff, #ff0000);
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    animation: rainbow-move 3s linear infinite;
    display: inline-block;
}
@keyframes rainbow-move { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }

/* ===== МЕНЮ ===== */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.nav-container { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; max-width: 1400px; margin: 0 auto; }
.nav-logo { display: flex; flex-direction: column; text-decoration: none; gap: 2px; min-width: 140px; }
.nav-logo .rainbow-text { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.nav-email { font-size: 0.75rem; color: var(--text-secondary); transition: color var(--transition); }
.nav-email:hover { color: var(--accent); }

.nav-toggle {
    display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; z-index: 1001;
}
.nav-toggle .bar { width: 26px; height: 3px; background: var(--text-primary); border-radius: 3px; transition: all 0.3s ease; }
.nav-toggle.active .bar:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.nav-toggle.active .bar:nth-child(2) { opacity: 0; }
.nav-toggle.active .bar:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

.nav-content { display: flex; align-items: center; gap: 24px; flex-grow: 1; justify-content: space-between; margin-left: 20px; }
.nav-links { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
    color: var(--text-secondary); text-decoration: none; font-size: 0.95rem; padding: 6px 4px;
    position: relative; transition: color var(--transition); white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-links a::after {
    content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px;
    background: var(--accent); transition: all var(--transition); transform: translateX(-50%);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 80%; }

.nav-controls { display: flex; align-items: center; gap: 10px; }
.control-btn {
    background: var(--bg-primary); border: 1px solid var(--border); color: var(--text-primary);
    padding: 6px 12px; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 0.85rem;
    transition: all var(--transition); text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.control-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); }
.icon-btn { font-size: 1.1rem; padding: 6px 10px; }

/* УБИРАЕМ ЧЁРНУЮ ПОЛОСУ (ФОКУС/АКТИВ) */
.control-btn:focus, .nav-toggle:focus, .nav-links a:focus, .icon-btn:focus {
    outline: none !important; box-shadow: none !important; border-color: transparent;
}
.control-btn:active, .nav-toggle:active { transform: scale(0.98); }

/* АДАПТИВ МЕНЮ */
@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .nav-content {
        position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
        background: var(--bg-secondary); flex-direction: column; align-items: flex-start;
        padding: 80px 24px 24px; gap: 20px; transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3); overflow-y: auto; margin: 0;
    }
    .nav-content.open { right: 0; }
    .nav-links { flex-direction: column; width: 100%; gap: 0; }
    .nav-links li { width: 100%; }
    .nav-links a { display: block; padding: 12px 0; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
    .nav-links a::after { display: none; }
    .nav-controls { flex-direction: column; width: 100%; gap: 12px; }
    .control-btn { width: 100%; justify-content: center; }
}

/* ===== КАРУСЕЛЬ ===== */
.carousel-section { width: 100%; padding: 40px 0; background: var(--bg-secondary); overflow: hidden; }
.carousel-container { position: relative; width: 100%; overflow: hidden; }
.carousel-track {
    display: flex; gap: 0; width: max-content;
    animation: scroll-flow 120s linear infinite;
}
.carousel-track:hover { animation-play-state: paused; }
.carousel-slide {
    flex-shrink: 0; width: 300px; height: 300px; margin-right: 20px;
    border-radius: 12px; overflow: hidden; transition: transform 0.3s ease; cursor: pointer;
}
.carousel-slide:hover { transform: scale(1.05); }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
@keyframes scroll-flow { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@media (max-width: 768px) { .carousel-slide { width: 200px; height: 200px; margin-right: 15px; } }
@media (max-width: 480px) { .carousel-slide { width: 150px; height: 150px; margin-right: 10px; } }

/* ===== ГАЛЕРЕЯ ===== */
.main { padding: 40px 0; }
.gallery-section { margin-bottom: 60px; }
.section-title {
    font-size: 1.8rem; margin-bottom: 30px; text-align: center;
    color: var(--text-primary); /* Гарантируем видимость текста */
}
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.gallery-item {
    position: relative; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden;
    cursor: pointer; background: var(--bg-secondary); transition: transform var(--transition);
}
.gallery-item:hover { transform: scale(1.03); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* ===== ПОДВАЛ ===== */
.footer { padding: 30px 0; background: var(--bg-secondary); border-top: 1px solid var(--border); margin-top: 40px; }
.footer__inner { display: flex; justify-content: center; gap: 25px; flex-wrap: wrap; }
.social-link { color: var(--text-secondary); text-decoration: none; font-size: 1.1rem; transition: color var(--transition); }
.social-link:hover { color: var(--accent); }

/* ===== ЛАЙТБОКС ===== */
.lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,0.95);
    display: flex; justify-content: center; align-items: center;
    z-index: 10000; opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.lightbox.active { opacity: 1; pointer-events: all; }
.lightbox__image { max-width: 90%; max-height: 90%; border-radius: 8px; }
.lightbox__close, .lightbox__prev, .lightbox__next {
    position: absolute; background: rgba(255,255,255,0.2); border: none; color: #fff;
    font-size: 2rem; width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background var(--transition);
}
.lightbox__close:hover, .lightbox__prev:hover, .lightbox__next:hover { background: var(--accent); }
.lightbox__close { top: 20px; right: 20px; }
.lightbox__prev { left: 20px; }
.lightbox__next { right: 20px; }

@media (max-width: 768px) { .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (max-width: 480px) { .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }

/* Иконки в стиле Underdog (игривый наклон + упругость) */
.icon-btn {
    font-size: 1.25rem;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-btn:hover {
    transform: rotate(-6deg) scale(1.15);
}

.icon-btn:active {
    transform: rotate(3deg) scale(0.95);
}