/* ============================================================
   Своя Вселенная - дизайн-система
   Тёмная «обсерваторская» тема: глубокий синий графит,
   золотой акцент, приглушённый голубой, статичные звёзды.
   ============================================================ */
:root {
  --bg: #060a14;
  --bg-soft: #0b1120;
  --bg-card: #0e1526;
  --bg-card-hover: #121a30;
  --text: #e9edf6;
  --text-muted: #9aa7bf;
  --text-faint: #6d7994;
  --gold: #d9a852;
  --gold-soft: rgba(217, 168, 82, 0.14);
  --blue: #7aa2ff;
  --blue-soft: rgba(122, 162, 255, 0.12);
  --line: rgba(233, 237, 246, 0.09);
  --line-strong: rgba(233, 237, 246, 0.16);
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --container: 1140px;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Jost", "Golos Text", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

/* Статичный звёздный фон: чистый CSS, без анимации и без JS */
.stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 12%, rgba(255,255,255,0.75), transparent 60%),
    radial-gradient(1px 1px at 22% 34%, rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 35% 8%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1px 1px at 48% 22%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(2px 2px at 63% 10%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1px 1px at 74% 30%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 86% 16%, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(1px 1px at 94% 42%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(1px 1px at 12% 52%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 30% 66%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1px 1px at 55% 48%, rgba(255,255,255,0.3), transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 62%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1px 1px at 88% 72%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(1px 1px at 6% 84%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 40% 90%, rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(1px 1px at 78% 88%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(1px 1px at 18% 26%, rgba(122,162,255,0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 58% 78%, rgba(217,168,82,0.45), transparent 60%);
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  margin: 0 0 0.6em;
}

p { margin: 0 0 1em; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Фокус-стейты: видимые и контрастные */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: #14100a;
  padding: 10px 18px;
  font-weight: 700;
  z-index: 100;
  border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus { left: 0; text-decoration: none; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 10, 20, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.logo:hover { text-decoration: none; }
.logo svg { flex: none; }

.main-nav { margin-left: auto; }
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.main-nav a:hover {
  color: var(--text);
  background: rgba(233, 237, 246, 0.06);
  text-decoration: none;
}

/* Пункт Telegram в меню - визуально выделен среди обычных ссылок */
.main-nav a.nav-link-telegram {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid rgba(122, 162, 255, 0.28);
}
.main-nav a.nav-link-telegram svg,
.main-nav a.nav-link-telegram i { flex: none; font-size: 14px; }
.main-nav a.nav-link-telegram:hover {
  color: var(--text);
  background: rgba(122, 162, 255, 0.22);
  border-color: rgba(122, 162, 255, 0.45);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--gold);
  color: #17110a;
}
.btn-primary:hover {
  background: #e6bb6a;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-header { padding: 10px 20px; font-size: 15px; }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(56px, 9vw, 110px) 0 clamp(48px, 7vw, 88px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(217, 168, 82, 0.28);
  border-radius: 999px;
}

.hero h1 {
  font-size: clamp(31px, 4.6vw, 54px);
  font-weight: 600;
}

.hero h1 .accent { color: var(--gold); }

.lead {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--text-muted);
  max-width: 34em;
  margin-bottom: 30px;
}

/* ---------- Форма выбора даты ---------- */
.date-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  width: 100%;
  min-width: 0;
}

.date-form .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 220px;
  min-width: 0;
}

.date-form label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.date-form input[type="date"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  transition: border-color 0.2s ease;
}
.date-form input[type="date"]:hover { border-color: rgba(233, 237, 246, 0.3); }
.date-form input[type="date"]:focus { border-color: var(--gold); outline: none; }

.form-note {
  flex-basis: 100%;
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--text-faint);
}
.date-form .field.has-error input[type="date"] { border-color: #ff8c7e; }
.form-note.is-error { color: #ff8c7e; }

/* ---------- Экран загрузки (async-запрос при отправке даты) ---------- */
.loading-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 10, 20, 0.94);
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
  padding: 24px;
}
.loading-overlay.is-active { opacity: 1; visibility: visible; }
.loading-overlay-inner { text-align: center; max-width: 420px; }
.loading-spinner {
  width: 46px; height: 46px; margin: 0 auto 26px;
  border-radius: 50%; border: 2px solid rgba(233, 237, 246, 0.15); border-top-color: var(--gold);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-phrase { color: var(--text-muted); font-size: 15px; min-height: 22px; transition: opacity 0.18s; }
.loading-phrase.is-fading { opacity: 0; }
.overloaded-panel { display: none; }
.overloaded-panel.is-visible { display: block; }
.overloaded-panel .icon {
  width: 46px; height: 46px; margin: 0 auto 20px; border-radius: 50%;
  background: var(--gold-soft); border: 1px solid rgba(217, 168, 82, 0.35);
  display: flex; align-items: center; justify-content: center; color: var(--gold); font-family: var(--font-display); font-weight: 700; font-size: 19px;
}
.overloaded-panel h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.overloaded-panel p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin-bottom: 22px; }
.overloaded-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .loading-spinner { animation: none; border-top-color: rgba(233,237,246,.15); } }

/* Визуал hero: статичная SVG-композиция */
.hero-visual {
  position: relative;
  aspect-ratio: 1;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}
.hero-visual svg { width: 100%; height: auto; }

/* ---------- Секции ---------- */
.section { padding: clamp(52px, 8vw, 96px) 0; }
.section + .section { border-top: 1px solid var(--line); }

.section-head {
  max-width: 640px;
  margin-bottom: clamp(32px, 4vw, 52px);
}
.section-head h2 { font-size: clamp(25px, 3.2vw, 38px); }
.section-head p { color: var(--text-muted); margin-bottom: 0; }

/* ---------- Как это работает ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 28px;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.step:hover {
  border-color: rgba(217, 168, 82, 0.4);
  background: var(--bg-card-hover);
}

.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(217, 168, 82, 0.25);
  border-radius: 14px;
}

.step h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 8px;
}
.step h3 .step-num { color: var(--gold); margin-right: 8px; }
.step p { color: var(--text-muted); font-size: 15px; margin: 0; }

/* ---------- Редакторский блок ---------- */
.editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.editorial-text p { color: var(--text-muted); }

.editorial-figures {
  display: grid;
  gap: 20px;
}

.figure-card {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
}
.figure-card svg { width: 100%; height: auto; }
.figure-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.figure-card figcaption {
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-faint);
  border-top: 1px solid var(--line);
}

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 12px; max-width: 780px; }

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  transition: border-color 0.25s ease;
}
.faq-item[open] { border-color: rgba(217, 168, 82, 0.35); }

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}
.faq-item[open] summary::after { transform: rotate(225deg); }
.faq-item summary:hover { color: var(--gold); }

.faq-answer {
  padding: 0 24px 22px;
  color: var(--text-muted);
}
.faq-answer p { margin: 0; }

/* ---------- Примеры дат ---------- */
.dates-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.date-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  color: var(--text);
  transition: border-color 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
}
.date-card:hover {
  text-decoration: none;
  border-color: rgba(217, 168, 82, 0.45);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}

.date-card .thumb {
  display: block;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}
.date-card .thumb svg { width: 100%; height: 100%; }
.date-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.date-card:hover .thumb img { transform: scale(1.05); }

.date-card .card-body { display: block; padding: 18px 22px 20px; }

.date-card .card-date {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.date-card .card-title {
  display: block;
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.date-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
}
.date-card:hover .card-link { color: var(--gold); }

/* ---------- Источник и перевод ---------- */
.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.source-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 30px;
}
.source-card h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 600;
}
.source-card h3 svg { color: var(--gold); flex: none; }
.source-card p { color: var(--text-muted); font-size: 15px; margin: 0; }
.source-card p + p { margin-top: 10px; }

/* ---------- Telegram ---------- */
.telegram {
  background: linear-gradient(135deg, rgba(122, 162, 255, 0.1), rgba(217, 168, 82, 0.07));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  padding: clamp(28px, 5vw, 52px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
}

.telegram-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  font-size: 32px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid rgba(122, 162, 255, 0.3);
  border-radius: 20px;
  flex: none;
}

.telegram h2 { font-size: clamp(22px, 2.6vw, 28px); margin-bottom: 8px; }
.telegram p { color: var(--text-muted); margin: 0; max-width: 40em; }

/* ---------- Финальный CTA ---------- */
.final-cta { text-align: center; }
.final-cta h2 { font-size: clamp(25px, 3.2vw, 38px); }
.final-cta p { color: var(--text-muted); max-width: 36em; margin: 0 auto 30px; }
.final-cta .date-form { max-width: 560px; margin: 0 auto; text-align: left; }

/* ---------- Футер ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  background: var(--bg-soft);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: center;
  justify-content: space-between;
}
.footer-disclaimer {
  flex: 1 1 420px;
  font-size: 14px;
  color: var(--text-faint);
  margin: 0;
}
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-nav a { font-size: 14px; color: var(--text-muted); }
.footer-nav a:hover { color: var(--text); }
.footer-copy {
  flex-basis: 100%;
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-faint);
}
/* ---------- Появление блоков при скролле ----------
   Класс .reveal добавляется только из JS и только если
   пользователь не просил reduced motion. Без JS контент
   виден сразу, ничего не скрыто и не анимировано. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
  .hero-grid,
  .editorial-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { max-width: 380px; order: -1; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .dates-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-grid { grid-template-columns: minmax(0, 1fr); }
  .telegram { grid-template-columns: auto 1fr; }
  .telegram .btn { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  /* Форма выбора даты в колонку: на iOS Safari растягивание поля даты
     через flex-grow работает ненадёжно (известная особенность WebKit
     с input type="date"), а блочная ширина 100% - однозначна и стабильна. */
  .date-form {
    flex-direction: column;
    align-items: stretch;
  }
  .date-form .field {
    flex: 1 1 auto;
    width: 100%;
  }
  .date-form input[type="date"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .date-form .btn {
    width: 100%;
    justify-content: center;
  }

  /* На мобильном декоративная планета только отнимает место над формой -
     убираем её полностью, оставляем заголовок и форму. */
  .hero-visual {
    display: none;
  }

  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line-strong);
    padding: 12px 24px 20px;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
  .main-nav a { display: block; padding: 12px 14px; font-size: 16px; }

  .header-cta { display: none; }

  .dates-grid { grid-template-columns: minmax(0, 1fr); }
  .telegram { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .date-form .btn { width: 100%; }
}
/* ---------- Общие хелперы (используются в т.ч. на странице результата) ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.btn[disabled],
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-primary[disabled]:hover,
.btn-primary:disabled:hover {
  background: var(--gold);
  transform: none;
}
.btn-ghost[disabled]:hover,
.btn-ghost:disabled:hover {
  border-color: var(--line-strong);
  color: var(--text);
}
