/* Интеграл — онлайн-школа математики */
:root {
  --bg: #f6f7fc;
  --white: #fff;
  --ink: #1b1f3b;
  --ink-2: #474b6b;
  --muted: #7b7f9e;
  --line: #e4e6f2;
  --primary: #4f46e5;
  --primary-2: #3f37c9;
  --primary-soft: #eceafe;
  --accent: #ffc93c;
  --mint: #22b893;
  --mint-soft: #dcf6ee;
  --pink: #ff6b8b;
  --head: 'Rubik', system-ui, sans-serif;
  --body: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 24px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 24px 60px -24px rgba(40, 36, 120, .28);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
body.is-locked { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.muted { color: var(--muted); }

h1, h2, h3 { font-family: var(--head); letter-spacing: -.02em; margin: 0; }
h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.1; font-weight: 700; margin-bottom: 18px; }
.h-center { text-align: center; }
.u { background: linear-gradient(transparent 62%, rgba(255, 201, 60, .65) 62%); }
.eyebrow { margin: 0 0 12px; font-weight: 700; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
.eyebrow--center { text-align: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-size: 14px; font-weight: 600; box-shadow: 0 6px 18px -10px rgba(40, 36, 120, .3); }

.btn { --h: 58px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 28px; border-radius: 16px; font-weight: 700; font-size: 16px; white-space: nowrap; transition: transform .2s var(--ease), background .2s, box-shadow .2s, border-color .2s; }
.btn:active { transform: scale(.97); }
.btn--sm { --h: 44px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 12px 26px -12px rgba(79, 70, 229, .8); }
.btn--primary:hover { background: var(--primary-2); transform: translateY(-2px); }
.btn--accent { background: var(--accent); color: var(--ink); box-shadow: 0 12px 26px -12px rgba(255, 170, 0, .8); }
.btn--accent:hover { transform: translateY(-2px); filter: brightness(1.04); }
.btn--ghost { border: 2px solid var(--line); background: var(--white); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }

/* header */
.header { position: fixed; inset: 0 0 auto; z-index: 50; transition: background .3s, box-shadow .3s; }
.header.is-scrolled { background: rgba(246, 247, 252, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.header__inner { height: 76px; display: flex; align-items: center; gap: 30px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 800 24px var(--head); letter-spacing: -.03em; }
.logo__mark { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: var(--accent); display: grid; place-items: center; font-size: 26px; font-style: italic; transform: rotate(-6deg); }
.nav { display: flex; gap: 26px; margin-left: auto; font-weight: 500; font-size: 15px; }
.nav a { color: var(--ink-2); transition: color .2s; }
.nav a:hover { color: var(--primary); }
.burger { display: none; width: 44px; height: 44px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.burger span { width: 20px; height: 2px; border-radius: 2px; background: var(--ink); transition: .3s var(--ease); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* hero */
.hero { position: relative; padding: 130px 0 70px; overflow: hidden; }
.hero::before { content: ''; position: absolute; width: 700px; height: 700px; right: -200px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(79, 70, 229, .14), transparent 65%); }
.hero__symbols span { position: absolute; font: 700 44px var(--head); color: rgba(79, 70, 229, .09); animation: drift 12s ease-in-out infinite; }
.hero__symbols span:nth-child(1) { left: 4%; top: 18%; }
.hero__symbols span:nth-child(2) { left: 44%; top: 12%; animation-delay: -2s; }
.hero__symbols span:nth-child(3) { left: 8%; bottom: 10%; animation-delay: -4s; }
.hero__symbols span:nth-child(4) { right: 6%; bottom: 8%; animation-delay: -6s; }
.hero__symbols span:nth-child(5) { left: 50%; bottom: 14%; animation-delay: -8s; }
.hero__symbols span:nth-child(6) { right: 40%; top: 30%; animation-delay: -10s; }
@keyframes drift { 50% { transform: translateY(-16px) rotate(8deg); } }
.hero__inner { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; }
.hero h1 { margin: 22px 0 20px; font-size: clamp(40px, 5.6vw, 70px); line-height: 1.04; font-weight: 800; }
.hero h1 mark { background: none; color: var(--primary); position: relative; white-space: nowrap; }
.hero h1 mark::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 9 C 50 2, 150 2, 198 7' fill='none' stroke='%23ffc93c' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%; }
.hero__lead { margin: 0 0 32px; max-width: 540px; color: var(--ink-2); font-size: 18px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.hero__stats { list-style: none; padding: 0; margin: 0; display: flex; gap: 34px; flex-wrap: wrap; }
.hero__stats li { display: flex; align-items: center; gap: 12px; }
.hero__stats b { font: 800 40px/1 var(--head); color: var(--primary); }
.hero__stats span { font-size: 14px; color: var(--muted); line-height: 1.35; }
.hero__media { position: relative; }
.hero__photo { border-radius: 32px; overflow: hidden; aspect-ratio: 5 / 5.2; box-shadow: var(--shadow); transform: rotate(2deg); border: 8px solid var(--white); }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.task { position: absolute; left: -46px; bottom: 34px; width: 290px; padding: 18px; background: var(--white); border-radius: 20px; box-shadow: var(--shadow); }
.task__head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.task__head small { color: var(--mint); font-weight: 700; }
.task__q { margin: 0 0 12px; font: 600 20px var(--head); }
.task__form { display: flex; gap: 8px; }
.task__form input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); font-weight: 700; }
.task__form input:focus { outline: none; border-color: var(--primary); }
.task__msg { margin: 8px 0 0; min-height: 20px; font-size: 14px; font-weight: 600; }
.task__msg.ok { color: var(--mint); }
.task__msg.no { color: var(--pink); }
.task.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.hero__badge { position: absolute; right: -10px; top: 26px; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; background: var(--white); border-radius: 18px; box-shadow: var(--shadow); font-size: 13px; line-height: 1.3; color: var(--muted); }
.hero__badge b { display: block; color: var(--ink); font-size: 14px; }
.avatars { display: flex; }
.avatars img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 3px solid var(--white); margin-left: -10px; }
.avatars img:first-child { margin-left: 0; }

.trust { background: var(--primary); color: #fff; padding: 18px 0; }
.trust__inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; font-weight: 600; font-size: 15px; }

/* sections */
.section { padding: clamp(70px, 9vw, 110px) 0; }
.section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.section__head h2 { margin: 0; }
.note { margin: 24px 0 0; font-size: 15px; color: var(--muted); }

.switch { display: inline-flex; padding: 5px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); }
.switch button { height: 44px; padding: 0 20px; border-radius: 12px; font-weight: 700; font-size: 15px; color: var(--muted); transition: .25s; }
.switch button.is-active { background: var(--primary); color: #fff; }

.programs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.program { position: relative; display: flex; flex-direction: column; padding: 30px 28px; border-radius: var(--r); background: var(--white); border: 2px solid var(--line); transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.program:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.program.is-hit { border-color: var(--primary); }
.program__tag { position: absolute; top: -14px; right: 22px; padding: 6px 12px; border-radius: 999px; background: var(--accent); font-size: 13px; font-weight: 700; }
.program__icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; margin-bottom: 18px; }
.program h3 { font-size: 24px; margin-bottom: 6px; }
.program__for { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.program ul { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; flex: 1; }
.program li { display: flex; gap: 10px; font-size: 15px; }
.program li::before { content: '✓'; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--mint-soft); color: var(--mint); display: grid; place-items: center; font-size: 12px; font-weight: 800; margin-top: 2px; }
.program__price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 18px; }
.program__price b { font: 800 34px var(--head); }
.program__price span { color: var(--muted); font-size: 15px; }
.program__price s { color: var(--muted); font-size: 16px; }
.price-anim { animation: pop .4s var(--ease); }
@keyframes pop { from { opacity: .3; transform: translateY(-6px); } }

/* how */
.how { background: var(--white); }
.how__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.how__media { position: relative; }
.how__media img { border-radius: 28px; width: 100%; aspect-ratio: 4 / 3.3; object-fit: cover; }
.how__chip { position: absolute; left: 20px; bottom: 20px; padding: 12px 16px; border-radius: 14px; background: var(--white); box-shadow: var(--shadow); font-weight: 600; font-size: 15px; }
.steps { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; padding: 18px; border-radius: 18px; background: var(--bg); }
.steps li::before { content: counter(s); grid-row: span 2; width: 52px; height: 52px; border-radius: 14px; background: var(--primary); color: #fff; display: grid; place-items: center; font: 800 22px var(--head); }
.steps b { font-size: 17px; }
.steps span { font-size: 15px; color: var(--muted); }

/* teachers */
.teachers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px; }
.teacher { background: var(--white); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); transition: transform .3s var(--ease), box-shadow .3s; }
.teacher:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.teacher__photo { position: relative; aspect-ratio: 5 / 5; overflow: hidden; background: var(--primary-soft); }
.teacher__photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.teacher__score { position: absolute; left: 14px; bottom: 14px; padding: 7px 12px; border-radius: 12px; background: var(--accent); font-weight: 800; font-size: 14px; }
.teacher__body { padding: 22px 24px 26px; }
.teacher h3 { font-size: 22px; margin-bottom: 4px; }
.teacher__role { color: var(--primary); font-weight: 600; font-size: 15px; margin: 0 0 12px; }
.teacher__text { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; }
.teacher__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.teacher__tags span { padding: 5px 10px; border-radius: 999px; background: var(--bg); font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* reviews */
.reviews { background: linear-gradient(180deg, var(--primary-soft), var(--bg)); }
.slider-nav { display: flex; gap: 10px; }
.round { width: 52px; height: 52px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); font-size: 20px; transition: .2s; }
.round:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.reviews__track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 44px) / 3); gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding: 6px 2px 10px; }
.reviews__track::-webkit-scrollbar { display: none; }
.review { scroll-snap-align: start; display: flex; flex-direction: column; gap: 16px; padding: 28px; border-radius: var(--r); background: var(--white); box-shadow: 0 10px 30px -20px rgba(40, 36, 120, .4); }
.review__score { align-self: flex-start; padding: 8px 14px; border-radius: 12px; background: var(--mint-soft); color: var(--mint); font: 800 18px var(--head); }
.review p { margin: 0; flex: 1; font-size: 16px; }
.review__who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.review__who b { display: block; color: var(--ink); font-size: 15px; }
.review__ava { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font: 700 18px var(--head); }

/* faq */
.faq { display: grid; grid-template-columns: .8fr 1.2fr; gap: 60px; align-items: start; }
.faq__list { display: grid; gap: 12px; }
.faq details { background: var(--white); border-radius: 18px; border: 1px solid var(--line); padding: 0 24px; transition: box-shadow .2s; }
.faq details[open] { box-shadow: var(--shadow); border-color: transparent; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 20px 0; font: 600 18px var(--head); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 22px; transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 20px; color: var(--ink-2); }

/* cta */
.cta__card { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; padding: 56px; border-radius: 36px; background: var(--primary); color: #fff; position: relative; overflow: hidden; }
.cta__card::before { content: '∫'; position: absolute; right: 38%; top: -80px; font: italic 800 380px/1 var(--head); color: rgba(255, 255, 255, .06); }
.cta__text h2 { font-size: clamp(32px, 4vw, 46px); }
.cta__text p { opacity: .85; margin: 0 0 20px; }
.cta__text ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 10px 22px; flex-wrap: wrap; font-weight: 600; }
.cta__text li::before { content: '✓ '; color: var(--accent); }
.form { position: relative; background: var(--white); color: var(--ink); border-radius: 26px; padding: 28px; }
.form__fields { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--muted); }
.field input, .field select { height: 52px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); font-size: 16px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); background: var(--white); }
.field em { display: none; font-style: normal; font-size: 13px; color: var(--pink); font-weight: 600; }
.field.is-invalid input { border-color: var(--pink); }
.field.is-invalid em { display: block; }
.form__hint { color: var(--muted); font-size: 12px; text-align: center; }
.form__done { text-align: center; padding: 30px 10px; }
.form__done h3 { font-size: 28px; margin: 14px 0 8px; }
.form__done p { margin: 0; color: var(--muted); }
.done-icon { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; background: var(--mint-soft); color: var(--mint); display: grid; place-items: center; font-size: 38px; font-weight: 800; animation: pop .5s var(--ease); }

.footer { padding: 40px 0 50px; border-top: 1px solid var(--line); }
.footer__inner { display: grid; gap: 10px; }
.footer p { margin: 0; font-size: 15px; }

/* quiz */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(27, 31, 59, .55); backdrop-filter: blur(4px); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.modal__dialog { position: relative; width: 100%; max-width: 640px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--white); border-radius: 30px; padding: 40px; box-shadow: 0 40px 100px -30px rgba(27, 31, 59, .6); animation: rise .4s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.modal__close { position: absolute; right: 18px; top: 18px; width: 40px; height: 40px; border-radius: 12px; background: var(--bg); font-size: 16px; }
.quiz__progress { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; margin: 0 50px 18px 0; }
.quiz__progress span { display: block; height: 100%; width: 20%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--mint)); transition: width .4s var(--ease); }
.quiz__step { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--primary); }
.quiz__title { font-size: 28px; margin-bottom: 22px; }
.quiz__options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; animation: rise .35s var(--ease); }
.opt { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 16px; border: 2px solid var(--line); text-align: left; font-weight: 600; transition: .15s; }
.opt span { font-size: 24px; }
.opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.quiz__nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; }
.quiz__gift { font-size: 14px; font-weight: 600; color: var(--muted); }
.quiz__result { animation: rise .4s var(--ease); }
.result-card { padding: 22px; border-radius: 20px; background: var(--primary-soft); margin-bottom: 18px; }
.result-card h4 { margin: 0 0 6px; font: 700 22px var(--head); }
.result-card p { margin: 0 0 10px; color: var(--ink-2); font-size: 15px; }
.result-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.result-card dt { color: var(--muted); }
.result-card dd { margin: 0; font-weight: 600; }
.result-card .sum { font: 800 22px var(--head); color: var(--primary); }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 150; padding: 14px 22px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: var(--shadow); animation: rise .3s var(--ease); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.hero .reveal { opacity: 1; transform: none; animation: rise .8s var(--ease) both; }
.hero .reveal:nth-child(2) { animation-delay: .06s; } .hero .reveal:nth-child(3) { animation-delay: .12s; }
.hero .reveal:nth-child(4) { animation-delay: .18s; } .hero .reveal:nth-child(5) { animation-delay: .24s; }

@media (max-width: 1000px) {
  .nav { position: fixed; top: 76px; left: 12px; right: 12px; flex-direction: column; gap: 0; padding: 10px; background: var(--white); border-radius: 20px; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: .3s var(--ease); }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 14px 16px; border-radius: 12px; font-size: 18px; font-weight: 600; color: var(--ink); }
  .burger { display: flex; }
  .header__cta { margin-left: auto; }
  .hero__inner, .how__inner, .faq, .cta__card { grid-template-columns: minmax(0, 1fr); }
  .hero__media { max-width: 480px; margin: 0 auto; width: 100%; }
  .programs, .teachers { grid-template-columns: 1fr 1fr; }
  .reviews__track { grid-auto-columns: calc((100% - 22px) / 2); }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  body { font-size: 16px; }
  .header__cta { display: none; }
  .burger { margin-left: auto; }
  .hero { padding-top: 104px; }
  .hero h1 mark { white-space: normal; }
  .hero__cta .btn { flex: 1 1 100%; }
  .hero__stats { gap: 18px; justify-content: space-between; }
  .hero__stats li { flex-direction: column; align-items: flex-start; gap: 4px; }
  .hero__stats b { font-size: 32px; }
  .hero__photo { transform: none; }
  .task { position: relative; left: 0; bottom: 0; width: 100%; margin-top: -60px; }
  .hero__badge { right: 8px; top: 8px; }
  .trust__inner { font-size: 14px; justify-content: flex-start; }
  .programs, .teachers { grid-template-columns: 1fr; }
  .reviews__track { grid-auto-columns: 88%; }
  .cta__card { padding: 30px 18px; border-radius: 28px; }
  .form { padding: 20px; }
  .modal { padding: 0; align-items: end; }
  .modal__dialog { border-radius: 26px 26px 0 0; padding: 30px 18px 24px; max-height: 92vh; }
  .quiz__options { grid-template-columns: 1fr; }
  .quiz__title { font-size: 23px; }
  .quiz__gift { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
