/* ================= VARIABLES ================= */
:root {
    /* Мягкая светлая тема (Off-white / Paper style) */
    --bg: #f2f4f7; 
    --card-bg: #ffffff;
    --header-bg: rgba(242, 244, 247, 0.85); 
    --text: #1a1c1e;
    --muted: #5f676d;
    --accent: #00c86b;
    --border: rgba(0, 0, 0, 0.06);
    --logo-color: #1a1c1e;
    --container-width: 1100px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

body[data-theme="dark"] {
    /* Глубокая темная тема */
    --bg: #0a0a0a;
    --card-bg: #141414;
    --header-bg: rgba(10, 10, 10, 0.9);
    --text: #ececec;
    --muted: #a1a1aa;
    --accent: #00ff88;
    --border: rgba(255, 255, 255, 0.05);
    --logo-color: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ================= BASE ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.section-wrapper {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 25px;
}

/* ================= HEADER ================= */
header {
    position: sticky;
    top: 0;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

header .section-wrapper {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    color: var(--logo-color);
    font-weight: 900;
    font-size: 22px;
    letter-spacing: -0.5px;
}

.logo span { color: var(--accent); }

nav { display: flex; align-items: center; gap: 25px; }

nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.7;
    transition: 0.2s;
}

nav a:hover, nav a.active { 
    opacity: 1; 
    color: var(--accent); 
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

.theme-btn:hover { background: rgba(128, 128, 128, 0.1); }

/* ================= HERO & INFO ================= */

/* ================= FULLSCREEN HERO ================= */
.hero-fullscreen {
    position: relative;
    min-height: 80vh; /* Занимает 80% высоты экрана */
    display: flex;
    align-items: center;
    background-image: url('img/setup.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Эффект параллакса при скролле */
    overflow: hidden;
}

/* Слой затемнения, чтобы текст "читался" */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Градиент от темного к прозрачному слева направо */
    background: linear-gradient(90deg, 
        rgba(242, 244, 247, 0.95) 0%, 
        rgba(242, 244, 247, 0.7) 40%, 
        rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

/* Адаптация под темную тему */
body[data-theme="dark"] .hero-overlay {
    background: linear-gradient(90deg, 
        rgba(10, 10, 10, 0.95) 0%, 
        rgba(10, 10, 10, 0.7) 40%, 
        rgba(0, 0, 0, 0.2) 100%);
}

.hero-fullscreen .section-wrapper {
    position: relative;
    z-index: 2; /* Текст выше фона и оверлея */
}

.hero-content {
    max-width: 600px;
}

.hero-subtitle {
    display: inline-block;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    margin-bottom: 15px;
}

.hero-fullscreen h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 0.95;
    margin-bottom: 25px;
    letter-spacing: -2px;
    color: var(--text);
}

.hero-fullscreen p {
    font-size: 18px;
    color: var(--muted);
    margin-bottom: 40px;
}

/* Убираем лишние отступы, если они были в старом hero */
.hero { display: none; }
.hero { padding: 100px 0; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1; margin-bottom: 20px; letter-spacing: -1.5px; }
.hero p { color: var(--muted); font-size: 18px; max-width: 550px; margin-bottom: 35px; }

.stats { padding: 50px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats-row { display: flex; gap: 60px; flex-wrap: wrap; }
.stat-item h3 { color: var(--accent); font-size: 28px; font-weight: 800; }
.stat-item p { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.info { padding: 80px 0; }
.section-title { font-size: 28px; margin-bottom: 25px; letter-spacing: -0.5px; }
.info-text { max-width: 750px; color: var(--muted); font-size: 17px; }

/* ================= CARDS (CATALOG) ================= */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Контейнер карточки должен иметь position: relative */
.sfx-card {
    position: relative; /* Обязательно для позиционирования бейджа */
    overflow: hidden;    /* Чтобы картинка не вылезала за края при зуме */
    display: flex;
    flex-direction: column;
}

/* Обновленный бейдж */
.badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10; /* Поднимаем над картинкой */
    background: rgba(0, 0, 0, 0.6); /* Полупрозрачный темный фон для читаемости */
    backdrop-filter: blur(4px);    /* Эффект стекла */
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    pointer-events: none; /* Чтобы бейдж не мешал кликать на карточку */
    transition: transform 0.3s ease;
}

/* Чтобы бейдж тоже немного "играл" при наведении на карточку */
.sfx-card:hover .badge {
    transform: translateY(-2px);
    background: var(--accent);
    color: #000;
}

/* Фикс для картинки */
.card-image {
    width: 100%;
    height: 180px;
    position: relative;
    z-index: 1; /* Картинка на нижнем слое */
    overflow: hidden;
    border-radius: 12px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

/* Адаптивность для мобилок */
@media (max-width: 480px) {
    .card-image {
        height: 150px;
    }
}

.specs { list-style: none; margin-top: 20px; }
.specs li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.specs li:last-child { border-bottom: none; }
.specs span { color: var(--muted); }

/* ================= BUTTONS ================= */
.btn-primary, .btn-secondary, .btn-filter {
    padding: 14px 28px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary { 
    background: var(--accent); 
    color: #000; 
    box-shadow: 0 4px 15px rgba(0, 200, 107, 0.25);
    margin-right: 12px;
}

.btn-primary:hover { 
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 200, 107, 0.4);
}

.btn-secondary { 
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text); 
}

.btn-secondary:hover {
    background: var(--bg);
    border-color: var(--text);
}

.btn-filter { 
    background: var(--card-bg); 
    border: 1px solid var(--border); 
    color: var(--text);
    padding: 10px 22px;
}

.btn-filter:hover, .btn-filter.active { 
    border-color: var(--accent); 
    color: var(--accent);
    background: var(--card-bg);
}

.filters { display: flex; gap: 12px; margin-bottom: 40px; }

/* ================= BUILDER ================= */
.builder {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    margin-top: 40px;
}

@media (max-width: 900px) {
    .builder { grid-template-columns: 1fr; }
}

.builder-left {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.builder-left select {
    appearance: none;
    width: 100%;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='gray' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
}

.builder-left select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 200, 107, 0.1);
}

.builder-right {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 35px;
    box-shadow: var(--shadow);
}

.builder-right h3 {
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.builder-right h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--accent);
    border-radius: 10px;
}

#density {
    font-size: 48px;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: -2px;
}

/* Status Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    margin-top: 15px;
}

.ok { background: rgba(0, 200, 107, 0.12); color: #00c86b; }
.warning { background: rgba(243, 156, 18, 0.12); color: #f39c12; }
.error { background: rgba(231, 76, 60, 0.12); color: #e74c3c; }

/* ================= FOOTER ================= */
.footer { 
    padding: 60px 0; 
    border-top: 1px solid var(--border); 
    margin-top: 100px; 
    color: var(--muted); 
    font-size: 14px; 
    text-align: center; 
}

/* ================= ABOUT PAGE ================= */
.about-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    padding: 80px 0;
    align-items: center;
}

.about-main-img img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.about-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding-bottom: 100px;
}

.gallery-item {
    text-align: center;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 20px;
    filter: grayscale(40%); /* Легкий эффект для стиля */
    transition: 0.3s;
}

.gallery-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.02);
}

.gallery-item h4 {
    margin-bottom: 10px;
    font-size: 18px;
    color: var(--accent);
}

.gallery-item p {
    font-size: 14px;
    color: var(--muted);
}

/* Мобильная версия */
@media (max-width: 768px) {
    .about-hero { grid-template-columns: 1fr; text-align: center; }
    .about-hero { flex-direction: column-reverse; display: flex; }
}