/* ==========================================================================
   Светлана Кривенко, лендинг
   Mobile first. Палитра: шалфей и лаванда (любимые цвета Светланы),
   без жёлтого и оранжевого. Шрифты свои, без внешних CDN.
   ========================================================================== */

/* ---------- Шрифты (подмножества: кириллица, латиница, типографика) ---------- */
@font-face {
  font-family: "Literata";
  src: url("../fonts/literata-var.woff2") format("woff2");
  font-weight: 400 560;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("../fonts/literata-italic-var.woff2") format("woff2");
  font-weight: 380 460;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-var.woff2") format("woff2");
  font-weight: 380 650;
  font-style: normal;
  font-display: swap;
}

/* ---------- Токены ---------- */
:root {
  /* Нейтрали, тонированные в зелёный */
  --paper: #F6F7F3;
  --line: #D5DBD3;
  --ink-900: #1C2620;
  --ink-700: #34403A;
  --ink-500: #56625B;

  /* Шалфей: действия и полосы */
  --sage-100: #E6EDE4;
  --sage-700: #3B5745;
  --sage-800: #2D4536;
  --sage-900: #22362A;

  /* Лаванда: голос клиента, словарь, номера шагов */
  --lav-100: #ECE7F4;
  --lav-300: #CBC0E3;
  --lav-700: #57478A;

  --font-serif: "Literata", Georgia, "Times New Roman", serif;
  --font-sans: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 48px);
  --maxw: 1200px;
  --section-y: clamp(64px, 9vw, 120px);
  --gap-cols: clamp(40px, 6vw, 96px);
  --radius-photo: 14px;
  --header-h: 60px;
}

/* ---------- База ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-700);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

h1, h2, h3 { margin: 0; color: var(--ink-900); }
h1, h2 {
  font-family: var(--font-serif);
  font-weight: 460;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.75rem, 1.25rem + 2.1vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.012em;
}
h3 {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
}

a { color: var(--sage-800); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

ul[role="list"],
ol[role="list"] { list-style: none; margin: 0; padding: 0; }

::selection { background: var(--lav-300); color: var(--ink-900); }

:focus-visible {
  outline: 3px solid var(--lav-700);
  outline-offset: 3px;
  border-radius: 6px;
}

[id] { scroll-margin-top: 16px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink-900);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}

.section { padding-block: var(--section-y); }

figcaption {
  margin-top: 10px;
  text-wrap: balance;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-500);
}

.icon { width: 1em; height: 1em; }

/* Маркер списков: два пересекающихся круга, как на фавиконке */
.rules li::before,
.terms li::before,
.topics li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.1em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sage-700);
  box-shadow: 6px 0 0 var(--lav-300);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 52px;
  min-width: 0;
  padding: 0.75em 1.35em;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 560;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn .icon { width: 1.25em; height: 1.25em; flex: none; }
.btn-primary { background: var(--sage-700); color: #fff; }
.btn-primary:hover { background: var(--sage-800); }
.btn-secondary { background: transparent; border-color: var(--sage-700); color: var(--sage-800); }
.btn-secondary:hover { background: var(--sage-100); }
.btn-small { min-height: 42px; padding: 0.5em 1.1em; font-size: 0.9375rem; }

.cta-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}
.cta-group .btn { padding-inline: 1em; }
.cta-group .btn-primary { grid-column: 1 / -1; }

/* ---------- Шапка ---------- */
.site-header {
  position: relative;
  z-index: 30;
  background: var(--paper);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
}
.brand {
  display: flex;
  flex-direction: column;
  margin-right: auto;
  padding-block: 6px;
  color: var(--ink-900);
  text-decoration: none;
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.005em;
}
.brand-role {
  margin-top: 1px;
  font-size: 0.8125rem;
  line-height: 1.2;
  color: var(--ink-500);
}
.header-cta { display: none; }
.menu-toggle { display: none; }

/* Без JS меню остаётся строкой ссылок под именем */
.nav { order: 3; width: 100%; overflow-x: auto; }
.nav ul { display: flex; gap: 18px; margin: 0; padding: 0 0 10px; list-style: none; white-space: nowrap; }
.nav a { color: var(--ink-700); font-size: 0.9375rem; text-decoration: none; }
.nav a:hover { color: var(--sage-800); text-decoration: underline; }

/* С JS: раскрывающаяся панель */
.js .menu-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-900);
  font: 500 0.9375rem/1 var(--font-sans);
  cursor: pointer;
}
.js .menu-toggle[aria-expanded="true"] { border-color: var(--sage-700); }
.js .nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  width: auto;
  overflow: visible;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 30px -24px rgba(28, 38, 32, 0.45);
}
.js .nav-open .nav { display: block; }
.js .nav ul { flex-direction: column; gap: 0; padding: 4px var(--gutter) 18px; white-space: normal; }
.js .nav a { display: block; padding: 13px 0; font-size: 1.125rem; border-bottom: 1px solid var(--line); }

/* ---------- Первый экран ---------- */
.hero { padding-bottom: 0; }
.hero-grid { display: grid; gap: 22px; }

.hero-photo {
  position: relative;
  order: -1;
  margin-inline: calc(-1 * var(--gutter));
}
.hero-photo img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: 50% 40%;
}
.hero-photo figcaption {
  position: absolute;
  left: var(--gutter);
  bottom: 12px;
  margin: 0;
  max-width: calc(100% - 2 * var(--gutter));
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(246, 247, 243, 0.92);
  color: var(--ink-700);
  font-size: 0.8125rem;
}

.hero-text h1 {
  font-size: clamp(2.125rem, 1.4rem + 3.1vw, 3.75rem);
  line-height: 1.06;
  font-weight: 450;
  letter-spacing: -0.018em;
}
.lead {
  margin-top: 16px;
  max-width: 34em;
  font-size: clamp(1.125rem, 1.02rem + 0.45vw, 1.3125rem);
  line-height: 1.5;
  color: var(--ink-700);
}
.hero-format {
  margin-top: 12px;
  max-width: 36em;
  font-weight: 500;
  color: var(--ink-900);
}
.cta-note {
  margin-top: 14px;
  font-size: 0.9375rem;
  color: var(--ink-500);
}

/* ---------- Ситуации родителей ---------- */
.situations-grid { display: grid; gap: 28px; }
.section-head p { margin-top: 14px; max-width: 34em; color: var(--ink-500); }

.voices { border-top: 1px solid var(--line); }
.voices li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1875rem, 1.05rem + 0.7vw, 1.5rem);
  line-height: 1.38;
  color: var(--ink-900);
}
.situations-answer {
  max-width: 40em;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}

/* ---------- Словарь подростка ---------- */
.dictionary { background: var(--lav-100); }
.dictionary-head { max-width: 40em; }
.dictionary-head p { margin-top: 14px; font-size: 1.125rem; }

.dict { margin: clamp(28px, 4vw, 48px) 0 0; }
.dict-row { padding: 22px 0; border-top: 1px solid var(--lav-300); }
.dict-row:last-child { border-bottom: 1px solid var(--lav-300); }
.dict dt {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.625rem, 1.2rem + 1.9vw, 2.625rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}
.dict dd {
  max-width: 30em;
  margin: 12px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--lav-700);
  font-size: 1.0625rem;
  line-height: 1.55;
}
.dictionary-outro {
  max-width: 38em;
  margin-top: clamp(24px, 3vw, 40px);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  color: var(--ink-900);
}

/* ---------- Этапы работы ---------- */
.process-grid { display: grid; gap: 36px; }
.process-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-photo);
}
.steps { margin-top: 28px; counter-reset: step; }
.steps li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  padding-top: 1px;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--lav-700);
}
.steps h3,
.steps p { grid-column: 2; }
.steps p { margin-top: 6px; }
.note {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 10px;
  background: var(--sage-100);
}
.note strong { font-weight: 600; color: var(--ink-900); }

/* ---------- Конфиденциальность ---------- */
.privacy { padding-top: 0; }
.privacy-grid {
  display: grid;
  gap: 22px;
  padding-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line);
}
.privacy-grid p { margin-top: 14px; max-width: 34em; }
.rules li,
.terms li {
  position: relative;
  padding: 14px 0 14px 30px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Форматы ---------- */
.formats { background: var(--sage-100); }
.formats-head { max-width: 40em; }
.formats-head p { margin-top: 14px; }
.formats-grid { display: grid; gap: 36px; margin-top: clamp(28px, 4vw, 48px); }
.format img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-photo);
}
.format:first-child img { object-position: 50% 62%; }
.format:last-child img { object-position: 50% 28%; }
.format h3 { margin-top: 18px; font-size: 1.25rem; }
.format p { margin-top: 8px; max-width: 30em; }

/* ---------- Взрослым ---------- */
.adults-grid { display: grid; gap: 32px; }
.adults-photo { order: -1; }
.adults-photo img,
.about-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: var(--radius-photo);
}
.adults-lead {
  margin-top: 16px;
  max-width: 36em;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}
.voices-small { margin-top: 22px; }
.voices-small li { padding: 12px 0; font-size: clamp(1.125rem, 1.02rem + 0.5vw, 1.3125rem); }
.adults-content h3 { margin-top: 32px; }
.topics { display: grid; column-gap: 32px; margin-top: 12px; }
.topics li {
  position: relative;
  padding: 11px 0 11px 30px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Обо мне ---------- */
.about { padding-top: 0; }
.about-grid {
  display: grid;
  gap: 32px;
  padding-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line);
}
.about-content h2 { margin-bottom: 18px; }
.about-content h3 { margin-top: 32px; }
.timeline { margin-top: 12px; border-top: 1px solid var(--line); }
.timeline li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.timeline .year {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--lav-700);
  font-variant-numeric: lining-nums tabular-nums;
}
.about-note { margin-top: 18px; font-weight: 500; color: var(--ink-900); }

/* ---------- Стоимость ---------- */
.price { background: var(--sage-100); }
.price-grid { display: grid; gap: 28px; }
.price-figure {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 20px 0 10px;
}
.price-sum {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 2rem + 3vw, 4rem);
  font-weight: 460;
  line-height: 1;
  color: var(--ink-900);
  font-variant-numeric: lining-nums;
}
.price-unit { font-size: 1.125rem; color: var(--ink-700); }
.price-terms .terms { border-top: 1px solid var(--line); }
.price-terms .btn { width: 100%; margin-top: 24px; }

/* ---------- Вопросы ---------- */
.faq-grid { display: grid; gap: 24px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 16px 0;
  list-style: none;
  cursor: pointer;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-900);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--sage-700);
  background:
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
  transition: transform 0.2s ease;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list summary:hover { color: var(--sage-800); }
.faq-list details p { max-width: 40em; margin: 0; padding: 0 0 20px; }

/* ---------- Контакты ---------- */
.contacts { background: var(--lav-100); }
.contacts-grid { display: grid; gap: 20px; }
.contacts-photo img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 18px;
}
.contacts-content p { margin-top: 12px; max-width: 34em; }
.contacts-phone { margin-top: 20px; }
.contacts-phone a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 560;
  color: var(--ink-900);
}
.contacts-phone .icon { width: 1.15em; height: 1.15em; }

/* ---------- Подвал ---------- */
.site-footer {
  padding-block: clamp(48px, 7vw, 80px);
  padding-bottom: calc(clamp(48px, 7vw, 80px) + env(safe-area-inset-bottom));
  background: var(--sage-900);
  color: #D9E3D9;
  font-size: 0.9375rem;
}
.footer-grid { display: grid; gap: 28px; }
.footer-brand {
  margin-bottom: 8px;
  font-family: var(--font-serif);
  font-size: 1.375rem;
  color: #fff;
}
.site-footer a { color: #fff; }
.site-footer strong { color: #fff; font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.footer-links a { display: inline-block; padding: 6px 0; }
.footer-notes p { margin: 0 0 8px; }

/* ---------- Липкая панель на телефоне ---------- */
.mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 10px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(246, 247, 243, 0.96);
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  backdrop-filter: saturate(1.2) blur(8px);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0s linear 0.25s;
}
.mobile-cta.is-visible {
  transform: none;
  visibility: visible;
  transition: transform 0.25s ease;
}
.mobile-cta .btn { min-height: 48px; padding-inline: 0.9em; }

/* ==========================================================================
   Планшет и больше
   ========================================================================== */
@media (min-width: 560px) {
  .price-terms .btn { width: auto; }
  .cta-group { display: flex; flex-wrap: wrap; }
  .cta-group .btn { padding-inline: 1.35em; }
  .topics { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 700px) {
  .formats-grid { grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); }
}

@media (min-width: 860px) {
  :root { --header-h: 68px; }
  body { font-size: 1.125rem; }
  [id] { scroll-margin-top: calc(var(--header-h) + 20px); }

  .site-header { position: sticky; top: 0; }
  .site-header.is-scrolled { box-shadow: 0 1px 0 var(--line); }
  .header-inner { flex-wrap: nowrap; gap: 20px; }
  .header-cta { display: inline-flex; }
  .mobile-cta { display: none; }

  .hero { padding-top: clamp(28px, 4vw, 64px); }
  .hero-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(40px, 5vw, 88px);
    align-items: center;
  }
  .hero-photo { order: 0; margin: 0; }
  .hero-photo img {
    aspect-ratio: 4 / 5;
    max-height: min(78vh, 720px);
    object-position: 50% 22%;
    border-radius: var(--radius-photo);
  }
  .hero-photo figcaption {
    position: static;
    max-width: none;
    margin-top: 12px;
    padding: 0;
    background: none;
    color: var(--ink-500);
    font-size: 0.875rem;
  }

  .situations-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--gap-cols);
    row-gap: 40px;
    align-items: start;
  }
  .situations-grid .section-head { position: sticky; top: calc(var(--header-h) + 32px); }
  .voices,
  .situations-answer { grid-column: 2; }

  .dict-row {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: clamp(32px, 5vw, 72px);
    align-items: baseline;
    padding: 30px 0;
  }
  .dict dd { margin: 0; padding-left: 20px; }

  .process-grid,
  .privacy-grid,
  .about-grid,
  .price-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--gap-cols);
    align-items: start;
  }
  .process-photo,
  .about-photo,
  .adults-photo { position: sticky; top: calc(var(--header-h) + 32px); }
  .rules { border-top: 1px solid var(--line); }

  .adults-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: var(--gap-cols);
    align-items: start;
  }
  .adults-photo { order: 0; }
  .adults-photo img,
  .about-photo img { aspect-ratio: 4 / 5; object-position: 50% 25%; }

  .price-grid { align-items: end; }

  .faq-grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: var(--gap-cols);
    align-items: start;
  }

  .contacts-grid {
    grid-template-columns: 300px minmax(0, 1fr);
    column-gap: clamp(40px, 6vw, 88px);
    align-items: center;
  }
  .contacts-photo img { width: 300px; height: 300px; border-radius: var(--radius-photo); }

  .footer-grid { grid-template-columns: 1.3fr 1fr 1.4fr; }
  .footer-links { flex-direction: column; gap: 2px; }
}

/* Полное меню в строку, когда хватает ширины */
@media (min-width: 1140px) {
  .js .menu-toggle { display: none; }
  .nav,
  .js .nav {
    position: static;
    order: 0;
    display: block;
    width: auto;
    overflow: visible;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .nav ul,
  .js .nav ul { flex-direction: row; gap: 24px; padding: 0; white-space: nowrap; }
  .nav a,
  .js .nav a { padding: 6px 0; font-size: 0.9375rem; border: 0; }
}

/* ---------- Одно движение: мягкое появление текста первого экрана ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-text .lead,
  .hero-text .hero-format,
  .hero-text .cta-group,
  .hero-text .cta-note { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-text .hero-format { animation-delay: 0.07s; }
  .hero-text .cta-group { animation-delay: 0.14s; }
  .hero-text .cta-note { animation-delay: 0.21s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
