/* =========================================================
   Everyday English (ee365) — версия 2 (адаптивная)
   Брейкпоинты: ≥1200 десктоп · 768–1199 планшет · <768 телефон
   ========================================================= */

/* ---------- Шрифты ---------- */
@font-face { font-family: "Medeo Sans"; src: url("../fonts/MedeoSansVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Medeo Mono"; src: url("../fonts/MedeoMonoVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Medeo Pixel"; src: url("../fonts/MedeoPixelVariable.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IvyPresto Display"; src: url("../fonts/IvyPrestoDisplay-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }

/* ---------- Токены ---------- */
:root {
  --c-ink: #11110f;
  --c-ink-soft: rgba(17, 17, 15, .68);   /* второстепенный текст, контраст ≥ 4.5 */
  --c-paper: #f3e8d2;
  --c-sand: #fae2b1;
  --c-green: #95c73a;
  --c-green-hover: #a6d64b;
  --c-green-light: #c9ee87;
  --c-green-dark: #628f0e;
  --c-page: #0a1711;
  --c-footer: #11110f;

  --f-sans: "Medeo Sans", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Medeo Mono", ui-monospace, "Courier New", monospace;
  --f-pixel: "Medeo Pixel", "Medeo Mono", monospace;
  --f-display: "IvyPresto Display", Georgia, "Times New Roman", serif;

  --gutter: clamp(8px, 2.2vw, 40px);              /* отступ панелей от краёв окна */
  --panel-w: min(1600px, calc(100% - 2 * var(--gutter)));
  --pad: clamp(20px, 6.25vw, 100px);              /* внутренний отступ панели */
  --pad-y: clamp(36px, 5vw, 80px);
  --r-panel: clamp(24px, 2.6vw, 40px);
  --gap: 10px;

  --fs-body: clamp(16px, 1.05vw, 20px);
  --fs-small: clamp(13px, .75vw, 14px);
  --fs-h2: clamp(30px, 3.2vw, 60px);
  --fs-h3: clamp(24px, 2.1vw, 40px);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--c-page);
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-text-size-adjust: 100%;
}
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
body {
  margin: 0;
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
/* Неподвижный фон: блоки скользят поверх */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: var(--c-page) url("../img/bg-tile.webp") repeat center top;
  pointer-events: none;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--c-green-dark); outline-offset: 3px; }

.pixel { font-family: var(--f-pixel); font-weight: 400; }
.accent { color: var(--c-green-dark); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.br-desk { display: none; }
@media (min-width: 1200px) { .br-desk { display: inline; } }


/* ---------- Каркас ---------- */
.page {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--gap);
  padding-bottom: var(--gap);
}
.panel {
  position: relative;
  width: var(--panel-w);
  padding: var(--pad-y) var(--pad);
  background: var(--c-paper);
  border-radius: var(--r-panel);
}
.section-title {
  font-weight: 300;
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: -.01em;
  max-width: 22ch;
}
.section-lead {
  margin-top: 18px;
  max-width: 62ch;
  font-weight: 300;
  font-size: clamp(17px, 1.3vw, 24px);
  line-height: 1.35;
  color: var(--c-ink-soft);
}

/* ---------- Кнопки (единый стиль) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border-radius: 12px;
  font-family: var(--f-mono);
  font-size: clamp(15px, 1vw, 18px);
  letter-spacing: -.01em;
  text-align: center;
  white-space: nowrap;
  transition: background-color .2s, color .2s, transform .15s, box-shadow .2s;
}
.btn--primary { background: var(--c-green); color: var(--c-ink); box-shadow: 0 6px 0 -2px rgba(17,17,15,.18); }
.btn--primary:hover { background: var(--c-green-hover); transform: translateY(-1px); box-shadow: 0 8px 0 -2px rgba(17,17,15,.2); }
.btn--primary:active { transform: translateY(2px); box-shadow: 0 3px 0 -2px rgba(17,17,15,.2); }
.btn--ghost { border: 1.5px solid var(--c-ink); }
.btn--ghost:hover { background: var(--c-ink); color: var(--c-paper); }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 15px; border-radius: 10px; }
.btn--block { width: 100%; }
.btn--dark { background: #11110f; color: #f3e8d2; }
.btn--dark:hover { background: #2a2a26; color: #f3e8d2; transform: translateY(-1px); }
.btn--dark:active { transform: translateY(1px); }
.program-card .program-card__more { margin-top: 10px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* =========================================================
   Верхняя панель (появляется при прокрутке)
   ========================================================= */
.topbar {
  position: fixed; z-index: 50;
  top: 10px; left: 50%;
  width: var(--panel-w);
  transform: translate(-50%, -140%);
  transition: transform .35s ease;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 10px 12px 10px clamp(16px, 2vw, 28px);
  background: rgba(243, 232, 210, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-radius: 18px;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.45);
}
.topbar.is-visible { transform: translate(-50%, 0); }
.topbar .logo img { width: 54px; height: auto; }
.topbar__right { display: flex; align-items: center; gap: 22px; }

.logo img { width: 68px; height: auto; }
/* Логотип текстом: «ee365» шрифтом IvyPresto Display (вместо картинки E.E); при наведении чуть увеличивается — видно, что кликабелен */
.logo--text { display: inline-block; font-family: var(--f-display); font-weight: 400; font-size: 36px; line-height: .8; letter-spacing: -.01em; color: var(--c-ink); text-decoration: none; transform-origin: left center; transition: transform .2s ease; }
.topbar .logo--text { font-size: 35px; }
.logo--text:hover, .logo--text:focus-visible { color: var(--c-ink); transform: scale(1.08); }
@media (prefers-reduced-motion: reduce) { .logo--text { transition: none; } }

/* Меню */
.nav { display: flex; gap: clamp(22px, 2.2vw, 42px); font-weight: 500; font-size: clamp(15px, 1.05vw, 20px); line-height: 1; text-transform: uppercase; white-space: nowrap; }
.nav a {
  display: inline-block;
  padding: 6px 9px; margin: -6px -9px;
  border-radius: 4px;
  transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.nav a:hover, .nav a:focus-visible { background: var(--c-ink); color: var(--c-paper); transform: scale(1.12); outline: none; }
.topbar .nav { font-size: 15px; gap: 26px; }
/* Текущая страница в меню (на внутренних страницах) */
.nav a[aria-current="page"] { background: var(--c-ink); color: var(--c-paper); }
.mmenu nav a[aria-current="page"] { color: var(--c-green-dark); }

.burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: 10px;
  align-items: center; justify-content: center;
}
.burger span, .burger span::before, .burger span::after {
  display: block; width: 22px; height: 2px; background: var(--c-ink); border-radius: 2px; position: relative;
}
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -7px; }
.burger span::after { top: 7px; }

/* Мобильное меню */
.mmenu {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  padding: 18px var(--gutter) 30px;
  background: var(--c-paper);
  transform: translateY(-100%);
  transition: transform .35s ease;
  overflow-y: auto;
}
.mmenu.is-open { transform: none; }
.mmenu__head { display: flex; justify-content: space-between; align-items: center; padding: 0 12px; }
.mmenu__close { width: 44px; height: 44px; font-size: 30px; line-height: 1; }
.mmenu nav { display: flex; flex-direction: column; gap: 6px; margin: 40px 12px 30px; }
.mmenu nav a { padding: 12px 0; border-bottom: 1px solid rgba(17,17,15,.12); font-size: 22px; font-weight: 500; text-transform: uppercase; }
.mmenu__contacts { margin: 24px 12px 0; display: grid; gap: 8px; color: var(--c-ink-soft); font-size: 16px; }

/* =========================================================
   1. Первый экран
   ========================================================= */
.hero {
  border-radius: 0 0 var(--r-panel) var(--r-panel);
  padding-top: 32px;
  min-height: min(100vh, 1000px);
  display: flex; flex-direction: column;
}
.header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.hero__body {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(24px, 3vh, 40px) 0 clamp(20px, 3vh, 40px);
}
.hero__crest { width: clamp(130px, 19vh, 260px); height: auto; aspect-ratio: 1; object-fit: contain; }
.hero__h1 { margin-top: clamp(8px, 1.5vh, 20px); font-weight: 400; }
.hero__eyebrow {
  display: block;
  font-family: var(--f-mono);
  font-size: clamp(13px, 1vw, 17px);
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}
.hero__title-wrap { position: relative; display: inline-block; margin-top: 6px; }
.hero__title {
  display: block;
  font-family: var(--f-display);
  font-size: clamp(54px, 8.3vw, 160px);
  line-height: 1;
  white-space: nowrap;
}
.hero__since {
  position: absolute; left: 0; top: 100%;
  font-family: var(--f-display);
  font-size: clamp(13px, 1.05vw, 20px);
  line-height: 1;
  color: var(--c-ink-soft);
}
.hero__offer {
  margin-top: clamp(26px, 4vh, 46px);
  max-width: 46ch;
  font-size: clamp(17px, 1.3vw, 24px);
  line-height: 1.35;
  font-weight: 300;
}
.hero__actions { margin-top: clamp(18px, 2.6vh, 30px); display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.trust {
  margin-top: clamp(18px, 2.6vh, 30px);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px;
  font-size: calc(var(--fs-small) + 2px);
  color: var(--c-ink-soft);
}
.trust b { color: var(--c-ink); font-weight: 600; }
.trust li { display: flex; align-items: center; gap: 6px; }
.trust li + li::before { content: "·"; margin-right: 20px; color: var(--c-ink-soft); }
.trust .star { color: #c79a1c; }

.hero__quote { margin-top: 10px; text-align: center; /* по центру экрана, высота та же */ font-size: clamp(14px, 1.05vw, 20px); line-height: 1.1; }
.hero__quote p { font-family: var(--f-pixel); font-size: calc(1em - 2px); max-width: 290px; margin-inline: auto; color: var(--c-ink-soft); }
.hero__quote cite { display: block; margin-top: 12px; font-size: 16px; font-style: normal; font-weight: 500; color: var(--c-ink-soft); opacity: .8; }

/* Печатная машинка */
.typewriter .tw-char { visibility: hidden; }
.typewriter .tw-char.is-on { visibility: visible; }
.typewriter .tw-caret { position: relative; display: inline-block; width: 0; height: 1em; vertical-align: text-bottom; }
.typewriter .tw-caret::after { content: ""; position: absolute; left: 1px; top: 0; width: 2px; height: 1em; background: currentColor; animation: tw-blink 1s steps(1) infinite; }
.typewriter.is-typing .tw-caret::after { animation: none; }
@keyframes tw-blink { 50% { opacity: 0; } }

/* Лупа */
.hero__title .lens-char { display: inline-block; transform-origin: 50% 80%; transition: transform .18s ease-out; will-change: transform; }

/* =========================================================
   2. Программы
   ========================================================= */
.programs__cards {
  margin-top: clamp(28px, 4vw, 60px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 30px);
}
.program-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--c-sand);
  border-radius: 15px 15px 30px 30px;
  overflow: hidden;
}
.program-card--featured { box-shadow: 0 0 0 3px var(--c-green), 0 20px 40px -24px rgba(17,17,15,.45); }
/* Зелёная рамка «на магните» (magnet-frame.js): ездит за курсором; без наведения стоит на «Выбирают чаще всего» */
.programs__cards { position: relative; }
.programs__cards.has-magnet .program-card--featured { box-shadow: 0 20px 40px -24px rgba(17,17,15,.45); }
.magnet-frame {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none;
  border-radius: 15px 15px 30px 30px;
  box-shadow: 0 0 0 3px var(--c-green);
  opacity: 0;
  /* «магнит»: едва заметно проскакивает и садится на место */
  transition: transform .45s cubic-bezier(.3, 1.08, .5, 1), width .45s cubic-bezier(.3, 1.08, .5, 1), height .45s cubic-bezier(.3, 1.08, .5, 1), opacity .3s ease;
}
.magnet-frame.is-on { opacity: 1; }
.magnet-frame.is-on.is-rest { opacity: .35; } /* курсор не на карточке — рамка приглушена */
@media (prefers-reduced-motion: reduce) { .magnet-frame { transition: opacity .2s ease; } }
.program-card__badge {
  position: absolute; top: 14px; left: 14px; z-index: 1;
  padding: 7px 12px;
  border-radius: 20px;
  background: var(--c-ink);
  color: var(--c-paper);
  font-family: var(--f-mono);
  font-size: 13px;
}
.program-card__img { aspect-ratio: 480 / 280; overflow: hidden; margin: 8px 8px 0; border-radius: 10px 10px 6px 6px; }
.program-card__img img { width: 100%; height: 100%; object-fit: cover; }
.program-card__body { flex: 1; display: flex; flex-direction: column; padding: clamp(20px, 1.8vw, 30px); }
.program-card__title { font-weight: 400; font-size: clamp(28px, 2.3vw, 45px); line-height: 1; letter-spacing: -.01em; }
.program-card__for { margin-top: 12px; font-size: clamp(16px, 1.1vw, 20px); line-height: 1.3; color: var(--c-ink-soft); }
.program-card__facts { margin-top: 20px; display: grid; gap: 8px; font-size: clamp(15px, .95vw, 17px); }
.program-card__facts li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px dashed rgba(17,17,15,.2); }
.program-card__facts span { color: var(--c-ink-soft); }
/* Преимущества — «сообщения в чате»: пузыри с хвостиком, последний — ответ справа */
.pills { margin-top: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.pill {
  position: relative;
  max-width: calc(100% - 14px);
  margin-left: 14px;
  padding: 9px 20px;
  border-radius: 27px;
  background: var(--c-green-light);
  font-size: clamp(14px, .9vw, 16px);
  line-height: 1.2;
}
.pill::before {
  content: "";
  position: absolute;
  left: -13px; bottom: 0;
  width: 28px; height: 10px;
  background: url(../img/chat-tail.svg) no-repeat center / 100% 100%;
}
.pills .pill:last-child:not(:first-child) { align-self: flex-end; margin-left: 0; margin-right: 14px; }
.pills .pill:last-child:not(:first-child)::before { left: auto; right: -14px; transform: scaleX(-1); }
.program-card__price { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.program-card__price b { font-family: var(--f-mono); font-weight: 500; font-size: clamp(26px, 1.8vw, 32px); letter-spacing: -.02em; }
.program-card__price > span { color: var(--c-ink-soft); font-size: 15px; line-height: 1.3; min-height: 2.6em; } /* подпись всегда в 2 строки — цены у карточек на одном уровне */
.program-card .btn { margin-top: 16px; }

/* =========================================================
   3. Как проходит обучение
   ========================================================= */
.steps {
  margin-top: clamp(28px, 4vw, 56px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 30px);
  counter-reset: step;
}
.step {
  position: relative;
  display: flex; flex-direction: column;
  padding: clamp(22px, 2vw, 34px);
  border-radius: 10px 30px 30px 30px;
  background: var(--c-sand);
}
.step:first-child { background: var(--c-green); }
.step__num { font-family: var(--f-pixel); font-weight: 400; font-size: clamp(56px, 5vw, 96px); line-height: .9; letter-spacing: -.01em; }
.step__title { margin-top: 14px; font-family: var(--f-mono); font-weight: 400; font-size: clamp(20px, 1.6vw, 28px); line-height: 1.2; letter-spacing: -.02em; }
.step__text { margin-top: 10px; font-size: clamp(15px, 1vw, 18px); line-height: 1.4; }
.step__meta { margin-top: auto; padding-top: 16px; font-family: var(--f-mono); font-size: 14px; color: var(--c-ink-soft); }
.step:first-child .step__meta { color: var(--c-ink); }

/* =========================================================
   CTA с формой
   ========================================================= */
.cta-panel { overflow: hidden; }
.cta-panel__deco { position: absolute; left: 2%; top: -20%; width: 54%; max-width: 869px; pointer-events: none; }
.cta {
  position: relative;
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr minmax(0, 490px);
  gap: clamp(20px, 3vw, 60px);
  padding: clamp(22px, 2.6vw, 45px) clamp(20px, 2.6vw, 40px);
  background: var(--c-green);
  border-radius: 17px;
}
.cta__title { font-weight: 400; font-size: clamp(28px, 2.4vw, 42px); line-height: 1.15; letter-spacing: -.01em; }
.cta__text { margin-top: 16px; max-width: 30em; font-size: clamp(16px, 1.05vw, 20px); line-height: 1.4; }
.cta__list { margin-top: 18px; display: grid; gap: 8px; font-size: clamp(15px, .95vw, 18px); }
.cta__list li { display: flex; gap: 10px; }
.cta__list li::before { content: "✓"; font-weight: 700; }
.cta__aside { display: flex; flex-direction: column; justify-content: space-between; }
.cta > * { min-width: 0; }
.cta__contacts { margin-top: 26px; }
.cta__contacts-label { font-size: clamp(15px, 1vw, 18px); }
.cta__socials { margin-top: 12px; display: flex; gap: 12px; }
.social { position: relative; width: 50px; height: 50px; border-radius: 50%; background: #fff; transition: transform .2s; }
.social:hover { transform: translateY(-2px); }
.social i { position: absolute; background: var(--c-green-dark); }
.social--phone i { left: 11px; top: 11px; width: 30px; height: 30px; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1.9.4 1.8.7 2.7a2 2 0 0 1-.5 2.1L8 9.8a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.7.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E") center/26px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1.9.4 1.8.7 2.7a2 2 0 0 1-.5 2.1L8 9.8a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.7.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E") center/26px no-repeat; }
.social--tg i { left: 11px; top: 12px; width: 28px; height: 28px; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M21.5 3.5 2.8 10.8c-.8.3-.8 1.4 0 1.7l4.6 1.6 1.8 5.6c.2.7 1.1.9 1.6.4l2.6-2.5 4.6 3.4c.6.4 1.4.1 1.6-.6l3.2-15.6c.2-.9-.6-1.6-1.3-1.3z'/%3E%3Cpath d='m7.4 14.1 9.8-6.3-7.3 7.5'/%3E%3C/svg%3E") center/26px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M21.5 3.5 2.8 10.8c-.8.3-.8 1.4 0 1.7l4.6 1.6 1.8 5.6c.2.7 1.1.9 1.6.4l2.6-2.5 4.6 3.4c.6.4 1.4.1 1.6-.6l3.2-15.6c.2-.9-.6-1.6-1.3-1.3z'/%3E%3Cpath d='m7.4 14.1 9.8-6.3-7.3 7.5'/%3E%3C/svg%3E") center/26px no-repeat; }
.social--wa i { left: 10px; top: 10px; width: 30px; height: 30px; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 20.5l1.3-4.2A8.5 8.5 0 1 1 8 19.4z'/%3E%3Cpath d='M9 8.6c0 3.4 2.9 6.4 6.4 6.4l1-1.6-2-1-.9.9c-1-.4-2-1.4-2.4-2.4l.9-.9-1-2L9.4 8.4z'/%3E%3C/svg%3E") center/26px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 20.5l1.3-4.2A8.5 8.5 0 1 1 8 19.4z'/%3E%3Cpath d='M9 8.6c0 3.4 2.9 6.4 6.4 6.4l1-1.6-2-1-.9.9c-1-.4-2-1.4-2.4-2.4l.9-.9-1-2L9.4 8.4z'/%3E%3C/svg%3E") center/26px no-repeat; }

.cta__proof { margin-top: 18px; display: flex; align-items: center; gap: 10px; font-size: 15px; }
.avatars { display: flex; }
.avatars span { width: 30px; height: 30px; margin-left: -8px; border-radius: 50%; border: 2px solid var(--c-green); display: grid; place-items: center; font-family: var(--f-display); font-size: 14px; background: var(--c-sand); }
.avatars span:first-child { margin-left: 0; }
.avatars span:nth-child(2) { background: var(--c-paper); }
.avatars span:nth-child(3) { background: var(--c-green-light); }

.form {
  position: relative;
  padding: clamp(20px, 2.4vw, 40px);
  background: var(--c-paper);
  border-radius: 10px;
  font-family: var(--f-mono);
}
.form__title { font-family: var(--f-sans); font-size: 18px; font-weight: 500; margin-bottom: 14px; }
.form__field {
  display: block;
  width: 100%; height: 60px;
  margin-bottom: 12px;
  padding: 0 20px;
  border: 1px solid rgba(17,17,15,.28); border-radius: 12px;
  background: transparent; /* поле в цвет карточки, только тонкая рамка */
  font-family: var(--f-mono);
  font-size: 16px;   /* ≥16px — iPhone не будет приближать поле */
  color: var(--c-ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form__field::placeholder { color: rgba(17,17,15,.66); opacity: 1; }
.form__field:hover { border-color: rgba(17,17,15,.45); }
.form__field:focus { border-color: var(--c-ink); box-shadow: inset 0 0 0 .5px var(--c-ink); }
.form__field.is-invalid { border-color: #b3261e; box-shadow: inset 0 0 0 .5px #b3261e; }
.check {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 4px 0 10px;
  font-size: 13px; line-height: 1.35;
  color: var(--c-ink-soft);
  cursor: pointer;
}
.check input {
  appearance: none; -webkit-appearance: none;
  flex: none; width: 16px; height: 16px; margin: 1px 0 0;
  border: 1.5px solid var(--c-ink); border-radius: 3px;
  background: transparent; cursor: pointer;
}
.check input:checked { background: var(--c-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.2 2.2 4.8-5' fill='none' stroke='%23f3e8d2' stroke-width='1.6'/%3E%3C/svg%3E") center/12px no-repeat; }
.check.is-invalid input { border-color: #b3261e; }
.check a, .form__offer a { text-decoration: underline; text-underline-offset: 2px; }
.form .btn { margin-top: 8px; }
.form__offer { margin-top: 12px; font-size: 12.5px; line-height: 1.4; color: var(--c-ink-soft); }
.form__note { margin-top: 8px; font-size: 12.5px; color: var(--c-ink-soft); }
.form__done {
  position: absolute; inset: 0;
  display: none; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px;
  padding: clamp(24px, 2.6vw, 44px);
  background: var(--c-paper); border-radius: 10px;
}
.form__done b { font-family: var(--f-display); font-weight: 400; font-size: 40px; line-height: 1; }
.form__done p { font-family: var(--f-sans); font-size: 17px; line-height: 1.4; }
.form__done ol { font-family: var(--f-sans); font-size: 16px; line-height: 1.4; display: grid; gap: 6px; counter-reset: n; }
.form__done li { counter-increment: n; display: flex; gap: 10px; }
.form__done li::before { content: counter(n); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--c-green); display: grid; place-items: center; font-family: var(--f-mono); font-size: 13px; }
.form.is-sent .form__done { display: flex; }

/* =========================================================
   4. Чем отличается школа
   ========================================================= */
.why__title { text-align: center; max-width: 24ch; margin: 0 auto; }
.why__grid {
  margin-top: clamp(30px, 4.5vw, 70px);
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 640px);
  justify-content: space-between;
  gap: clamp(24px, 4vw, 80px);
}
.why__photo-track { position: relative; }
.why__photo {
  position: sticky; top: var(--sticky-top, 100px);
  width: 100%; aspect-ratio: 559 / 694;
  object-fit: cover; object-position: bottom;
  border-radius: 4px;
}
.reasons { display: grid; gap: clamp(20px, 3vw, 54px); }
.reason {
  position: relative;
  padding: clamp(24px, 2.4vw, 46px) clamp(22px, 2.6vw, 50px);
  border-radius: 10px 30px 30px 30px;
  overflow: hidden;
}
.reason::before {
  content: ""; position: absolute; left: 0; top: 0; width: 42px; height: 95px;
  background: url("../img/arrow-short.png") no-repeat 0 0 / 42px auto;
  transform: translate(-56px, -18px);
}
.reason--green { background: var(--c-green); }
.reason__title { position: relative; font-family: var(--f-mono); font-weight: 400; font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -.02em; max-width: 15em; }
.reason__text { position: relative; margin-top: 14px; max-width: 34em; font-size: clamp(16px, 1.05vw, 20px); line-height: 1.35; }
.reason__deco { position: absolute; right: -10px; top: 0; height: 107%; width: auto; pointer-events: none; }

/* =========================================================
   5. Отзывы
   ========================================================= */
.reviews__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.rating {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 22px;
  border-radius: 15px;
  background: var(--c-green);
}
.rating__num { font-family: var(--f-pixel); font-size: 56px; line-height: 1; }
.rating__stars { color: var(--c-ink); letter-spacing: 2px; font-size: 18px; }
.rating__meta { font-size: 14px; }
.reviews__grid {
  margin-top: clamp(26px, 3.5vw, 50px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 24px);
}
.review {
  display: flex; flex-direction: column; gap: 16px;
  padding: clamp(20px, 2vw, 30px);
  border-radius: 20px;
  background: var(--c-sand);
}
.review__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.review__stars { color: #a77f0f; letter-spacing: 2px; }
.review__text { font-size: clamp(16px, 1.05vw, 19px); line-height: 1.45; }
.review__result { padding: 10px 14px; border-radius: 10px; background: var(--c-paper); font-family: var(--f-mono); font-size: 14px; }
.review__author { margin-top: auto; display: flex; align-items: center; gap: 12px; }
.review__avatar { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--c-green-light); font-family: var(--f-display); font-size: 22px; }
.review__name { font-weight: 500; }
.review__meta { font-size: 14px; color: var(--c-ink-soft); }

/* =========================================================
   6. Преподаватели (лента с прокруткой)
   ========================================================= */
.teachers__head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; }
.teachers__note {
  position: relative;
  max-width: 464px;
  padding: 26px 56px;
  background: var(--c-green);
  border-radius: 15px;
  text-align: center;
  font-weight: 300; font-size: clamp(18px, 1.4vw, 26px); line-height: 1.2;
}
.teachers__note img { position: absolute; top: 50%; width: 16px; height: auto; transform: translateY(-50%); }
.teachers__note img:first-child { left: 16px; }
.teachers__note img:last-child { right: 16px; }
.carousel { position: relative; margin-top: clamp(26px, 3.5vw, 50px); }
.carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(260px, 22vw, 372px);
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 4px 2px 14px;
  margin: 0 -2px;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__nav { display: flex; gap: 10px; }
.carousel__btn {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1.5px solid var(--c-ink);
  display: grid; place-items: center;
  font-size: 22px; line-height: 1;
  transition: background-color .2s, color .2s, opacity .2s;
}
.carousel__btn:hover { background: var(--c-ink); color: var(--c-paper); }
.carousel__btn:disabled { opacity: .3; pointer-events: none; }
.teacher {
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center;
  padding: 30px 24px 26px;
  border-radius: 20px;
  background: var(--c-sand);
  text-align: center;
}
.teacher__avatar {
  width: 160px; height: 160px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-display); font-size: 64px;
  background: var(--av, var(--c-green-light));
  overflow: hidden;
  position: relative;
}
/* фото — ровно в круг (в grid высота 100% считалась как 200px, и iPhone Safari сдвигал фото вниз) */
.teacher__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.teacher__name { margin-top: 22px; font-weight: 500; font-size: clamp(24px, 1.6vw, 30px); line-height: 1; }
.teacher__role { margin-top: 8px; color: var(--c-ink-soft); font-size: 16px; }
.teacher__facts { margin-top: 16px; display: grid; gap: 6px; font-size: 16px; }
.teacher__facts span { color: var(--c-ink-soft); margin-right: 4px; }
.teacher__tags { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.teacher__tags span { padding: 5px 10px; border-radius: 20px; background: var(--c-paper); font-size: 13px; }
/* «Подробнее» — открывает карточку преподавателя (teacher-modal.js) */
.teacher__details {
  margin-top: auto; padding-top: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px;
  font-family: var(--f-mono); font-size: 15px; text-transform: uppercase; letter-spacing: .02em;
  text-decoration: underline; text-underline-offset: 4px;
  transition: color .2s;
}
.teacher__details svg { transition: transform .2s; }
.teacher__details:hover { color: var(--c-green-dark); }
.teacher__details:hover svg { transform: translateX(3px); }
.teacher__more { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; white-space: nowrap; font-family: var(--f-mono); font-size: 14px; color: var(--c-ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.teacher__more:hover { color: var(--c-green-dark); }

/* =========================================================
   7. Вопросы и ответы
   ========================================================= */
.faq__grid { margin-top: clamp(26px, 3.5vw, 50px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 24px; align-items: start; }
.faq__item { border-radius: 15px; background: var(--c-sand); }
.faq__item summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 24px;
  font-size: clamp(17px, 1.15vw, 21px); font-weight: 500; line-height: 1.3;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+"; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c-paper); font-family: var(--f-mono); font-size: 20px;
  transition: transform .25s;
}
.faq__item[open] summary::after { transform: rotate(45deg); background: var(--c-green); }
.faq__item p { padding: 0 24px 22px; font-size: clamp(15px, 1vw, 18px); line-height: 1.5; color: rgba(17,17,15,.82); }

/* =========================================================
   Футер (выезжает из-под страницы)
   ========================================================= */
.footer-reveal { position: relative; clip-path: inset(0); }
.footer-reveal.is-reveal .footer { position: fixed; left: 0; right: 0; bottom: 0; }
.footer { background: var(--c-footer); color: var(--c-paper); }
.footer__inner {
  width: min(1780px, 100% - 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(36px, 3.7vw, 70px) 0 clamp(24px, 2vw, 36px);
  display: grid;
  grid-template-columns: 1.3fr .9fr 1fr;
  gap: 40px clamp(20px, 3vw, 60px);
}
.footer__nav { display: flex; flex-wrap: wrap; gap: 14px 40px; max-width: 460px; font-size: 16px; text-transform: uppercase; }
.footer__legal { margin-top: 26px; display: grid; gap: 10px; font-size: 13px; text-transform: uppercase; color: rgba(243,232,210,.72); }
.footer a:hover { color: var(--c-green-light); }
.footer__label { font-size: 18px; margin-bottom: 14px; }
.footer__boxes { display: grid; gap: 10px; justify-items: start; }
.footer__box { display: inline-flex; align-items: center; min-height: 47px; padding: 0 16px; border: 1px solid var(--c-paper); border-radius: 5px; font-size: clamp(17px, 1.2vw, 23px); transition: background-color .2s, color .2s; }
a.footer__box:hover { background: var(--c-paper); color: var(--c-footer); }
.footer__company { margin-top: 26px; font-size: 14px; line-height: 1.6; color: rgba(243,232,210,.68); }
.footer__brand {
  grid-column: 1 / -1;
  font-family: var(--f-display);
  font-size: clamp(56px, 8.9vw, 170px);
  line-height: 1;
  white-space: nowrap;
}

/* =========================================================
   Анимация появления блоков
   ========================================================= */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* =========================================================
   Первый экран внутренних страниц (партнёры, правила и др.)
   ========================================================= */
.hero.hero--page { min-height: 0; padding-bottom: clamp(40px, 5vw, 80px); }
.page-hero { margin-top: clamp(40px, 6vw, 90px); max-width: 900px; }
.page-hero__eyebrow { font-family: var(--f-mono); font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--c-ink-soft); }
.page-hero__title { margin-top: 14px; font-weight: 300; font-size: clamp(44px, 5.4vw, 96px); line-height: 1.04; letter-spacing: -.01em; font-optical-sizing: none; }
.page-hero__lead { margin-top: 20px; font-weight: 300; font-size: clamp(19px, 1.6vw, 28px); line-height: 1.3; color: var(--c-ink-soft); }

@media (max-width: 767px) {
  .hero.hero--page { padding-bottom: 36px; }
  .page-hero { margin-top: 32px; }
}

/* =========================================================
   Планшет и маленький ноутбук
   ========================================================= */
@media (max-width: 1199px) {
  .topbar .nav, .header .nav { display: none; }
  .burger { display: inline-flex; }
  .programs__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .program-card--featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .program-card--featured .program-card__img { aspect-ratio: auto; height: calc(100% - 16px); margin: 8px 0 8px 8px; }
  .cta { grid-template-columns: minmax(0, 1fr); } /* minmax(0,…): длинное слово или форма не распирают блок шире экрана */
  .why__grid { grid-template-columns: 1fr 1.25fr; }
  .reason::before { display: none; }
  .reviews__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reviews__grid .review:nth-child(3) { display: none; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__col--nav { grid-column: 1 / -1; }
  .hero__quote { display: none; }
  .hero { min-height: auto; }
  .hero__body { padding: 40px 0 30px; }
}

/* =========================================================
   Телефон
   ========================================================= */
@media (max-width: 767px) {
  :root { --gap: 8px; }
  .topbar { top: 8px; padding: 6px 6px 6px 14px; }
  .topbar .btn { display: none; }
  .hero { min-height: auto; padding-top: 18px; }
  .hero__body { padding-top: 28px; }
  .hero__title { font-size: clamp(36px, 12.6vw, 64px); }
  .hero__actions { flex-direction: column; width: 100%; }
  .hero__actions .btn { width: 100%; white-space: normal; }
  .hero__since { position: static; margin-top: 8px; display: block; text-align: right; }
  .trust { flex-direction: column; gap: 6px; align-items: center; }
  .trust li + li::before { display: none; }
  .programs__cards { grid-template-columns: 1fr; }
  .program-card--featured { display: flex; }
  .program-card--featured .program-card__img { aspect-ratio: 480 / 280; height: auto; margin: 8px 8px 0; }
  .steps { grid-template-columns: 1fr; }
  .cta { padding: 22px 16px 16px; }
  .form { padding: 18px; }
  .why__grid { grid-template-columns: 1fr; }
  .why__photo { position: static; aspect-ratio: 4 / 3; }
  .reason__deco { opacity: .6; }
  .reviews__grid { grid-template-columns: 1fr; }
  .reviews__grid .review:nth-child(3) { display: flex; }
  .teachers__head { grid-template-columns: 1fr; }
  .teachers__note { padding: 20px 46px; }
  .carousel__nav { display: none; }
  .carousel__track { grid-auto-columns: 78%; }
  .faq__grid { grid-template-columns: 1fr; }
  .faq__item summary { padding: 18px; }
  .faq__item p { padding: 0 18px 18px; }
  .footer__inner { grid-template-columns: 1fr; gap: 30px; }
  .footer__nav { gap: 12px 28px; }
  .footer__brand { white-space: normal; }
}

/* Неразрывные фрагменты */
.nowrap { white-space: nowrap; }
/* Удобная зона нажатия для мелких ссылок (вид не меняется) */
.check a, .form__offer a { padding: 8px 0; }
.footer__nav a { padding: 8px 0; margin: -8px 0; }
.footer__legal a { padding: 4px 0; margin: -4px 0; }

/* Телефон: длинная надпись на кнопке переносится, а не вылезает за край (на iPhone шрифт чуть шире) */
@media (max-width: 767px) { .btn { white-space: normal; padding-left: 20px; padding-right: 20px; } .form__note .nowrap { white-space: normal; } }

/* Футер выше экрана (телефон): страница уезжает и открывает футер, а он «догоняет» её; верхний ряд виден, как только верх футера доходит до шапки.
   Анимацию по прокрутке считает сам браузер (плавно, без скрипта); где не умеет — футер просто стоит в потоке. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .footer-reveal:not(.is-reveal) .footer {
      animation: footer-catch-up linear both;
      animation-timeline: view();
      /* футер «встаёт на место», когда его верх доходит до шапки (~90px от верха экрана), дальше листается как обычно */
      animation-range: entry 0% cover calc(100svh - 90px);
    }
  }
}
@keyframes footer-catch-up { from { transform: translateY(calc(90px - 100svh)); } to { transform: none; } }
