/* Ольга Заболотна, логопед. Стилі сайту.
   Ідея: «від тиші до мовлення». Вечірній синій = тиша, медовий = голос і світло. */

/* ---------- Шрифти (свої файли, без Google Fonts) ---------- */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/literata-cyrillic-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+2116;
}
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/literata-latin-normal.woff2') format('woff2');
  unicode-range: U+0020-007E, U+00A0-00BF, U+00D7, U+2010-2027, U+2032-2033, U+2039-203A, U+20AC, U+2212;
}
@font-face {
  font-family: 'Literata';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/literata-cyrillic-italic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+2116;
}
@font-face {
  font-family: 'Literata';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/literata-latin-italic.woff2') format('woff2');
  unicode-range: U+0020-007E, U+00A0-00BF, U+00D7, U+2010-2027, U+2032-2033, U+2039-203A, U+20AC, U+2212;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/onest-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/onest-latin.woff2') format('woff2');
  unicode-range: U+0020-007E, U+00A0-00BF, U+00D7, U+2010-2027, U+2032-2033, U+2039-203A, U+20AC, U+2212;
}

/* ---------- Токени ---------- */
:root {
  --night: #1D3049;
  --night-2: #26405F;
  --night-3: #2F4D72;
  --linen: #E7EDF3;
  --paper: #F9F7F3;
  --white: #FFFFFF;
  --ink: #18212E;
  --ink-soft: #4B5666;
  --line: rgba(24, 33, 46, 0.13);
  --line-strong: rgba(24, 33, 46, 0.28);
  --on-night: #F3F1EC;
  --on-night-soft: #B7C2D1;
  --line-night: rgba(243, 241, 236, 0.18);
  --honey: #E3A53E;
  --honey-hover: #ECB65C;
  --error: #A3322A;

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

  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --fs-h3: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
  --fs-h2: clamp(1.875rem, 1.35rem + 2.2vw, 3rem);
  --fs-h1: clamp(2.25rem, 1.45rem + 3.6vw, 4.125rem);

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --radius-card: 22px;
  --radius-btn: 14px;
  --radius-input: 12px;
}

/* ---------- Основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.nw { white-space: nowrap; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 1100px) {
  :root { --fs-body: 1.125rem; --header-h: 76px; }
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; }
h1, h2 { font-family: var(--serif); letter-spacing: -0.012em; }
h2 { font-size: var(--fs-h2); line-height: 1.12; font-weight: 560; }
h3 { font-size: var(--fs-h3); line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
dl, dd { margin: 0; }
section[id] { scroll-margin-top: calc(var(--header-h) + 8px); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

:focus-visible { outline: 3px solid var(--night); outline-offset: 3px; border-radius: 6px; }
.site-header :focus-visible,
.hero :focus-visible,
.section--night :focus-visible,
.site-footer :focus-visible,
.chat__head :focus-visible { outline-color: var(--honey); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--honey); color: var(--ink); padding: 10px 16px; border-radius: 10px;
  font-weight: 600; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 12px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: var(--radius-btn);
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  font-family: var(--sans); font-size: 1rem; font-weight: 600; line-height: 1.2;
  text-align: center; transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn--small { min-height: 42px; padding: 0 16px; font-size: 0.9375rem; border-radius: 12px; }
.btn--honey { background: var(--honey); color: var(--ink); }
.btn--honey:hover { background: var(--honey-hover); }
.btn--ink { background: var(--night); color: var(--on-night); }
.btn--ink:hover { background: var(--night-3); }
.btn--ghost { border-color: rgba(243, 241, 236, 0.42); color: var(--on-night); background: transparent; }
.btn--ghost:hover { border-color: var(--on-night); background: rgba(243, 241, 236, 0.06); }
.btn--quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--quiet:hover { border-color: var(--ink); }
.btn[disabled] { opacity: .6; cursor: progress; }

.text-link {
  display: inline; padding: 0; border: 0; background: none; cursor: pointer;
  color: inherit; font-weight: 600; text-decoration: underline;
  text-decoration-color: var(--honey); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.text-link:hover { text-decoration-color: currentColor; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--night); color: var(--on-night);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line-night); box-shadow: 0 8px 24px -16px rgba(0, 0, 0, .6); }
.site-header__inner { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; min-width: 0; color: var(--on-night); }
.brand__mark { flex: none; width: 30px; height: 30px; fill: var(--honey); }
.brand__mark rect:nth-child(1) { opacity: .55; }
.brand__mark rect:nth-child(2) { opacity: .78; }
.brand__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.brand__name { font-family: var(--serif); font-size: clamp(1.3125rem, 1.15rem + 0.55vw, 1.625rem); font-weight: 600; letter-spacing: -0.015em; white-space: nowrap; }
.brand__role { margin-top: 3px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--honey); white-space: nowrap; }
.brand:hover .brand__name { color: #fff; }

/* Переключатель языка */
.lang-switch { display: flex; align-items: center; gap: 4px; }
.lang-switch a:not(.btn), .site-nav .lang-switch a:not(.btn) {
  display: inline-grid; place-items: center; min-width: 38px; min-height: 38px; padding: 0 7px;
  border: 1px solid transparent; border-radius: 10px; color: var(--on-night-soft); text-decoration: none;
  font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; line-height: 1;
}
.lang-switch a:not(.btn):hover, .site-nav .lang-switch a:not(.btn):hover { color: var(--on-night); background: rgba(243, 241, 236, 0.08); text-decoration: none; }
.lang-switch a[aria-current], .site-nav .lang-switch a[aria-current] { color: var(--on-night); border-color: var(--honey); }
.lang-switch--footer a:not(.btn) { min-height: 36px; border-color: var(--line-night); }
.lang-switch--footer a[aria-current] { border-color: var(--honey); }
.cta-short { display: none; }
.site-nav ul { list-style: none; display: flex; gap: 4px; }
.site-nav a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 11px; white-space: nowrap;
  text-decoration: none; color: var(--on-night); font-size: 0.9875rem; font-weight: 500; border-radius: 10px;
}
.site-nav a:not(.btn):hover { background: rgba(243, 241, 236, 0.08); }
.menu-toggle {
  display: inline-grid; place-items: center; width: 46px; height: 46px; margin-right: -6px;
  border: 0; background: transparent; color: var(--on-night); cursor: pointer; border-radius: 12px;
}
.menu-toggle svg { width: 26px; height: 26px; }

@media (min-width: 1100px) {
  .site-nav { display: flex; align-items: center; gap: 16px; }
  .site-nav__cta { white-space: nowrap; }
  .site-nav__cta .cta-long { display: none; }
  .site-nav__cta .cta-short { display: inline; }
  .menu-toggle, .site-header__cta { display: none; }
  .site-nav__cta { min-height: 46px; padding: 0 20px; }
  .site-nav .lang-switch { margin-left: -4px; gap: 2px; }
}
@media (max-width: 1099px) {
  .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
    display: none; flex-direction: column; gap: 28px;
    padding: 28px var(--gutter) 40px; background: var(--night); overflow-y: auto;
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav a:not(.btn) { font-family: var(--serif); font-size: 1.625rem; min-height: 56px; padding: 0; }
  .site-nav__cta { align-self: flex-start; }
  .site-nav .lang-switch { gap: 10px; padding-top: 24px; border-top: 1px solid var(--line-night); }
  .site-nav .lang-switch a:not(.btn) { min-width: 60px; min-height: 48px; padding: 0 12px; font-size: 0.9375rem; border-color: var(--line-night); border-radius: 12px; }
  .site-nav .lang-switch a[aria-current] { border-color: var(--honey); }
}
@media (max-width: 419px) {
  .brand__mark { display: none; }
  .brand__name { font-size: 1.1875rem; }
  .brand__role { font-size: 0.6875rem; letter-spacing: 0.07em; }
}
@media (max-width: 389px) {
  .brand__name { font-size: 1.0625rem; }
  .site-header__cta { padding-left: 13px; padding-right: 13px; }
  .site-header__inner { gap: 10px; }
}
@media (max-width: 359px) {
  .brand__name { font-size: 1.1875rem; }
}
@media (max-width: 359px) {
  .site-header__cta { display: none; }
}
html.is-locked, html.is-locked body { overflow: hidden; }
html.menu-open .chat-launcher { display: none; }

/* ---------- Перший екран ---------- */
.hero { background: var(--night); color: var(--on-night); padding: clamp(32px, 5vw, 64px) 0 clamp(48px, 6vw, 72px); overflow: hidden; }
.hero__grid { display: grid; gap: 40px; align-items: center; }
.hero__title { font-size: var(--fs-h1); line-height: 1.06; font-weight: 560; max-width: 13ch; }
.hero__lead { margin-top: 24px; font-size: var(--fs-lead); color: var(--on-night-soft); max-width: 50ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__note { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: var(--fs-small); font-weight: 500; color: var(--on-night); }
.hero__note::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--honey); box-shadow: 0 0 0 4px rgba(227, 165, 62, .22); }
.hero__facts {
  list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px;
  max-width: 560px; margin-top: 36px; font-size: var(--fs-small); color: var(--on-night-soft);
}
.hero__facts li { padding: 11px 0; border-top: 1px solid var(--line-night); line-height: 1.4; }
.hero__card {
  margin: 0; justify-self: center; width: min(78vw, 360px);
  background: var(--paper); border-radius: 26px; padding: 12px 12px 0;
  transform: rotate(-2deg); box-shadow: 0 34px 60px -26px rgba(0, 0, 0, .55);
}
.hero__card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; }
.hero__card figcaption {
  padding: 14px 0 18px; text-align: center; color: var(--ink);
  font-family: var(--sans); font-size: 1.5rem; font-weight: 600; letter-spacing: 0.01em;
}
@media (max-width: 899px) {
  .hero__grid { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .hero__text { display: contents; }
  .hero__card { align-self: center; }
  .hero__title { order: 1; }
  .hero__lead { order: 2; }
  .hero__actions { order: 3; }
  .hero__note { order: 3; justify-content: center; }
  .hero__actions .btn { flex: 1 1 100%; }
  .hero__card { order: 4; margin-top: 44px; }
  .hero__facts { order: 5; margin-top: 44px; }
}
@media (min-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(40px, 5vw, 80px); }
  .hero__card { justify-self: end; width: min(100%, 420px); }
}
@media (min-width: 900px) and (min-height: 640px) {
  .hero__grid { min-height: min(calc(100svh - var(--header-h) - clamp(32px, 5vw, 64px)), 860px); }
  .speech { margin-top: 16px; }
}

/* Сходинки мовлення в першому екрані */
.speech { display: none; }
@media (min-width: 900px) {
  .speech { display: block; margin-top: clamp(40px, 5vw, 72px); }
  .speech__steps { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; }
  .speech__steps li { --h: calc(34px + var(--i) * 24px); }
  .speech__steps a { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-decoration: none; color: inherit; border-radius: 8px; }
  .speech__say {
    padding: 0 18px 12px 18px; font-family: var(--serif); font-style: italic;
    font-size: calc(0.9375rem + var(--i) * 0.17rem); line-height: 1.3;
    color: rgba(243, 241, 236, calc(0.62 + var(--i) * 0.095)); transition: color .2s;
  }
  .speech__cap {
    display: block; height: var(--h); padding: 10px 18px 0;
    border-top: 2px solid rgba(243, 241, 236, 0.4); border-left: 2px solid rgba(243, 241, 236, 0.4);
    font-size: 0.875rem; color: var(--on-night-soft); transition: border-color .2s, color .2s;
  }
  .speech__steps li:last-child .speech__say { color: var(--honey); }
  .speech__steps li:last-child .speech__cap { border-color: var(--honey); color: var(--honey); }
  .speech__steps a:hover .speech__say { color: var(--on-night); }
  .speech__steps li:last-child a:hover .speech__say { color: var(--honey-hover); }
  .speech__steps a:hover .speech__cap { border-color: var(--on-night); color: var(--on-night); }
  .speech__hint { margin-top: 18px; font-size: 0.875rem; color: var(--on-night-soft); }

  /* Єдина анімація при завантаженні: мовлення «піднімається» сходинками */
  .speech.is-animated li { opacity: 0; transform: translateY(10px); }
  .speech.is-animated .speech__cap { clip-path: inset(0 100% 0 0); }
  .speech.is-playing li { animation: speech-rise .7s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(0.35s + var(--i) * 0.42s); }
  .speech.is-playing .speech__cap { animation: speech-draw .6s ease-out forwards; animation-delay: calc(0.35s + var(--i) * 0.42s); }
}
@keyframes speech-rise { to { opacity: 1; transform: none; } }
@keyframes speech-draw { to { clip-path: inset(0 0 0 0); } }

/* ---------- Секції ---------- */
.section { padding: clamp(72px, 9vw, 128px) 0; }
.section--linen { background: var(--linen); }
.section--night { background: var(--night); color: var(--on-night); }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 4vw, 56px); }
.section-head .lead, .lead { margin-top: 18px; font-size: var(--fs-lead); color: var(--ink-soft); max-width: 62ch; }
.section--night .lead { color: var(--on-night-soft); }

/* Галочки */
.ticks { list-style: none; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before {
  content: ''; position: absolute; left: 2px; top: 0.5em; width: 14px; height: 8px;
  border-left: 2px solid var(--honey); border-bottom: 2px solid var(--honey);
  transform: rotate(-45deg); transform-origin: center;
}

/* ---------- Ознаки ---------- */
.signs { display: grid; gap: 36px; }
.signs__col { border-top: 2px solid var(--ink); padding-top: 22px; }
.signs__col h3 { font-family: var(--serif); font-size: clamp(1.3125rem, 1.15rem + 0.6vw, 1.625rem); font-weight: 560; line-height: 1.22; }
.signs__kind { margin: 8px 0 18px; font-size: var(--fs-small); color: var(--ink-soft); }
@media (min-width: 900px) {
  .signs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
}
.callout {
  display: flex; flex-direction: column; align-items: flex-start; gap: 20px;
  margin-top: clamp(40px, 5vw, 64px); padding: clamp(24px, 3vw, 36px);
  background: var(--linen); border-radius: var(--radius-card);
}
.callout p { font-size: var(--fs-lead); max-width: 62ch; }
@media (min-width: 900px) {
  .callout { flex-direction: row; align-items: center; justify-content: space-between; gap: 40px; }
  .callout .btn { flex-shrink: 0; }
}

/* ---------- РАС ---------- */
.ras { display: grid; gap: 32px; align-items: start; }
.ras__note { margin-top: 20px; color: var(--ink-soft); max-width: 62ch; }
.ras__card { background: var(--paper); border-radius: var(--radius-card); padding: clamp(24px, 3vw, 36px); }
.ras__card h3 { margin-bottom: 18px; }
.ras__card .text-link { display: inline-block; margin-top: 22px; }
@media (min-width: 900px) {
  .ras { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 64px; }
  .ras__card { margin-top: 8px; }
}

/* ---------- Метод: сходинки ---------- */
.stairs__prompt { font-weight: 600; font-size: 1.0625rem; margin-bottom: 18px; }
.stairs {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; gap: 6px;
  border-bottom: 2px solid var(--line-night);
}
.stairs__step {
  --sh: calc(64px + var(--i) * 18px);
  height: var(--sh); display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 12px; border: 0; border-radius: 14px 14px 3px 3px; text-align: left; cursor: pointer;
  background: var(--night-2); color: var(--on-night);
  box-shadow: inset 0 3px 0 rgba(243, 241, 236, 0.2);
  transition: background-color .2s ease, color .2s ease;
}
.stairs__step:hover { background: var(--night-3); }
.stairs__step[aria-selected="true"] { background: var(--honey); color: var(--ink); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.55); }
.stairs__num { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1; }
.stairs__step[data-step="5"]:not([aria-selected="true"]) .stairs__num,
.stairs__step[data-step="5"]:not([aria-selected="true"]) .stairs__name { color: var(--honey); }
.stairs__name { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
@media (max-width: 759px) {
  .stairs__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 760px) {
  .stairs__step { --sh: calc(108px + var(--i) * 34px); padding: 16px 18px; }
  .stairs__num { font-size: 1.75rem; }
  .stairs { gap: 8px; }
}
.stairs__panels { margin-top: 20px; display: grid; gap: 20px; }
.stair-panel {
  background: var(--paper); color: var(--ink); border-radius: var(--radius-card);
  padding: clamp(22px, 4vw, 44px); display: grid; gap: 24px;
}
.stair-panel[hidden] { display: none; }
.stair-panel.is-entering { animation: panel-in .28s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stair-panel__level { font-size: var(--fs-small); font-weight: 600; color: var(--ink-soft); }
.stair-panel__title { margin-top: 6px; font-family: var(--serif); font-size: clamp(1.5rem, 1.25rem + 1vw, 2.125rem); font-weight: 560; line-height: 1.15; }
.stair-panel__say {
  margin-top: 18px; padding-left: 16px; border-left: 3px solid var(--honey);
  font-family: var(--serif); font-style: italic; font-size: clamp(1.1875rem, 1.05rem + 0.7vw, 1.5rem); line-height: 1.35; color: var(--night);
}
.stair-panel__body { display: grid; gap: 22px; }
.stair-panel__body h4 { font-size: 1rem; margin-bottom: 6px; }
.stair-panel__body p { color: var(--ink-soft); }
.stair-panel__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.stair-panel__note { font-size: var(--fs-small); color: var(--ink-soft); }
@media (min-width: 900px) {
  .stair-panel { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); column-gap: 56px; }
  .stair-panel__body { grid-template-columns: 1fr 1fr; gap: 32px; }
  .stair-panel__actions { grid-column: 1 / -1; }
}

/* ---------- Що входить у корекцію ---------- */
.correction { display: grid; gap: 40px; align-items: start; }
.correction__cols { display: grid; gap: 28px; margin-top: 36px; }
.correction__cols h3 { font-family: var(--serif); font-size: clamp(1.25rem, 1.15rem + 0.4vw, 1.4375rem); font-weight: 560; margin-bottom: 4px; }
.plain-list { list-style: none; }
.plain-list li { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list strong { color: var(--ink); font-weight: 600; }
@media (min-width: 760px) {
  .correction__cols { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (min-width: 1100px) {
  .correction { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 64px; }
  .correction__photo { position: sticky; top: calc(var(--header-h) + 32px); margin-top: 8px; }
}

/* Фото з підписом, як навчальна картка */
.photo { margin: 0; }
.photo img { width: 100%; border-radius: 18px; aspect-ratio: 3 / 2; object-fit: cover; background: var(--linen); }
.photo figcaption { margin-top: 12px; font-size: var(--fs-small); color: var(--ink-soft); max-width: 46ch; }

/* ---------- Як проходить робота ---------- */
.process-block { margin-top: clamp(72px, 9vw, 120px); }
.process { list-style: none; position: relative; display: grid; gap: 28px; margin-top: 36px; }
.process__item { position: relative; padding-left: 68px; }
.process__item:not(:last-child)::before { content: ''; position: absolute; left: 21px; top: 38px; bottom: -34px; width: 2px; background: var(--line); }
.process__num {
  position: absolute; left: 0; top: -6px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--paper); border: 2px solid var(--night);
  font-family: var(--serif); font-size: 1.125rem; font-weight: 600; color: var(--night);
}
.process__item:last-child .process__num { background: var(--honey); border-color: var(--honey); color: var(--ink); }
.process__item h3 { margin-bottom: 6px; }
.process__item p { color: var(--ink-soft); }
@media (min-width: 1000px) {
  .process { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; }
  .process__item { padding-left: 0; padding-top: 68px; }
  .process__item:not(:last-child)::before { left: 44px; right: -28px; top: 21px; bottom: auto; width: auto; height: 2px; }
  .process__num { top: 0; }
}

/* ---------- Онлайн ---------- */
.online__photos { display: grid; gap: 28px; }
.online__points { list-style: none; display: grid; gap: 24px; margin-top: clamp(40px, 5vw, 64px); }
.online__points li { border-top: 2px solid var(--ink); padding-top: 18px; }
.online__points h3 { margin-bottom: 6px; }
.online__points p { color: var(--ink-soft); }
@media (min-width: 760px) {
  .online__photos { grid-template-columns: 1fr 1fr; }
  .online__points { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; }
}

/* ---------- Результати і відгуки ---------- */
.results { display: grid; gap: 28px; }
.result-card { margin: 0; }
.result-card__player { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: var(--night); }
.result-card__player button {
  position: absolute; inset: 0; width: 100%; border: 0; padding: 0; cursor: pointer; background: var(--night);
  display: grid; place-items: center;
}
.result-card__player img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.result-card__play {
  position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px;
  background: var(--honey); color: var(--ink); font-weight: 600;
}
.result-card__player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.result-card h3 { margin-top: 14px; }
.result-card p { color: var(--ink-soft); margin-top: 4px; }
.reviews { display: grid; gap: 24px; }
.review { margin: 0; padding: 26px; background: var(--paper); border-radius: var(--radius-card); }
.review p { font-family: var(--serif); font-size: 1.125rem; line-height: 1.55; }
.review footer { margin-top: 14px; font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
.review__note { display: block; margin-top: 2px; font-weight: 400; font-size: 0.8125rem; color: var(--ink-soft); }
@media (min-width: 760px) {
  .results { grid-template-columns: 1fr 1fr; }
  .reviews { display: block; columns: 2; column-gap: 24px; }
  .review { break-inside: avoid; margin-bottom: 24px; }
}
@media (min-width: 1100px) {
  .reviews { columns: 3; }
}

/* ---------- Про мене ---------- */
.about { display: grid; gap: 40px; align-items: start; }
.about__photo img { aspect-ratio: 4 / 5; }
.about__text > p { margin-top: 18px; max-width: 62ch; }
.about__text h2 { margin-bottom: 4px; }
.quote { margin: 32px 0 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--honey); }
.quote p { font-family: var(--serif); font-style: italic; font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem); line-height: 1.38; color: var(--night); }
.creds { display: grid; gap: 0; margin-top: 32px; }
.creds > div { display: grid; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.creds dt { font-size: var(--fs-small); color: var(--ink-soft); }
.creds dd { max-width: 60ch; }
@media (min-width: 600px) {
  .creds > div { grid-template-columns: 8.5rem 1fr; gap: 20px; }
}
.diploma-btn {
  display: inline-flex; align-items: center; gap: 16px; margin-top: 24px; padding: 10px 20px 10px 10px;
  background: transparent; border: 1.5px solid var(--line-strong); border-radius: var(--radius-btn);
  cursor: pointer; font-weight: 600; transition: border-color .18s, background-color .18s;
}
.diploma-btn:hover { border-color: var(--ink); background: var(--white); }
.diploma-btn img { width: 54px; height: 72px; object-fit: cover; border-radius: 6px; }
@media (min-width: 900px) {
  .about { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 72px; }
  .about__photo { position: sticky; top: calc(var(--header-h) + 32px); }
}

/* ---------- Формат ---------- */
.facts { display: grid; gap: 0 32px; margin-bottom: 40px; }
.facts > div { padding: 18px 0; border-top: 1px solid var(--line-strong); }
.facts dt { font-size: var(--fs-small); color: var(--ink-soft); }
.facts dd { margin-top: 4px; font-family: var(--serif); font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem); line-height: 1.35; }
@media (min-width: 560px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Питання ---------- */
.faq { max-width: 860px; border-top: 1px solid var(--line-strong); }
@media (min-width: 1000px) {
  .faq-wrap { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr); gap: 64px; align-items: start; }
  .faq-wrap .section-head { position: sticky; top: calc(var(--header-h) + 32px); margin-bottom: 0; }
}
.faq details { border-bottom: 1px solid var(--line-strong); }
.faq summary {
  position: relative; list-style: none; cursor: pointer; padding: 22px 56px 22px 0;
  font-family: var(--serif); font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem); font-weight: 500; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after {
  content: ''; position: absolute; right: 12px; top: 50%; width: 16px; height: 2px; background: var(--ink);
  transition: transform .2s ease;
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq summary:hover { color: var(--night-3); }
.faq details p { padding: 0 56px 24px 0; color: var(--ink-soft); max-width: 68ch; }

/* ---------- Запис ---------- */
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: start; }
.contact__intro h2 { color: var(--on-night); }
.messengers { margin-top: 32px; }
.messengers__label { font-size: var(--fs-small); color: var(--on-night-soft); margin-bottom: 12px; }
.messengers__list { display: flex; flex-wrap: wrap; gap: 10px; }
.msg-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px;
  border: 1.5px solid rgba(243, 241, 236, 0.32); border-radius: 999px; color: var(--on-night);
  text-decoration: none; font-weight: 600; font-size: 0.9875rem; transition: border-color .18s, background-color .18s;
}
.msg-btn:hover { border-color: var(--on-night); background: rgba(243, 241, 236, 0.06); }
.msg-btn svg { width: 22px; height: 22px; }
.contact__photo { display: none; }
@media (min-width: 900px) {
  .contact__grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 64px; }
  .contact__photo { display: block; margin-top: 40px; max-width: 360px; }
  .contact__photo img { aspect-ratio: 4 / 5; opacity: .92; }
}

/* Форма */
.form-card { background: var(--paper); color: var(--ink); border-radius: 24px; padding: clamp(22px, 3.5vw, 40px); }
.lead-form__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.lead-form__count { font-size: var(--fs-small); color: var(--ink-soft); }
.lead-form__bar { display: flex; gap: 6px; }
.lead-form__bar span { width: 36px; height: 6px; border-radius: 6px; background: var(--line); transition: background-color .2s; }
.lead-form__bar span.is-done { background: var(--honey); }
.lead-form__title { font-family: var(--serif); font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem); font-weight: 560; margin-bottom: 22px; }
.lead-form__title:focus { outline: none; }
.field { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.field legend, .field__label { display: block; padding: 0; margin-bottom: 12px; font-weight: 600; font-size: 1rem; line-height: 1.4; }
.optional { font-weight: 400; font-size: 0.875rem; color: var(--ink-soft); margin-left: 4px; }
.field__hint { margin-top: 6px; font-size: 0.875rem; color: var(--ink-soft); }
.field__error { margin-top: 8px; font-size: 0.9375rem; font-weight: 500; color: var(--error); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input, .option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: var(--white); cursor: pointer; font-size: 0.9875rem; font-weight: 500;
  transition: background-color .15s, border-color .15s, color .15s; user-select: none;
}
.chip span:hover { border-color: var(--ink); }
.chip input:checked + span { background: var(--night); border-color: var(--night); color: var(--on-night); }
.chip input:focus-visible + span, .option input:focus-visible + span { outline: 3px solid var(--night); outline-offset: 2px; }
.options { display: grid; gap: 8px; }
.option { position: relative; display: block; }
.option span {
  display: block; position: relative; padding: 12px 16px 12px 50px; border: 1.5px solid var(--line-strong);
  border-radius: 14px; background: var(--white); cursor: pointer; font-size: 0.9375rem; color: var(--ink-soft); line-height: 1.4;
  transition: border-color .15s, background-color .15s;
}
.option span b { display: block; color: var(--ink); font-weight: 600; font-size: 1rem; }
.option span::before {
  content: ''; position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
  border-radius: 50%; border: 2px solid var(--line-strong); background: var(--white); transition: border-color .15s, box-shadow .15s;
}
.option span:hover { border-color: var(--ink); }
.option input:checked + span { border-color: var(--night); }
.option input:checked + span::before { border-color: var(--night); box-shadow: inset 0 0 0 4px var(--white); background: var(--night); }
.field input[type="text"], .field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-input);
  background: var(--white); color: var(--ink); font: inherit; font-size: 1rem; line-height: 1.4; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 104px; resize: vertical; }
.field input[type="text"]:focus, .field textarea:focus { outline: none; border-color: var(--night); box-shadow: 0 0 0 3px rgba(29, 48, 73, 0.18); }
.field.is-invalid input[type="text"], .field.is-invalid .chip span, .field.is-invalid .option span { border-color: var(--error); }
.consent { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 0.9375rem; line-height: 1.45; }
.consent input { flex-shrink: 0; width: 22px; height: 22px; margin: 0; accent-color: var(--night); }
.consent a { font-weight: 600; text-decoration-color: var(--honey); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.lead-form__nav { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.lead-form__nav [data-form-next], .lead-form__nav [data-form-submit] { margin-left: auto; }
.lead-form__status { margin-top: 14px; font-size: 0.9375rem; color: var(--error); }
.lead-form__status:empty { display: none; }
.lead-form__status a { font-weight: 600; }
.lead-done { padding: 12px 0; }
.lead-done:focus { outline: none; }
.lead-done h3 { font-family: var(--serif); font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem); font-weight: 560; display: flex; align-items: center; gap: 14px; }
.lead-done h3::before {
  content: ''; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--honey) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%2318212E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.lead-done p { margin-top: 14px; color: var(--ink-soft); }
.lead-done__demo { font-size: 0.875rem; }
.lead-done .btn { margin-top: 24px; }

/* ---------- Підвал ---------- */
.site-footer { background: var(--night); color: var(--on-night-soft); padding: 0 0 104px; font-size: var(--fs-small); }
.site-footer__grid { display: grid; gap: 28px; padding-top: 40px; border-top: 1px solid var(--line-night); }
.site-footer__name { font-family: var(--serif); font-size: 1.25rem; color: var(--on-night); margin-bottom: 6px; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--on-night); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--honey); text-underline-offset: 4px; }
.site-footer__contacts { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer__contacts:empty { display: none; }
.site-footer__contacts a { display: inline-flex; align-items: center; gap: 8px; }
.site-footer__contacts svg { width: 18px; height: 18px; }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: 8px 24px; }
@media (min-width: 900px) {
  .site-footer__grid { grid-template-columns: 1.2fr 1fr; align-items: start; }
  .site-footer__nav { justify-content: flex-end; }
  .site-footer .lang-switch--footer { justify-self: end; }
  .site-footer__legal { grid-column: 1 / -1; justify-content: space-between; padding-top: 20px; border-top: 1px solid var(--line-night); }
}

/* ---------- Чат-помічник ---------- */
.chat-launcher {
  position: fixed; z-index: 60; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 20px 0 16px;
  border: 0; border-radius: 999px; background: var(--honey); color: var(--ink); cursor: pointer;
  font-weight: 600; font-size: 1rem; box-shadow: 0 14px 34px -12px rgba(13, 22, 35, 0.55);
  transition: background-color .18s, transform .18s;
}
.chat-launcher:hover { background: var(--honey-hover); }
.chat-launcher svg { width: 24px; height: 24px; }
.chat-launcher:focus-visible { outline: 3px solid var(--night); outline-offset: 3px; }
@media (max-width: 599px) {
  .chat-launcher { width: 56px; height: 56px; min-height: 0; padding: 0; justify-content: center; }
  .chat-launcher__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.chat {
  position: fixed; z-index: 70; right: 16px; bottom: 86px;
  width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 110px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); color: var(--ink); border-radius: 22px;
  box-shadow: 0 30px 80px -24px rgba(13, 22, 35, 0.55), 0 0 0 1px rgba(24, 33, 46, 0.08);
}
.chat[hidden] { display: none; }
.chat.is-opening { animation: chat-in .22s ease-out; }
@keyframes chat-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 599px) {
  .chat { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
  html.chat-open .chat-launcher { display: none; }
}
.chat__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 12px 16px 20px; background: var(--night); color: var(--on-night); }
.chat__title { font-family: var(--serif); font-size: 1.1875rem; font-weight: 560; }
.chat__sub { font-size: 0.875rem; color: var(--on-night-soft); margin-top: 2px; }
.chat__reset {
  min-height: 28px; margin-top: 4px; padding: 2px 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 0.8125rem; color: var(--on-night-soft);
  text-decoration: underline; text-decoration-color: rgba(227, 165, 62, .7); text-underline-offset: 3px;
}
.chat__reset:hover { color: var(--on-night); }
.chat__close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--on-night); cursor: pointer; }
.chat__close:hover { background: rgba(243, 241, 236, 0.1); }
.chat__close svg { width: 22px; height: 22px; }
.chat__log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 0.96875rem; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.msg--bot { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg--user { align-self: flex-end; background: var(--night); color: var(--on-night); border-bottom-right-radius: 6px; }
.msg--note { align-self: center; max-width: 100%; padding: 4px 8px; font-size: 0.8125rem; color: var(--ink-soft); background: none; }
.msg a { font-weight: 600; }
.msg--typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
.msg--typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); animation: typing 1s infinite ease-in-out; }
.msg--typing span:nth-child(2) { animation-delay: .15s; }
.msg--typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 12px; }
.chat__chips:empty { display: none; }
.chat-chip {
  min-height: 40px; padding: 6px 14px; border: 1.5px solid var(--night); border-radius: 999px;
  background: transparent; color: var(--night); cursor: pointer; font-size: 0.9375rem; font-weight: 500; line-height: 1.25; text-align: left;
  transition: background-color .15s, color .15s;
}
.chat-chip:hover { background: var(--night); color: var(--on-night); }
.chat__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--paper); }
/* Многострочное поле: растёт до ~5 строк, дальше прокрутка (высоту ставит main.js) */
.chat__form textarea {
  display: block; flex: 1; min-width: 0; height: 48px; min-height: 48px; max-height: 140px; padding: 11px 14px;
  border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--white); color: var(--ink);
  font: inherit; font-size: 1rem; line-height: 1.4; resize: none; overflow-y: hidden;
}
.chat__form textarea:focus { outline: none; border-color: var(--night); box-shadow: 0 0 0 3px rgba(29, 48, 73, 0.18); }
.chat__send { flex-shrink: 0; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 12px; background: var(--honey); color: var(--ink); cursor: pointer; }
.chat__send:hover { background: var(--honey-hover); }
.chat__send svg { width: 22px; height: 22px; }
.chat__legal { padding: 0 16px 12px; font-size: 0.75rem; color: var(--ink-soft); background: var(--paper); }
.chat__legal a { color: inherit; }

/* ---------- Диплом ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(92vw, 640px); max-height: 94vh; overflow: visible; }
.lightbox::backdrop { background: rgba(13, 22, 35, 0.78); }
.lightbox img { width: 100%; height: auto; max-height: 88vh; object-fit: contain; border-radius: 12px; background: var(--white); }
.lightbox__close {
  position: absolute; top: -14px; right: -14px; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: var(--honey); color: var(--ink); cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}
.lightbox__close svg { width: 20px; height: 20px; }
@media (max-width: 599px) { .lightbox__close { top: 8px; right: 8px; } }

/* ---------- Менше руху, якщо так налаштовано ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .speech.is-animated li { opacity: 1; transform: none; }
  .speech.is-animated .speech__cap { clip-path: none; }
}

/* Друк: тільки зміст */
@media print {
  .site-header, .chat-launcher, .chat, .hero__actions, .speech, .form-card, .messengers { display: none !important; }
  .section--night, .hero { background: none; color: #000; }
}
