/* =====================================================================
 * ЕГЭ-Хаб — стили. Дизайн-система «Спокойный драйв» v1.0 (DESIGN.md).
 * Тихий по умолчанию, энергия в точках мотивации:
 * зелёный = бренд и рост, оранжевый = действие, золото = награда.
 * ===================================================================== */

:root {
  /* Поверхности и чернила */
  --bg: #fafaf8;
  --bg-elev: #ffffff;                     /* --surface */
  --bg-soft: #eef1ee;                     /* нейтральный трек */
  --surface-alt: #f2f8f5;                 /* мятная рабочая подложка */
  --fg: #14201a;                          /* --ink-900 */
  --fg-soft: #4a5a52;                     /* --ink-600 */
  --muted: #67766d;                       /* --ink-400, K: AA 4.58 */
  --border: rgba(20, 32, 26, .07);        /* --line, мягче — «бумажный» вид */

  /* Акценты */
  --accent: #1e6b4f;                      /* бренд, прогресс, «правильно» */
  --accent-strong: #155741;
  --accent-soft: #e7f2ed;
  --teal: #0f766e;                        /* вторичный: инфо, свежесть */

  /* Действие и награда */
  --cta: #bd5417;                         /* главный CTA — дозированно; K: AA 4.73 с белым */
  --cta-strong: #a3490f;
  --cta-soft: #fdeee2;
  --gold: #d9a441;                        /* XP, достижения (плашки) */
  --gold-text: #8a6218;                   /* K: текст на --gold-soft, AA 4.87 */
  --gold-soft: #faf1de;

  /* Градиенты энергии */
  --gradient-drive: linear-gradient(135deg, #1e6b4f 0%, #3a9d74 100%);
  --gradient-gold: linear-gradient(90deg, #d9a441, #e8bd6a);

  /* Форма и глубина */
  --radius: 12px;                         /* кнопки */
  --radius-card: 18px;                    /* карточки */
  --radius-input: 10px;
  --shadow: 0 1px 2px rgba(20,32,26,.05), 0 8px 24px rgba(20,32,26,.06);
  --shadow-lg: 0 2px 4px rgba(20,32,26,.06), 0 12px 32px rgba(20,32,26,.10);
  --transition: .24s cubic-bezier(.2, .8, .2, 1);

  /* Типографика: редакционная антиква на тёплой бумаге (референс Steep/Notion из Refero) */
  --font-serif: 'PT Serif', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.6;
}

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 780px; }
.accent { color: var(--accent); }

.skip-link {
  position: absolute; top: -60px; left: 12px; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 18px;
  border-radius: var(--radius); font-weight: 600; transition: top .25s;
}
.skip-link:focus { top: 12px; }

/* ============================ NAVBAR ============================ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250,250,248,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-mark {
  background: var(--gradient-drive); color: #fff; font-weight: 800;
  font-size: 14px; padding: 6px 10px; border-radius: 9px; letter-spacing: .02em;
}
.logo-text { font-weight: 800; font-size: 20px; color: var(--fg); letter-spacing: -.02em; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--fg-soft); text-decoration: none; font-weight: 500; font-size: 14px; transition: color var(--transition); }
.nav-links a:hover { color: var(--accent); }

.burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 5px; }
.burger span { display: block; width: 22px; height: 2px; background: var(--fg); border-radius: 2px; transition: var(--transition); }

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--radius); border: none;
  font-family: inherit; font-size: 15px; font-weight: 700; text-decoration: none;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--cta); color: #fff; }
.btn-primary:hover {
  background: var(--cta-strong); transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(224,115,42,.28), var(--shadow);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--fg); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn-block { width: 100%; }

/* «Дыхание» главного CTA — только в hero, очень мягкое */
@media (prefers-reduced-motion: no-preference) {
  .hero .btn-primary { animation: cta-breathe 2.4s ease-in-out infinite; }
}
@keyframes cta-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224,115,42,.22); }
  50%      { box-shadow: 0 0 0 8px rgba(224,115,42,0); }
}

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.badge-ok { background: var(--accent-soft); color: var(--accent-strong); }
.badge-soon { background: var(--bg-soft); color: var(--muted); }

/* ============================ HERO ============================ */
section[id] { scroll-margin-top: 88px; }

.hero { padding: 140px 0 96px; overflow: hidden; position: relative; }
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(2px); z-index: -1;
}
.hero::before {
  width: 560px; height: 560px; top: -180px; right: -140px;
  background: radial-gradient(circle, rgba(15,118,110,.08) 0%, rgba(15,118,110,0) 68%);
}
.hero::after {
  width: 420px; height: 420px; bottom: -160px; left: -160px;
  background: radial-gradient(circle, rgba(30,107,79,.07) 0%, rgba(30,107,79,0) 68%);
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 600;
  font-size: 13px; padding: 8px 16px; border-radius: 999px; margin-bottom: 24px;
}
/* Статичная точка-индикатор «набор открыт» (фаза 3: без пульса — §10.3) */
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(42px, 5.6vw, 66px); font-weight: 700; line-height: 1.12;
  letter-spacing: -.005em; margin: 0 0 24px;
  display: flex; flex-direction: column;
}
/* Маркер-подсветка «как в тетради» — золотом по ключевому слову */
.marker {
  background: linear-gradient(180deg,
    transparent 58%,
    rgba(217,164,65,.35) 58%,
    rgba(217,164,65,.35) 92%,
    transparent 92%);
  border-radius: 3px; padding: 0 .08em;
}
/* Фаза 3: сплошной акцент вместо градиентной заливки букв (§10.3, решение 12.09) */
.hero-title .grad { color: var(--accent); }
.hero-sub { font-size: 18px; color: var(--fg-soft); margin: 0 0 32px; max-width: 460px; }
.hero-actions { display: flex; gap: 14px; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 0; }
.hero-stat { display: flex; flex-direction: column; gap: 2px; padding: 0 28px; }
.hero-stat:first-child { padding-left: 0; }
.hero-stat + .hero-stat { border-left: 1px solid var(--border); }
.hero-stat-val {
  font-size: 34px; font-weight: 700; color: var(--accent);
  font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: -.02em;
}
.hero-stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }

/* --- Кластер справа: карточка + плавающие элементы + точечная сетка --- */
.hero-visual { position: relative; padding: 28px; }
.hero-visual::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(20,32,26,.10) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, #000 40%, transparent 100%);
}
.hero-card {
  position: relative;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 20px;
  padding: 24px; box-shadow: var(--shadow-lg);
}
.hero-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; font-size: 13px; color: var(--muted);
}
.hero-card-body { display: flex; gap: 24px; align-items: center; }
.hero-ring {
  width: 116px; height: 116px; flex: none; border-radius: 50%;
  background: conic-gradient(var(--accent) 0% 86%, var(--bg-soft) 86% 100%);
  display: grid; place-items: center;
}
.hero-ring-inner {
  width: 92px; height: 92px; border-radius: 50%; background: var(--bg-elev);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px var(--border);
}
.hero-ring-inner b {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 30px;
  font-weight: 700; color: var(--accent); line-height: 1;
}
.hero-ring-inner small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.hero-card-right { flex: 1; min-width: 0; }
.hero-score-row {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px;
  font-size: 14px; color: var(--fg-soft); font-weight: 500;
}
.hero-score {
  font-size: 26px; font-weight: 700; color: var(--accent);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.hero-score-bar { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.hero-score-fill { height: 100%; background: var(--gradient-drive); border-radius: 999px; }
.hero-score-meta {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
/* Серия дней и XP — награда золотом, дозированно */
.hero-streak {
  display: flex; gap: 8px; margin-top: 16px; padding-top: 16px;
  border-top: 1px dashed var(--border); flex-wrap: wrap;
}
.hero-streak-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold-soft); color: var(--fg-soft);
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
}
.hero-streak-item b {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 700;
  color: var(--gold-text);
}
/* Плавающие карточки: слабая тема + цель */
.hero-float {
  position: absolute; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px 16px;
}
.hero-float-topic {
  left: -12px; bottom: -4px; display: flex; flex-direction: column; gap: 6px;
  transform: rotate(-2deg); min-width: 190px;
}
.hero-float-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--cta-strong); font-weight: 700; }
.hero-float-name { font-size: 15px; font-weight: 700; }
.hero-float-bar { height: 5px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.hero-float-bar i { display: block; height: 100%; background: var(--gradient-gold); border-radius: 999px; }
.hero-float-note { font-size: 11px; color: var(--muted); }
.hero-float-chip {
  right: -6px; top: 6px; transform: rotate(2deg);
  font-size: 12.5px; font-weight: 600; color: var(--fg-soft);
}
.hero-float-chip b { color: var(--accent); }

/* ============================ MARQUEE ============================ */
.marquee {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--bg-elev); overflow: hidden; padding: 16px 24px;
}
.marquee-track {
  display: flex; gap: 40px; white-space: nowrap; align-items: center;
  animation: marquee 30s linear infinite;
  font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase;
}
.marquee-track .sep { color: var(--teal); opacity: .55; font-size: 11px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================ SECTIONS ============================ */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-elev); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 48px; }
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 42px); font-weight: 700;
  letter-spacing: -.005em; line-height: 1.18; margin: 0 0 12px;
}
.section-sub { font-size: 16px; color: var(--muted); margin: 0; }
/* Фаза 3: eyebrow-кикеры над заголовками убраны (§10.3) — заголовок секции сам крупный */

/* ============================ SUBJECTS (bento) ============================ */
.subjects-bento {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px;
}
.subject-card-hero {
  grid-row: span 3;
  background: linear-gradient(160deg, var(--accent-soft) 0%, var(--bg-elev) 55%);
  border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 32px; display: flex; flex-direction: column; gap: 14px;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.subject-card-hero:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.subject-hero-top { display: flex; justify-content: space-between; align-items: flex-start; }
.subject-icon-xl {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--accent);
  box-shadow: var(--shadow);
}
.subject-icon-xl svg, .subject-icon-sm svg { width: 34px; height: 34px; }
.subject-card-hero .subject-name { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.subject-card-hero .subject-desc { font-size: 15px; max-width: 420px; }
.subject-name { font-size: 18px; font-weight: 700; }
.subject-desc { font-size: 14px; color: var(--fg-soft); flex: 1; }
.subject-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; }
.chip {
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--fg-soft);
  font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
}
.chip-more { color: var(--accent); border-style: dashed; }
.subject-card-mini {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 20px; display: flex; align-items: center; gap: 14px;
  transition: all var(--transition);
}
.subject-card-mini:hover { border-color: var(--teal); transform: translateX(4px); }
.subject-icon-sm {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-alt); color: var(--teal);
}
.subject-icon-sm svg { width: 22px; height: 22px; }
.subject-card-mini .subject-name { flex: 1; }
.subject-card-mini .badge { margin-left: auto; }

/* ============================ TEACHERS ============================ */
.teachers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.teacher-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 28px; text-align: center; transition: all var(--transition);
}
.teacher-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.teacher-avatar {
  width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; color: var(--accent); overflow: hidden;
}
.teacher-avatar img { width: 100%; height: 100%; object-fit: cover; }
.teacher-name { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.teacher-role { font-size: 13px; color: var(--accent-strong); font-weight: 600; margin: 0 0 12px; }
.teacher-bio { font-size: 14px; color: var(--fg-soft); margin: 0 0 16px; }
.teacher-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.teacher-tag {
  background: var(--bg-soft); padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--fg-soft);
}

/* ============================ PROGRAM (editorial index) ============================ */
.program-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px;
  border-top: 1px solid var(--border);
}
.program-row {
  display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.program-row:hover { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.program-row-num {
  font-family: var(--font-serif); font-style: italic;
  font-size: 30px; font-weight: 700; color: var(--muted); line-height: 1;
  transition: color var(--transition);
}
.program-row:hover .program-row-num { color: var(--accent); }
.program-row-title { font-size: 19px; font-weight: 700; margin: 0 0 4px; }
.program-row-desc { font-size: 13.5px; color: var(--fg-soft); margin: 0; }

/* ============================ FORMAT (timeline) ============================ */
.format-timeline {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; position: relative;
}
.format-timeline::before {
  content: ''; position: absolute; top: 24px; left: 8%; right: 8%;
  border-top: 2px dashed var(--border);
}
.format-step { position: relative; }
.format-dot {
  width: 48px; height: 48px; border-radius: 50%; margin-bottom: 18px;
  background: var(--bg-elev); border: 1.5px solid var(--accent);
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: var(--accent);
  position: relative; z-index: 1; box-shadow: var(--shadow);
}
.format-step h3 { font-size: 19px; font-weight: 700; margin: 0 0 8px; }
.format-step p { font-size: 14px; color: var(--fg-soft); margin: 0; }

/* ============================ PRICING ============================ */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.price-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 32px; display: flex; flex-direction: column; position: relative;
  transition: all var(--transition);
}
.price-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.price-card.featured {
  border: 2px solid var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--bg-elev) 40%);
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
.price-card.featured:hover { transform: translateY(-10px); }
.price-badge {
  position: absolute; top: -12px; left: 32px; background: var(--gradient-drive); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 999px; letter-spacing: .04em;
}
.price-name { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.price-desc { font-size: 13px; color: var(--muted); margin: 0 0 20px; }
.price-val {
  font-size: 36px; font-weight: 700; margin-bottom: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: -.02em;
}
.price-per { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.price-features { list-style: none; padding: 0; margin: 0 0 28px; flex: 1; }
.price-features li { font-size: 14px; color: var(--fg-soft); padding: 6px 0; display: flex; gap: 8px; align-items: baseline; }
.price-features li::before { content: '✓'; color: var(--accent); font-weight: 700; }

.teachers-grid.single { display: flex; justify-content: center; }
.teachers-grid.single .teacher-card { max-width: 520px; text-align: left; display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: start; }
.teachers-grid.single .teacher-avatar { width: 96px; height: 96px; font-size: 38px; margin: 0; }
.teachers-grid.single .teacher-name { margin-top: 8px; }

/* ============================ SHOP ============================ */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.shop-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 26px; display: flex; flex-direction: column; gap: 10px; position: relative; transition: all var(--transition);
}
.shop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.badge-free { position: absolute; top: 14px; right: 14px; background: var(--gold-soft); color: var(--gold-text); }
.shop-title { font-size: 19px; font-weight: 700; margin: 0; padding-right: 86px; }
.shop-desc { font-size: 14px; color: var(--fg-soft); flex: 1; margin: 0; }
.shop-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.shop-price { font-size: 18px; font-weight: 700; color: var(--accent); }

/* ============================ TESTIMONIALS ============================ */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.testimonial-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 28px; display: flex; flex-direction: column; gap: 16px;
}
.testimonial-card:hover { box-shadow: var(--shadow); }
/* Первый отзыв — крупный, на две колонки */
.testimonial-card:first-child {
  grid-column: span 2;
  background: linear-gradient(160deg, var(--accent-soft), var(--bg) 60%);
  border-color: rgba(30,107,79,.18);
}
.testimonial-card:first-child .testimonial-text { font-size: 19px; line-height: 1.5; }
.testimonial-card:first-child .testimonial-score { font-size: 16px; }
@media (max-width: 640px) { .testimonial-card:first-child { grid-column: auto; } }
.testimonial-score {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 700;
  font-size: 14px; padding: 6px 14px; border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.testimonial-text {
  font-family: var(--font-serif); font-style: italic;
  font-size: 15.5px; color: var(--fg); flex: 1; line-height: 1.55;
}
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: var(--fg-soft);
}
.testimonial-name { font-size: 14px; font-weight: 700; }
.testimonial-role { font-size: 12px; color: var(--muted); }

/* ============================ FAQ ============================ */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.faq-question {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 600; color: var(--fg); text-align: left;
}
.faq-arrow { transition: transform var(--transition); font-size: 14px; color: var(--muted); }
.faq-item.open { border-color: var(--accent); }
.faq-item.open .faq-arrow { transform: rotate(180deg); color: var(--accent); }
.faq-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; } /* K: без max-height */
.faq-item.open .faq-answer { grid-template-rows: 1fr; }
/* нижний паддинг — только в открытом состоянии: постоянный padding-bottom
   держал padding-box 20px и в свёрнутом виде — верх первой строки ответа
   был виден до раскрытия (клип идёт по padding-box). Без transition:
   высоту анимирует grid-template-rows выше, layout-свойства не tween'им (K) */
.faq-answer-text { overflow: hidden; min-height: 0; padding: 0 24px; font-size: 15px; color: var(--fg-soft); }
.faq-item.open .faq-answer-text { padding-bottom: 20px; }

/* ============================ ENROLL (dark zone) ============================ */
/* Фаза 3: тёмная зона записи на всю секцию (не карточка) — белая форма остаётся
   единственной карточкой; глубину даём фоном и отступами (§10.3) */
.section-enroll { background: linear-gradient(150deg, #12201a 0%, #1b3126 100%); }
.enroll-panel {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center;
  position: relative; overflow: hidden;
}
.enroll-panel::before {
  content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  top: -160px; right: -120px; pointer-events: none;
  background: radial-gradient(circle, rgba(58,157,116,.16) 0%, transparent 70%);
}
.enroll-panel .section-title { color: #f5f3ee; }
.enroll-panel .section-sub { color: rgba(245,243,238,.72); max-width: 420px; }
.enroll-points {
  list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 12px;
}
.enroll-points li {
  color: rgba(245,243,238,.85); font-size: 15px; font-weight: 500;
  display: flex; gap: 10px; align-items: baseline;
}
.enroll-points li::before { content: '✓'; color: #7fc4a8; font-weight: 700; }
.enroll-form {
  background: #ffffff; border-radius: var(--radius-card);
  padding: 32px; display: flex; flex-direction: column; gap: 20px;
  box-shadow: 0 24px 48px rgba(0,0,0,.25);
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--fg-soft); }
.input {
  padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-input);
  font-family: inherit; font-size: 15px; background: var(--bg-elev); color: var(--fg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(30, 107, 79, .12);
}
.input::placeholder { color: var(--muted); }
.form-note { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }
/* Honeypot: невидим людям, заполняют боты */
.hp-field {
  position: absolute; left: -9999px; top: -9999px;
  width: 1px; height: 1px; opacity: 0; border: none; padding: 0;
}

/* ============================ FOOTER ============================ */
.footer { border-top: 1px solid var(--border); background: var(--bg-elev); padding: 48px 0 24px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-desc { font-size: 14px; color: var(--muted); margin: 12px 0 0; max-width: 280px; }
.footer-col .footer-h { display: block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-soft); margin: 0 0 16px; }
.footer-col a { display: block; font-size: 14px; color: var(--muted); text-decoration: none; padding: 4px 0; transition: color var(--transition); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 24px; font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.footer-platform a { color: var(--muted); text-decoration: none; border-bottom: 1px dashed var(--muted); }
.footer-platform a:hover { color: var(--accent); border-color: var(--accent); }

/* ============================ TOAST ============================ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 100px);
  background: var(--fg); color: #fff; border-radius: 12px; padding: 16px 24px;
  z-index: 200; opacity: 0; transition: all .35s cubic-bezier(.2,.7,.3,1);
  max-width: 90vw; text-align: center; box-shadow: var(--shadow-lg);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-text { font-size: 14px; font-weight: 600; }
.toast-text small { display: block; font-weight: 400; opacity: .8; margin-top: 4px; font-size: 12px; }

/* ============================ MOTION-СЛОЙ (вдохновлено motionsites.ai, дозировано) ============================ */
/* Полоса прогресса чтения */
#progress {
  position: fixed; top: 0; left: 0; z-index: 110;
  height: 3px; width: 0;
  background: var(--gradient-drive);
  border-radius: 0 999px 999px 0;
}

@media (prefers-reduced-motion: no-preference) {
  /* Кинетическая типографика: строки заголовка поднимаются каскадом */
  .hero-title > span {
    opacity: 0; transform: translateY(28px);
    animation: rise .55s cubic-bezier(.2,.8,.2,1) forwards;
  }
  .hero-title > span:nth-child(1) { animation-delay: .05s; }
  .hero-title > span:nth-child(2) { animation-delay: .16s; }
  .hero-title > span:nth-child(3) { animation-delay: .27s; }

  /* Плавающие карточки — лёгкое «живое» покачивание */
  .hero-float-topic { animation: floaty-a 7s ease-in-out infinite alternate; }
  .hero-float-chip  { animation: floaty-b 6s 1.2s ease-in-out infinite alternate; }

  /* Медленный дрейф градиентных пятен фона */
  .hero::before { animation: drift 26s ease-in-out infinite alternate; }
  .hero::after  { animation: drift 32s ease-in-out infinite alternate-reverse; }

  /* Tilt: плавный уход/возврат карточки */
  .hero-card { transition: transform .25s ease-out; will-change: transform; }
}
@keyframes rise   { to { opacity: 1; transform: none; } }
@keyframes floaty-a { from { transform: rotate(-2deg) translateY(0); }  to { transform: rotate(-2deg) translateY(-9px); } }
@keyframes floaty-b { from { transform: rotate(2deg) translateY(0); }   to { transform: rotate(2deg) translateY(-7px); } }
@keyframes drift  { from { transform: translate(0, 0); }               to { transform: translate(44px, 28px); } }

@media (prefers-reduced-motion: reduce) {
  #progress { display: none; }
  .hero-title > span { opacity: 1; transform: none; animation: none; }
  .hero-float-topic, .hero-float-chip { animation: none; }
}

/* ============================ ANIMATIONS ============================ */
.fade-up {
  opacity: 0; transform: translateY(20px);
  transition: opacity .32s cubic-bezier(.2,.8,.2,1), transform .32s cubic-bezier(.2,.8,.2,1);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* Доступность: уважаем prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-up { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  .hero .btn-primary { animation: none; }
  .btn, .card, .subject-card, .teacher-card, .price-card { transition: none; }
}

/* ============================ RESPONSIVE ============================ */
@media (max-width: 1020px) {
  .format-timeline { grid-template-columns: repeat(2, 1fr); gap: 40px 32px; }
  .format-timeline::before { display: none; }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .subjects-bento { grid-template-columns: 1fr; }
  .subject-card-hero { grid-row: auto; }
  .program-list { grid-template-columns: 1fr; }
  .enroll-panel { grid-template-columns: 1fr; gap: 36px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-inner > .btn { display: none; }
  .burger { display: flex; }
  .hero { padding: 104px 0 64px; }
  .hero-actions { flex-direction: column; }
  .hero-stats { flex-wrap: wrap; gap: 20px 0; }
  .hero-stat { padding: 0 20px; }
  .hero-visual { padding: 12px; }
  .hero-float-chip { display: none; }
  .hero-float-topic { left: 0; bottom: -10px; }
  .format-timeline { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .section-enroll { padding-bottom: 64px; }
}

/* Mobile nav open state */
.nav-links.open {
  display: flex; position: absolute; top: 64px; left: 0; right: 0;
  background: var(--bg-elev); border-bottom: 1px solid var(--border);
  flex-direction: column; padding: 24px; gap: 16px;
}

/* Плашка демо-станда */
#demoBadge {
  position: fixed; left: 16px; bottom: 16px; z-index: 150;
  background: var(--gold-soft); color: var(--fg-soft);
  border: 1px dashed var(--gold, #d9a441); border-radius: 999px;
  font-size: 12.5px; font-weight: 600; padding: 8px 16px;
  box-shadow: var(--shadow); max-width: 86vw;
}
#demoBadge b { color: var(--gold-text); }

/* Заметки по ходу демо */
#demoNoteBtn {
  position: fixed; right: 16px; bottom: 16px; z-index: 150;
  background: var(--gradient-drive); color: #fff; border: none; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 14px; padding: 12px 18px;
  border-radius: 999px; box-shadow: var(--shadow-lg);
}
#demoNotePanel {
  position: fixed; right: 16px; bottom: 68px; z-index: 150; width: min(320px, 90vw);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 16px;
  display: none; flex-direction: column; gap: 8px;
}
#demoNotePanel.open { display: flex; }
#demoNotePanel b { font-size: 14px; }
#demoNotePanel textarea { min-height: 90px; font: inherit; font-size: 14px; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 10px; resize: vertical; }
#demoNotePanel input { font: inherit; font-size: 14px; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 10px; }
#demoNotePanel .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.demo-note-ok { font-size: 13px; color: var(--accent); font-weight: 600; }
.demo-note-ok.hidden { display: none; }

/* Focus visible */
.btn:focus-visible, .input:focus-visible, .faq-question:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
