:root {
    --bg-dark: #121212;
    --text-main: #F5F5F5;
    --text-muted: #D9D4C7;
    --accent-red: #B22222;
    --accent-cyan: #4A8B9C;
    --border-color: rgba(255, 255, 255, 0.2);
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Noto Serif', serif;
    --font-hand: 'Caveat', cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-dark); color: var(--text-main); font-family: var(--font-sans); line-height: 1.6; overflow-x: hidden; }

.noise-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; opacity: 0.04;
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.site-header { position: fixed; top: 0; width: 100%; z-index: 100; backdrop-filter: blur(15px); border-bottom: 1px solid rgba(255, 255, 255, 0.05); background: rgba(18, 18, 18, 0.8); }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 70px; padding: 10px 0;}
.logo { font-weight: 800; letter-spacing: 2px; font-size: 1.1rem; display: flex; align-items: center; }
.logo-link { display: flex; align-items: center; gap: 15px; text-decoration: none; color: inherit; }
.logo-text { display: inline-block; max-width: 300px; line-height: 1.2; }
.site-logo { max-height: 50px; width: auto; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 30px; flex-wrap: wrap;}
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: color 0.3s; }
.nav-links a:hover { color: var(--text-main); }
.lang-switcher { display: flex; gap: 10px; padding-left: 20px; border-left: 1px solid var(--border-color); }
.lang-switcher a { font-weight: bold; opacity: 0.5; }
.lang-switcher a.active { opacity: 1; color: var(--accent-cyan); }

.hero { min-height: 100vh; display: flex; align-items: center; position: relative; padding-top: 70px; padding-bottom: 50px; }
.hero-content { position: relative; z-index: 2; max-width: 800px; }
.hero-badge { display: inline-block; padding: 5px 15px; border: 1px solid var(--accent-cyan); color: var(--accent-cyan); border-radius: 20px; font-size: 0.8rem; margin-bottom: 20px; }
.hero-title { font-size: clamp(3rem, 8vw, 6rem); font-weight: 800; line-height: 1.1; margin-bottom: 30px; letter-spacing: -2px; }
.text-accent { color: var(--accent-red); }
.hero-quote { font-family: var(--font-serif); font-size: 1.5rem; color: var(--text-muted); border-left: 3px solid var(--accent-red); padding-left: 20px; margin-bottom: 40px; font-style: italic; }
.hero-quote cite { display: block; font-size: 0.9rem; font-family: var(--font-sans); margin-top: 10px; font-style: normal; opacity: 0.7;}
.btn { display: inline-block; padding: 15px 30px; background: transparent; color: var(--text-main); text-decoration: none; border: 1px solid var(--border-color); font-weight: 600; transition: all 0.3s ease; }
.btn-primary:hover { background: var(--accent-red); border-color: var(--accent-red); }

@media (max-width: 760px) {
    .header-inner { flex-direction: column; padding: 15px 10px; gap: 15px; }
    .logo-text { font-size: 0.8rem; letter-spacing: 1px; text-align: center; max-width: 100%; }
    .hero { padding-top: 100px; padding-bottom: 40px; min-height: 100vh; justify-content: center; align-items: center; display: flex; }
    .hero-title { font-size: 3.1rem; margin-bottom: 20px; word-wrap: break-word; text-align: center; }
    .hero-quote { font-size: 1.3rem; margin-bottom: 30px; padding-left: 15px; }
    .hero-badge { margin-top: 0; margin-bottom: 20px; display: block; width: fit-content; margin-left: auto; margin-right: auto;}
    .hero-content { padding: 0 10px; width: 100%; text-align: center;}
}

.grid-animation {
    position: absolute; top: 0; right: 0; width: 50%; height: 100%;
    background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 40px 40px; opacity: 0.2; transform: perspective(500px) rotateY(-15deg);
    mask-image: linear-gradient(to left, black, transparent); -webkit-mask-image: linear-gradient(to left, black, transparent);
}

.stats-section { padding: 100px 0 50px 0; }
.year-selector { display: flex; gap: 15px; margin-bottom: 50px; justify-content: center; flex-wrap: wrap; }
.year-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); color: var(--text-muted); font-size: 1.2rem; font-weight: 600; cursor: pointer; transition: all 0.3s; padding: 10px 30px; border-radius: 30px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.year-btn.active, .year-btn:hover { color: #fff; background: var(--accent-cyan); border-color: var(--accent-cyan); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(74, 139, 156, 0.4); }

/* Иерархические деревья */
.stats-groups { display: flex; flex-direction: column; gap: 60px; margin-bottom: 80px; }
.info-tree { display: flex; flex-direction: column; align-items: center; width: 100%; position: relative; }
.tree-root { 
    background: rgba(25, 25, 25, 0.5); border: 2px solid var(--accent-red); 
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px; 
    padding: 30px 50px; text-align: center; position: relative; z-index: 2;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.tree-branches { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; margin-top: 40px; position: relative; width: 100%; }
.tree-branches::before {
    content: ''; position: absolute; top: -45px; left: 10%; width: 80%; height: 50px;
    background-image: url('data:image/svg+xml;utf8,<svg preserveAspectRatio="none" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M50 0 Q52 50 50 100 M10 100 Q50 50 90 100 M25 100 Q50 60 75 100" stroke="%23D9D4C7" stroke-width="1.5" fill="none" opacity="0.4" stroke-linecap="round"/></svg>');
    background-size: 100% 100%; z-index: 1; pointer-events: none;
}
.tree-node { 
    background: rgba(25, 25, 25, 0.3); border: 2px dashed var(--border-color); 
    border-radius: 15px 225px 15px 255px/255px 15px 225px 15px; 
    padding: 25px 30px; text-align: center; z-index: 2; flex: 1; min-width: 150px; max-width: 250px;
}

/* Обычные карточки */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 30px; margin-bottom: 80px; }
.stat-card {
    background: rgba(25, 25, 25, 0.3); border: 2px solid var(--border-color);
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    padding: 40px 20px; transition: transform 0.3s; display: flex; flex-direction: column;
    align-items: center; text-align: center; box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
}
.stat-card:hover, .tree-node:hover { transform: translateY(-5px) rotate(1deg); border-color: rgba(255,255,255,0.5); }

.stat-value { font-family: var(--font-hand); font-size: 4rem; font-weight: 700; color: var(--accent-cyan); line-height: 1; margin-bottom: 10px; letter-spacing: 2px; }
.tree-root .stat-value { font-size: 5rem; color: var(--text-main); }
.stat-label { font-size: 0.95rem; color: var(--text-muted); font-family: var(--font-sans); }

.charts-container { display: flex; flex-direction: column; align-items: center; }
.sketch-card { background: rgba(25, 25, 25, 0.3); padding: 30px; width: 100%; border: 2px solid var(--border-color); border-radius: 15px 225px 15px 255px/255px 15px 225px 15px; }
.sketch-card h3 { margin-bottom: 20px; font-weight: 400; letter-spacing: 1px; color: var(--text-muted); text-align: center;}

/* О проекте */
.about-section { padding: 80px 0; background: rgba(18, 18, 18, 0.6); border-top: 1px solid rgba(255,255,255,0.05); }
.about-content { max-width: 800px; margin: 0 auto; font-size: 1.1rem; color: var(--text-muted); line-height: 1.8; text-align: center; }

.testimony-layer { padding: 60px 0; overflow: hidden; background: #0a0a0a; border-top: 1px solid rgba(255,255,255,0.05);}
.section-title { font-size: 2rem; margin-bottom: 40px; font-weight: 300;}
.testimony-track { position: relative; height: 350px; display: flex; align-items: center;}
.testimony-item { position: absolute; font-family: var(--font-serif); white-space: nowrap; font-style: italic; width: 100%; text-align: center; }

/* Динамичные настройки для каждого слоя свидетельств (разные скорости, размеры и прозрачность) */
.testimony-item:nth-child(1) { top: 3%; animation: scrollRight 35s linear infinite; font-size: 2.2rem; opacity: 0.95; color: var(--text-main); z-index: 2; }
.testimony-item:nth-child(2) { top: 1%; animation: scrollLeft 45s linear infinite; font-size: 6.5rem; opacity: 0.15; color: var(--accent-red); z-index: 1; }
.testimony-item:nth-child(3) { top: 45%; animation: scrollLeft 28s linear infinite; font-size: 2.2rem; opacity: 0.95; color: var(--text-main); z-index: 2; }
.testimony-item:nth-child(4) { top: 70%; animation: scrollLeft 55s linear infinite; font-size: 5.5rem; opacity: 0.1; color: var(--text-muted); z-index: 1; }
.testimony-item:nth-child(5) { top: 90%; animation: scrollRight 40s linear infinite; font-size: 2.2rem; opacity: 0.95; color: var(--accent-cyan); z-index: 2; }
.testimony-item:nth-child(6) { top: 35%; animation: scrollLeft 65s linear infinite reverse; font-size: 6.5rem; opacity: 0.05; color: #fff; z-index: 0; font-weight: bold; }

@media (max-width: 760px) {
    .testimony-track { height: 280px; }
    .testimony-item:nth-child(1), .testimony-item:nth-child(3), .testimony-item:nth-child(5) { font-size: 1.4rem; }
    .testimony-item:nth-child(2), .testimony-item:nth-child(4) { font-size: 2.5rem; }
    .testimony-item:nth-child(6) { font-size: 3.5rem; }
}

@keyframes scrollLeft { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
@keyframes scrollRight { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.site-footer { padding: 40px 0; text-align: center; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,0.05); font-size: 0.9rem; }
.secret-admin-link { color: inherit; text-decoration: none; cursor: default; }
.secret-admin-link:hover { color: var(--accent-red); }

/* Кнопка наверх */
#scrollTopBtn {
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px;
    background: var(--accent-cyan); border: none; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); fill: #fff;
}
#scrollTopBtn.show { opacity: 1; visibility: visible; }
#scrollTopBtn:hover { transform: translateY(-5px); background: #3a6f7c; }
#scrollTopBtn svg { width: 24px; height: 24px; }
@media(max-width: 760px) { #scrollTopBtn { bottom: 20px; right: 20px; width: 45px; height: 45px; } }
