/* Лендинг Fluxy (docs/landing.md). Тёмная тема, без зависимостей. */

:root {
  --bg: #000;
  --bg-2: #0a0a0c;
  --surface: rgba(255, 255, 255, .04);
  --surface-2: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .1);
  --text: #f5f5f7;
  --muted: #86868b;
  --blue: #2997ff;
  --violet: #bf5af2;
  --pink: #ff4f9a;
  --green: #30d158;
  --gold: #ffd60a;
  --grad: linear-gradient(100deg, var(--blue), var(--violet) 55%, var(--pink));
  --radius: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
[hidden] { display: none !important; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }

.muted { color: var(--muted); }

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
}

.section-title {
  margin: 0 0 40px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -.03em;
  font-weight: 700;
  max-width: 16ch;
}
.section-title--sm { font-size: clamp(28px, 4vw, 40px); margin-bottom: 10px; max-width: none; }

.gradient-text {
  background: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s linear infinite;
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Кнопки ---------- */

.btn {
  --mx: 0px;
  --my: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font: 600 17px/1 var(--font);
  cursor: pointer;
  transform: translate(var(--mx), var(--my));
  transition: transform .4s var(--ease), background .3s, box-shadow .3s, opacity .3s;
}
.btn--primary {
  background: var(--text);
  color: #000;
  box-shadow: 0 0 0 0 rgba(41, 151, 255, 0);
}
.btn--primary:hover { box-shadow: 0 10px 40px -8px rgba(41, 151, 255, .6); }
.btn--ghost { color: var(--blue); padding-inline: 12px; }
.btn--ghost:hover { text-decoration: underline; }
.btn--small { min-height: 34px; padding: 0 16px; font-size: 14px; }
.btn--large { min-height: 60px; padding: 0 36px; font-size: 19px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---------- Прогресс и навигация ---------- */

.progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 60;
  background: var(--grad);
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
}

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  transition: background .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(0, 0, 0, .65);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-color: var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, 100% - 32px);
  height: 56px;
  margin-inline: auto;
}
.nav__links { display: flex; gap: 28px; font-size: 14px; color: #d2d2d7; }
.nav__links a { transition: color .2s; }
.nav__links a:hover { color: var(--text); }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
/* Маскот Fluxy. */
.logo__mark {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

/* ---------- Появление при прокрутке ---------- */

.reveal {
  opacity: 0;
  transform: translateY(40px) scale(.98);
  filter: blur(8px);
  transition:
    opacity 1s var(--ease) var(--d, 0ms),
    transform 1s var(--ease) var(--d, 0ms),
    filter 1s var(--ease) var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; filter: none; }

/* Слова заголовка: data-split разбивает его на span.word. */
.word {
  display: inline-block;
  opacity: 0;
  transform: translateY(.6em) rotateX(-40deg);
  filter: blur(12px);
  transform-origin: 50% 100%;
  animation: word-in 1.1s var(--ease) forwards;
  animation-delay: calc(var(--i) * 90ms + 100ms);
}
@keyframes word-in { to { opacity: 1; transform: none; filter: none; } }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100svh;
  padding: 140px 16px 120px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, #000 20%, transparent 70%);
}

.aurora { position: absolute; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora__blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .35;
  mix-blend-mode: screen;
  animation: drift 22s ease-in-out infinite alternate;
}
.aurora__blob--1 { background: var(--blue); top: -30vmax; left: -15vmax; }
.aurora__blob--2 { background: var(--violet); top: -25vmax; right: -20vmax; animation-duration: 28s; animation-delay: -6s; }
.aurora__blob--3 { background: var(--pink); top: 10vmax; left: 25%; width: 40vmax; height: 40vmax; opacity: .18; animation-duration: 34s; }
.aurora--soft .aurora__blob { opacity: .16; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8vmax, 6vmax) scale(1.15); }
  100% { transform: translate(-6vmax, 10vmax) scale(.95); }
}

/* Подсветка за курсором (--hx/--hy ставит JS). */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(600px circle at var(--hx, 50%) var(--hy, 30%), rgba(41, 151, 255, .12), transparent 40%);
  pointer-events: none;
}

.hero__content { max-width: 920px; }
.hero__title {
  margin: 0;
  font-size: clamp(48px, 9.5vw, 112px);
  line-height: 1;
  letter-spacing: -.045em;
  font-weight: 700;
  perspective: 800px;
}
.hero__lead {
  max-width: 640px;
  margin: 28px auto 0;
  font-size: clamp(18px, 2.2vw, 22px);
  color: #a1a1a6;
}
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 20px; margin-top: 36px; }

.hero__device {
  position: relative;
  width: min(880px, 100%);
  margin-top: 72px;
  perspective: 1400px;
}
.hero__glow {
  position: absolute;
  inset: 20% 10% -10%;
  z-index: -1;
  background: var(--grad);
  filter: blur(80px);
  opacity: .35;
}

.window {
  --rx: 14deg;
  --ry: 0deg;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(16, 16, 20, .82);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .08);
  text-align: left;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .6s var(--ease);
}
.window__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.window__bar span { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.window__bar span:nth-child(2) { background: #febc2e; }
.window__bar span:nth-child(3) { background: #28c840; }
.window__bar p { margin: 0 auto; padding-right: 52px; color: var(--muted); font-size: 13px; }
.window__body { display: grid; grid-template-columns: 1fr 200px; gap: 16px; padding: 22px; min-height: 260px; }

.code {
  margin: 0;
  font: 15px/1.7 var(--mono);
  color: #e5e5ea;
  white-space: pre-wrap;
}
.code .k { color: #ff7ab2; }
.code .f { color: #67b7ff; }
.code .s { color: #ffa14f; }
.code .n { color: #d9c97c; }
.code .c { color: #6c7986; }
.caret {
  display: inline-block;
  width: 8px;
  height: 1.15em;
  vertical-align: -3px;
  background: var(--blue);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.window__side { display: flex; flex-direction: column; gap: 10px; }
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.chip.is-in { opacity: 1; transform: none; }
.chip--ok { color: var(--green); }
.chip--coin { color: var(--gold); }

.coin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6b0, var(--gold) 45%, #c79100);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2);
}
.coin--big { width: 56px; height: 56px; }

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  width: 26px;
  height: 42px;
  margin-left: -13px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-radius: 14px;
}
.scroll-hint span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--text);
  animation: scroll-dot 1.8s var(--ease) infinite;
}
@keyframes scroll-dot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Бегущая строка ---------- */

.marquee {
  padding: 28px 0;
  border-block: 1px solid var(--line);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee ul { display: flex; gap: 56px; margin: 0; padding: 0 28px; list-style: none; }
.marquee li {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -.02em;
  color: #6e6e73;
  white-space: nowrap;
}
.marquee li:nth-child(3n + 1) { color: var(--text); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Цифры ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-block: 120px;
}
.stat strong {
  display: block;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -.04em;
  background: linear-gradient(180deg, #fff, #8e8e93);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat p { margin: 12px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- Липкая сцена урока ---------- */

.story { position: relative; height: 400vh; }
.story__sticky {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}
.story__layout { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.story .section-title { font-size: clamp(32px, 4vw, 48px); margin-bottom: 28px; }
.story__steps { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.story__steps li {
  display: flex;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  opacity: .32;
  transition: opacity .5s var(--ease), background .5s var(--ease);
}
.story__steps li.is-active { opacity: 1; background: var(--surface); }
.story__steps h3 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.01em; }
.story__steps p { margin: 0; color: var(--muted); font-size: 16px; }
.story__num { font: 600 14px/1.9 var(--mono); color: var(--blue); }

.story__visual { position: relative; aspect-ratio: 4 / 3.4; }
.screen {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(120% 90% at 0% 0%, rgba(41, 151, 255, .18), transparent 50%), var(--bg-2);
  box-shadow: 0 40px 100px -40px rgba(41, 151, 255, .35);
  overflow: hidden;
}
.screen > * {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transform: translateY(30px) scale(.96);
  filter: blur(10px);
  transition: opacity .7s var(--ease), transform .7s var(--ease), filter .7s var(--ease);
}
.screen[data-scene="0"] .slide,
.screen[data-scene="1"] .task,
.screen[data-scene="2"] .check,
.screen[data-scene="3"] .reward { opacity: 1; transform: none; filter: none; }

.slide__kicker { margin: 0; color: var(--blue); font-weight: 600; }
.slide__title { margin: 12px 0 0; font-size: clamp(32px, 4vw, 52px); line-height: 1.05; font-weight: 700; letter-spacing: -.03em; }
.slide__dots { display: flex; gap: 6px; margin-top: 32px; }
.slide__dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.slide__dots i.on { width: 24px; border-radius: 4px; background: var(--blue); }

.task__title { margin: 0; color: var(--muted); font-size: 14px; }
.task__q { margin: 8px 0 20px; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.task__code { margin: 0; padding: 20px; border-radius: 14px; background: #000; border: 1px solid var(--line); font: 15px/1.7 var(--mono); color: #e5e5ea; }
.task__code .k { color: #ff7ab2; }
.task__code .f { color: #67b7ff; }
.task__code .n { color: #d9c97c; }

.check { align-items: center; text-align: center; }
.check svg,
.form__done svg { width: 96px; height: 96px; fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.check circle,
.form__done circle { stroke-dasharray: 151; stroke-dashoffset: 151; opacity: .5; }
.check path,
.form__done path { stroke-dasharray: 40; stroke-dashoffset: 40; }
.screen[data-scene="2"] .check circle,
.form__done.is-in circle { animation: draw .8s var(--ease) .1s forwards; }
.screen[data-scene="2"] .check path,
.form__done.is-in path { animation: draw .5s var(--ease) .6s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.check p { margin: 18px 0 10px; font-size: 24px; font-weight: 600; }
.check ul { margin: 0; padding: 0; list-style: none; font: 15px/1.7 var(--mono); color: var(--muted); }

.reward { align-items: center; text-align: center; }
.reward__coins { display: flex; gap: 0; height: 80px; align-items: flex-end; }
.reward__coins .coin { margin: 0 -8px; }
.screen[data-scene="3"] .reward__coins .coin { animation: coin-pop .8s var(--ease) both; }
.screen[data-scene="3"] .reward__coins .coin:nth-child(2) { animation-delay: .12s; transform: translateY(-14px); }
.screen[data-scene="3"] .reward__coins .coin:nth-child(3) { animation-delay: .24s; }
@keyframes coin-pop { from { opacity: 0; transform: translateY(40px) rotateY(180deg) scale(.4); } }
.reward__value { margin: 12px 0 0; font-size: 72px; font-weight: 800; letter-spacing: -.04em; color: var(--gold); line-height: 1; }
.reward__label { margin: 4px 0 24px; color: var(--muted); }
.reward__streak { padding: 10px 16px; border-radius: 999px; background: rgba(255, 159, 10, .12); color: #ff9f0a; font-size: 15px; font-weight: 600; }

/* ---------- Бенто ---------- */

.features { padding-block: 140px 80px; }
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.card {
  --x: 50%;
  --y: 50%;
  position: relative;
  min-height: 240px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
  isolation: isolate;
}
.card--wide { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; }
.card h3 { margin: 18px 0 8px; font-size: 22px; letter-spacing: -.02em; }
.card--wide h3 { font-size: clamp(26px, 3vw, 36px); max-width: 14ch; line-height: 1.1; }
.card p { margin: 0; color: var(--muted); font-size: 16px; max-width: 46ch; }
.card__icon { font-size: 32px; line-height: 1; }

/* Свет за курсором: --x/--y ставит JS ([data-spotlight]). */
[data-spotlight]::before,
[data-spotlight]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s;
}
[data-spotlight]::before {
  z-index: -1;
  background: radial-gradient(420px circle at var(--x) var(--y), rgba(255, 255, 255, .07), transparent 45%);
}
[data-spotlight]::after {
  padding: 1px;
  background: radial-gradient(300px circle at var(--x) var(--y), rgba(41, 151, 255, .8), rgba(191, 90, 242, .4) 30%, transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
[data-spotlight]:hover::before,
[data-spotlight]:hover::after { opacity: 1; }

/* Схема класса: компьютер учителя и ученики по локальной сети. */
.network { --r: min(150px, 28vw); position: relative; flex: 1; min-height: 340px; margin-top: 24px; }
.network::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--r) * 2);
  height: calc(var(--r) * 2);
  margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1);
  border: 1px dashed rgba(255, 255, 255, .12);
  border-radius: 50%;
  animation: spin 60s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.network__hub,
.network__node {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 14px;
}
.network__hub {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  background: var(--grad);
  box-shadow: 0 0 60px rgba(41, 151, 255, .6);
}
.network__hub::before,
.network__hub::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(41, 151, 255, .5);
  border-radius: 20px;
  animation: ping 2.6s var(--ease) infinite;
}
.network__hub::after { animation-delay: 1.3s; }
@keyframes ping { from { transform: scale(1); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
.network__node {
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: linear-gradient(160deg, #2c2c34, #15151a);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a)));
}
.network__node::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 12px var(--blue);
  animation: packet 2.4s var(--ease) infinite;
  animation-delay: calc(var(--a) / 72deg * .45s);
}
/* Пакет летит от центра к ученику: смещение в обратную сторону от узла. */
@keyframes packet {
  0% { transform: rotate(calc(var(--a) + 180deg)) translateX(var(--r)); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: rotate(calc(var(--a) + 180deg)) translateX(0); opacity: 0; }
}

/* ---------- Родителям ---------- */

.parents { padding-block: 100px; overflow: hidden; }
.parents__layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
.checklist { display: grid; gap: 18px; margin: 0 0 36px; padding: 0; list-style: none; }
.checklist li { position: relative; padding-left: 36px; font-size: 19px; color: #d2d2d7; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--grad);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='11'/%3E%3C/svg%3E");
}
.checklist li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 9px;
  width: 8px;
  height: 5px;
  border: 2px solid #000;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg);
}
.parents__actions { display: grid; gap: 14px; justify-items: start; }
.hint { margin: 0; color: var(--muted); font-size: 14px; max-width: 42ch; }

.phone { justify-self: center; transform: translateY(var(--py, 0)); }
.phone.reveal.is-in { transform: translateY(var(--py, 0)); }
.phone__frame {
  position: relative;
  width: 300px;
  height: 620px;
  padding: 14px;
  border-radius: 54px;
  background: linear-gradient(145deg, #3a3a3c, #1c1c1e 40%, #2c2c2e);
  box-shadow: 0 60px 120px -40px rgba(191, 90, 242, .45), inset 0 0 0 2px #48484a;
}
.phone__notch { position: absolute; top: 26px; left: 50%; width: 96px; height: 28px; margin-left: -48px; border-radius: 20px; background: #000; z-index: 2; }
.phone__screen {
  position: relative;
  height: 100%;
  padding: 64px 16px 16px;
  border-radius: 42px;
  background: linear-gradient(180deg, #0f0f14, #050507);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.app__hello { margin: 0 4px 6px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.app__card { padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .06); }
.app__card--accent { background: linear-gradient(135deg, rgba(41, 151, 255, .9), rgba(191, 90, 242, .9)); }
.app__label { margin: 0; font-size: 12px; opacity: .7; }
.app__big { margin: 2px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.app__sub { margin: 2px 0 0; font-size: 13px; opacity: .85; }
.app__text { margin: 4px 0 0; font-size: 14px; line-height: 1.4; color: #d2d2d7; }
.app__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.app__mini .app__big { font-size: 18px; }
.app__tabbar { margin-top: auto; display: flex; justify-content: space-around; padding: 14px; border-radius: 20px; background: rgba(255, 255, 255, .05); }
.app__tabbar i { width: 22px; height: 22px; border-radius: 7px; background: rgba(255, 255, 255, .18); }
.app__tabbar i.on { background: var(--blue); }

.phone .app__card,
.phone .app__hello { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.phone.is-in .app__hello { opacity: 1; transform: none; transition-delay: .3s; }
.phone.is-in .app__card { opacity: 1; transform: none; }
.phone.is-in .app__card:nth-of-type(2) { transition-delay: .45s; }
.phone.is-in .app__card:nth-of-type(3) { transition-delay: .6s; }
.phone.is-in .app__row .app__card { transition-delay: .75s; }

/* ---------- Скачать ---------- */

.download { padding-block: 80px; }
.download__card {
  --x: 50%;
  --y: 50%;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 40px;
  align-items: center;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(80% 140% at 100% 0%, rgba(191, 90, 242, .16), transparent 60%), var(--bg-2);
  isolation: isolate;
  overflow: hidden;
}
.download__icon {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(41, 151, 255, .25), rgba(41, 151, 255, .05));
  border: 1px solid rgba(41, 151, 255, .3);
}
.download__icon svg { width: 52px; height: 52px; fill: var(--blue); }
.download__text p { margin: 0; }
.download__action { display: grid; gap: 10px; justify-items: center; text-align: center; }
.download__soon { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Филиалы ---------- */

.branches { padding-block: 100px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: #d2d2d7;
  font: 500 15px var(--font);
  cursor: pointer;
  transition: background .3s, color .3s, border-color .3s;
}
.filters button:hover { border-color: rgba(255, 255, 255, .3); }
.filters button[aria-selected="true"] { background: var(--text); color: #000; border-color: var(--text); }

.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.branch {
  --x: 50%;
  --y: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg-2);
  isolation: isolate;
  overflow: hidden;
  animation: card-in .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.branch__city { margin: 0; color: var(--blue); font-size: 14px; font-weight: 600; }
.branch__name { margin: 6px 0 14px; font-size: 24px; letter-spacing: -.02em; line-height: 1.15; }
.branch__meta { display: grid; gap: 6px; margin: 0 0 20px; color: #a1a1a6; font-size: 15px; }
.branch__meta a:hover { color: var(--text); }
.branch__actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: auto; align-items: center; }
.branch__actions .btn { min-height: 40px; font-size: 15px; }
.branch__actions .btn--ghost { padding: 0; }
.branch__name a:hover { color: var(--blue); }
.branch--cover { padding-top: 0; }
.branch__cover { display: block; margin: 0 -28px 22px; aspect-ratio: 16 / 9; overflow: hidden; background: #15151a; }
.branch__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.branch:hover .branch__cover img { transform: scale(1.04); }
.branch--skeleton { min-height: 230px; background: linear-gradient(100deg, var(--bg-2) 30%, #15151a 50%, var(--bg-2) 70%); background-size: 300% 100%; animation: skeleton 1.4s linear infinite; }
@keyframes skeleton { to { background-position: -150% 0; } }
.empty { padding: 40px; border: 1px dashed var(--line); border-radius: 24px; color: var(--muted); text-align: center; }

/* ---------- Заявка ---------- */

.signup { position: relative; padding-block: 120px 140px; isolation: isolate; overflow: hidden; }
.signup__layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start; }
.signup__text { position: sticky; top: 120px; }
.signup__text p { font-size: 19px; }

.form {
  position: relative;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 20, 24, .6);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .8);
}
.form__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
.field { display: grid; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field span { font-size: 14px; color: #d2d2d7; }
.field em { font-style: normal; color: var(--muted); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font: 17px var(--font);
  transition: border-color .25s, background .25s, box-shadow .25s;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2386868b' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
.field select option { background: #1c1c1e; }
.field textarea { resize: vertical; min-height: 96px; }
.field input::placeholder,
.field textarea::placeholder { color: #5a5a5f; }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: rgba(255, 255, 255, .22); }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--blue); background: rgba(41, 151, 255, .06); box-shadow: 0 0 0 4px rgba(41, 151, 255, .18); }
.field small { min-height: 0; color: #ff6961; font-size: 13px; }
.field small:empty { display: none; }
.field.has-error input,
.field.has-error select { border-color: #ff6961; }
.field.flash select { animation: flash 1.2s var(--ease); }
@keyframes flash { 30% { border-color: var(--blue); box-shadow: 0 0 0 6px rgba(41, 151, 255, .35); } }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* Согласие на обработку персональных данных (docs/legal.md) */
.consent { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; margin: 4px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.45; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue); cursor: pointer; }
.consent a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.consent a:hover { text-decoration-color: currentColor; }
.consent small { grid-column: 2; color: #ff6961; font-size: 13px; }
.consent small:empty { display: none; }
.form__error { margin: 10px 0 0; color: #ff6961; font-size: 15px; text-align: center; }
.form__error:empty { display: none; }

.form__done {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px;
  border-radius: inherit;
  background: #0c0c0f;
  text-align: center;
  animation: fade-in .5s var(--ease);
}
.form__done h3 { margin: 22px 0 8px; font-size: 28px; letter-spacing: -.02em; }
.form__done p { margin: 0; color: var(--muted); max-width: 32ch; }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- Подвал ---------- */

.footer { padding-block: 40px; border-top: 1px solid var(--line); font-size: 14px; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 24px; color: #a1a1a6; }
.footer nav a:hover { color: var(--text); }
.footer p { margin: 0; }

/* ---------- Направления ---------- */

.nav__partners { color: var(--text) !important; }
.nav__partners::after { content: " ↗"; color: var(--blue); }

.directions { padding-block: 40px 140px; }
.dir-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.dir {
  --x: 50%;
  --y: 50%;
  --accent: var(--blue);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(90% 70% at 100% 100%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--bg-2);
  overflow: hidden;
  isolation: isolate;
}
.dir--code { grid-column: span 2; --accent: var(--blue); }
.dir--tall { grid-row: span 2; }
.dir--3d { --accent: var(--violet); }
.dir--math { --accent: var(--gold); }
.dir--logic { --accent: var(--green); }
.dir--wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 40px; min-height: 220px; --accent: var(--pink); }
.dir__text { position: relative; z-index: 1; max-width: 44ch; }
.dir__tag { margin: 0; color: var(--accent); font: 600 13px/1.4 var(--mono); letter-spacing: .02em; }
.dir h3 { margin: 12px 0 8px; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; letter-spacing: -.02em; }
.dir p:not(.dir__tag) { margin: 0; color: var(--muted); font-size: 16px; }
.dir__art { position: relative; flex: 1; min-height: 120px; margin-top: 24px; }

/* Код: строки «печатаются» по очереди. */
.dir-code { display: grid; align-content: center; gap: 12px; }
.dir-code i {
  display: block;
  height: 10px;
  width: var(--w);
  margin-left: calc(var(--in, 0) * 28px);
  border-radius: 6px;
  background: var(--c);
  opacity: .85;
  transform-origin: 0 50%;
  animation: type-line 4.8s var(--ease) infinite;
}
.dir-code i:nth-child(2) { animation-delay: .25s; }
.dir-code i:nth-child(3) { animation-delay: .5s; }
.dir-code i:nth-child(4) { animation-delay: .75s; }
.dir-code i:nth-child(5) { animation-delay: 1s; }
.dir-code i:nth-child(6) { animation-delay: 1.25s; }
@keyframes type-line {
  0% { transform: scaleX(0); opacity: 0; }
  12%, 78% { transform: scaleX(1); opacity: .85; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* 3D: вращающийся каркасный куб и прыгающий мяч. */
.dir-3d { display: grid; place-items: center; min-height: 300px; perspective: 700px; }
.cube {
  --s: 120px;
  position: relative;
  width: var(--s);
  height: var(--s);
  transform-style: preserve-3d;
  animation: cube-spin 14s linear infinite;
}
.cube__face {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(191, 90, 242, .8);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(191, 90, 242, .14), rgba(41, 151, 255, .06));
  box-shadow: inset 0 0 30px rgba(191, 90, 242, .25);
}
.cube__face--front { transform: translateZ(calc(var(--s) / 2)); }
.cube__face--back { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.cube__face--right { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.cube__face--left { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.cube__face--top { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.cube__face--bottom { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
@keyframes cube-spin { from { transform: rotateX(-24deg) rotateY(0); } to { transform: rotateX(-24deg) rotateY(360deg); } }
.dir-3d__ball {
  position: absolute;
  right: 18%;
  bottom: 22%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--pink) 45%, #8a1048);
  animation: bounce 1.4s cubic-bezier(.5, 0, .5, 1) infinite;
}
.dir-3d__shadow {
  position: absolute;
  right: calc(18% + 2px);
  bottom: calc(22% - 10px);
  width: 30px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  filter: blur(3px);
  animation: bounce-shadow 1.4s cubic-bezier(.5, 0, .5, 1) infinite;
}
/* Мяч сплющивается при ударе — классика анимации. */
@keyframes bounce {
  0%, 100% { transform: translateY(-110px) scale(1); }
  45% { transform: translateY(0) scale(1); }
  50% { transform: translateY(0) scale(1.25, .75); }
  55% { transform: translateY(-4px) scale(.95, 1.05); }
}
@keyframes bounce-shadow { 0%, 100% { transform: scale(.4); opacity: .3; } 50% { transform: scale(1.1); opacity: .8; } }

/* Математика: волна рисуется, символы всплывают. */
.dir-math svg { position: absolute; inset: 20% 0 auto; width: 100%; height: 60%; overflow: visible; }
.dir-math__axis { stroke: rgba(255, 255, 255, .12); stroke-width: 1; fill: none; }
.dir-math__wave {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  filter: drop-shadow(0 0 8px rgba(255, 214, 10, .5));
  vector-effect: non-scaling-stroke;
  animation: wave-draw 5s var(--ease) infinite;
}
@keyframes wave-draw { 0% { stroke-dashoffset: 400; } 55%, 80% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.dir-math__sym {
  position: absolute;
  bottom: 0;
  left: var(--x);
  color: rgba(255, 214, 10, .8);
  font: 600 24px var(--mono);
  animation: sym-float 4.8s ease-in-out infinite;
  animation-delay: var(--t);
}
@keyframes sym-float { 0% { transform: translateY(10px); opacity: 0; } 30%, 70% { opacity: 1; } 100% { transform: translateY(-90px) rotate(20deg); opacity: 0; } }

/* Логика: плитки загораются по закономерности. */
.dir-logic { display: grid; grid-template-columns: repeat(3, 34px); gap: 8px; align-content: center; justify-content: start; }
.dir-logic i {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(48, 209, 88, .35);
  background: rgba(48, 209, 88, .06);
  animation: tile 3.6s var(--ease) infinite;
}
/* Порядок обхода — «змейка»: 1 2 3 6 5 4 7 8 9. */
.dir-logic i:nth-child(1) { animation-delay: 0s; }
.dir-logic i:nth-child(2) { animation-delay: .2s; }
.dir-logic i:nth-child(3) { animation-delay: .4s; }
.dir-logic i:nth-child(6) { animation-delay: .6s; }
.dir-logic i:nth-child(5) { animation-delay: .8s; }
.dir-logic i:nth-child(4) { animation-delay: 1s; }
.dir-logic i:nth-child(7) { animation-delay: 1.2s; }
.dir-logic i:nth-child(8) { animation-delay: 1.4s; }
.dir-logic i:nth-child(9) { animation-delay: 1.6s; }
@keyframes tile {
  0%, 100% { background: rgba(48, 209, 88, .06); box-shadow: none; transform: scale(1); }
  10% { background: var(--green); box-shadow: 0 0 24px rgba(48, 209, 88, .6); transform: scale(1.08); }
  30% { background: rgba(48, 209, 88, .25); transform: scale(1); }
}

/* Языки: приветствие сменяется на разных языках (JS). */
.dir-lang { display: flex; align-items: center; justify-content: center; margin-top: 0; min-height: 140px; }
.dir-lang__word {
  position: relative;
  z-index: 1;
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 700;
  letter-spacing: -.04em;
  background: linear-gradient(100deg, var(--pink), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity .45s var(--ease), transform .45s var(--ease), filter .45s var(--ease);
}
.dir-lang__word.is-out { opacity: 0; transform: translateY(-24px) rotateX(50deg); filter: blur(8px); }
.dir-lang__word.is-pre { opacity: 0; transform: translateY(24px) rotateX(-50deg); filter: blur(8px); transition: none; }
.dir-lang__bubble {
  position: absolute;
  inset: 10% 20%;
  border-radius: 60px 60px 60px 12px;
  border: 1px solid rgba(255, 79, 154, .25);
  background: rgba(255, 79, 154, .05);
  animation: bubble 4s ease-in-out infinite;
}
@keyframes bubble { 50% { transform: scale(1.04); border-color: rgba(255, 79, 154, .5); } }

/* ---------- Для каждого возраста ---------- */

.ages { --hue: 210; position: relative; padding-block: 100px 140px; overflow: hidden; isolation: isolate; }
.ages__glow {
  position: absolute;
  inset: 10% -10% auto;
  height: 70%;
  z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, hsl(var(--hue) 90% 55% / .22), transparent 70%);
  filter: blur(40px);
  transition: background 1s var(--ease);
}
.ages .section-title { max-width: 20ch; }
.ages__lead { max-width: 52ch; margin: -16px 0 36px; font-size: 19px; }

.ages__switch {
  --i: 0;
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.ages__thumb {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / 4);
  border-radius: 999px;
  background: var(--text);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform .55s cubic-bezier(.5, 1.6, .4, 1);
}
.ages__switch button {
  position: relative;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  background: none;
  color: #d2d2d7;
  font: 600 16px var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: color .3s;
}
.ages__switch button[aria-selected="true"] { color: #000; }

.ages__panel {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 24px;
}
.ages__info,
.ages__task {
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 10, 12, .7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.ages__task { --x: 50%; --y: 50%; position: relative; display: flex; flex-direction: column; overflow: hidden; isolation: isolate; }

/* Смена возраста: содержимое уходит вниз с размытием и возвращается. */
.ages [data-age-field],
.ages__dirs,
.ages__level { transition: opacity .35s var(--ease), transform .35s var(--ease), filter .35s var(--ease); }
.ages__panel.is-switching [data-age-field],
.ages__panel.is-switching .ages__dirs { opacity: 0; transform: translateY(12px); filter: blur(6px); }

.ages__stage { margin: 0; color: hsl(var(--hue) 90% 65%); font: 600 13px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; transition: color .6s; }
.ages__title { margin: 10px 0 10px; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -.03em; }
.ages__text { margin: 0 0 28px; color: #a1a1a6; font-size: 17px; max-width: 48ch; }

.ages__level { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; color: var(--muted); font-size: 14px; }
.level { --n: 1; display: flex; gap: 6px; }
.level i {
  width: 34px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
  position: relative;
}
.level i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--green), var(--gold) 50%, var(--pink));
  background-size: calc(34px * 5 + 24px) 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .4s var(--ease);
}
.level i:nth-child(2)::after { background-position: -40px 0; }
.level i:nth-child(3)::after { background-position: -80px 0; }
.level i:nth-child(4)::after { background-position: -120px 0; }
.level i:nth-child(5)::after { background-position: -160px 0; }
.level i.on::after { transform: scaleX(1); }
.level i:nth-child(2)::after { transition-delay: .06s; }
.level i:nth-child(3)::after { transition-delay: .12s; }
.level i:nth-child(4)::after { transition-delay: .18s; }
.level i:nth-child(5)::after { transition-delay: .24s; }

.ages__dirs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ages__dirs li {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: #d2d2d7;
  animation: chip-in .5s var(--ease) both;
  animation-delay: calc(var(--i) * 60ms + 150ms);
}
@keyframes chip-in { from { opacity: 0; transform: translateY(10px) scale(.9); } }

.ages__task-label { margin: 0; color: var(--muted); font-size: 14px; }
.ages__task-dir { margin: 6px 0 0; color: hsl(var(--hue) 90% 65%); font-weight: 600; transition: color .6s; }
.ages__task-text { margin: 18px 0 28px; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
.ages__task-bar { margin-top: auto; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ages__task-bar span { display: block; height: 100%; width: 100%; background: hsl(var(--hue) 90% 60%); transform: scaleX(0); transform-origin: 0 50%; }
/* Полоса — таймер автопереключения возраста. */
.ages.is-auto .ages__task-bar span { animation: age-timer 6s linear forwards; }
@keyframes age-timer { to { transform: scaleX(1); } }

/* ---------- Монеты в бенто ---------- */

.card--span2 { grid-column: span 2; }
.coins-float { position: relative; flex: 1; min-height: 300px; margin-top: 16px; }
.coins-float .coin {
  position: absolute;
  bottom: 0;
  left: var(--x);
  scale: var(--s);
  animation: coin-rise 5s var(--ease) infinite;
  animation-delay: var(--t);
}
@keyframes coin-rise {
  0% { transform: translateY(0) rotateY(0); opacity: 0; }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(-220px) rotateY(720deg); opacity: 0; }
}
.coins-float__shop { position: absolute; right: 0; top: 10%; display: grid; gap: 12px; }
.coins-float__shop span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  font-size: 28px;
  animation: shop-bob 3s ease-in-out infinite;
}
.coins-float__shop span:nth-child(2) { animation-delay: -1s; }
.coins-float__shop span:nth-child(3) { animation-delay: -2s; }
@keyframes shop-bob { 50% { transform: translateY(-8px); } }

/* ---------- Ссылка «Партнёрам» ---------- */

.partner-cta { padding-block: 40px 20px; }
.partner-cta__card {
  --x: 50%;
  --y: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 44px 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(110deg, rgba(41, 151, 255, .14), rgba(191, 90, 242, .1) 50%, rgba(255, 79, 154, .08)), var(--bg-2);
  overflow: hidden;
  isolation: isolate;
}
.partner-cta__card p { margin: 0; }
.partner-cta__card .eyebrow { margin-bottom: 10px; }
.partner-cta__arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--text);
  color: #000;
  font-size: 26px;
  transition: transform .5s var(--ease);
}
.partner-cta__card:hover .partner-cta__arrow { transform: translateX(6px) rotate(-45deg); }

/* ---------- QR приложения для родителей ---------- */

.qr {
  width: min(400px, 100% - 32px);
  padding: 40px 32px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(22, 22, 26, .92);
  color: var(--text);
  text-align: center;
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .8), 0 0 80px -30px rgba(191, 90, 242, .5);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  backdrop-filter: blur(30px) saturate(1.6);
}
.qr::backdrop { background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.qr[open] { animation: qr-in .5s var(--ease); }
.qr[open]::backdrop { animation: qr-fade .4s var(--ease); }
.qr__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font: 400 22px/1 var(--font);
  cursor: pointer;
  transition: color .2s, background .2s;
}
.qr__close:hover { color: var(--text); background: rgba(255, 255, 255, .14); }
.qr__code {
  position: relative;
  width: 220px;
  margin: 0 auto 24px;
  padding: 14px;
  border-radius: 22px;
  background: #fff;
}
/* Светящаяся градиентная рамка вокруг кода */
.qr__code::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: 24px;
  background: var(--grad);
  filter: blur(14px);
  opacity: .6;
  animation: qr-glow 4s ease-in-out infinite alternate;
}
.qr__code svg { width: 100%; height: auto; }
.qr__title { margin: 0 0 8px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.qr__text { margin: 0 auto 16px; color: var(--muted); font-size: 15px; max-width: 32ch; }
.qr__link { color: var(--blue); font-size: 14px; word-break: break-all; }
.qr__link:hover { text-decoration: underline; }

@keyframes qr-in {
  from { opacity: 0; transform: translateY(16px) scale(.94); filter: blur(8px); }
}
@keyframes qr-fade { from { opacity: 0; } }
@keyframes qr-glow { to { opacity: .9; filter: blur(20px); } }

/* ---------- Адаптив ---------- */

@media (max-width: 960px) {
  .nav__links { display: none; }
  .dir-grid { grid-template-columns: 1fr 1fr; }
  .dir--code,
  .dir--wide { grid-column: 1 / -1; }
  .dir--tall { grid-row: auto; }
  .dir-3d { min-height: 220px; }
  .ages__panel { grid-template-columns: 1fr; }
  .card--span2 { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(2, 1fr); padding-block: 80px; }
  .story { height: auto; }
  .story__sticky { position: static; min-height: 0; padding-block: 100px 40px; }
  .story__layout,
  .parents__layout,
  .signup__layout { grid-template-columns: 1fr; gap: 48px; }
  .story__steps li { opacity: 1; }
  .story__visual { aspect-ratio: 4 / 3.6; }
  .bento { grid-template-columns: 1fr 1fr; }
  .card--wide { grid-column: 1 / -1; grid-row: auto; }
  .signup__text { position: static; }
  .download__card { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 40px 24px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding-top: 112px; }
  .hero__device { margin-top: 48px; }
  .window__body { grid-template-columns: 1fr; padding: 16px; min-height: 0; }
  .window__side { flex-direction: row; flex-wrap: wrap; }
  .code { font-size: 13px; }
  .bento { grid-template-columns: 1fr; }
  .card { padding: 26px; min-height: 0; }
  .screen > * { padding: 24px; }
  .form { padding: 24px 18px; }
  .form__fields { grid-template-columns: 1fr; }
  .phone__frame { width: 270px; height: 560px; }
  .features { padding-block: 100px 40px; }
  .branch-grid { grid-template-columns: 1fr; }
  .dir-grid { grid-template-columns: 1fr; }
  .dir { padding: 26px; min-height: 0; }
  .dir--wide { flex-direction: column; align-items: stretch; gap: 0; }
  .ages__switch { display: grid; width: 100%; }
  .ages__switch button { padding: 0 6px; font-size: 14px; }
  .ages__info,
  .ages__task { padding: 24px; }
  .card--span2 { grid-column: auto; }
  .coins-float { min-height: 220px; }
  .partner-cta__card { padding: 32px 24px; }
  .partner-cta__arrow { width: 52px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal,
  .word { opacity: 1; transform: none; filter: none; }
}
