/* ===========================================================
   Надежда — общие стили
   Палитры переключаются через data-theme на <html>
   =========================================================== */

:root {
  /* shared / default ("Чёрный гербарий") */
  --bg: #0a0a0a;
  --bg-2: #131211;
  --fg: #f2ede4;
  --fg-dim: #a8a39a;
  --line: rgba(242, 237, 228, 0.14);
  --accent: #e8c25a;   /* пламя */
  --c-plamya: oklch(0.85 0.13 85);
  --c-mak: oklch(0.65 0.22 35);
  --c-gort: oklch(0.55 0.18 250);
  --c-moh: oklch(0.6 0.12 130);
  --c-siren: oklch(0.78 0.09 320);

  --font-display: "Unbounded", "Ruslan Display", system-ui, sans-serif;
  --font-text: "Onest", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --max: 1400px;
  --pad: clamp(20px, 4vw, 64px);
}

html[data-theme="acid"] {
  --bg: #050505;
  --bg-2: #0d0d0d;
  --fg: #eafd5a;
  --fg-dim: #8fa83e;
  --line: rgba(234, 253, 90, 0.2);
  --accent: #ff3df0;
}

html[data-theme="paper"] {
  --bg: #f0ece2;
  --bg-2: #e6e1d3;
  --fg: #181613;
  --fg-dim: #6b665c;
  --line: rgba(24, 22, 19, 0.18);
  --accent: #d63a2f;
}

html[data-display="ruslan"] {
  --font-display: "Ruslan Display", "Unbounded", sans-serif;
}
html[data-display="bungee"] {
  --font-display: "Bungee", "Unbounded", sans-serif;
}
html[data-display="rubik"] {
  --font-display: "Rubik Mono One", "Unbounded", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y pinch-zoom;
  }

  .page {
    overflow-x: clip;
  }
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--bg); }

/* ---------- header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  background: linear-gradient(to bottom, var(--bg) 0%, color-mix(in oklab, var(--bg) 80%, transparent) 80%, transparent 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
  display: flex; align-items: center; gap: 10px;
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.nav {
  display: flex; gap: 28px; align-items: center;
  font-size: 14px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav a {
  position: relative;
  padding: 4px 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.nav a:hover { opacity: 1; }
.nav a.active {
  opacity: 1;
}
.nav a.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent);
}

.header-right {
  display: flex; align-items: center; gap: 18px;
}

.lang-switch {
  display: flex; gap: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.lang-switch button {
  background: none;
  border: 0;
  color: var(--fg-dim);
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.06em;
}
.lang-switch button.on {
  background: var(--fg);
  color: var(--bg);
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 120px;
  border-top: 1px solid var(--line);
  padding: 60px var(--pad) 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  font-size: 14px;
}
.site-footer .footer-brand {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-weight: 700;
  max-width: 360px;
}
.site-footer h4 {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  margin: 0 0 14px;
  font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer a:hover { color: var(--accent); }
.footer-bottom {
  grid-column: 1 / -1;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}

@media (max-width: 800px) {
  .site-footer { grid-template-columns: 1fr 1fr; }
  .site-footer .footer-brand { grid-column: 1 / -1; font-size: 40px; }
  .nav { display: none; }
  .footer-bottom { flex-direction: column; gap: 10px; }
}

/* ---------- typography utilities ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* page container */
.page { padding-top: 84px; }
.section { padding: clamp(60px, 10vw, 140px) var(--pad); }

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- tweaks panel ---------- */
.tweaks-launcher {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  display: none;
  background: var(--fg); color: var(--bg);
  border: 0; cursor: pointer;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tweaks-panel {
  position: fixed; bottom: 20px; right: 20px; z-index: 101;
  width: 280px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  font-size: 13px;
  display: none;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.tweaks-panel.open { display: block; }
.tweaks-panel h5 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
}
.tweaks-panel h5 + h5 { margin-top: 18px; }
.tweaks-panel .row {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.tweaks-panel .row button {
  flex: 1;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.tweaks-panel .row button.on {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.tweaks-panel .close-x {
  background: none; border: 0; color: var(--fg-dim);
  cursor: pointer; padding: 0; font-size: 16px; line-height: 1;
}
