:root {
  --ink: #142744;
  --muted: #5d7190;
  --purple: #5d4df4;
  --purple2: #7668ff;
  --line: #e2eafa;
  --bg: #f6f9ff;
  --orange: #ffb21b;
  --blue: #4b9eea;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; }

.wrap {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

section {
  padding: 58px 0;
  scroll-margin-top: 20px;
}

/* Верхнее меню */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: .2px;
  flex-shrink: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, #5940b7, #8b72e8);
  color: #ffca45;
  padding: 8px;
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 0 8px 20px #5d4df433;
}

.brand-mark svg { display: block; width: 100%; height: 100%; overflow: visible; }

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.navlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 17px;
  font-size: 12px;
  font-weight: 650;
}

.navlinks a { transition: color .2s ease; }
.navlinks a:hover { color: var(--purple); }

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--purple);
  color: #fff;
  border: 0;
  border-radius: 15px;
  padding: 14px 22px;
  font-weight: 750;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 18px #5d4df42b;
  text-align: center;
  transition: background .2s ease, transform .2s ease;
}

.btn:hover { background: #493be0; transform: translateY(-1px); }
.btn.secondary { background: white; color: var(--ink); border: 1px solid #b9c7e1; box-shadow: none; }
.btn.secondary:hover { background: #f4f3ff; }

/* Первый экран */
.hero {
  background: linear-gradient(115deg, #f3f7ff, #f9fbff 65%, #f0f1ff);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 36px;
  align-items: center;
  padding: 48px 0 42px;
}

.eyebrows { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pill { border-radius: 99px; padding: 6px 12px; background: #e9edff; color: #6358dc; font-size: 12px; font-weight: 750; }
.pill.light { background: #edf4ff; color: #607b9f; }

.hero h1 {
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.08;
  letter-spacing: -1.5px;
  margin: 0 0 18px;
  max-width: 620px;
}

.hero-copy > p { font-size: 16px; color: var(--muted); max-width: 530px; margin: 0 0 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.proofs { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 30px; color: #314969; font-size: 12px; }
.proof { display: flex; align-items: center; gap: 8px; max-width: 150px; }
.proof b { font-size: 20px; color: var(--purple); }

.hero-image-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 280px;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(145deg, #e8e8ff, #f0f7ff);
  box-shadow: 0 18px 45px rgba(38, 53, 110, .10);
}

.hero-image { position: relative; z-index: 1; display: block; width: 100%; height: auto; object-fit: contain; }
.hero-fallback { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; color: var(--ink); }
.hero-fallback span { font-size: 78px; }
.hero-fallback strong { font-size: 22px; }
.hero-fallback small { color: var(--muted); }
.hero-image-missing .hero-fallback { display: flex; }

/* Заголовки разделов */
.section-head { max-width: 680px; margin-bottom: 28px; }
.kicker { color: var(--purple); font-size: 12px; text-transform: uppercase; font-weight: 850; letter-spacing: 1.3px; }
.section-head h2 { font-size: clamp(27px, 3vw, 36px); line-height: 1.15; margin: 8px 0 10px; letter-spacing: -.8px; }
.section-head p { margin: 0; color: var(--muted); }

/* Заголовки уровней */
.level-title {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--line);
}
.level-title h3 {
  margin: 0 0 4px;
  font-size: 24px;
  color: var(--purple);
  display: inline-block;
}
.level-title span {
  display: block;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.mt-40 { margin-top: 40px; }

/* Сетка программ */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.program {
  min-width: 0;
  border-radius: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Цветовые схемы */
.program.scratch { background: linear-gradient(140deg, #fffaf0, #fffdf8); border-color: #ffebbf; }
.program.neuro { background: linear-gradient(140deg, #eefbf6, #f6fffa); border-color: #cceee0; }
.program.python { background: linear-gradient(140deg, #f1f8ff, #fbfdff); border-color: #d8eaff; }
.program.web { background: linear-gradient(140deg, #fff0f5, #fffbfc); border-color: #ffd1dc; }
.program.bots { background: linear-gradient(140deg, #eef9ff, #f6fcff); border-color: #bce5ff; }
.program.unity { background: linear-gradient(140deg, #f5f1ff, #fffaff); border-color: #e2d8ff; }
.program.unity-pro { background: linear-gradient(140deg, #f8f5ff, #fcfaff); border-color: #dbccff; }

/* Возрастные плашки */
.age { display: inline-block; border-radius: 99px; padding: 4px 9px; font-size: 11px; font-weight: 800; background: #fff0c7; color: #9a6800; margin-left: 3px; vertical-align: 4px; }
.neuro .age { background: #d4f7e7; color: #1b7a52; }
.python .age { background: #dceeff; color: #2467a5; }
.web .age { background: #ffd1dc; color: #a8334b; }
.bots .age { background: #bce5ff; color: #1c638c; }
.unity .age { background: #e9e1ff; color: #6347ad; }
.unity-pro .age { background: #dbccff; color: #4b2b9e; }

/* Номера модулей */
.num { width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: white; font-size: 11px; font-weight: 850; display: grid; place-items: center; }
.neuro .num { background: #20b07b; }
.python .num { background: var(--blue); }
.web .num { background: #ff6b8b; }
.bots .num { background: #3ea5e0; }
.unity .num { background: #8a72ec; }
.unity-pro .num { background: #6a4ed8; }

/* Результаты */
.result { border-radius: 14px; padding: 12px; background: #fff1cb; color: #79530a; font-size: 12px; margin-top: auto; line-height: 1.4; }
.neuro .result { background: #d7f5e8; color: #145c3e; }
.python .result { background: #e3f2ff; color: #245c8d; }
.web .result { background: #ffe3ea; color: #8f2941; }
.bots .result { background: #d4efff; color: #14547a; }
.unity .result { background: #eee8ff; color: #594295; }
.unity-pro .result { background: #e8dfff; color: #3b2184; }

/* Внутренности карточки */
.program-header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.emoji { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; font-size: 29px; background: #fff; box-shadow: 0 5px 20px #1427440c; flex-shrink: 0; }
.program-title-wrap { flex-grow: 1; }
.program h3 { margin: 0; font-size: 21px; line-height: 1.35; }
.program h3 a:hover { color: var(--purple); }
.program-sub { font-weight: 750; margin: 8px 0 0; color: #263b5b; font-size: 13px; }
.program-details { display: flex; flex-direction: column; flex-grow: 1; }
.program p { color: var(--muted); font-size: 13px; margin: 0; }
.program-link { display: inline-flex; align-self: flex-start; margin-top: 12px; color: var(--purple); font-size: 13px; font-weight: 750; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.program-link:hover { color: #493be0; }
.mobile-toggle { display: none; }

.module-list { margin-top: 20px; background: #ffffffc9; border-radius: 16px; padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }
.module-list h4 { margin: 0 0 12px; font-size: 13px; }
.module { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: start; margin: 11px 0; }
.module strong { display: block; font-size: 12px; line-height: 1.4; }
.module small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.4; }
.module em { font-style: normal; color: var(--muted); font-size: 10px; white-space: nowrap; }

.program-note { margin-top: 16px; color: var(--muted); font-size: 12px; }

/* Проекты */
.projects-section { background: linear-gradient(180deg, #fff, #f7f8ff); }
.projects-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: stretch; }
.project-card { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 10px 30px rgba(30, 45, 90, .06); transition: transform .2s ease, box-shadow .2s ease; }
.project-card:hover { transform: translateY(-4px); box-shadow: 0 16px 35px rgba(30, 45, 90, .11); }
.project-scratch { border-color: #ffebbf; }
.project-python { border-color: #d8eaff; }
.project-unity { border-color: #e2d8ff; }
.project-video { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, #f1edff, #eaf4ff); }
.project-video video { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; }
.video-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 64px; background: linear-gradient(135deg, #f1edff, #eaf4ff); }
.project-video video:not([src=""]) { background: transparent; }
.project-video.video-error .video-placeholder, .project-video.video-paused .video-placeholder { z-index: 2; }
.project-content { padding: 22px; }
.project-tag { display: inline-block; margin-bottom: 10px; color: var(--purple); font-size: 12px; font-weight: 800; }
.project-content h3 { margin: 0 0 10px; font-size: 21px; line-height: 1.3; }
.project-content p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.project-skills { margin-top: 17px; padding-top: 14px; border-top: 1px solid #edf0fa; color: #586b91; font-size: 12px; font-weight: 700; line-height: 1.7; }

/* Учебный план */
.curriculum { background: var(--bg); }
.curr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 20px; align-items: start; }
.curr-card { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px; scroll-margin-top: 24px; }
.curr-card h3 { margin: 0 0 4px; font-size: 20px; }
.curr-card .intro { color: var(--muted); font-size: 13px; margin: 0 0 15px; }
.curr-card details { border-top: 1px solid #edf1f8; padding: 12px 0; }
.curr-card summary { font-weight: 750; font-size: 14px; cursor: pointer; }
.curr-card summary:hover { color: var(--purple); }
.curr-card details ul { font-size: 13px; color: var(--muted); margin: 8px 0 0; padding-left: 18px; }
.curr-card details li { margin-bottom: 5px; }

/* Как проходят занятия */
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: #fff; }
.step .icon { font-size: 25px; }
.step h3 { font-size: 17px; margin: 10px 0 6px; }
.step p { font-size: 13px; color: var(--muted); margin: 0; }

/* Стоимость */
.prices-section { padding-top: 35px; }
.pricing { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.price-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; padding: 24px; background: #fff; }
.price-card h3 { margin: 0; font-size: 20px; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 0; flex-wrap: wrap; }
.old-price { font-size: 18px; font-weight: 500; color: #a0aec0; text-decoration: line-through; }
.new-price { font-size: 32px; font-weight: 850; letter-spacing: -1px; color: var(--ink); }
.per-lesson { font-size: 13px; font-weight: 550; color: var(--muted); letter-spacing: 0; }
.price-card p { font-size: 13px; color: var(--muted); }
.price-card ul { flex: 1; padding-left: 18px; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.price-card li { margin-bottom: 7px; }
.price-card .btn { width: 100%; }
.package-note { margin-top: 12px; font-size: 11px; color: #887b9e; text-align: center; line-height: 1.4; }

/* Обо мне */
.about { display: grid; grid-template-columns: .68fr 1.32fr; gap: 30px; align-items: center; background: #f7f6ff; border-radius: 24px; padding: 30px; }
.about-mark { min-height: 250px; border-radius: 20px; background: linear-gradient(140deg, #dcd8ff, #eef5ff); display: grid; place-items: center; font-size: 120px; line-height: 1; }
.about h2 { font-size: 30px; line-height: 1.2; margin: 7px 0 12px; }
.about p { color: var(--muted); font-size: 14px; }
.about ul { padding-left: 20px; color: var(--muted); font-size: 13px; }
.about li { margin-bottom: 6px; }

/* Призыв к записи */
.cta { padding: 30px; border-radius: 22px; background: linear-gradient(110deg, #f0efff, #f1f8ff); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.cta h2 { font-size: 25px; margin: 0 0 5px; }
.cta p { color: var(--muted); margin: 0; font-size: 13px; }

/* Контакты */
.contact { background: #132746; color: white; padding: 48px 0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.contact h2 { font-size: 30px; line-height: 1.2; margin: 8px 0 10px; }
.contact p { color: #c6d3e8; font-size: 14px; }
.contact-kicker { color: #a9a2ff; }
.contact-action { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.telegram-link { display: inline-flex; align-items: center; justify-content: center; padding: 15px 22px; border-radius: 14px; background: #7b70ff; color: #fff; font-size: 15px; font-weight: 800; transition: background .2s ease, transform .2s ease; width: 280px; }
.telegram-link:hover { background: #6558ed; transform: translateY(-2px); }
.social-link { display: inline-flex; align-items: center; justify-content: center; padding: 13px 18px; border-radius: 13px; color: #fff; font-size: 14px; font-weight: 750; transition: transform .2s ease, opacity .2s ease; width: 280px; }
.social-link:hover { transform: translateY(-2px); opacity: .92; }
.vk-link { background: #3978c8; }
.email-link { background: #51418e; }
.contact small { display: block; color: #b5c3da; font-size: 12px; }

/* Подвал */
.footer { padding: 20px 0; color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 15px; }
.footer a { font-weight: 700; }
.footer a:hover { color: var(--purple); }

/* Планшеты и мобилки */
@media (max-width: 1050px) {
  .nav { flex-wrap: wrap; }
  .navlinks { order: 3; width: 100%; justify-content: center; }
  .projects-grid, .pricing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .curr-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  section { padding: 42px 0; }
  .nav { gap: 12px; }
  .navlinks { display: none; }
  .brand { font-size: 14px; }
  .brand small { font-size: 11px; }
  .brand-mark { width: 42px; height: 42px; }
  .nav-btn { padding: 11px 13px; font-size: 12px; }

  .hero-grid { grid-template-columns: 1fr; gap: 25px; padding: 35px 0 30px; }
  .hero h1 { font-size: clamp(34px, 9vw, 44px); }
  .hero-image-wrap { min-height: 220px; border-radius: 20px; }
  .proofs { gap: 14px; }
  .proof { max-width: calc(50% - 10px); }

  .programs-grid, .projects-grid, .pricing, .contact-grid, .how-grid {
    grid-template-columns: 1fr;
  }
  .program { padding: 18px; }
  .program-header { gap: 11px; }

  .project-content { padding: 18px; }
  .curr-card { padding: 18px; }
  
  .about { grid-template-columns: 1fr; gap: 20px; padding: 22px; }
  .about-mark { min-height: 130px; }
  .about h2 { font-size: 26px; }

  .cta { align-items: flex-start; flex-direction: column; padding: 24px; }
  .cta .btn { width: 100%; }
  .contact-action { width: 100%; align-items: stretch; }
  .telegram-link, .social-link { width: 100%; }
  .footer { flex-direction: column; }
}

@media (max-width: 380px) {
  .wrap { width: calc(100% - 24px); }
  .brand { gap: 8px; }
  .brand-mark { width: 36px; height: 36px; font-size: 18px; }
  .nav-btn { padding: 10px; font-size: 11px; }
  .hero h1 { font-size: 32px; }
  .eyebrows { gap: 6px; }
  .pill { font-size: 11px; padding: 5px 9px; }
  .price-row { gap: 5px; }
  .new-price { font-size: 28px; }
}

/* Дополнительное направление: Python — приложения */
.program.python-apps { background: linear-gradient(140deg, #eef8ff, #fafcff); border-color: #b8e0ff; }
.python-apps .age { background: #cce9ff; color: #185282; }
.python-apps .num { background: #3ea5e0; }
.python-apps .result { background: #e0f2ff; color: #1e558a; }


/* Бесплатное знакомство */
.trial-offer {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #fff7e6;
  border: 2px dashed #ffb21b;
  border-radius: 16px;
  padding: 16px 20px;
  margin: 25px 0 0;
  box-shadow: 0 4px 15px rgba(255, 178, 27, .15);
}
.trial-icon { font-size: 36px; line-height: 1; flex-shrink: 0; }
.trial-text strong { display: block; font-size: 16px; color: #9a6800; margin-bottom: 4px; }
.trial-text p { margin: 0; font-size: 13px; color: #7a5a17; line-height: 1.5; }

/* FAQ */
.faq-section { background: var(--bg); }
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 16px;
}
.faq-grid details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  transition: box-shadow .2s ease;
}
.faq-grid details:hover { box-shadow: 0 4px 15px rgba(0,0,0,.05); }
.faq-grid summary {
  font-weight: 750;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
}
.faq-grid summary::-webkit-details-marker { display: none; }
.faq-grid summary::after {
  content: "+";
  font-size: 20px;
  color: var(--purple);
  font-weight: 400;
  margin-left: 10px;
  flex-shrink: 0;
}
.faq-grid details[open] summary::after { content: "−"; }
.faq-grid details p { margin: 12px 0 0; font-size: 14px; color: var(--muted); line-height: 1.6; }

/* Адаптация новых блоков */
@media (max-width: 1050px) {
  .faq-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .trial-offer { flex-direction: column; text-align: center; margin-top: 22px; }
  .faq-grid { grid-template-columns: 1fr; }
  .faq-grid details { padding: 17px; }
}
@media (max-width: 420px) {
  .faq-grid summary { font-size: 14px; }
  .trial-text strong { font-size: 15px; }
}


/* Email modal */
.email-modal {
  width: min(92vw, 480px); max-width: 480px; border: 0; border-radius: 22px;
  padding: 0; color: var(--ink); background: #fff;
  box-shadow: 0 24px 80px rgba(8, 18, 38, .28);
}
.email-modal::backdrop { background: rgba(10, 20, 40, .62); backdrop-filter: blur(3px); }
.email-modal-inner { position: relative; padding: 34px; }
.email-modal-close {
  position: absolute; top: 14px; right: 16px; width: 38px; height: 38px;
  border: 0; border-radius: 50%; background: #f1f0f8; color: var(--ink);
  font-size: 26px; cursor: pointer;
}
.email-modal .kicker { color: var(--purple); font-size: 12px; font-weight: 800; }
.email-modal h2 { margin: 10px 0; font-size: 28px; }
.email-modal p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.email-address {
  display: inline-block; margin: 10px 0 18px; padding: 12px 15px;
  border-radius: 12px; background: #f5f3ff; color: #51418e;
  font-size: 16px; font-weight: 800; overflow-wrap: anywhere;
}
.email-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.email-copy-btn, .email-compose-btn {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 16px; border: 0; border-radius: 12px; font: inherit;
  font-size: 13px; font-weight: 800; cursor: pointer;
}
.email-copy-btn { background: #eeecff; color: #51418e; }
.email-compose-btn { background: #51418e; color: white; }
.email-modal .email-copy-status { min-height: 20px; margin: 12px 0 0; font-size: 12px; color: #28764a; }
@media (max-width: 480px) {
  .email-modal-inner { padding: 28px 22px; }
  .email-modal-actions { flex-direction: column; }
  .email-copy-btn, .email-compose-btn { width: 100%; }
}
