/* ===== Design Tokens ===== */
:root {
  /* Светлая тема (переменные из index.html) */
  --bg-color: #f9fafb;
  --text-primary: #222;
  --text-secondary: #555;
  --card-bg: #ffffff;
  --navbar-bg: rgba(255, 255, 255, 0.9);
  --shadow-color: rgba(0, 0, 0, 0.05);
  
  /* Тёмная тема */
  --color-primary: #0B3B24;
  --color-primary-dark: #052010;
  --color-primary-light: #1A5B3A;
  --color-accent: #2E7D32;
  --color-accent-light: #4CAF50;
  --color-white: #FFFFFF;
  --color-text: #1A1A1A;
  --color-text-secondary: #4A4A4A;
  --color-text-muted: #6B6B6B;
  --color-border: #E0E4E0;
  --color-border-light: #EEF0EE;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.10);
  
  --primary-gradient: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --transition: 0.3s ease;
  --font-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --navbar-height: 72px;
}

/* ===== Dark Theme Overrides ===== */
[data-theme="dark"] {
  --bg-color: #121212;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --card-bg: #1e1e1e;
  --navbar-bg: rgba(18, 18, 18, 0.9);
  --shadow-color: rgba(0,0,0,0.6);
  --color-white: #1E1E1E;
  --color-text: #E0E0E0;
  --color-text-secondary: #B0B0B0;
  --color-border: #333333;
  --color-border-light: #2A2A2A;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-height);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: color 0.3s; }
img { max-width: 100%; height: auto; display: block; }

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3 {
  color: #E0E0E0;
}
p { color: var(--text-secondary); }

/* ===== Utilities ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 1920px) {
  .container { max-width: 1400px; padding: 0 2rem; }
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ===== Loader ===== */
#page-loader {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--bg-color);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s, visibility 0.5s;
}
#page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* ===== Buttons ===== */
.btn, .btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}
.btn-primary, .btn-hero-primary {
  background: #1a5e2a; color: #fff; border-color: #1a5e2a; box-shadow: var(--shadow-sm);
}
.btn-primary:hover, .btn-hero-primary:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md); background: #0f441d;
}
.btn-hero-primary { background: #fff; color: #1a5e2a; }
.btn-hero-primary:hover { background: #f0f0f0; color: #1a5e2a; }

.btn-outline, .btn-hero-outline {
  background: transparent; color: #fff; border-color: #fff;
}
.btn-outline:hover, .btn-hero-outline:hover {
  background: #fff; color: #1a5e2a; transform: translateY(-2px);
}

/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--navbar-height);
  background: var(--navbar-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-light);
  display: flex; align-items: center; padding: 0 2rem;
  box-shadow: 0 2px 10px var(--shadow-color);
  transition: background 0.3s, box-shadow 0.3s;
}
.navbar .container { display: flex; justify-content: space-between; align-items: center; width: 100%; }

.nav-logo {
  font-weight: 700; font-size: 1.2rem; color: #2e7d32;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
[data-theme="dark"] .nav-logo { color: #4caf50; }
.nav-logo i { color: #27ae60; }

.nav-links {
  display: flex; list-style: none; gap: 0.2rem;
  justify-content: flex-end; align-items: center; margin: 0;
}
.nav-links a, .dropbtn {
  font-weight: 500; color: var(--text-secondary);
  position: relative; background: none; border: none; cursor: pointer;
  font-size: 1rem; font-family: inherit;
  padding: 0.5rem 0.85rem; border-radius: 6px;
  transition: all 0.2s;
}
.nav-links a:hover, .dropbtn:hover { color: #2e7d32; background: var(--color-border-light); }
[data-theme="dark"] .nav-links a:hover, [data-theme="dark"] .dropbtn:hover { color: #4caf50; background: #2A2A2A; }

.dropdown { position: relative; display: inline-block; }
.dropbtn { display: flex; align-items: center; gap: 4px; }
.dropdown-content {
  display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background-color: var(--card-bg); min-width: 160px;
  box-shadow: var(--shadow-md); border-radius: 8px; padding: 0.5rem 0;
  z-index: 1001; margin-top: 5px; border: 1px solid var(--shadow-color);
}
.dropdown:hover .dropdown-content { display: block; }
.dropdown-content a {
  padding: 10px 16px; display: block; transition: 0.2s; color: var(--text-secondary);
}
.dropdown-content a:hover { background-color: #e8f5e9; color: #2e7d32; }
[data-theme="dark"] .dropdown-content a:hover { background-color: #263238; color: #4caf50; }

.nav-actions { display: flex; align-items: center; gap: 1rem; }
.theme-toggle {
  background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-primary); transition: color 0.3s;
}
.hamburger { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 25px; height: 3px; background: var(--text-primary); transition: 0.3s; }

@media (max-width: 1024px) {
  .hamburger { display: flex; }
  .nav-links {
    position: fixed; top: var(--navbar-height); left: 0; right: 0;
    background: var(--card-bg); flex-direction: column; align-items: stretch;
    padding: 1rem; gap: 0.2rem; transform: translateY(-120%); opacity: 0;
    transition: var(--transition); border-bottom: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-lg); max-height: 70vh; overflow-y: auto;
  }
  .nav-links.active { transform: translateY(0); opacity: 1; }
  .nav-links a { padding: 0.75rem 1rem; font-size: 1rem; border-radius: 8px; }
  .navbar { padding: 0 1rem; }
}

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 2rem; color: #fff;
  background: linear-gradient(rgba(0, 60, 0, 0.6), rgba(0, 120, 0, 0.4)),
    url('https://images.unsplash.com/photo-1542601906990-b4d3fb778b09?auto=format&fit=crop&w=1920&q=80') no-repeat center center;
  background-size: cover; padding-top: var(--navbar-height);
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem); font-weight: 800; line-height: 1.2;
  margin-bottom: 1.5rem; text-shadow: 0 4px 15px rgba(0,0,0,0.3); color: #fff;
}
.hero p {
  font-size: clamp(1rem, 2vw, 1.4rem); max-width: 650px; margin: 0 auto 2.5rem;
  line-height: 1.6; opacity: 0.9; color: #fff;
}
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 768px) {
  .hero { min-height: 90vh; padding: 2rem 1rem; }
}

/* ===== Sections ===== */
.section-padding { padding: 5rem 0; }
@media (max-width: 768px) { .section-padding { padding: 3rem 0; } }

.section-header { text-align: center; margin-bottom: 3.5rem; }
@media (max-width: 768px) { .section-header { margin-bottom: 2.5rem; } }

.section-tag {
  display: inline-block; background: #e8f5e9; color: #2e7d32; padding: 0.3rem 1.2rem;
  border-radius: 20px; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.5rem;
}
[data-theme="dark"] .section-tag { background: #1b5e20; color: #a5d6a7; }

.section-title {
  font-size: clamp(2rem, 4vw, 2.5rem); font-weight: 700; color: var(--text-primary);
  margin-bottom: 1rem; transition: color 0.3s;
}

/* ===== Counters / Stats ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 2rem; text-align: center;
}
.stat-card {
  background: var(--card-bg); padding: 2.5rem 1.5rem; border-radius: 20px;
  box-shadow: 0 5px 25px var(--shadow-color); transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
}
.stat-card:hover { transform: translateY(-10px); }
.stat-card i { font-size: 2.5rem; color: #27ae60; margin-bottom: 1rem; }
.stat-number { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; color: var(--text-primary); }
.stat-label { color: var(--text-secondary); margin-top: 0.5rem; font-weight: 500; }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr 1fr; gap: 1rem; } }

/* ===== Mission / About Grid ===== */
.flex-about {
  display: flex; flex-wrap: wrap; gap: 3rem; align-items: center;
}
.flex-about > * { flex: 1; min-width: 280px; }
.about-image {
  height: 350px; border-radius: 20px; box-shadow: var(--shadow-lg); background-size: cover; background-position: center;
}
@media (max-width: 480px) { .about-image { height: 250px; } }

/* ===== Timeline ===== */
.timeline { position: relative; padding: 2rem 0; }
.timeline::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px;
  background: var(--text-secondary); opacity: 0.2; transform: translateX(-50%);
}
.timeline-item {
  display: flex; justify-content: flex-end; padding-right: calc(50% + 30px);
  position: relative; margin-bottom: 3rem;
}
.timeline-item:nth-child(even) { justify-content: flex-start; padding-right: 0; padding-left: calc(50% + 30px); }
.timeline-content {
  background: var(--card-bg); padding: 1.5rem; border-radius: 15px;
  box-shadow: 0 5px 20px var(--shadow-color); max-width: 400px; transition: 0.3s, background 0.3s, box-shadow 0.3s;
}
.timeline-content:hover { transform: scale(1.02); }
.timeline-content h4 { color: #27ae60; margin-bottom: 0.5rem; }
.timeline-content p { color: var(--text-secondary); }
.timeline-icon {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 50px; height: 50px; background: var(--primary-gradient); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}
@media (max-width: 768px) {
  .timeline::before { left: 20px; }
  .timeline-item { padding: 0 0 0 60px !important; justify-content: flex-start !important; }
  .timeline-icon { left: 20px !important; }
  .timeline-content { max-width: 100%; }
}

/* ===== Tree Map Preview ===== */
.tree-preview {
  display: flex; flex-wrap: wrap; background: var(--card-bg); border-radius: 20px;
  overflow: hidden; box-shadow: var(--shadow-lg); transition: background 0.3s;
}
.tree-preview-info { flex: 1; padding: 2.5rem 3rem; min-width: 280px; }
.tree-preview-info h3 { margin-bottom: 1rem; color: #1a5e2a; font-size: clamp(1.4rem, 3vw, 1.8rem); }
[data-theme="dark"] .tree-preview-info h3 { color: #4caf50; }
.tree-preview-visual {
  flex: 1; background: #1a5e2a; aspect-ratio: 16 / 9; min-height: 200px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 5rem;
}
@media (max-width: 768px) {
  .tree-preview { flex-direction: column; }
  .tree-preview-visual { width: 100%; aspect-ratio: 16 / 9; }
}

/* ===== Widgets (Weather & Fact) ===== */
.widget-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.widget-card {
  background: var(--card-bg); padding: 2rem; border-radius: 20px;
  box-shadow: 0 5px 25px var(--shadow-color); transition: background 0.3s, box-shadow 0.3s;
}
.weather-current { display: flex; align-items: center; gap: 2rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.weather-temp { font-size: clamp(2.5rem, 6vw, 3.5rem); font-weight: 700; color: var(--text-primary); }
.weather-details { color: var(--text-secondary); }
.forecast-grid { display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap; }
.forecast-item {
  text-align: center; background: var(--bg-color); padding: 1rem; border-radius: 12px; flex: 1;
  transition: background 0.3s; min-width: 60px;
}
.forecast-item i { font-size: 1.8rem; color: #27ae60; margin: 0.5rem 0; }
.fact-card {
  background: var(--card-bg); padding: 2.5rem; border-radius: 20px;
  box-shadow: 0 5px 25px var(--shadow-color); border-left: 6px solid #27ae60;
  font-size: clamp(1rem, 1.8vw, 1.3rem); line-height: 1.6; color: var(--text-primary);
  position: relative; transition: background 0.3s, box-shadow 0.3s;
  display: flex; flex-direction: column; justify-content: center;
}
@media (max-width: 768px) { .widget-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .forecast-grid { flex-wrap: wrap; gap: 0.5rem; } }

/* ===== Partners (SDG Icons) ===== */
.partners-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 2rem; text-align: center;
}
.partners-grid .stat-card { padding: 2rem; }
.partners-grid .stat-card i { color: #1a5e2a; }
.partners-grid h4 { margin-top: 1rem; color: var(--text-primary); }

/* ===== Footer ===== */
.site-footer {
  background: #0b1f14; color: #b0c4b6; padding: 4rem 1.5rem 2rem; margin-top: 0;
}
.site-footer .container { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2rem; }
.social-links { display: flex; gap: 1.5rem; font-size: 1.5rem; }
.social-links a { color: #b0c4b6; transition: 0.3s; }
.social-links a:hover { color: #4caf50; transform: translateY(-2px); }
.site-footer p { color: #b0c4b6; margin: 0; }
@media (max-width: 480px) { .site-footer { padding: 3rem 1rem; } }

/* ===== Reveal Animation ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }