/* ============================================================
   AniCode — мультяшно-анимешный стиль
   ============================================================ */

:root {
  --ink: #2b1b3d;
  --ink-soft: #4a3a5e;
  --muted: #7a6a8e;
  --paper: #fff6ec;
  --white: #ffffff;

  --pink: #ff6fa5;
  --pink-deep: #e94f8a;
  --purple: #8b5cf6;
  --blue: #38bdf8;
  --yellow: #ffd93d;
  --green: #34d399;

  --shadow-hard: 6px 6px 0 var(--ink);
  --shadow-soft: 0 10px 30px rgba(43, 27, 61, 0.12);

  --radius-card: 24px;
  --font-display: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
}

/* ---------- Сброс ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* якорные ссылки не должны уезжать под липкую шапку */
section[id] {
  scroll-margin-top: 96px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(43, 27, 61, 0.07) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* ---------- Фоновая декорация ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

.blob-pink {
  width: 460px;
  height: 460px;
  background: #ffb3d1;
  top: -140px;
  left: -120px;
}

.blob-blue {
  width: 400px;
  height: 400px;
  background: #a5e3ff;
  top: 38%;
  right: -160px;
}

.blob-yellow {
  width: 340px;
  height: 340px;
  background: #ffe89a;
  bottom: -120px;
  left: 28%;
}

.spark {
  position: absolute;
  font-size: 30px;
  color: var(--pink);
  opacity: 0.65;
  animation: twinkle 4.5s ease-in-out infinite;
}

.spark-1 { top: 12%; left: 8%; animation-delay: 0s; }
.spark-2 { top: 26%; right: 12%; color: var(--purple); animation-delay: 1.4s; }
.spark-3 { bottom: 30%; left: 14%; color: var(--blue); animation-delay: 2.2s; }
.spark-4 { bottom: 14%; right: 8%; color: var(--yellow); animation-delay: 0.8s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85) rotate(0deg); }
  50% { opacity: 0.8; transform: scale(1.15) rotate(12deg); }
}

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(255, 246, 236, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--ink);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--purple);
  color: #fff;
  font-family: 'Courier New', monospace;
  font-weight: 800;
  font-size: 17px;
  border: 3px solid var(--ink);
  border-radius: 13px;
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-4deg);
  transition: transform 0.2s ease;
}

.logo:hover .logo-mark {
  transform: rotate(4deg) scale(1.06);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-text span {
  color: var(--pink);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 28px);
}

.nav-link {
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 3px dashed transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  color: var(--pink-deep);
  border-color: var(--pink);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--ink);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}

.btn:focus-visible {
  outline: 3px dashed var(--purple);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--pink);
  color: #fff;
}

.btn-primary:hover {
  background: #ff5c9a;
}

.btn-ghost {
  background: var(--white);
}

.btn-big {
  font-size: 19px;
  padding: 14px 30px;
}

.btn-small {
  font-size: 15px;
  padding: 8px 16px;
  box-shadow: 0 4px 0 var(--ink);
}

.btn-small:hover {
  box-shadow: 0 6px 0 var(--ink);
}

.btn-small:active {
  box-shadow: 0 1px 0 var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(36px, 6vw, 84px) 24px 32px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-1.5deg);
}

.hero-title {
  margin: 20px 0 18px;
  font-size: clamp(2.3rem, 5.4vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.hl {
  background: linear-gradient(180deg, transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%);
  padding: 0 0.08em;
  border-radius: 4px;
}

.hero-sub {
  max-width: 54ch;
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  line-height: 1.65;
  color: var(--ink-soft);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0 0;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 3.5vw, 40px);
  margin-top: 34px;
  list-style: none;
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stats strong {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 800;
  color: var(--purple);
  line-height: 1;
}

.hero-stats span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------- Маскот ---------- */
.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  padding: 10px;
}

.mascot {
  width: 100%;
  max-width: 400px;
  height: auto;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 18px 0 rgba(43, 27, 61, 0.10));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.float-chip {
  position: absolute;
  z-index: 2;
  padding: 6px 13px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 12px;
  font-family: 'Courier New', monospace;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 4px 4px 0 var(--ink);
  animation: float 5s ease-in-out infinite;
}

.chip-1 { top: 7%; left: 0; color: var(--pink-deep); animation-delay: 0.2s; }
.chip-2 { top: 17%; right: 0; color: var(--purple); animation-delay: 1.2s; }
.chip-3 { bottom: 15%; left: 2%; color: var(--blue); animation-delay: 0.8s; }
.chip-4 { bottom: 5%; right: 3%; color: var(--green); animation-delay: 1.8s; }

/* ---------- Секции ---------- */
.course,
.how,
.cta,
.pricing {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.section-kicker {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--pink-deep);
}

.section-title {
  margin: 4px 0 6px;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-sub {
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
}

/* ---------- Фильтры ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 26px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, color 0.15s ease;
}

.chip:hover {
  transform: translateY(-2px);
  box-shadow: 3px 5px 0 var(--ink);
}

.chip:focus-visible {
  outline: 3px dashed var(--purple);
  outline-offset: 3px;
}

.chip.is-active {
  background: var(--ink);
  color: #fff;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

/* ---------- Сетка модулей ---------- */
.modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 22px;
  align-items: start;
}

.noscript {
  font-weight: 800;
  color: var(--pink-deep);
}

/* ---------- Карточка модуля ---------- */
.module-card {
  position: relative;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
  animation: cardIn 0.45s ease backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.module-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 9px;
  background: var(--accent, var(--pink));
}

.module-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.module-card.is-open {
  grid-column: 1 / -1;
  box-shadow: 8px 8px 0 var(--ink);
}

.module-card[hidden] {
  display: none;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.module-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 18px 16px;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.module-head:focus-visible {
  outline: 3px dashed var(--purple);
  outline-offset: -8px;
}

.module-icon {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 27px;
  background: var(--accent-soft, #ffe9f2);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 3px 3px 0 var(--ink);
}

.module-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.module-kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-deep, var(--pink-deep));
}

.module-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}

.module-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}

.module-meta {
  flex: none;
  display: flex;
  align-items: end;
  gap: 1px;
  align-content: stretch;
  justify-content: space-evenly;
  flex-direction: column;
}

.module-live {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e3fbf2;
  border: 2px solid #10b981;
  color: #047857;
  white-space: nowrap;
}

.module-count {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft, #ffe9f2);
  border: 2px solid var(--accent, var(--pink));
  color: var(--accent-deep, var(--pink-deep));
  white-space: nowrap;
}

.module-chevron {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}

.module-chevron::before {
  content: '+';
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
  margin-top: -2px;
}

.module-card.is-open .module-chevron {
  transform: rotate(45deg);
  background: var(--accent, var(--pink));
  color: #fff;
}

.module-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s ease;
}

.module-body-inner {
  overflow: hidden;
  padding: 0 20px;
}

.module-card.is-open .module-body {
  grid-template-rows: 1fr;
}

.module-card.is-open .module-body-inner {
  padding-bottom: 20px;
}

.lesson-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
  border-top: 2px dashed #e6dbef;
  padding-top: 16px;
}

.lesson-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 2px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.lesson-link:hover {
  background: var(--accent-soft, #ffe9f2);
  border-color: var(--accent, var(--pink));
  transform: translateX(3px);
}

.lesson-link:focus-visible {
  outline: 3px dashed var(--purple);
  outline-offset: 1px;
}

.lesson-num {
  flex: none;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft, #ffe9f2);
  border: 2px solid var(--accent, var(--pink));
  color: var(--accent-deep, var(--pink-deep));
  font-size: 11px;
  font-weight: 800;
}

.lesson-title {
  line-height: 1.25;
}

/* урок за пределами бесплатной части: видно, что он закрыт */
.lesson-link.is-locked {
  opacity: 0.62;
}

.lesson-link.is-locked .lesson-num {
  border-style: dashed;
  background: #f4f0f8;
  border-color: #c9b9d8;
  color: #8f7fae;
}

.lesson-lock {
  margin-left: auto;
  font-size: 12px;
  line-height: 1;
}

/* ---------- Цветовые категории ---------- */
.cat-html {
  --accent: #ff9f43;
  --accent-soft: #fff2e2;
  --accent-deep: #b45d05;
}

.cat-css {
  --accent: #38bdf8;
  --accent-soft: #e6f7ff;
  --accent-deep: #0369a1;
}

.cat-js {
  --accent: #fbbf24;
  --accent-soft: #fff8dd;
  --accent-deep: #96620a;
}

.cat-oop {
  --accent: #a78bfa;
  --accent-soft: #f2ecff;
  --accent-deep: #6d28d9;
}

.cat-browser {
  --accent: #34d399;
  --accent-soft: #e3fbf2;
  --accent-deep: #047857;
}

.cat-backend {
  --accent: #fb7185;
  --accent-soft: #ffe9ed;
  --accent-deep: #be123c;
}

.cat-devops {
  --accent: #7c8ba1;
  --accent-soft: #eef2f7;
  --accent-deep: #334155;
}

/* ---------- «Как учиться» ---------- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.how-card {
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 22px;
  padding: 22px 20px;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.how-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.how-icon {
  display: block;
  font-size: 32px;
  margin-bottom: 10px;
}

.how-card h3 {
  font-size: 21px;
  margin-bottom: 6px;
}

.how-card p {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ---------- CTA ---------- */
.cta {
  padding-bottom: 60px;
}

.cta-inner {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(30px, 5vw, 54px) clamp(20px, 4vw, 40px);
  background: linear-gradient(120deg, #ffd6ec, #dcccff 55%, #bfe9ff);
  border: 3px solid var(--ink);
  border-radius: 30px;
  box-shadow: 8px 8px 0 var(--ink);
}

.cta-inner::before,
.cta-inner::after {
  content: '✦';
  position: absolute;
  font-size: 34px;
  color: rgba(43, 27, 61, 0.25);
}

.cta-inner::before {
  top: 18px;
  left: 26px;
  transform: rotate(-12deg);
}

.cta-inner::after {
  bottom: 18px;
  right: 26px;
  transform: rotate(14deg);
}

.cta-inner h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  margin-bottom: 8px;
}

.cta-inner p {
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

/* ---------- Подвал ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 3px solid var(--ink);
  background: var(--white);
  padding: 26px 24px;
  text-align: center;
  font-weight: 700;
}

.footer-small {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* Реквизиты исполнителя: нужны для платёжного сервиса и по закону
   о защите прав потребителей — на каждой странице. */
.footer-legal {
  margin: 14px auto 0;
  padding-top: 12px;
  max-width: 720px;
  border-top: 1px dashed rgba(43, 27, 61, 0.2);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.65;
  color: var(--muted);
}

.footer-legal a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-legal a:hover {
  color: var(--pink-deep);
}

/* Кнопка в подвале выглядит ссылкой: открывает форму поддержки. */
.footer-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.footer-link:hover {
  color: var(--pink-deep);
}

/* ---------- Страница реквизитов ---------- */
.legal-page {
  position: relative;
  z-index: 1;
  padding: 40px 18px 64px;
}

.legal-card {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 32px 28px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow-hard);
}

.legal-card h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.2;
}

.legal-card h2 {
  margin: 26px 0 8px;
  font-family: var(--font-display);
  font-size: 21px;
}

.legal-card p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.legal-card a {
  color: var(--pink-deep);
}

.legal-table {
  width: 100%;
  margin: 16px 0 8px;
  border-collapse: collapse;
  font-size: 14.5px;
}

.legal-table th,
.legal-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(43, 27, 61, 0.12);
}

.legal-table th {
  width: 42%;
  font-weight: 700;
  color: var(--muted);
}

.legal-table td {
  color: var(--ink-soft);
}

/* цена и дата не должны рваться посередине на узком экране */
.legal-table .legal-price {
  white-space: nowrap;
  font-weight: 700;
}

.legal-table td small {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.legal-table .legal-nowrap {
  white-space: nowrap;
}

.legal-back {
  margin-top: 26px;
  font-weight: 700;
}

/* Длинные юридические документы: оферта, политика, оплата. */
.legal-doc {
  width: min(820px, 100%);
}

.legal-doc h2 {
  margin: 30px 0 10px;
  font-size: 19px;
  line-height: 1.35;
}

.legal-meta {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.legal-list {
  margin: 8px 0 14px;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.legal-list li {
  margin-bottom: 6px;
}

.legal-doc .legal-table th {
  width: 38%;
}

/* ---------- Тост ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  max-width: min(92vw, 480px);
  padding: 13px 24px;
  background: var(--ink);
  color: #fff;
  border: 3px solid var(--pink);
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 6px 0 rgba(43, 27, 61, 0.25);
  transform: translate(-50%, 160%);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  pointer-events: none;
}

.toast.is-visible {
  transform: translate(-50%, 0);
}

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 28px;
    text-align: center;
  }

  .hero-sub {
    margin: 0 auto;
  }

  .hero-actions,
  .hero-stats {
    justify-content: center;
  }

  .hero-art {
    order: 2;
    max-width: 360px;
    margin: 0 auto;
  }

  .mascot {
    max-width: 320px;
  }

  .hero-stats li {
    align-items: center;
  }

  /* карточка модуля: бейджи уходят на вторую строку и не сжимают заголовок */
  .module-head {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .module-titles {
    flex: 1 1 60%;
  }

  .module-meta {
    flex: 1 1 100%;
    align-items: flex-start;
    padding-left: 70px;
  }

  .module-chevron {
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  .site-nav .nav-link {
    display: none;
  }

  /* шапка на телефоне: вход и регистрация не должны вылезать за край */
  .site-nav {
    gap: 6px;
  }

  .auth-slot {
    gap: 6px;
  }

  .auth-slot .btn {
    padding: 7px 11px;
    font-size: 12px;
  }

  .auth-chip {
    max-width: 90px;
    font-size: 11.5px;
  }

  /* логотип уже ведёт на главную — отдельная кнопка на телефоне лишняя */
  .site-nav > .btn-ghost {
    display: none;
  }

  /* на телефоне в шапку не влезает ещё одна кнопка */
  .auth-slot .auth-admin {
    display: none;
  }

  /* CTA дублируется в hero — в шапке он не помещается рядом с аккаунтом */
  .site-nav > .btn-primary {
    display: none;
  }

  .module-head {
    padding: 22px 14px 14px;
    gap: 10px;
  }

  .module-icon {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  .module-title {
    font-size: 17px;
  }

  .module-count {
    display: none;
  }

  .module-body-inner {
    padding: 0 14px;
  }

  .module-meta {
    padding-left: 58px;
  }

  /* четыре пункта статистики в hero — сеткой 2×2, а не 3+1 */
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    width: 100%;
    text-align: left;
  }

  /* декоративные звёздочки садятся на кнопку и заголовок CTA */
  .cta-inner::before,
  .cta-inner::after {
    display: none;
  }

  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: none;
  }

  .float-chip {
    font-size: 13px;
    padding: 5px 10px;
  }

  .chip-1 { left: -2%; }
  .chip-2 { right: -2%; }
  .chip-3 { left: 0; }
  .chip-4 { right: 0; }

  .hero-title {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }
}

/* совсем узкий экран: длинная подпись кнопки не влезает в шапку */
@media (max-width: 480px) {
  /* имя рядом с кнопкой подтверждения уже не помещается */
  .auth-slot:has(.btn-verify) .auth-chip {
    display: none;
  }

  /* селекторы специфичнее базового .verify-short { display: none } */
  .auth-slot .btn-verify .verify-full {
    display: none;
  }

  .auth-slot .btn-verify .verify-short {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Аккаунт: шапка и модалка ---------- */
.auth-slot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-chip {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font-size: 12.5px;
  font-weight: 800;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(43, 27, 61, 0.55);
  backdrop-filter: blur(3px);
}

.auth-overlay[hidden] {
  display: none;
}

.auth-box {
  position: relative;
  width: min(420px, 100%);
  padding: 24px 22px 22px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--shadow-hard);
}

.auth-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.auth-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tab {
  flex: 1;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--pink);
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 800;
}

.auth-field[hidden] {
  display: none;
}

.auth-field input {
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  background: var(--white);
}

.auth-field input:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 1px;
}

.auth-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}

.auth-forgot {
  align-self: flex-start;
  margin-top: -2px;
  font-size: 12px;
  color: var(--purple);
  text-decoration: none;
}

.auth-forgot:hover {
  text-decoration: underline;
}

.auth-error {
  margin: 0;
  padding: 8px 10px;
  border: 2px solid var(--pink-deep);
  border-radius: 10px;
  background: #ffe8f0;
  font-size: 12.5px;
  font-weight: 700;
  color: #a3184d;
}

.auth-submit {
  margin-top: 4px;
}

/* ---------- Подтверждение почты ---------- */
.btn-verify {
  background: var(--yellow);
  white-space: nowrap;
}

/* на телефоне длинная подпись не влезает в шапку */
.verify-short {
  display: none;
}

.auth-mail {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 2px dashed var(--ink);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  word-break: break-all;
}

.auth-note {
  margin: 0;
  padding: 8px 10px;
  border: 2px solid #2f9e5c;
  border-radius: 10px;
  background: #e8f8ee;
  font-size: 12.5px;
  font-weight: 700;
  color: #1c6b3c;
}

.auth-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.auth-actions .auth-submit {
  margin-top: 0;
  flex: 1;
}

/* ---------- Страница подтверждения почты ---------- */
.verify-page {
  position: relative;
  z-index: 1;
  min-height: 60vh;
  display: grid;
  place-items: center;
  padding: 40px 18px 64px;
}

.verify-card {
  width: min(520px, 100%);
  padding: 28px 26px 26px;
  text-align: center;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow-hard);
}

.verify-icon {
  margin: 0 0 6px;
  font-size: 42px;
  line-height: 1;
}

.verify-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 1.7rem);
}

.verify-text {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
  word-break: break-word;
}

.verify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.verify-actions[hidden] {
  display: none;
}

/* ---------- Цены ---------- */
.pricing {
  scroll-margin-top: 92px;
}

.pricing-lead {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
}

.pricing-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.price-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 20px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 5px 5px 0 var(--ink);
}

.price-card--featured {
  background: linear-gradient(160deg, #fff0f7, #f3ecff);
}

.price-name {
  margin: 0;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pink-deep);
}

.price-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.15;
}

.price-period {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
}

.price-next {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.price-note {
  margin: 6px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.price-buy {
  margin-top: 14px;
  width: 100%;
  justify-content: center;
}

.price-action {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.price-action--active {
  color: #15803d;
}

/* Согласие с офертой: без галочки оплата не стартует. */
.pricing-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  cursor: pointer;
}

.pricing-consent[hidden] {
  display: none;
}

.pricing-consent input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--pink-deep);
  cursor: pointer;
}

.pricing-consent a {
  color: var(--pink-deep);
  font-weight: 700;
}

.pricing-fineprint {
  margin: 16px 0 0;
  max-width: 62ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Платный модуль ---------- */
.module-card.is-locked .module-head {
  background: linear-gradient(120deg, #f7f2ff, #fff6ec);
}

.module-live--locked {
  background: #fff3d6;
  border-color: #f59e0b;
  color: #92400e;
}

/* ---------- Paywall в уроке ---------- */
.paywall {
  max-width: 720px;
  padding: 26px 24px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow-hard);
}

.paywall-kicker {
  margin: 0 0 6px;
  font-size: 11.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pink-deep);
}

.paywall-title {
  margin: 0 0 10px;
  font-size: clamp(1.3rem, 3.4vw, 1.8rem);
  line-height: 1.2;
}

.paywall-text {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.paywall-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.paywall-plan {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: #fffaf3;
  border: 3px solid var(--ink);
  border-radius: 18px;
}

.paywall-plan-name {
  font-size: 11.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pink-deep);
}

.paywall-plan-price {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.paywall-plan-period {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.paywall-next {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

.paywall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Кнопка оплаты внутри карточки тарифа в paywall. */
.paywall-buy {
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}

/* Согласие с офертой на paywall: без галочки оплата не стартует. */
.paywall-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  cursor: pointer;
}

.paywall-consent input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--pink-deep);
  cursor: pointer;
}

.paywall-consent a {
  color: var(--pink-deep);
  font-weight: 700;
}

/* Уведомление об оплате на странице модуля, где нет #toast. */
.pay-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 60;
  max-width: min(92vw, 460px);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: #fff;
  background: var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.pay-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.paywall-note {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Форма восстановления пароля ---------- */
.reset-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  text-align: left;
}

.reset-label {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.reset-input {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  outline: none;
}

.reset-input:focus {
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25);
}

.reset-error {
  margin: 2px 0 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #c0255a;
}

.reset-submit {
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}

.reset-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

