/* LearnMath — промо-сайт. Тёмная «тетрадь в клетку», один акцент — зелёный «верно». */
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("fonts/nunito-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("fonts/nunito-cyrillic-800-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-weight: 900; font-display: swap; src: url("fonts/nunito-cyrillic-900-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("fonts/nunito-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("fonts/nunito-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-weight: 900; font-display: swap; src: url("fonts/nunito-latin-900-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #0d1014;
  --bg-2: #13171d;
  --card: #161b22;
  --ink: #f4f1ea;
  --muted: #a0a8b2;
  --dim: #6b7480;
  --line: rgba(255, 255, 255, .075);
  --accent: #3fe08a;
  --accent-ink: #052014;
  --chalk: #ffd166;
  --radius: 22px;
  /* тени — тёплые снизу-справа, как key-свет сцены */
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 24px 60px -24px rgba(0, 0, 0, .75), 0 8px 20px -12px rgba(63, 224, 138, .12);
  --font: "Nunito", "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: min(1180px, calc(100vw - 48px));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 18px/1.6 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
img, video { display: block; max-width: 100%; }
h1, h2, h3 { font-weight: 900; line-height: 1.02; letter-spacing: -.025em; margin: 0; }
p { margin: 0; }
.wrap { width: var(--wrap); margin: 0 auto; }

/* --- фон: клетка тетради + свечение за островом --- */
.backdrop {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60vmax 45vmax at 50% 62%, rgba(63, 224, 138, .13), transparent 62%),
    radial-gradient(40vmax 30vmax at 50% 72%, rgba(255, 200, 130, .07), transparent 70%),
    linear-gradient(var(--bg), var(--bg));
}
.backdrop::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(150, 180, 220, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 180, 220, .07) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 78%);
}
/* поля тетради — красная линия слева */
.backdrop::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: max(18px, calc((100vw - 1180px) / 2 - 34px));
  width: 2px; background: linear-gradient(rgba(63, 224, 138, .0), rgba(63, 224, 138, .28) 20%, rgba(63, 224, 138, .18) 80%, transparent);
}
#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
#stage.on { opacity: 1; }
/* без WebGL — постер из игры вместо сцены */
.poster { display: none; }
.no-webgl .poster {
  display: block; position: fixed; inset: auto 0 0 0; height: 62vh; z-index: -1; pointer-events: none;
  background: url("img/poster.webp") center / cover no-repeat; opacity: .5;
  -webkit-mask-image: linear-gradient(transparent, #000 40%); mask-image: linear-gradient(transparent, #000 40%);
}

/* --- шапка --- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px; justify-content: space-between;
  padding: 14px max(20px, calc((100vw - 1180px) / 2));
  background: linear-gradient(rgba(13, 16, 20, .92), rgba(13, 16, 20, .0));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; text-decoration: none; letter-spacing: -.01em; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-size: 20px; line-height: 1;
  box-shadow: 0 6px 18px -6px rgba(63, 224, 138, .6);
}
.top nav { display: flex; align-items: center; gap: 8px; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang a { padding: 5px 11px; border-radius: 999px; font-size: 14px; font-weight: 800; text-decoration: none; color: var(--muted); }
.lang a[aria-current="page"] { background: rgba(255, 255, 255, .09); color: var(--ink); }
.lang a:hover { color: var(--ink); }

/* --- кнопки --- */
.btn {
  --h: 56px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 28px; border-radius: 999px;
  font: 900 18px/1 var(--font); text-decoration: none; white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn-play { background: var(--accent); color: var(--accent-ink); box-shadow: 0 14px 34px -12px rgba(63, 224, 138, .75), 0 2px 0 rgba(255, 255, 255, .25) inset; }
.btn-play:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -12px rgba(63, 224, 138, .85), 0 2px 0 rgba(255, 255, 255, .25) inset; }
.btn-play svg { width: 18px; height: 18px; }
.btn-ghost { border: 1.5px solid rgba(255, 255, 255, .2); color: var(--ink); background: rgba(13, 16, 20, .4); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, .5); transform: translateY(-2px); }
.btn-sm { --h: 40px; padding: 0 18px; font-size: 15px; }
.btn:focus-visible, .lang a:focus-visible, .brand:focus-visible, .live a:focus-visible { outline: 3px solid var(--chalk); outline-offset: 3px; }

/* --- hero --- */
.hero { min-height: 100svh; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 108px 0 40px; position: relative; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; color: var(--muted); letter-spacing: .02em; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(63, 224, 138, .18); }
.hero h1 { font-size: clamp(64px, 12.5vw, 196px); letter-spacing: -.055em; margin: 14px 0 8px; line-height: .9; }
.hero h1 span { color: var(--accent); }
.hero h1.two { font-size: clamp(44px, 8.4vw, 132px); line-height: .94; margin-bottom: 14px; }
.hero h1.two span { display: block; }
.hook { font-size: clamp(20px, 2.3vw, 28px); font-weight: 800; max-width: 760px; line-height: 1.3; text-wrap: balance; }
.hook em { font-style: normal; color: var(--chalk); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
.facts { display: flex; gap: clamp(18px, 4vw, 48px); margin-top: 30px; flex-wrap: wrap; justify-content: center; }
.facts div { display: flex; flex-direction: column; align-items: center; }
.facts b { font-size: clamp(30px, 3.6vw, 46px); font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.facts span { font-size: 14px; color: var(--muted); font-weight: 800; margin-top: 6px; }
.scroll-cue { margin-top: auto; width: 24px; height: 38px; border: 2px solid rgba(255, 255, 255, .25); border-radius: 14px; position: relative; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--ink); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(12px); opacity: 0; } }

/* --- общие секции --- */
section { position: relative; }
.kicker { display: inline-block; font-weight: 900; font-size: 15px; color: var(--accent); letter-spacing: .04em; margin-bottom: 14px; }
.h2 { font-size: clamp(38px, 5.4vw, 72px); text-wrap: balance; }
.lead { color: var(--muted); font-size: clamp(18px, 1.6vw, 21px); max-width: 640px; margin-top: 18px; }
.pen { position: relative; white-space: nowrap; }
.pen::after {
  content: ""; position: absolute; left: -4%; right: -4%; bottom: -.12em; height: .32em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 14 C 50 4, 120 4, 197 10' fill='none' stroke='%233fe08a' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* --- скролл-история: текст сбоку, сцена напротив --- */
.story { padding: 8vh 0 4vh; }
.chapter { min-height: 100vh; display: flex; align-items: center; }
.chapter .panel { width: min(470px, 100%); }
.chapter.right .wrap { display: flex; justify-content: flex-end; }
.panel {
  background: linear-gradient(180deg, rgba(22, 27, 34, .9), rgba(16, 20, 26, .86));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 32px 30px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.step-no { font-weight: 900; font-size: 15px; color: var(--accent); letter-spacing: .04em; }
.panel h2 { font-size: clamp(32px, 3.6vw, 46px); margin: 10px 0 14px; }
.panel p { color: var(--muted); }
.panel ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.panel li { display: flex; gap: 12px; align-items: baseline; font-weight: 800; font-size: 16px; }
.panel li::before { content: "✓"; color: var(--accent); font-weight: 900; }
.formula { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; padding: 10px 16px; border-radius: 12px; background: #1f4a39; color: #fff; font-weight: 800; font-size: 22px; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .8); }
.formula .fr { display: inline-flex; flex-direction: column; align-items: center; font-size: .72em; line-height: 1.05; }
.formula .fr i { font-style: normal; border-top: 2px solid currentColor; padding: 0 2px; }
.formula b { color: var(--chalk); }
.grade5 { color: var(--accent); font-weight: 900; }

/* --- программа 1–9 --- */
.program { padding: 14vh 0 8vh; background: linear-gradient(transparent, rgba(13, 16, 20, .92) 14%, var(--bg)); }
.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 46px; }
.grade {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 24px 22px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform .25s ease, border-color .25s ease;
}
.grade:hover { transform: translateY(-4px); border-color: rgba(63, 224, 138, .4); }
.grade-n { position: absolute; right: 14px; top: -14px; font-size: 120px; font-weight: 900; color: rgba(255, 255, 255, .045); line-height: 1; pointer-events: none; }
.grade h3 { font-size: 22px; letter-spacing: -.01em; }
.grade h3 small { display: block; font-size: 13px; color: var(--accent); font-weight: 900; letter-spacing: .04em; margin-bottom: 6px; }
.grade p { color: var(--muted); font-size: 15.5px; margin-top: 10px; line-height: 1.5; }
.program-note { margin-top: 26px; color: var(--dim); font-size: 15px; max-width: 820px; }

/* --- как устроено обучение: карточки механик --- */
.mech { padding: 10vh 0; background: var(--bg); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 46px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.card .ico { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 24px; font-weight: 900; background: rgba(63, 224, 138, .12); color: var(--accent); border: 1px solid rgba(63, 224, 138, .25); }
.card h3 { font-size: 21px; letter-spacing: -.01em; line-height: 1.15; }
.card p { color: var(--muted); font-size: 15.5px; line-height: 1.55; }

/* учителя */
.teachers { margin-top: 70px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.teacher { text-align: center; padding: 18px 10px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.teacher .em { font-size: 34px; line-height: 1; }
.teacher b { display: block; margin-top: 10px; font-size: 16px; font-weight: 900; }
.teacher span { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; line-height: 1.35; }

/* --- скриншоты --- */
.shots { padding: 10vh 0; background: var(--bg); }
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-top: 46px; }
.shot { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.shot img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.shot figcaption { padding: 14px 18px 16px; color: var(--muted); font-size: 15px; font-weight: 800; }
.shot.big { grid-column: span 7; }
.shot.mid { grid-column: span 5; }
.shot.half { grid-column: span 6; }

/* --- живые кадры игроков --- */
.live { padding: 4vh 0 10vh; background: var(--bg); }
.live[hidden] { display: none; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 32px; }
.live a { display: block; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--card); border: 1px solid var(--line); position: relative; }
.live img, .live video { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.live a:hover img, .live a:hover video { transform: scale(1.04); }
.live .badge { position: absolute; left: 10px; top: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(13, 16, 20, .75); font-size: 12px; font-weight: 900; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-right: 8px; animation: pulse 1.6s ease-in-out infinite; vertical-align: middle; }
@keyframes pulse { 50% { opacity: .35; } }

/* --- финал --- */
.final { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; padding: 16vh 0 6vh; }
.final .h2 { max-width: 900px; }
.final .lead { margin-left: auto; margin-right: auto; }
.final .cta-row { margin-top: 32px; }
.final-note { margin-top: 18px; color: var(--dim); font-size: 15px; max-width: 560px; }

/* --- появление --- */
.js .rise { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .rise.in { opacity: 1; transform: none; }

@media (max-width: 1020px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .teachers { grid-template-columns: repeat(3, 1fr); }
  .grades { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .top { padding: 10px 16px; }
  .top .btn-sm { display: none; }
  .hero { padding-top: 92px; }
  .chapter { align-items: flex-start; padding-top: 12vh; min-height: 110vh; }
  .chapter.right .wrap { justify-content: flex-start; }
  .panel { padding: 26px 22px; }
  .grades, .cards { grid-template-columns: 1fr; }
  .teachers { grid-template-columns: repeat(2, 1fr); }
  .shot.big, .shot.mid, .shot.half { grid-column: span 12; }
  .btn { --h: 52px; padding: 0 22px; font-size: 17px; }
  .facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 36px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rise { opacity: 1; transform: none; transition: none; }
  .scroll-cue::after, .live-dot { animation: none; }
  #stage { transition: none; }
  .btn, .grade, .live img, .live video { transition: none; }
}
