/* Мила — главная страница */
:root {
  --navy: #0f2a78;
  --navy-2: #1b3a94;
  --ink: #233466;
  --blue: #1f5fe0;
  --blue-2: #1745c4;
  --sky-top: #bfe0fb;
  --sky-mid: #dcefff;
  --page: #f3f8ff;
  --white: #ffffff;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(31, 82, 170, .12);
  --shadow-sm: 0 4px 14px rgba(31, 82, 170, .10);
  --font: "Montserrat", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--navy);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
.container { width: min(1360px, 100% - 48px); margin-inline: auto; }

svg { flex-shrink: 0; }
.main-nav svg, .btn svg, .round-arrow svg {
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 700 16px/1 var(--font);
  border-radius: 999px; padding: 12px 22px;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
  cursor: pointer; border: 0;
}
.btn svg { width: 20px; height: 20px; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid #ffb400; outline-offset: 3px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #2f6ff0 0%, var(--blue-2) 100%);
  box-shadow: 0 8px 20px rgba(23, 69, 196, .35), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover { box-shadow: 0 12px 26px rgba(23, 69, 196, .45), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-lg { font-size: 19px; padding: 19px 34px; }
.btn-white { background: #fff; color: var(--navy-2); box-shadow: 0 10px 24px rgba(10, 40, 130, .25); }

/* ---------- Шапка ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  padding: 10px 0;
  transition: background-color .25s ease, box-shadow .25s ease, padding .25s ease;
}
.site-header.is-stuck {
  position: fixed;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(10px);
  box-shadow: 0 4px 20px rgba(15, 42, 120, .08);
  padding: 4px 0;
}
.header-row { display: flex; align-items: center; gap: 32px; }
.logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo-img { width: auto; height: 90px; filter: drop-shadow(0 4px 10px rgba(15, 42, 120, .15)); transition: height .25s ease; }
.is-stuck .logo-img { height: 60px; }
.logo-sm .logo-img { height: 54px; filter: none; }
.logo-cap { color: var(--navy-2); }

.main-nav { display: flex; gap: 6px; margin-left: auto; margin-right: auto; }
.main-nav a {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px;
  font-weight: 600; font-size: 15px; color: var(--navy);
  transition: background-color .18s ease;
}
.main-nav svg { width: 22px; height: 22px; }
.main-nav a:hover { background: rgba(255,255,255,.6); }
.main-nav a.is-active { color: var(--blue-2); }
.main-nav a.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 3px; border-radius: 3px; background: var(--blue);
}
.btn-login { padding: 12px 24px; font-size: 16px; }
.btn-login svg { width: 18px; height: 18px; }
.burger { display: none; }

/* ---------- Первый экран ---------- */
.hero {
  position: relative;
  padding: 110px 0 110px;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 60%, #eaf5ff 100%);
  overflow: hidden;
  isolation: isolate;
}
.hero::after { /* мягкая белая волна снизу */
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -70px; height: 140px;
  background: var(--page); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  z-index: 2;
}
.hero-sky { position: absolute; inset: 0; z-index: -1; }
.cloud { position: absolute; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.95), rgba(255,255,255,0)); filter: blur(2px); }
.cloud.c1 { width: 380px; height: 200px; left: -120px; top: 40px; }
.cloud.c2 { width: 300px; height: 160px; left: 30%; top: -50px; opacity: .8; }
.cloud.c3 { width: 520px; height: 220px; left: -160px; bottom: 30px; opacity: .9; }

.hero-grid { position: static; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; min-height: 440px; }
.hero-copy { position: relative; z-index: 3; padding-top: 10px; padding-bottom: 40px; }
.hero h1 {
  font-weight: 800; letter-spacing: -.03em; line-height: 1.02;
  font-size: clamp(40px, 5.2vw, 76px);
  color: var(--navy);
  white-space: nowrap;
}
.hero-sub { margin: 18px 0 32px; font-weight: 700; font-size: clamp(17px, 1.6vw, 23px); color: var(--navy); }
.paper-plane { position: absolute; width: 200px; right: -160px; top: -20px; opacity: .95; pointer-events: none; }

.hero-art { position: absolute; right: 0; bottom: 18px; width: min(63%, 1100px); z-index: 1; }
.hero-art img {
  width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 18%), linear-gradient(180deg, transparent 0%, #000 14%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, #000 18%), linear-gradient(180deg, transparent 0%, #000 14%);
  mask-composite: intersect;
}

/* ---------- Заголовки секций ---------- */
.section-title { display: flex; align-items: center; justify-content: center; gap: 28px; font-weight: 800; font-size: clamp(22px, 2.1vw, 30px); text-align: center; letter-spacing: -.01em; }
.section-title::before, .section-title::after { content: ""; flex: 1; max-width: 230px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, #bcd6f6); }
.section-title::after { transform: scaleX(-1); }
.section-title--sm { font-size: clamp(20px, 1.8vw, 26px); }

/* ---------- Предметы ---------- */
.subjects { position: relative; z-index: 3; margin-top: -60px; }
.subject-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 22px; }
.subject-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 150px; padding: 18px 64px 16px 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform .22s ease, box-shadow .22s ease;
  overflow: hidden;
}
.subject-card img { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); height: 88px; width: auto; transition: transform .3s ease; }
.subject-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.subject-card:hover img { transform: translateX(-50%) scale(1.06) rotate(-2deg); }
.subject-name { position: relative; font-weight: 700; font-size: 20px; line-height: 1.05; color: var(--navy); padding-top: 92px; }
.round-arrow {
  position: absolute; right: 18px; bottom: 16px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
}
.round-arrow svg { width: 20px; height: 20px; }
.tone-blue   { background: linear-gradient(160deg, #dff0ff, #b4dbfb); }
.tone-violet { background: linear-gradient(160deg, #ece2ff, #ccb8f6); }
.tone-green  { background: linear-gradient(160deg, #e1f9d4, #b3eb98); }
.tone-orange { background: linear-gradient(160deg, #fff0bf, #fccb63); }
.tone-blue   .round-arrow { background: #1f5fe0; }
.tone-violet .round-arrow { background: #2747c4; }
.tone-green  .round-arrow { background: #1c9a4c; }
.tone-orange .round-arrow { background: #df4f1d; }

/* ---------- Что тебя ждёт ---------- */
.features { padding: 26px 0 8px; }
.feature-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.feature {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border-radius: 18px; padding: 12px 18px;
  box-shadow: var(--shadow-sm);
  font-weight: 600; font-size: 15px; line-height: 1.25; color: var(--navy);
}
.feature img { width: 52px; height: 44px; object-fit: contain; }

/* ---------- Баннер «Ты можешь!» ---------- */
.motivation { padding: 34px 0 30px; }
.banner {
  position: relative;
  display: grid; grid-template-columns: 300px 1fr auto 200px; align-items: center; gap: 28px;
  min-height: 140px; padding: 18px 40px 18px 0;
  border-radius: 34px;
  background:
    radial-gradient(120% 140% at 85% 120%, rgba(255,255,255,.35), transparent 40%),
    linear-gradient(100deg, #2f74f0 0%, #4f97f8 55%, #6fb2ff 100%);
  box-shadow: 0 16px 40px rgba(31, 95, 224, .30);
  color: #fff;
}
.banner-robot { align-self: end; width: 270px; margin: -60px 0 -18px 30px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.2)); }
.banner-copy h2 { font-weight: 800; font-size: clamp(30px, 3vw, 44px); letter-spacing: -.02em; text-shadow: 0 3px 10px rgba(10, 40, 130, .25); }
.banner-copy p { margin-top: 8px; font-weight: 500; font-size: 18px; line-height: 1.3; max-width: 420px; }
.banner-trophy { width: 180px; margin: -24px 0 -16px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.18)); }
.spark { position: absolute; width: 18px; height: 18px; background: #ffe36e; clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); opacity: .9; animation: twinkle 3s ease-in-out infinite; }
.spark.s1 { left: 28px; top: 26px; }
.spark.s2 { left: 330px; top: 20px; width: 12px; height: 12px; animation-delay: .6s; background: #fff; }
.spark.s3 { right: 230px; top: 22px; width: 14px; height: 14px; animation-delay: 1.2s; }
.spark.s4 { right: 24px; bottom: 26px; width: 12px; height: 12px; animation-delay: 1.8s; background: #fff; }
.spark.s5 { left: 46%; bottom: 14px; width: 10px; height: 10px; animation-delay: .9s; background: #fff; }
@keyframes twinkle { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(.6); opacity: .5; } }

/* ---------- Подвал ---------- */
.site-footer { background: #fff; border-top: 1px solid #e3edfb; padding: 18px 0; }
.footer-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.tagline { font-size: 13px; font-weight: 500; color: var(--ink); }
.footer-nav { display: flex; margin-left: auto; }
.footer-nav a { padding: 2px 18px; font-weight: 500; font-size: 15px; color: var(--navy); }
.footer-nav a + a { border-left: 2px solid var(--navy); }
.footer-nav a:hover { color: var(--blue); }
.socials { display: flex; gap: 14px; }
.socials a { width: 40px; height: 40px; border-radius: 50%; background: var(--navy-2); color: #fff; display: grid; place-items: center; transition: background-color .18s ease, transform .18s ease; }
.socials a:hover { background: var(--blue); transform: translateY(-2px); }
.socials svg { width: 22px; height: 22px; }
.grades { display: inline-flex; align-items: center; gap: 10px; padding: 10px 20px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); border: 1px solid #e3edfb; font-weight: 600; font-size: 15px; }
.grades .logo-cap { width: 28px; height: 22px; }
.copyright { margin-left: auto; font-size: 12px; color: var(--ink); }

/* ---------- Появление при прокрутке ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 1240px) {
  .main-nav a { padding: 10px 10px; font-size: 14px; }
  .feature-list { grid-template-columns: repeat(3, 1fr); }
  .banner { grid-template-columns: 240px 1fr auto; }
  .banner-trophy { display: none; }
  .banner-robot { width: 220px; }
  .copyright { margin-left: 0; width: 100%; text-align: center; }
}

@media (max-width: 1020px) {
  .header-row { gap: 16px; }
  .burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 46px; height: 46px; border-radius: 14px; border: 0; background: #fff; box-shadow: var(--shadow-sm); padding: 0 12px; cursor: pointer;
  }
  .burger span { display: block; height: 3px; border-radius: 3px; background: var(--navy); transition: transform .2s ease, opacity .2s ease; }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .btn-login { margin-left: auto; }
  .main-nav {
    position: absolute; top: calc(100% + 6px); left: 24px; right: 24px;
    flex-direction: column; gap: 2px; padding: 10px;
    background: #fff; border-radius: 18px; box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .main-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .main-nav a { padding: 14px; font-size: 16px; }
  .main-nav a.is-active::after { display: none; }
  .main-nav a.is-active { background: #eef4ff; }

  .hero { padding-bottom: 40px; }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { text-align: center; padding-bottom: 0; }
  .paper-plane { display: none; }
  .hero { padding-bottom: 60px; }
  .hero-art { position: relative; right: auto; bottom: auto; width: auto; margin: 16px -24px 0; }
  .hero-art img { -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12%); mask-image: linear-gradient(180deg, transparent 0, #000 12%); }
  .subjects { margin-top: 0; }
  .subject-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-list { grid-template-columns: repeat(2, 1fr); }
  .banner { grid-template-columns: 1fr; text-align: center; padding: 30px 24px 30px; justify-items: center; gap: 16px; }
  .banner-robot { width: 200px; margin: -80px 0 0; }
  .banner-copy p { margin-inline: auto; }
  .footer-row { justify-content: center; text-align: center; }
  .footer-nav { margin-left: 0; }
}

@media (max-width: 560px) {
  .container { width: calc(100% - 32px); }
  .logo-img { height: 52px; }
  .is-stuck .logo-img { height: 46px; }
  .btn-login { padding: 11px 16px; font-size: 15px; }
  .hero { padding-top: 92px; }
  .hero h1 { white-space: normal; }
  .btn-lg { font-size: 17px; padding: 16px 26px; }
  .subject-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .subject-card { min-height: 140px; padding: 14px 14px 14px; }
  .subject-card img { height: 72px; }
  .subject-name { font-size: 16px; padding-top: 76px; padding-right: 40px; }
  .round-arrow { width: 32px; height: 32px; right: 12px; bottom: 12px; }
  .feature-list { grid-template-columns: 1fr; }
  .section-title::before, .section-title::after { display: none; }
  .footer-nav a { padding: 4px 14px; }
}

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