/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-accent: #1c2333;
  --border: #30363d;
  --primary: #58a6ff;
  --primary-dim: #1f3a5f;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-link: #58a6ff;
  --accent: #388bfd;
  --radius: 10px;
  --font-sans: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

html { scroll-behavior: smooth; background: var(--bg); }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  background-image: url('../background.png');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  position: relative;
}

/* Затемняющий слой */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 17, 23, 0.85);
  pointer-events: none;
  z-index: -1;
}

/* Контент поверх фона */
header, .hero, .section, .stats, .cta, footer, .wiki-wrap {
  position: relative;
  z-index: 1;
}
a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); background: var(--bg-accent); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; color: var(--primary); }

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== HEADER ===== */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
header .inner {
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.1rem; color: var(--text);
}
.logo img { width: 32px; height: 32px; }
nav { display: flex; align-items: center; gap: 8px; }
nav a {
  color: var(--text-muted); padding: 6px 12px; border-radius: var(--radius);
  font-size: 0.9rem; transition: color 0.2s, background 0.2s;
}
nav a:hover { color: var(--text); background: var(--bg-accent); text-decoration: none; }
.nav-icons { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius);
  color: var(--text-muted); transition: color 0.2s, background 0.2s;
}
.icon-btn:hover { color: var(--text); background: var(--bg-accent); text-decoration: none; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.sw-icon svg { width: 16px; height: 16px; transform: scale(1.2); margin: -4px; }

/* Lang dropdown */
.lang-wrap { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); padding: 6px 12px;
  border-radius: var(--radius); cursor: pointer;
  font-size: 0.85rem; font-family: var(--font-sans);
  transition: border-color 0.2s, color 0.2s;
}
.lang-btn:hover { color: var(--text); border-color: var(--primary); }
.lang-btn svg { width: 16px; height: 16px; }
.lang-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 160px;
  overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 200;
}
.lang-wrap:hover .lang-dropdown,
.lang-wrap:focus-within .lang-dropdown { display: block; }
.lang-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; color: var(--text-muted); font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}
.lang-dropdown a:hover { background: var(--bg-accent); color: var(--text); text-decoration: none; }
.lang-dropdown a.active { color: var(--primary); }

/* ===== HERO ===== */
.hero {
  padding: 100px 0 80px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800; line-height: 1.15;
  margin-bottom: 24px; color: var(--text);
}
.hero p {
  font-size: 1.2rem; color: var(--text-muted);
  max-width: 700px; margin: 0 auto 48px;
  line-height: 1.7;
}
.hero h3 { font-size: 1.4rem; margin-bottom: 24px; color: var(--text); }
.install-group { display: flex; flex-direction: column; gap: 16px; max-width: 700px; margin: 0 auto 16px; }
.install-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  font-family: var(--font-mono); font-size: 0.9rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; color: var(--text); text-align: left;
}
.install-box code { background: none; padding: 0; color: var(--text); font-size: 0.9rem; word-break: break-all; }
.copy-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px; border-radius: 6px;
  transition: color 0.2s; flex-shrink: 0;
}
.copy-btn:hover { color: var(--primary); }
.copy-btn svg { width: 16px; height: 16px; display: block; }
.or-divider { color: var(--text-muted); font-size: 0.9rem; }
.hero-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 12px; }

/* ===== SECTION TITLES ===== */
.section { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 56px; }
.section-title h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin-bottom: 12px; }
.section-title p { font-size: 1.1rem; color: var(--text-muted); }

/* ===== INTERFACE ===== */
.interface-img {
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.interface-img img { width: 100%; display: block; }

/* ===== FEATURES GRID ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: border-color 0.2s;
}
.feature-card:hover { border-color: var(--primary); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 10px;
  background: var(--primary-dim); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.feature-card p { color: var(--text-muted); line-height: 1.65; font-size: 0.95rem; }

/* ===== STATS ===== */
.stats { background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 60px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: center; }
.stat-num { font-size: 3rem; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--text-muted); font-size: 0.95rem; margin-top: 6px; }

/* ===== CTA ===== */
.cta { padding: 100px 0; text-align: center; }
.cta h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin-bottom: 16px; }
.cta p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 40px; max-width: 600px; margin-left: auto; margin-right: auto; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  text-decoration: none; border: none; font-family: var(--font-sans);
}
.btn:hover { text-decoration: none; opacity: 0.85; }
.btn-outline {
  background: transparent; border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); opacity: 1; }
.btn svg { width: 18px; height: 18px; }

/* ===== FOOTER ===== */
footer {
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 60px 0 30px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 48px;
}
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
footer h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; color: var(--text); }
footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
footer ul a {
  color: var(--text-muted); font-size: 0.9rem;
  display: flex; align-items: center; gap: 8px;
  transition: color 0.2s;
}
footer ul a:hover { color: var(--text); text-decoration: none; }
footer ul a svg { width: 16px; height: 16px; flex-shrink: 0; }
footer ul a .sw-small { width: 22px; height: 22px; margin-left: -2px; }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 24px;
  text-align: center; color: var(--text-muted); font-size: 0.85rem;
}

/* ===== WIKI LAYOUT ===== */
.wiki-wrap { display: flex; gap: 0; min-height: calc(100vh - 65px); }
.wiki-sidebar {
  width: 280px; flex-shrink: 0;
  background: var(--bg-card); border-right: 1px solid var(--border);
  padding: 24px 0; position: sticky; top: 65px;
  height: calc(100vh - 65px); overflow-y: auto;
}
.wiki-sidebar h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 0 20px; margin-bottom: 8px; }
.wiki-sidebar nav { display: flex; flex-direction: column; gap: 0; margin-bottom: 24px; }
.wiki-sidebar nav a {
  padding: 8px 20px; color: var(--text-muted); font-size: 0.9rem;
  border-radius: 0; transition: background 0.15s, color 0.15s;
  display: block; border-left: 2px solid transparent;
}
.wiki-sidebar nav a:hover { background: var(--bg-accent); color: var(--text); text-decoration: none; }
.wiki-sidebar nav a.active { color: var(--primary); border-left-color: var(--primary); background: var(--primary-dim); }
.wiki-content { flex: 1; padding: 48px; max-width: 900px; }
.wiki-content h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 8px; }
.wiki-content .lead { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 40px; line-height: 1.7; }
.wiki-section { margin-bottom: 48px; padding-bottom: 48px; border-bottom: 1px solid var(--border); }
.wiki-section:last-child { border-bottom: none; }
.wiki-section h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 12px; }
.wiki-section h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; }
.wiki-section p { color: var(--text-muted); line-height: 1.7; margin-bottom: 12px; }
.wiki-section ul { list-style: disc; padding-left: 20px; color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; font-size: 0.95rem; }
.wiki-section ul li ul { margin-top: 6px; }

.info-box {
  background: var(--bg-accent); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  margin: 16px 0;
}
.info-box p { margin-bottom: 0; }
.info-box ul { color: var(--text-muted); }

.step-list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.step {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #0d1117;
  font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-body h4 { font-weight: 600; margin-bottom: 4px; }
.step-body p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

.alert-box {
  border-radius: var(--radius); padding: 16px 20px; margin: 16px 0;
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 0.9rem;
}
.alert-box.warn { background: rgba(210,153,34,0.1); border: 1px solid rgba(210,153,34,0.3); color: #d2993a; }
.alert-box.info { background: rgba(88,166,255,0.1); border: 1px solid rgba(88,166,255,0.3); color: var(--primary); }
.alert-box svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.community-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.community-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 0.95rem; font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
}
.community-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.community-btn svg { width: 18px; height: 18px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr; gap: 32px; }
  .wiki-sidebar { display: none; }
  .wiki-content { padding: 24px; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 48px; }
  nav a { display: none; }
  .features-grid { grid-template-columns: 1fr; }
}
