/* ОФИЦИАЛЬНЫЙ САЙТ «РОБОСОМА» — стиль игры: тёмный космос, циановые линии интерфейса,
   марсианская охра. Ни одного внешнего файла (шрифты системные, графика — SVG-спрайт):
   сервер слабый, а страница обязана открываться на дешёвом телефоне за секунду. */

:root {
  --bg: #070b12;
  --bg-soft: #0d1420;
  --panel: rgba(14, 22, 34, 0.82);
  --line: #1f3450;
  --cyan: #5ad2ff;
  --cyan-dim: #2b7fa8;
  --mars: #e0743c;
  --mars-soft: #f0a877;
  --green: #7ff0a0;
  --text: #dbe7f5;
  --muted: #8fa3bb;
  --radius: 14px;
  --wrap: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ── КОСМОС: три слоя параллакса. Рисуются один раз на canvas, при прокрутке
      двигаются только CSS-трансформом — телефон не пересчитывает звёзды. ── */
#space {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 22% 12%, rgba(90, 210, 255, 0.09), transparent 70%),
    radial-gradient(ellipse 50% 40% at 82% 78%, rgba(224, 116, 60, 0.10), transparent 72%),
    var(--bg);
}
#space canvas { position: absolute; inset: 0; width: 100%; height: 100%; will-change: transform; }

/* Марсианская дымка у нижней кромки экрана — глубина без единой картинки. */
#horizon {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 38vh;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(224, 116, 60, 0.16), rgba(224, 116, 60, 0.04) 45%, transparent);
}

.wrap { width: min(var(--wrap), 100% - 32px); margin: 0 auto; }

/* ── ШАПКА ── */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(7, 11, 18, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand b { font-size: 18px; letter-spacing: 0.14em; }
.brand span { display: block; font-size: 11px; color: var(--muted); letter-spacing: 0.18em; }
.menu { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.menu a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  white-space: nowrap;
}
.menu a:hover, .menu a.on { color: var(--cyan); background: rgba(90, 210, 255, 0.08); }
.burger { display: none; margin-left: auto; background: none; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px; cursor: pointer; }
.burger svg { width: 22px; height: 22px; display: block; }

/* ── ОБЩИЕ БЛОКИ ── */
section { padding: 64px 0 8px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 14px; }
h1 { font-size: clamp(30px, 6vw, 54px); letter-spacing: -0.01em; }
h2 { font-size: clamp(23px, 4vw, 34px); }
h3 { font-size: 18px; }
p { margin: 0 0 14px; color: #c3d3e6; }
.lead { font-size: clamp(16px, 2.4vw, 19px); color: #cddced; max-width: 70ch; }
.muted { color: var(--muted); }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cyan); border: 1px solid var(--cyan-dim);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 16px;
}
.tag svg { width: 14px; height: 14px; }

/* ── ГЕРОЙ ── */
.hero { padding-top: 42px; }
.hero-grid { display: grid; gap: 26px; grid-template-columns: 1.05fr 0.95fr; align-items: center; }
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; display: block; }
.btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 12px; text-decoration: none;
  font-weight: 600; border: 1px solid transparent; min-height: 48px;
}
.btn svg { width: 20px; height: 20px; }
.btn-main { background: linear-gradient(135deg, #2aa5d8, #1d7fb0); color: #06121b; }
.btn-main:hover { filter: brightness(1.12); }
.btn-ghost { border-color: var(--line); color: var(--text); background: rgba(255,255,255,0.02); }
.btn-ghost:hover { border-color: var(--cyan-dim); color: var(--cyan); }

/* ── КАРТОЧКИ ── */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card h3 { display: flex; align-items: center; gap: 10px; }
.card h3 svg { width: 26px; height: 26px; flex: none; }
.card p { margin: 0; font-size: 15px; color: #b8c9dd; }

/* ── ГАЛЕРЕЯ СКРИНШОТОВ ── */
.shots { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--bg-soft); }
figure img { width: 100%; height: auto; display: block; aspect-ratio: 16/9; object-fit: cover; }
figcaption { padding: 10px 14px; font-size: 13px; color: var(--muted); }

/* ── ТАБЛИЦА ФАКТОВ ── */
.facts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 22px 0; }
.fact { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: rgba(13,20,32,0.6); }
.fact b { display: block; font-size: clamp(20px, 3.4vw, 26px); color: var(--cyan); }
.fact span { font-size: 13px; color: var(--muted); }

/* ── ЛОР ── */
.lore { border-left: 2px solid var(--mars); padding-left: 18px; }
.lore h3 { color: var(--mars-soft); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 1px solid var(--line); }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 7px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--mars);
}
.timeline b { color: var(--cyan); }

/* ── ФОРМА ── */
form { display: grid; gap: 12px; max-width: 620px; }
label { font-size: 14px; color: var(--muted); }
input, textarea {
  width: 100%; padding: 13px 14px; min-height: 48px;
  background: rgba(8, 13, 21, 0.9); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; font: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--cyan-dim); }
textarea { min-height: 130px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-msg { font-size: 14px; min-height: 22px; }
.form-msg.ok { color: var(--green); }
.form-msg.err { color: #ff8f7a; }

/* ── ПОДВАЛ ── */
footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 26px 0 40px; color: var(--muted); font-size: 14px; }
footer a { color: var(--cyan-dim); display: inline-block; padding: 8px 2px; min-height: 40px; }
footer p { margin: 0 0 6px; }

/* ── АДАПТИВ: телефон в приоритете ── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .menu {
    position: fixed; inset: 56px 0 auto 0; flex-direction: column; gap: 0;
    background: rgba(7, 11, 18, 0.97); border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px; display: none;
  }
  .menu.open { display: flex; }
  .menu a { padding: 14px 8px; font-size: 16px; border-bottom: 1px solid rgba(31,52,80,0.5); }
  .burger { display: block; }
  section { padding: 44px 0 4px; }
}

/* Экономия батареи и уважение к настройке «меньше движения». */
@media (prefers-reduced-motion: reduce) {
  #space canvas { transform: none !important; }
  .fade { opacity: 1 !important; transform: none !important; }
}

/* Плавное появление блоков при прокрутке (IntersectionObserver добавляет .in). */
.fade { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.fade.in { opacity: 1; transform: none; }
