/* =========================================================
   Сайт репетитора — стили
   Цвета меняются в одном месте: блок :root ниже
   ========================================================= */
:root {
  --bg: #fffaf3;
  --bg-tint: #fff1e0;
  --paper: #ffffff;
  --ink: #2b2d42;
  --ink-soft: #5c5f77;
  --line: #f0e2cf;
  --grid: rgba(76, 140, 200, .09);

  --coral: #f2734d;
  --coral-dark: #d95a34;
  --teal: #2aa198;
  --yellow: #ffc94a;
  --violet: #8c7ae6;
  --sky: #4c8cc8;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(120, 80, 40, .10);
  --shadow-lg: 0 18px 50px rgba(120, 80, 40, .16);

  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--coral-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 900; }
h3 { font-size: 1.1rem; font-weight: 800; }
p { margin: 0 0 1em; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.container { width: min(1140px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 32px); }
.center { text-align: center; }
.mt { margin-top: 72px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 15px 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 800; font-size: 1rem;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--coral); color: #fff; box-shadow: 0 8px 20px rgba(242, 115, 77, .35); }
.btn--primary:hover { background: var(--coral-dark); }
.btn--ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--coral); }
.btn--sm { padding: 10px 20px; font-size: .95rem; }
.btn--wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 250, 243, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo__mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--coral); color: #fff;
  font-family: var(--hand); font-size: 1.9rem; line-height: 1;
  transform: rotate(-6deg);
}
.logo__text { display: flex; flex-direction: column; line-height: 1.15; }
.logo__text strong { font-weight: 900; }
.logo__text small { color: var(--ink-soft); font-size: .8rem; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem; }
.nav a:hover { color: var(--coral); }
.burger { display: none; }

/* ---------- Первый экран ---------- */
.hero {
  position: relative;
  padding: 64px 0 80px;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
.hero__inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero__kicker {
  display: inline-block;
  font-family: var(--hand); font-size: 1.6rem; color: var(--teal);
  margin-bottom: .3em;
}
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); letter-spacing: -.01em; }
.marker {
  background: linear-gradient(transparent 58%, rgba(255, 201, 74, .65) 58%, rgba(255, 201, 74, .65) 92%, transparent 92%);
  padding: 0 .1em;
}
.hero__lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 36em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0; }
.hero__badges { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.hero__badges li {
  background: var(--paper); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .92rem;
}

.hero__photo { position: relative; justify-self: center; width: min(400px, 100%); }
.hero__img {
  width: 100%; aspect-ratio: 4 / 5;
  border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%;
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  border: 8px solid #fff;
}
.hero__art {
  width: 100%; aspect-ratio: 4 / 5;
  border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%;
  border: 8px solid #fff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: radial-gradient(circle at 75% 18%, #fff3d6 0, #ffe2c2 35%, #ffc9a8 70%, #ffb38f 100%);
}
.hero__art svg { width: 100%; height: 100%; display: block; }
.art-rays { animation: rays-spin 30s linear infinite; transform-origin: 0 0; }
@keyframes rays-spin { to { transform: rotate(360deg); } }

.sticker {
  position: absolute;
  font-family: var(--hand); font-weight: 700; font-size: 1.6rem;
  background: #fff; padding: 6px 16px; border-radius: 14px;
  box-shadow: var(--shadow);
  animation: float 5s ease-in-out infinite;
}
.sticker--1 { top: 8%; left: -12%; color: var(--teal); transform: rotate(-8deg); }
.sticker--2 { bottom: 14%; left: -8%; color: var(--violet); animation-delay: -1.5s; }
.sticker--3 { top: 18%; right: -8%; color: var(--coral); animation-delay: -3s; }
@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

/* ---------- Цифры ---------- */
.stats { margin-top: -36px; position: relative; z-index: 2; }
.stats__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 10px;
}
.stat { text-align: center; padding: 0 12px; border-right: 1px dashed var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-size: clamp(1.6rem, 6.5vw, 2.4rem); white-space: nowrap; font-weight: 900; color: var(--coral); line-height: 1.1; }
.stat span { color: var(--ink-soft); font-weight: 600; font-size: .95rem; }

/* ---------- Секции ---------- */
.section { padding: 96px 0; }
.section--tint { background: var(--bg-tint); }
.section--grid {
  background-color: #f6fbff;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
.section__title { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.section__sub { color: var(--ink-soft); font-size: 1.1rem; margin-top: -.4em; margin-bottom: 36px; }

/* ---------- Обо мне ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about__text p { font-size: 1.1rem; }
.principles { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.principle {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--paper); border-radius: var(--radius-sm); padding: 18px 20px;
  border: 1px solid var(--line);
}
.principle__icon {
  flex: none; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.5rem; background: var(--bg-tint);
}
.principle h3 { margin-bottom: .2em; }
.principle p { margin: 0; color: var(--ink-soft); font-size: .97rem; }

/* ---------- Вкладки и карточки ---------- */
.tabs {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin: 0 auto 32px; padding: 6px; width: fit-content; max-width: 100%;
  background: var(--paper); border-radius: 999px; box-shadow: var(--shadow);
}
.tab {
  border: 0; background: transparent; padding: 10px 22px; border-radius: 999px;
  font-weight: 800; color: var(--ink-soft);
}
.tab.is-active { background: var(--ink); color: #fff; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: var(--paper); border-radius: var(--radius); padding: 26px 22px;
  box-shadow: var(--shadow); border-top: 6px solid var(--c, var(--coral));
  animation: pop .35s ease both;
}
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .1s; }
.card:nth-child(4) { animation-delay: .15s; }
.card__emoji { font-size: 2.2rem; display: block; margin-bottom: 10px; }
.card p { color: var(--ink-soft); margin: 0; font-size: .97rem; }
.card--yellow { --c: var(--yellow); }
.card--teal { --c: var(--teal); }
.card--coral { --c: var(--coral); }
.card--violet { --c: var(--violet); }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Форматы и шаги ---------- */
.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.format {
  text-align: center; background: var(--paper); border: 2px dashed var(--line);
  border-radius: var(--radius); padding: 30px 24px;
}
.format__icon { font-size: 2.6rem; display: block; margin-bottom: 8px; }
.format p { color: var(--ink-soft); margin: 0; }

.prices {
  display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center;
  gap: 20px; margin: 32px 0 28px;
}
.price {
  text-align: center; background: var(--paper); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--shadow); border: 2px solid var(--line);
}
.price--free { border-color: var(--teal); background: #f0fbf9; }
.price__name { font-weight: 800; margin-bottom: .3em; }
.price__value { font-size: 2.4rem; font-weight: 900; color: var(--coral); line-height: 1.1; margin-bottom: .4em; }
.price--free .price__value { color: var(--teal); }
.price__note { color: var(--ink-soft); margin: 0; font-size: .95rem; }

.steps {
  list-style: none; padding: 0; margin: 32px 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  counter-reset: s;
}
.step { position: relative; padding: 24px 20px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.step__num {
  display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 12px;
  border-radius: 50%; background: var(--teal); color: #fff;
  font-family: var(--hand); font-size: 1.8rem; line-height: 1;
}
.step:nth-child(2) .step__num { background: var(--coral); }
.step:nth-child(3) .step__num { background: var(--violet); }
.step:nth-child(4) .step__num { background: var(--yellow); color: var(--ink); }
.step p { color: var(--ink-soft); margin: 0; font-size: .97rem; }

/* ---------- Панель (тест, игра, форма) ---------- */
.panel {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 32px;
}
.panel__label { font-weight: 800; margin: 0 0 12px; }
.panel__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-top: 24px; }
.panel__actions.center { justify-content: center; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.chip {
  border: 2px solid var(--line); background: var(--bg); color: var(--ink);
  padding: 10px 18px; border-radius: 999px; font-weight: 700;
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--coral); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Тест ---------- */
.checks { display: grid; gap: 10px; }
.check {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 14px 16px; border-radius: var(--radius-sm); border: 2px solid var(--line);
  transition: border-color .15s, background .15s;
}
.check:hover { border-color: #f5b79f; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--coral); flex: none; }
.check:has(input:checked) { border-color: var(--coral); background: #fff4ee; }
.quiz-result { text-align: center; }
.quiz-result__emoji { font-size: 3.5rem; }
.quiz-result h3 { font-size: 1.5rem; }
.quiz-result ul { text-align: left; display: inline-block; margin: 0 auto 8px; padding-left: 1.2em; color: var(--ink-soft); }

/* ---------- Игра ---------- */
.game__best { text-align: center; color: var(--ink-soft); margin: 14px 0 0; font-weight: 700; }
.game__bar { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.3rem; }
.game__progress { height: 8px; background: var(--bg-tint); border-radius: 99px; overflow: hidden; margin: 10px 0 18px; }
.game__progress span { display: block; height: 100%; width: 100%; background: var(--teal); transition: width 1s linear; }
.game__hint { text-align: center; color: var(--ink-soft); margin: 0; min-height: 1.6em; }
.game__question {
  text-align: center; font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 900;
  min-height: 1.6em; margin: 6px 0 22px; letter-spacing: .02em;
}
.game__question .gap { color: var(--coral); }
.game__options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.game__options button {
  border: 2px solid var(--line); background: var(--bg); border-radius: var(--radius-sm);
  padding: 18px 10px; font-size: 1.6rem; font-weight: 900; color: var(--ink);
  transition: transform .1s, background .15s, border-color .15s;
}
.game__options button:hover { border-color: var(--teal); }
.game__options button.is-right { background: #dff5f1; border-color: var(--teal); }
.game__options button.is-wrong { background: #ffe4dc; border-color: var(--coral); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.game__end { text-align: center; }
.game__trophy { font-size: 4rem; }
.game__final { font-size: 1.3rem; font-weight: 800; }

/* ---------- Отзывы ---------- */
.reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.review {
  position: relative; background: var(--paper); border-radius: var(--radius);
  padding: 34px 26px 24px; box-shadow: var(--shadow);
}
.review::before {
  content: "“"; position: absolute; top: -8px; left: 20px;
  font-size: 5rem; line-height: 1; color: var(--yellow); font-family: Georgia, serif;
}
.review--placeholder { border: 2px dashed var(--line); box-shadow: none; }
.review--placeholder .review__text { color: var(--ink-soft); font-style: italic; }
.review__author { margin: 0; display: flex; flex-direction: column; }
.review__author span { color: var(--ink-soft); font-size: .9rem; }

/* ---------- Вопросы ---------- */
.faq { display: grid; gap: 12px; margin-top: 32px; }
.faq details { background: var(--paper); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 56px 18px 22px;
  font-weight: 800; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; translate: 0 -50%;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-tint); color: var(--coral); font-size: 1.3rem; transition: rotate .2s;
}
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { padding: 0 22px 20px; margin: 0; color: var(--ink-soft); }

/* ---------- Контакты и форма ---------- */
.contacts { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.messengers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.messenger {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-weight: 800; text-decoration: none; color: #fff;
  transition: transform .15s;
}
.messenger:hover { transform: translateY(-2px); }
.messenger__icon { font-size: 1.2rem; }
.messenger--tg { background: #2aabee; }
.messenger--max { background: linear-gradient(135deg, #4b6cff, #a64dff); }
.messenger--vk { background: #0077ff; }
.messenger--phone { background: var(--teal); }
.contacts__place { color: var(--ink-soft); font-weight: 600; }

.form { display: grid; gap: 4px; }
.field { margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 800; margin-bottom: 6px; font-size: .95rem; padding: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 13px 16px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--bg);
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); background: #fff; }
.field .is-invalid, .field input.is-invalid { border-color: var(--coral); }
.field .choice-row { margin-bottom: 0; }
.check-chip { cursor: pointer; position: relative; }
.check-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.check-chip span {
  display: inline-block; padding: 9px 16px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--bg); font-weight: 700; font-size: .95rem;
}
.check-chip input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.check-chip input:focus-visible + span { outline: 3px solid rgba(42, 161, 152, .35); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--ink-soft); margin: 4px 0 16px; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--coral); }
.consent.is-invalid { color: var(--coral-dark); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status { margin: 12px 0 0; font-weight: 700; text-align: center; min-height: 1.5em; }
.form__status.is-ok { color: var(--teal); }
.form__status.is-error { color: var(--coral-dark); }

/* ---------- Подвал ---------- */
.footer { background: var(--ink); color: #d7d8e4; padding: 32px 0; font-size: .95rem; }
.footer b { color: #fff; }
.footer__inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer__links { display: flex; gap: 20px; }
.footer a { color: #d7d8e4; }

.float-cta { display: none; }

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 1100px) {
  .logo__text small { display: none; }
}

@media (max-width: 1000px) and (min-width: 901px) {
  .header__inner { gap: 16px; }
  .nav { gap: 12px !important; }
  .nav a { font-size: .85rem !important; }
}

@media (max-width: 1024px) {
  .nav { gap: 16px; }
  .nav a { font-size: .9rem; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .header__cta { display: none; }
  .burger {
    display: grid; gap: 5px; margin-left: auto;
    width: 46px; height: 46px; place-content: center;
    background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  }
  .burger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
  .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); }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 4px; font-size: 1.05rem; border-bottom: 1px dashed var(--line); }

  .hero { padding: 40px 0 72px; }
  .hero__inner, .about, .contacts { grid-template-columns: 1fr; gap: 40px; }
  .hero__photo { width: min(260px, 70%); }
  .sticker { font-size: 1.25rem; }
  .sticker--1 { left: -14%; }
  .sticker--3 { right: -12%; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); row-gap: 22px; }
  .stat:nth-child(2) { border-right: 0; }
  .formats { grid-template-columns: 1fr; }
  .reviews { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }

  .float-cta {
    display: block; position: fixed; left: 16px; right: 16px; bottom: 14px; z-index: 40;
    text-align: center; padding: 15px; border-radius: 999px;
    background: var(--coral); color: #fff; font-weight: 800; text-decoration: none;
    box-shadow: 0 10px 26px rgba(242, 115, 77, .45);
    transition: transform .25s, opacity .25s;
  }
  .float-cta.is-hidden { transform: translateY(120%); opacity: 0; pointer-events: none; }
  .footer { padding-bottom: 90px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero__actions .btn { width: 100%; }
  .cards, .steps { grid-template-columns: 1fr; }
  .panel { padding: 22px 18px; }
  .field-row, .messengers, .prices { grid-template-columns: 1fr; }
  .tab { padding: 9px 14px; font-size: .92rem; }
  .logo__text small { display: none; }
}

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