/* Стили лендинга Ephemra. Один файл на все страницы: копии CSS в трёх
   документах разъезжаются при первой же правке — на этом проект уже горел.
   Палитра светлых токенов — из макета Mini App (docs/design/mockup-form-v2.html),
   золото — цвет стихии воздуха из палитры рендера, тот же, что на лучах
   космограммы. */

/* Палитра продукта: светлые токены — из макета Mini App (docs/design/mockup-form-v2.html),
   золото — цвет стихии воздуха из палитры рендера, тот же, что на лучах космограммы. */
:root {
  --night: #0F1322;
  --night-soft: #1B2138;
  --gold: #C79A2E;
  --gold-light: #E8C368;
  --paper: #F4F1E9;
  --bg: #F2F3F7;
  --card: #FFFFFF;
  --text: #17212B;
  --muted: #5E6875;
  --faint: #8A94A0;
  --accent: #2481CC;
  --line: #E9EBF0;
  --radius: 14px;
  --wrap: 68rem;
}

* { 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-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }

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

/* --- Шапка и первый экран ---------------------------------------------------- */

.top {
  background: linear-gradient(160deg, var(--night) 0%, var(--night-soft) 100%);
  color: var(--paper);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.2px; }
/* На внутренних страницах логотип — ссылка домой, но выглядеть должен логотипом,
   а не синей ссылкой посреди тёмной шапки */
a.brand { color: inherit; text-decoration: none; }
.brand img { width: 28px; height: 28px; }

.nav-links { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.nav-links a { color: #C2C9D8; text-decoration: none; font-size: 15px; }
.nav-links a:hover { color: var(--paper); }

/* На узком экране прячем только якоря: до своего раздела человек и так
   долистает. А ссылки на соседние страницы прятать нельзя — иначе попасть
   на них с телефона можно было только из подвала, в конце длинной страницы. */
@media (max-width: 640px) {
  .nav { flex-wrap: wrap; gap: 10px 14px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 14px; }
  .nav-links .nav-anchor { display: none; }
}

.hero { padding: 40px 0 72px; text-align: center; }

.hero-mark { width: 96px; height: 96px; margin: 0 auto 26px; }

h1 { margin: 0; font-weight: 700; }
.wordmark {
  display: block;
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.5px;
}
.tagline {
  display: block;
  margin-top: 18px;
  font-size: clamp(1.15rem, 3.6vw, 1.6rem);
  font-weight: 600;
  color: var(--gold-light);
}

.h1-sub {
  display: block;
  margin-top: 16px;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  font-weight: 400;
  color: #C2C9D8;
}

.lead {
  max-width: 40rem;
  margin: 22px auto 0;
  color: #C2C9D8;
  font-size: clamp(1rem, 2.4vw, 1.12rem);
}

.cta-row { margin-top: 32px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

.button {
  display: inline-block;
  padding: 15px 34px;
  border-radius: 999px;
  background: var(--gold);
  color: #24190A;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  transition: background 0.15s ease;
}
.button:hover { background: var(--gold-light); }
.button.ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(244, 241, 233, 0.35);
}
.button.ghost:hover { background: rgba(244, 241, 233, 0.08); }

.free-note { font-size: 0.95rem; color: #9AA4B8; }

/* --- Секции ------------------------------------------------------------------- */

section { padding: 68px 0; }
section + section { border-top: 1px solid var(--line); }

h2 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 4.4vw, 2.05rem);
  line-height: 1.2;
  letter-spacing: -0.2px;
}

.section-lead { max-width: 42rem; margin: 0 0 34px; color: var(--muted); }

p { margin: 0 0 16px; }
.prose { max-width: 42rem; }
.prose p:last-child { margin-bottom: 0; }

/* --- «Откуда берутся числа» --------------------------------------------------- */

/* На широком экране колонка текста и врезка стоят рядом: одна узкая колонка
   посреди пустой страницы выглядит недоделанной вёрсткой, а не воздухом */
.split { display: grid; gap: 28px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) {
  .split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; }
  .split .prose { max-width: none; }
  .split .under { margin-top: 0; }
}

.under {
  margin: 32px 0 0;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 42rem;
}
.under h3 { margin: 0 0 12px; font-size: 0.85rem; text-transform: uppercase;
             letter-spacing: 0.08em; color: var(--faint); }
.under ul { margin: 0; padding-left: 20px; color: var(--muted); }
.under li { margin-bottom: 7px; }
.under li:last-child { margin-bottom: 0; }

/* --- «Что вы получаете» ------------------------------------------------------- */

.cards { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.card h3 { margin: 0 0 10px; font-size: 1.25rem; }
.card p { color: var(--muted); }
.card figure { margin: 18px 0 0; }
.card img { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.card figcaption { margin-top: 10px; font-size: 0.85rem; color: var(--faint); }

.extra-shot { margin: 24px auto 0; max-width: 34rem; text-align: center; }
.extra-shot img { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.extra-shot figcaption { margin-top: 12px; font-size: 0.9rem; color: var(--muted); }

/* --- Шаги --------------------------------------------------------------------- */

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0;
         display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--night);
  color: var(--gold-light);
  font-weight: 700;
}
.steps h3 { margin: 0 0 8px; font-size: 1.1rem; }
.steps p { color: var(--muted); margin: 0; }

/* --- Вопросы ------------------------------------------------------------------ */

.faq { max-width: 46rem; }
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 22px;
  margin-bottom: 12px;
}
.faq summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--faint);
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); margin: 0 0 16px; }

/* --- Финальный призыв и подвал ------------------------------------------------ */

.closing { background: var(--night); color: var(--paper); text-align: center; }
.closing h2 { color: var(--paper); }
.closing p { color: #C2C9D8; max-width: 34rem; margin-left: auto; margin-right: auto; }

.foot { background: var(--night); color: #8F9AB0; padding: 0 0 40px; font-size: 0.92rem; }
.foot-inner {
  border-top: 1px solid rgba(244, 241, 233, 0.12);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  align-items: center;
  justify-content: space-between;
}
.foot a { color: #C2C9D8; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot-links { display: flex; flex-wrap: wrap; gap: 12px 22px; }

/* --- Внутренние страницы: метод и глоссарий --------------------------------- */

/* Шапка на внутренних страницах короткая: первый экран занимает не картинка,
   а сразу заголовок и объяснение — человек пришёл читать, а не любоваться */
.page-head { padding: 34px 0 44px; }
.page-head h1 {
  font-size: clamp(1.9rem, 5.2vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.4px;
  max-width: 24ch;
}
.page-head .lead { margin-left: 0; margin-right: 0; text-align: left; max-width: 44rem; }

.crumbs { padding: 16px 0 0; font-size: 0.9rem; color: #8F9AB0; }
.crumbs a { color: #C2C9D8; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

article.page { padding: 56px 0 68px; }
article.page h2 {
  margin: 44px 0 14px;
  font-size: clamp(1.35rem, 3.8vw, 1.8rem);
}
article.page h2:first-of-type { margin-top: 0; }
article.page h3 { margin: 26px 0 8px; font-size: 1.1rem; }
article.page p,
article.page ul,
article.page ol { max-width: 44rem; }
article.page ul,
article.page ol { color: var(--muted); padding-left: 22px; }
article.page li { margin-bottom: 8px; }

/* Разобранный пример цепочки: моноширинный, чтобы стрелки стояли столбиком */
.chain {
  max-width: 44rem;
  margin: 18px 0;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text);
  overflow-x: auto;
}

.aside {
  max-width: 44rem;
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--accent-soft, #E7F1FA);
  border-radius: var(--radius);
  color: #1B4A70;
}
.aside p { margin: 0; }

figure.shot { max-width: 34rem; margin: 26px 0; }
figure.shot img { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
figure.shot figcaption { margin-top: 10px; font-size: 0.88rem; color: var(--faint); }

/* --- Глоссарий -------------------------------------------------------------- */

.terms { max-width: 46rem; margin: 0; }
.terms div {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.terms dt { font-weight: 700; margin-bottom: 6px; }
.terms dd { margin: 0; color: var(--muted); }
.terms dt .also { font-weight: 400; color: var(--faint); }

.cta-block {
  max-width: 44rem;
  margin: 44px 0 0;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cta-block h2 { margin: 0 0 8px; }
.cta-block p { color: var(--muted); }
.cta-block .button { background: var(--night); color: var(--paper); }
.cta-block .button:hover { background: var(--night-soft); }
