/* MathRoutes — стили сайта
   Светлая тема: кремовая бумага и цветные карандаши.
   Тёмная тема: школьная доска и мел (по prefers-color-scheme). */

/* ---------- Токены ---------- */
:root {
  --paper: #FBF6EC;
  --paper-2: #F3EBDA;
  --card: #FFFDF8;
  --ink: #26242E;
  --muted: #55505F;
  --line: #E2D7C2;
  --grid: rgba(42, 95, 158, .07);

  --red: #B5401F;      /* текст на бумаге: 5.6:1 */
  --blue: #2A5F9E;     /* 6.2:1 */
  --green: #2E7449;    /* 5.5:1 */
  --yellow: #E8A93A;   /* только декор */
  --tape: rgba(232, 169, 58, .45);

  --btn-bg: var(--red);
  --btn-fg: #FFFFFF;
  --dark-bg: #26242E;
  --dark-fg: #FBF6EC;

  --font-head: "Montserrat Alternates", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Comic Sans MS", cursive;

  --radius: 14px;
  --shadow: 0 1px 0 rgba(38, 36, 46, .06), 0 10px 24px -14px rgba(38, 36, 46, .35);
  --gutter: 1rem;
  --maxw: 1140px;
  color-scheme: light;
}

/* Русские заголовки: обычный Montserrat (в Alternates «т» и «д» выглядят как «m» и «g»).
   В нём только кириллица, поэтому латиница (MathRoutes) берётся из Alternates. */
html:lang(ru) { --font-head: "Montserrat", "Montserrat Alternates", "Trebuchet MS", system-ui, sans-serif; }

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1E2925;
    --paper-2: #24312C;
    --card: #2A3833;
    --ink: #F2EEE3;
    --muted: #C9C4B6;
    --line: #3C4C46;
    --grid: rgba(242, 238, 227, .05);
    --red: #F2936D;
    --blue: #93BBEB;
    --green: #93D3A8;
    --yellow: #F2C46B;
    --tape: rgba(242, 196, 107, .3);
    --btn-bg: #F2936D;
    --btn-fg: #1E2925;
    --dark-bg: #15201C;
    --dark-fg: #F2EEE3;
    --shadow: 0 10px 24px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;          /* 18px */
  line-height: 1.65;
  overflow-x: hidden;
  overflow-wrap: break-word;
}
img, video, svg { max-width: 100%; display: block; }
img, video { height: auto; }
a { color: var(--blue); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.18;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
  hyphens: auto;
}
h1 { font-size: clamp(2rem, 6.4vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 4.6vw, 2.6rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .7rem 1rem; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 640px) { :root { --gutter: 1.5rem; } }

/* ---------- Мелочи типографики ---------- */
.kicker {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--red);
  margin: 0 0 .3rem;
}
.lead { font-size: 1.2rem; color: var(--ink); }
.narrow { max-width: 44rem; }
.emph { font-weight: 800; }
.hand-note {
  font-family: var(--font-hand);
  font-size: 1.45rem;
  line-height: 1.15;
  color: var(--ink);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .7rem 1.4rem;
  border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 2px solid var(--btn-bg);
  font-family: var(--font-body); font-weight: 800; font-size: 1.05rem;
  text-decoration: none; text-align: center; line-height: 1.2;
  box-shadow: 0 3px 0 rgba(38, 36, 46, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 rgba(38, 36, 46, .25); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(38, 36, 46, .25); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); box-shadow: none; }
.btn-ghost:hover { box-shadow: none; background: var(--paper-2); }
.btn-small { min-height: 44px; padding: .45rem 1rem; font-size: .95rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px dashed var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: .75rem;
  min-height: 4.25rem; position: relative;
}
.logo {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--ink); text-decoration: none; min-height: 44px;
}
.logo-mark { width: 36px; height: 36px; flex: none; }
.logo-word { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; letter-spacing: -.02em; }
.logo-word span { color: var(--red); }

.main-nav { display: none; margin-left: auto; }
.main-nav ul, .mobile-nav ul, .lang-switch ul { list-style: none; margin: 0; padding: 0; }
.main-nav ul { display: flex; gap: .1rem; }
.main-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .6rem;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem; border-radius: 8px;
}
.main-nav a:hover { background: var(--paper-2); }

.header-tools { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.header-cta { display: none; }

.lang-switch ul { display: flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.lang-switch a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 40px; padding: 0 .5rem;
  font-weight: 800; font-size: .85rem; color: var(--ink); text-decoration: none;
}
.lang-switch li + li a { border-left: 2px solid var(--ink); }
.lang-switch a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.lang-switch a:not([aria-current]):hover { background: var(--paper-2); }

/* мобильное меню на <details> */
.mobile-nav summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 44px; padding: 0 .8rem;
  border-radius: 999px; border: 2px solid var(--ink); font-weight: 800; font-size: .9rem;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary::before {
  content: ""; width: 16px; height: 10px;
  border-top: 2px solid currentColor; border-bottom: 2px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}
.mobile-nav[open] summary { background: var(--ink); color: var(--paper); }
.mobile-nav nav {
  position: absolute; left: var(--gutter); right: var(--gutter); top: calc(100% + .25rem);
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .5rem;
}
.mobile-nav a {
  display: flex; align-items: center; min-height: 48px; padding: 0 .8rem;
  color: var(--ink); text-decoration: none; font-weight: 700; border-radius: 8px;
}
.mobile-nav a:hover { background: var(--paper-2); }

/* Узкие экраны: кнопка меню — только иконка (текст остаётся для скринридеров),
   на самых узких прячем словесный знак, оставляя значок логотипа с aria-label */
@media (max-width: 559px) {
  .mobile-nav summary { padding: 0; width: 44px; justify-content: center; }
  .mobile-nav summary .menu-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .header-inner { gap: .5rem; }
  .lang-switch a { min-width: 40px; }
}
@media (max-width: 379px) {
  .site-header .logo-word { display: none; }
}
@media (min-width: 1120px) {
  .main-nav { display: block; }
  .header-tools { margin-left: .5rem; }
  .mobile-nav { display: none; }
}
@media (min-width: 1320px) { .header-cta { display: inline-flex; } }

/* ---------- Фото: бумажная рамка, скотч, лёгкий наклон ---------- */
.photo {
  margin: 0; position: relative;
  background: var(--card);
  padding: .55rem .55rem .6rem;
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.photo img { border-radius: 3px; width: 100%; }
.photo figcaption { padding: .5rem .25rem 0; }
.taped::before {
  content: ""; position: absolute; z-index: 2;
  top: -12px; left: 50%; width: 96px; height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--tape);
  border-left: 2px dotted rgba(0, 0, 0, .06); border-right: 2px dotted rgba(0, 0, 0, .06);
}
@media (min-width: 720px) {
  .tilt-l { transform: rotate(-1.6deg); }
  .tilt-r { transform: rotate(1.4deg); }
}

/* ---------- Секции ---------- */
.section { padding: 4.5rem 0; position: relative; }
@media (min-width: 900px) { .section { padding: 6.5rem 0; } }
.section-tint { background: var(--paper-2); }
.section-grid-paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}

.split { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1.15fr .85fr; gap: 4rem; }
  .split-wide { grid-template-columns: 1.2fr .8fr; align-items: start; }
  .split-photos-left { grid-template-columns: .9fr 1.1fr; }
}

.note-card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem .4rem;
  margin-top: 1.5rem;
  box-shadow: 5px 5px 0 var(--yellow);
}
.note-card h3 { color: var(--red); }
.note-blue { box-shadow: 5px 5px 0 var(--blue); }
.note-blue h3 { color: var(--blue); }

/* ---------- Hero ---------- */
.hero { padding: 3rem 0 0; position: relative; overflow: hidden; }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero-text .kicker { font-size: 1.5rem; }
.hero .lead { max-width: 36rem; }
.hero-photo { max-width: 560px; justify-self: center; transform: rotate(1.2deg); }
.hero-photo figcaption { text-align: right; }
@media (min-width: 960px) {
  .hero { padding-top: 4.5rem; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 3.5rem; }
}
.hero-routes { width: 100%; height: 90px; margin-top: 2rem; overflow: visible; }
.route { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 8 10; }
.route-1 { stroke: var(--blue); }
.route-2 { stroke: var(--red); }
.route-3 { stroke: var(--green); }
.route-peak { fill: var(--yellow); stroke: var(--ink); stroke-width: 2.5; }

/* Мягкая «прорисовка» маршрутов при загрузке (отключается при reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .route { animation: route-walk 2.4s ease-out both; }
  .route-2 { animation-delay: .25s; }
  .route-3 { animation-delay: .5s; }
  @keyframes route-walk { from { stroke-dashoffset: 240; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }
}

/* ---------- Проблема ---------- */
.prose p { max-width: 38rem; }
.problem-side { display: grid; gap: 2rem; max-width: 420px; }
.try-box {
  background: var(--card);
  border: 2px dashed var(--blue);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem .3rem;
}
.try-box h3 { color: var(--blue); font-family: var(--font-hand); font-size: 1.7rem; font-weight: 600; }
.try-after { font-weight: 800; }
.hurricane { margin-top: 3rem; text-align: center; }
.hurricane-svg { width: 100%; max-width: 820px; height: auto; margin: 0 auto; }
.hurricane-q {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.3rem, 3.4vw, 1.9rem); line-height: 1.3;
  max-width: 40rem; margin: 1rem auto 0;
}

/* ---------- Поворот (цитата) ---------- */
.turn { background: var(--dark-bg); color: var(--dark-fg); padding: 4rem 0; }
.big-quote { margin: 0; text-align: center; }
.big-quote p {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.6rem, 4.8vw, 3rem); line-height: 1.22;
  max-width: 54rem; margin: 0 auto;
}
.big-quote p::before, .big-quote p::after { color: var(--yellow); }

/* ---------- Карточки-двери ---------- */
.doors {
  list-style: none; margin: 2.5rem 0 0; padding: 0;
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}
.door {
  position: relative;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 90px 90px var(--radius) var(--radius);
  padding: 2rem 1.2rem 1.2rem;
  text-align: center;
  box-shadow: var(--shadow);
}
/* дверная ручка */
.door::after {
  content: ""; position: absolute; right: 16px; top: 55%;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--yellow); border: 2px solid var(--ink);
}
.door h3 { margin-top: .75rem; }
.door p { font-size: 1rem; color: var(--muted); margin: 0; }
.door-icon { width: 64px; height: 64px; margin: 0 auto; }
.door-1 { border-top-color: var(--red); }
.door-2 { border-top-color: var(--blue); }
.door-3 { border-top-color: var(--yellow); }
.door-4 { border-top-color: var(--green); }
.door-5 { border-top-color: var(--red); }
@media (min-width: 720px) {
  .door:nth-child(odd) { transform: rotate(-.8deg); }
  .door:nth-child(even) { transform: rotate(.8deg) translateY(10px); }
}

.photo-collage {
  display: grid; gap: 1.25rem; margin-top: 3.5rem;
  grid-template-columns: 1fr 1fr;
}
.photo-collage .c-1, .photo-collage .c-4 { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .photo-collage { grid-template-columns: 1.3fr .8fr .8fr 1.3fr; align-items: center; }
  .photo-collage .c-1, .photo-collage .c-4 { grid-column: auto; }
  .photo-collage .c-1 { transform: rotate(-1.4deg); }
  .photo-collage .c-2 { transform: rotate(1.2deg) translateY(-14px); }
  .photo-collage .c-3 { transform: rotate(-1deg) translateY(18px); }
  .photo-collage .c-4 { transform: rotate(1.4deg); }
}

.principles { display: grid; gap: 1.5rem; margin-top: 3.5rem; }
@media (min-width: 760px) { .principles { grid-template-columns: 1fr 1fr; gap: 2.5rem; } }
.principle {
  display: grid; grid-template-columns: 64px 1fr; column-gap: 1.1rem; align-items: start;
  border-top: 2px dashed var(--line); padding-top: 1.5rem;
}
.principle-icon { width: 64px; height: 64px; grid-row: span 2; }
.principle p { color: var(--muted); }

/* ---------- Программа ---------- */
.stats {
  list-style: none; margin: 2.5rem 0 3.5rem; padding: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.stats li {
  background: var(--card); border-radius: var(--radius);
  border: 2px solid var(--ink); padding: 1.2rem 1.35rem;
  display: flex; flex-direction: column;
}
.stat-num {
  font-family: var(--font-head); font-weight: 700;
  font-size: 3rem; line-height: 1; color: var(--red);
}
.stat-word { font-size: 2.2rem; color: var(--blue); }
.stats li:last-child .stat-num { color: var(--green); }
.stat-label { font-weight: 800; font-size: 1.15rem; margin-top: .35rem; }
.stat-sub { color: var(--muted); font-size: .98rem; margin-top: .4rem; }

.h3-lg { font-size: clamp(1.35rem, 3vw, 1.75rem); }

/* Ступеньки встречи */
.steps {
  list-style: none; margin: 2rem 0 0; padding: 0 0 0 1.75rem;
  display: grid; gap: 2rem;
  position: relative;
}
/* пунктирная тропинка слева (мобильные) */
.steps::before {
  content: ""; position: absolute; left: .55rem; top: .5rem; bottom: .5rem;
  border-left: 3px dashed var(--blue);
}
.step { position: relative; }
.step-n {
  position: absolute; left: -1.75rem; top: 0;
  width: 2.1rem; height: 2.1rem; margin-left: -.5rem;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--ink); color: var(--paper);
  font-family: var(--font-head); font-weight: 700; font-size: 1rem;
}
.step-photo { max-width: 260px; margin-bottom: .9rem; }
.step-photo img { aspect-ratio: 4 / 3; object-fit: cover; }
.step-illu {
  background: var(--card); border-radius: 6px; box-shadow: var(--shadow);
  aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 1rem;
}
.step-illu svg { width: 70%; }
.step h4 { margin-bottom: .3rem; }
.step p { color: var(--muted); font-size: 1rem; margin: 0; }

@media (min-width: 960px) {
  .steps {
    grid-template-columns: repeat(5, 1fr); gap: 1.25rem;
    padding: 0; align-items: end;
  }
  .steps::before { display: none; }
  /* лестница: каждый следующий шаг выше */
  .step:nth-child(1) { margin-top: 8rem; }
  .step:nth-child(2) { margin-top: 6rem; }
  .step:nth-child(3) { margin-top: 4rem; }
  .step:nth-child(4) { margin-top: 2rem; }
  .step { border-bottom: 4px solid var(--ink); padding-bottom: 1rem; align-self: start; }
  .step-n { position: static; margin: 0 0 .5rem; }
  .step-photo { max-width: none; }
}

.choice { display: grid; gap: 2.5rem; margin-top: 4.5rem; align-items: center; }
@media (min-width: 900px) { .choice { grid-template-columns: .75fr 1.25fr; gap: 4rem; } }
.choice-photo { max-width: 380px; }
.chain {
  list-style: none; margin: 1.25rem 0 1.5rem; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
}
.chain li {
  position: relative;
  font-weight: 800; padding: .45rem 1rem; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--card);
}
.chain li + li { margin-left: 1.5rem; }
/* стрелка между «бусинами» цепочки */
.chain li + li::before {
  content: "→"; position: absolute; left: -1.6rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 800;
}
.chain li:nth-child(1) { color: var(--red); }
.chain li:nth-child(2) { color: var(--blue); }
.chain li:nth-child(3) { color: var(--green); }
.chain li:nth-child(4) { background: var(--ink); color: var(--paper); }

/* ---------- Менторы ---------- */
.mentor-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.mentor-photos .m-2 { margin-top: 3rem; }

/* ---------- Видео ---------- */
.videos {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(2, 1fr);
}
.videos .wide { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .videos { grid-template-columns: repeat(5, 1fr); align-items: start; }
  .videos .wide { grid-column: span 2; }
}
.videos figure { margin: 0; }
.videos video {
  width: 100%; border-radius: 10px; background: #111;
  box-shadow: var(--shadow);
}
.videos figcaption { font-size: .95rem; color: var(--muted); margin-top: .5rem; line-height: 1.4; }

/* ---------- Дорожная карта ---------- */
.roadmap {
  list-style: none; margin: 2.5rem 0 0; padding: 0 0 0 2.5rem;
  display: grid; gap: 2rem; position: relative;
}
.roadmap::before {
  content: ""; position: absolute; left: .95rem; top: 1rem; bottom: 1rem;
  border-left: 3px dashed var(--muted);
}
.rm { position: relative; }
.rm-dot {
  position: absolute; left: -2.5rem; top: 0;
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 3px solid var(--muted); background: var(--paper);
  display: grid; place-items: center;
}
.rm.done .rm-dot { background: var(--green); border-color: var(--green); color: #fff; }
.rm.next .rm-dot { border-color: var(--red); border-style: dashed; }
.rm-status {
  display: inline-block; font-size: .85rem; font-weight: 800;
  padding: .1rem .6rem; border-radius: 999px;
  border: 2px solid var(--muted); color: var(--muted); margin-bottom: .5rem;
}
.rm.done .rm-status { border-color: var(--green); color: var(--green); }
.rm.next .rm-status { border-color: var(--red); color: var(--red); }
.rm h3 { margin-bottom: .3rem; }
.rm p { color: var(--muted); margin: 0; }
.rm:not(.done) h3 { color: var(--muted); }

@media (min-width: 960px) {
  .roadmap { grid-template-columns: repeat(4, 1fr); padding: 3rem 0 0; gap: 1.75rem; }
  .roadmap::before { left: 1rem; right: 1rem; top: 1rem; bottom: auto; border-left: 0; border-top: 3px dashed var(--muted); }
  .rm-dot { left: 0; top: -3rem; }
}

/* ---------- Почему это важно (тёмный блок) ---------- */
.section-dark { background: var(--dark-bg); color: var(--dark-fg); }
.section-dark .kicker { color: var(--yellow); }
.section-dark .prose p { color: color-mix(in srgb, var(--dark-fg) 88%, transparent); }
.section-dark h2 { color: var(--dark-fg); }
.why-end {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.3rem, 3vw, 1.7rem); line-height: 1.3;
  color: var(--dark-fg) !important; margin-top: 1.5rem;
  border-left: 5px solid var(--yellow); padding-left: 1rem;
}
.section-dark .photo { background: #FFFDF8; max-width: 380px; justify-self: center; }

/* ---------- Присоединиться ---------- */
.audience {
  list-style: none; margin: 2.5rem 0 0; padding: 0;
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.aud {
  background: var(--card); border-radius: var(--radius);
  padding: 1.4rem 1.35rem .5rem;
  border: 2px solid var(--ink);
  border-top-width: 8px;
}
.aud-1 { border-top-color: var(--red); }
.aud-2 { border-top-color: var(--blue); }
.aud-3 { border-top-color: var(--green); }
.aud-4 { border-top-color: var(--yellow); }
.aud p { color: var(--muted); font-size: 1rem; }
.soon {
  margin-top: 2rem; font-family: var(--font-hand); font-size: 1.6rem; color: var(--blue);
}

/* ---------- FAQ ---------- */
.faq { margin: 2rem 0 0; display: grid; gap: 1rem; max-width: 52rem; }
.faq > div {
  background: var(--card); border-radius: var(--radius);
  border: 2px solid var(--line); padding: 1.15rem 1.35rem;
}
.faq dt { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; margin-bottom: .4rem; }
.faq dd { margin: 0; color: var(--muted); }

/* ---------- Финал ---------- */
.finale { padding: 5rem 0 4.5rem; text-align: center; }
.summit { width: 100%; max-width: 560px; margin: 0 auto 2rem; }
.finale-text { max-width: 42rem; margin: 0 auto 1.75rem; color: var(--muted); }
.finale-quote {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.4rem); line-height: 1.25;
  max-width: 50rem; margin: 0 auto;
}

/* ---------- Футер ---------- */
.site-footer { border-top: 2px dashed var(--line); padding: 2.5rem 0 1.5rem; background: var(--paper-2); }
.footer-grid { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1fr 1.6fr auto; gap: 3rem; } }
.footer-tag { color: var(--muted); font-size: 1rem; margin-top: .5rem; }
.disclaimer { font-size: .95rem; color: var(--muted); max-width: 40rem; }
.footer-bottom { margin-top: 1.5rem; font-size: .9rem; color: var(--muted); }
.footer-bottom p { margin: 0; }

/* ---------- 404 ---------- */
.nf-main { padding-top: 3rem; padding-bottom: 4rem; max-width: 46rem; }
.nf-block { border-top: 2px dashed var(--line); padding: 2rem 0 1rem; }
.nf-block:first-of-type { margin-top: 2rem; }
.nf-block h1, .nf-block h2 { font-size: clamp(1.6rem, 5vw, 2.3rem); }

/* ---------- Фоновые математические «каракули» ---------- */
.doodles {
  position: absolute; inset: 0; width: 100%; height: 100%;
  color: var(--blue); opacity: .1; pointer-events: none;
}
.section > .wrap { position: relative; }

/* ---------- Методика ---------- */
.principles-grid {
  list-style: none; margin: 2.5rem 0 0; padding: 0;
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  counter-reset: pr;
}
.pr {
  position: relative; counter-increment: pr;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 1.4rem 1.35rem .6rem;
  box-shadow: 6px 6px 0 var(--accent, var(--yellow));
}
.pr::after {
  content: counter(pr, decimal-leading-zero);
  position: absolute; top: .9rem; right: 1.1rem;
  font-family: var(--font-hand); font-size: 1.8rem; line-height: 1; color: var(--muted);
}
.pr-red { --accent: var(--red); }
.pr-blue { --accent: var(--blue); }
.pr-yellow { --accent: var(--yellow); }
.pr-green { --accent: var(--green); }
.pr-icon { width: 56px; height: 56px; margin-bottom: .6rem; }
.pr p { font-size: 1rem; }
.pr > p:not(.pr-note) { color: var(--muted); }
.pr-note { border-top: 2px dashed var(--line); padding-top: .7rem; font-size: .95rem !important; }
.pr-note span { font-weight: 800; color: var(--accent); }

.method-duo { display: grid; gap: 2.5rem; margin-top: 4rem; }
@media (min-width: 900px) { .method-duo { grid-template-columns: 1.15fr .85fr; gap: 3.5rem; align-items: start; } }

/* столбики «помощь отступает» */
.release-bars {
  list-style: none; margin: 1.5rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: end;
}
.release-bars li { display: flex; flex-direction: column; gap: .35rem; font-size: .95rem; }
.release-bars strong { font-family: var(--font-head); font-size: 1rem; line-height: 1.25; }
.release-bars li > span:not(.bar) { color: var(--muted); line-height: 1.4; }
.bar {
  display: block; width: 100%; border-radius: 10px 10px 0 0;
  border: 2px solid var(--ink); border-bottom-width: 4px;
  background: repeating-linear-gradient(-45deg, var(--blue) 0 6px, color-mix(in srgb, var(--blue) 70%, var(--card)) 6px 12px);
  margin-bottom: .4rem;
}
.bar-1 { height: 150px; }
.bar-2 { height: 90px; }
.bar-3 { height: 28px; background: var(--green); }
.release-axis {
  margin-top: .75rem; padding-top: .5rem; border-top: 2px solid var(--ink);
  font-family: var(--font-hand); font-size: 1.3rem; color: var(--muted);
}
.release-axis::after { content: " →"; }

/* блокнот ментора */
.notebook-page {
  position: relative; margin-top: 1.25rem;
  background:
    linear-gradient(90deg, transparent 2.6rem, color-mix(in srgb, var(--red) 45%, transparent) 2.6rem 2.75rem, transparent 2.75rem),
    repeating-linear-gradient(var(--card) 0 2.35rem, var(--line) 2.35rem 2.45rem);
  border: 2px solid var(--ink); border-radius: 6px 14px 14px 6px;
  padding: 1rem 1.2rem 1rem 3.4rem;
  box-shadow: var(--shadow);
  transform: rotate(-1deg);
}
.notebook-page ul { list-style: none; margin: 0; padding: 0; }
.notebook-page li {
  font-family: var(--font-hand); font-size: 1.75rem; line-height: 2.45rem; color: var(--blue);
}
.notebook-page li::before { content: "☐ "; color: var(--ink); }
.notebook-key { font-family: var(--font-hand); font-size: 1.6rem; line-height: 2.45rem; color: var(--red); margin: 0; }

/* таблица «обычно / в MathRoutes» */
.vs-title { margin-top: 4.5rem; }
.vs {
  width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 1rem;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden;
}
.vs th, .vs td { text-align: left; padding: .9rem 1.2rem; vertical-align: top; }
.vs th { font-family: var(--font-head); font-size: 1rem; background: var(--paper-2); }
.vs th:last-child { color: var(--green); }
.vs td:first-child { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 60%, transparent); }
.vs td:last-child { font-weight: 800; }
.vs tbody tr + tr td { border-top: 1px dashed var(--line); }
.vs td:first-child, .vs th:first-child { border-right: 2px solid var(--line); }
@media (max-width: 639px) {
  .vs thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .vs, .vs tbody, .vs tr, .vs td { display: block; }
  .vs td { border-right: 0 !important; padding: .6rem 1rem; }
  .vs td::before {
    content: attr(data-label); display: block;
    font-size: .8rem; font-weight: 800; text-decoration: none; color: var(--muted);
  }
  .vs td:first-child { text-decoration: none; }
  .vs td:first-child > * , .vs td:first-child { text-decoration-line: none; }
  .vs tbody tr + tr td:first-child { border-top: 2px solid var(--ink); }
  .vs tbody tr + tr td:last-child { border-top: 0; }
}

/* петля обратной связи */
.loop { display: grid; gap: 2rem; margin-top: 4.5rem; align-items: center; }
@media (min-width: 900px) { .loop { grid-template-columns: 1fr 1fr; gap: 3.5rem; } }
.loop-ring {
  list-style: none; margin: 0 auto; padding: 0;
  position: relative; width: min(calc(100% - 5rem), 340px); aspect-ratio: 1;
  border: 3px dashed var(--blue); border-radius: 50%;
}
.lr {
  position: absolute; transform: translate(-50%, -50%);
  background: var(--card); border: 2px solid var(--ink); border-radius: 999px;
  padding: .4rem .9rem; font-weight: 800; white-space: nowrap; font-size: .95rem;
}
.lr-1 { left: 50%; top: 0; color: var(--red); }
.lr-2 { left: 93%; top: 70%; color: var(--blue); }
.lr-3 { left: 7%; top: 70%; color: var(--green); }
.lr-center {
  left: 50%; top: 50%; background: var(--ink); color: var(--paper);
  font-family: var(--font-head); font-size: 1.15rem; padding: .7rem 1.2rem;
}

/* ---------- Анатомия карточки и материалы ---------- */
.anatomy { display: grid; gap: 2rem; margin-top: 4.5rem; align-items: center; }
@media (min-width: 800px) { .anatomy { grid-template-columns: 300px 1fr; gap: 3.5rem; } }
.anatomy-card { width: 100%; max-width: 300px; margin: 0 auto; transform: rotate(-2deg); }
.anatomy-card svg { width: 100%; height: auto; }
.anatomy-list { margin: 1rem 0 0; padding: 0; list-style: none; counter-reset: an; display: grid; gap: .9rem; }
.anatomy-list li { counter-increment: an; display: grid; grid-template-columns: 2.1rem 1fr; gap: .8rem; align-items: start; }
.anatomy-list li::before {
  content: counter(an);
  width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); font-weight: 800; font-size: .95rem;
}

.materials-title { margin-top: 4rem; }
.materials {
  list-style: none; margin: 1.25rem 0 0; padding: 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}
.materials li {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem;
  background: var(--card); border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 1.1rem .8rem; font-weight: 700; font-size: .98rem; line-height: 1.3;
}
.materials svg { width: 56px; height: 56px; }

/* ---------- Галерея ---------- */
.g-group { margin-top: 3.5rem; }
.g-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.5rem; }
.g-head h3 { font-size: clamp(1.3rem, 3vw, 1.6rem); margin-bottom: .2rem; }
.g-head p { color: var(--muted); margin: 0; }
.g-num {
  flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--yellow); color: #26242E; border: 2px solid var(--ink);
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem;
}
.g-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: 1fr 1fr; align-items: start; }
.g-grid .photo figcaption { font-size: 1.3rem; }
.g-grid .g-wide { grid-column: 1 / -1; }
.g-video video { width: 100%; border-radius: 3px; background: #111; }
@media (max-width: 539px) {
  .g-grid { grid-template-columns: 1fr; }
}
@media (min-width: 900px) {
  .g-grid-class { grid-template-columns: .8fr 1fr .8fr; }
  .g-grid-class li:nth-child(1) { transform: rotate(-1.2deg); }
  .g-grid-class li:nth-child(2) { transform: rotate(.8deg) translateY(2rem); }
  .g-grid-class li:nth-child(3) { transform: rotate(-.6deg) translateY(.5rem); }

  .g-grid-work { grid-template-columns: repeat(4, 1fr); }
  .g-grid-work .g-wide { grid-column: span 2; grid-row: span 2; }
  .g-grid-work li:nth-child(even) { transform: rotate(1deg); }
  .g-grid-work li:nth-child(odd):not(.g-wide) { transform: rotate(-1deg); }

  .g-grid-ball { grid-template-columns: 1.6fr 1fr 1fr; }
  .g-grid-ball .g-wide { grid-column: auto; transform: rotate(-.8deg); }
  .g-grid-ball li:nth-child(2) { transform: rotate(1.2deg) translateY(1.5rem); }
}

.see-all { margin-top: 3rem; text-align: center; }

/* ---------- Фотостена: «кирпичная» раскладка на CSS-колонках ---------- */
.photo-wall {
  list-style: none; margin: 2.5rem 0 0; padding: 0;
  columns: 2; column-gap: 1rem;
}
@media (min-width: 700px) { .photo-wall { columns: 3; column-gap: 1.25rem; } }
@media (min-width: 1100px) { .photo-wall { columns: 4; } }
.photo-wall li { break-inside: avoid; margin-bottom: 1rem; }
.photo-wall .photo { padding: .4rem; }
@media (min-width: 700px) {
  .photo-wall li { margin-bottom: 1.25rem; }
  .photo-wall li:nth-child(3n+1) .photo { transform: rotate(-1deg); }
  .photo-wall li:nth-child(3n+2) .photo { transform: rotate(.8deg); }
}

/* ---------- Без анимаций по запросу ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Печать ---------- */
@media print {
  .site-header, .skip-link, .btn-row, .videos, .hero-routes, .lang-switch, .mobile-nav { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .section, .turn, .section-dark { padding: 1.5rem 0; background: #fff !important; color: #000 !important; }
  .photo { box-shadow: none; transform: none !important; break-inside: avoid; }
  .taped::before { display: none; }
  a { color: #000; }
}
