/* ===== ПЕРЕМЕННЫЕ (Тема Африканского саммита) ===== */
:root {
  --bg: #F8FAFC;
  --surface: #ffffff;
  --surface2: #F4F7FB;
  --border: #E2E8F0;
  --text: #1E293B;
  --muted: #64748B;
  --muted2: #94A3B8;
  
  /* Терракотовый/Оранжевый (Главный) */
  --accent: #E65100;
  /* Изумрудный (Вторичный) */
  --accent2: #2E7D32;
  
  --shadow: rgba(0, 0, 0, 0.06);
  
  /* Приглушенные цвета шапки из первого варианта */
  --hero-from: #3E2723;
  --hero-to: #BF360C;
}

body.dark {
  --bg: #0B0F19;
  --surface: #111827;
  --surface2: #1E293B;
  --border: rgba(255, 255, 255, 0.08);
  --text: #F1F5F9;
  --muted: #94A3B8;
  --muted2: #64748B;
  
  --accent: #FF9800;
  --accent2: #4CAF50;
  
  --shadow: rgba(0, 0, 0, 0.4);
  
  /* Темные приглушенные цвета для ночной темы */
  --hero-from: #1A100C;
  --hero-to: #4A140C;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Montserrat', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
button, a { -webkit-tap-highlight-color: transparent; outline: none; }

/* ===== HERO ===== */
/* Возвращен приглушенный градиент без кричащего оранжевого по центру */
.hero { position: relative; padding: 5.5rem 2rem 5rem; text-align: center; overflow: hidden; background: linear-gradient(145deg, var(--hero-from) 0%, var(--hero-to) 100%); }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 70% at 70% 30%, rgba(191, 54, 12, 0.15) 0%, transparent 60%), radial-gradient(ellipse 40% 50% at 20% 80%, rgba(62, 39, 35, 0.3) 0%, transparent 60%); pointer-events: none; }

.hero-badge { display: inline-block; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.28); color: rgba(255, 255, 255, 0.9); padding: .38rem 1.1rem; border-radius: 100px; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1.8rem; }
.hero h1 { font-family: 'Unbounded', sans-serif; font-size: clamp(2rem, 6vw, 3.8rem); font-weight: 800; line-height: 1.1; letter-spacing: -.03em; color: #ffffff; margin-bottom: 1.2rem; }
.hero-sub { color: rgba(255, 255, 255, 0.75); font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin: 0 auto; }

/* ===== BUTTONS (THEME, LANG, UP, ARCHIVE) ===== */
.theme-toggle, .scroll-to-top { position: fixed; right: 1.5rem; z-index: 9999; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px var(--shadow); transition: transform .2s, box-shadow .2s, background .3s; }
.theme-toggle { bottom: 1.5rem; }
.theme-toggle:hover { transform: scale(1.1); box-shadow: 0 8px 30px var(--shadow); color: var(--accent); }
.scroll-to-top { bottom: 5.5rem; opacity: 0; pointer-events: none; transform: translateY(20px); }
.scroll-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.scroll-to-top:hover { color: var(--accent); transform: scale(1.1); }
body.dark .scroll-to-top { background: var(--surface2); }
.lang-toggle, .home-btn { position: absolute !important; pointer-events: auto !important; top: 1.5rem !important; z-index: 101 !important; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; padding: 0.4rem 0.8rem; border-radius: 8px; font-weight: 700; font-size: 0.8rem; text-decoration: none; transition: all 0.2s; backdrop-filter: blur(5px); }
.lang-toggle { right: 1.5rem !important; }
.home-btn { left: 1.5rem !important; display: inline-flex; align-items: center; gap: 6px; }
.lang-toggle:hover, .home-btn:hover { background: #fff; color: var(--hero-to); }

/* ===== NAV ===== */
.nav-wrap { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); padding: 0 1rem; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04); transition: background .3s, border-color .3s; }
body.dark .nav-wrap { background: rgba(11, 15, 25, 0.97); }
.nav-tabs { display: flex; max-width: 1200px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; justify-content: center; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab { padding: 1.2rem 1.4rem; font-size: .88rem; font-weight: 700; font-family: 'Montserrat', sans-serif; color: var(--muted); cursor: pointer; border: none; background: none; border-bottom: 3px solid transparent; transition: all .2s; white-space: nowrap; position: relative; top: 1px; display: flex; align-items: center; gap: 6px; }
.nav-tab:hover { color: var(--accent); }
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== LAYOUT & SECTION ===== */
.tab-section { display: none; max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.tab-section.active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: translateY(0) } }

.section-intro { background: linear-gradient(135deg, var(--accent) 0%, var(--hero-to) 100%); border-radius: 18px; padding: 2rem 2.2rem; margin-bottom: 1.75rem; color: #fff; position: relative; overflow: hidden; transition: background 0.3s, border 0.3s; }
body.dark .section-intro { background: linear-gradient(135deg, #111827 0%, #1E293B 100%); border: 1px solid rgba(255, 152, 0, 0.2) !important; }
.section-intro-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: rgba(255, 255, 255, 0.65); margin-bottom: .55rem; position: relative; z-index: 1; }
.section-intro h2 { font-family: 'Unbounded', sans-serif; font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: .85rem; line-height: 1.3; position: relative; z-index: 1; }
.section-intro p { font-size: .88rem; color: rgba(255, 255, 255, 0.82); line-height: 1.75; font-weight: 500; position: relative; z-index: 1; }

.section-title { font-family: 'Unbounded', sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: .35rem; color: var(--text); }
.dcard { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.75rem; margin-bottom: 1.5rem; box-shadow: 0 4px 15px var(--shadow); transition: background .3s, border-color .3s; }
.dcard h3 { font-family: 'Unbounded', sans-serif; font-size: .85rem; font-weight: 700; margin-bottom: 1.4rem; color: var(--text); text-transform: uppercase; letter-spacing: .06em; }
.badge-pct { padding: 3px 8px; border-radius: 100px; font-size: .7rem; font-weight: 700; border: 1px solid var(--border); white-space: nowrap; }
.grid-responsive { display: grid; gap: 1.5rem; }
.grid-cols-2 { grid-template-columns: 1fr 1fr; }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ===== TABLES ===== */
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: .8rem .9rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--surface2); color: var(--muted); font-weight: 700; font-size: .68rem; text-transform: uppercase; }
tr:hover td { background: rgba(230, 81, 0, 0.03); }
body.dark tr:hover td { background: rgba(255, 152, 0, 0.04); }

/* ===== CIT LINKS NEW DESIGN ===== */
.cit-card { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; text-decoration: none; transition: all 0.3s ease; box-shadow: 0 2px 8px var(--shadow); }
.cit-card:hover { border-color: var(--accent); box-shadow: 0 6px 15px rgba(230, 81, 0, 0.1); transform: translateY(-2px); }
body.dark .cit-card:hover { background: rgba(255, 152, 0, 0.05); }
.cit-content { flex-grow: 1; padding-right: 1.5rem; }
.cit-badge { display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 0.7rem; font-weight: 700; margin-bottom: 0.8rem; }
.cit-title { font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: 0.5rem; line-height: 1.4; }
.cit-authors { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.cit-desc { font-size: 0.8rem; color: var(--muted2); line-height: 1.5; }
.cit-stats { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; padding: 1rem 0; width: 130px; flex-shrink: 0; background: var(--surface2); }
.cit-stats-val { font-family: 'Unbounded', sans-serif; font-size: 1.8rem; font-weight: 800; color: var(--accent); line-height: 1; margin-bottom: 0.3rem; }
.cit-stats-lbl { font-size: 0.65rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== FOOTER ===== */
footer { text-align: center; padding: 3rem 1.5rem; background-color: #0F172A; color: var(--muted2); font-size: .8rem; margin: 0; line-height: 1.6; }
body.dark footer { background-color: #04070E; }

/* ===== MOBILE ===== */
@media(max-width:800px) {
  .grid-responsive.grid-cols-2, .grid-responsive.grid-cols-3 { grid-template-columns: 1fr !important; }
  .hero { padding: 3.5rem 1.2rem 3rem; }
  .hero h1 { white-space: nowrap !important; font-size: 6vw !important; letter-spacing: -0.03em !important; }
  .tab-section { padding: 1.5rem 0.75rem; }
  .nav-wrap { position: static; padding: 1rem; border-bottom: none; background: transparent !important; box-shadow: none; }
  .nav-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
  .nav-tab { padding: 0.85rem 0.5rem; font-size: 0.75rem; border: 1px solid var(--border) !important; border-radius: 10px; background: var(--surface); text-align: center; flex: 1 1 calc(33% - 0.5rem); justify-content: center; }
  .nav-tab.active { background: rgba(230, 81, 0, 0.05); border-color: var(--accent) !important; color: var(--accent); }
  body.dark .nav-tab.active { background: rgba(255, 152, 0, 0.06); }
  
  .cit-card { flex-direction: column; align-items: stretch; padding: 1.2rem; }
  .cit-content { padding-right: 0; margin-bottom: 1.5rem; }
  .cit-stats { flex-direction: row; justify-content: space-between; padding: 0.8rem 1.2rem; width: 100%; }
  .cit-stats-val { font-size: 1.4rem; margin-bottom: 0; }
  
  table thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0.5rem 1rem; box-shadow: 0 2px 8px var(--shadow); }
  td { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 0; border-bottom: 1px solid var(--border); text-align: right !important; gap: 1rem; }
  td:last-child { border-bottom: none; }
  
  .theme-toggle, .scroll-to-top { width: 44px; height: 44px; }
  .theme-toggle { bottom: 1rem; right: 1rem; }
  .scroll-to-top { bottom: 4.5rem; right: 1rem; }
  .lang-toggle, .home-btn { top: 1rem !important; padding: 0.3rem 0.6rem; font-size: 0.75rem; }
  .home-btn { left: 1rem !important; }
  .lang-toggle { right: 1rem !important; }
}
@media(max-width: 400px) { .hero h1 { font-size: 5.3vw !important; } }