/* ==========================================================================
   LingoSTEAM.uz — стили сайта
   Токены дизайна:
     Цвет:  белый / светло-синий фон, акценты — синий, голубой, фиолетовый
     Шрифт: Unbounded (заголовки) · Golos Text (текст) · JetBrains Mono (метки)
     Форма: мягкие скругления, тонкие линии, спокойная тень с синим оттенком
     Сигнатура: орбита STEAM вокруг кириллической буквы в hero-блоке
   ========================================================================== */

/* -------------------------- 1. Токены и сброс -------------------------- */
:root {
  --bg: #ffffff;
  --bg-soft: #f3f6fd;
  --bg-alt: #eaf0fd;
  --surface: #ffffff;
  --ink: #10142a;
  --ink-soft: #454b6c;
  --muted: #6b7290;
  --line: #e1e7f8;
  --line-strong: #cdd7f5;

  --primary: #2f5efb;
  --primary-dark: #1f45c9;
  --primary-ink: #ffffff;
  --sky: #1fb6d8;
  --violet: #8657f2;
  --primary-soft: #5b7fff;
  --violet-soft: #a476f7;

  /* Фирменные цвета по логотипу LingoSTEAM (5 направлений STEAM) */
  --steam-science: #1f9d55;
  --steam-tech: #0a63b5;
  --steam-eng: #f1740b;
  --steam-arts: #da3841;
  --steam-math: #61388d;
  --brand-teal: #0d8282;

  --success: #1f9d55;
  --danger: #e5484d;

  --shadow-sm: 0 1px 2px rgba(24, 39, 100, 0.06), 0 1px 1px rgba(24, 39, 100, 0.04);
  --shadow-md: 0 10px 30px rgba(30, 55, 140, 0.10);
  --shadow-lg: 0 20px 60px rgba(30, 55, 140, 0.16);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --font-display: 'Unbounded', 'Golos Text', sans-serif;
  --font-body: 'Golos Text', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --container: 1180px;
  --header-h: 76px;
  --ease: cubic-bezier(.22, .8, .3, 1);
}

[data-theme='dark'] {
  --bg: #0a0e1f;
  --bg-soft: #10142a;
  --bg-alt: #141a36;
  --surface: #121732;
  --ink: #edf0ff;
  --ink-soft: #c1c7ec;
  --muted: #8991c2;
  --line: #232a52;
  --line-strong: #2e3868;

  --primary: #6084ff;
  --primary-dark: #7d9bff;
  --primary-ink: #06091a;
  --sky: #35d0ee;
  --violet: #ac86ff;
  --primary-soft: #86a3ff;
  --violet-soft: #cbb1ff;

  --steam-science: #34c471;
  --steam-tech: #4f9eff;
  --steam-eng: #ff9736;
  --steam-arts: #ff5b64;
  --steam-math: #9b6fd1;
  --brand-teal: #2bd9d1;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.5);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s var(--ease), color .3s var(--ease);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon { width: 1.3em; height: 1.3em; flex-shrink: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section--soft { background: var(--bg-soft); }
.section--alt { background: var(--bg-alt); }
@media (max-width: 720px) { .section { padding: 64px 0; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent);
  padding: 6px 14px; border-radius: var(--radius-pill); margin-bottom: 18px;
}
[data-theme='dark'] .eyebrow { background: color-mix(in srgb, var(--primary) 18%, transparent); }

.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-title { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: 14px; }
.section-lead { color: var(--ink-soft); font-size: 1.05rem; }

/* -------------------------------- Кнопки -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: var(--radius-pill); font-weight: 600; font-size: .95rem;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 1.1em; height: 1.1em; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff; box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 9px 16px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* -------------------------------- Хедер ---------------------------------- */
.header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; text-decoration: none; white-space: nowrap; }
.brand__logo { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.brand__word { display: inline-flex; align-items: baseline; }
.brand__word .w-lingo { color: var(--ink); }
.brand__word .w-s { color: var(--brand-teal); }
.brand__word .w-t { color: var(--steam-tech); }
.brand__word .w-e { color: var(--steam-eng); }
.brand__word .w-a { color: var(--steam-arts); }
.brand__word .w-m { color: var(--steam-math); }
.brand__tld { color: var(--brand-teal); font-size: .78em; margin-left: 1px; }
.brand--footer { font-size: 1.3rem; }
.brand--footer .brand__logo { width: 42px; height: 42px; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav__links { display: flex; gap: 17px; }
.nav__links a { text-decoration: none; font-size: .93rem; font-weight: 500; color: var(--ink-soft); padding: 6px 2px; position: relative; white-space: nowrap; }
.nav__links a:hover { color: var(--primary); }
.nav__links a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px; background: var(--primary);
  transition: right .25s var(--ease);
}
.nav__links a:hover::after { right: 0; }

.header__actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg-soft); border: 1px solid var(--line); transition: all .2s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn .icon { width: 18px; height: 18px; }

.theme-toggle .icon--moon { display: none; }
[data-theme='dark'] .theme-toggle .icon--sun { display: none; }
[data-theme='dark'] .theme-toggle .icon--moon { display: block; }

.menu-toggle { display: none; }

.search-box { position: relative; }
.search-box input {
  width: 190px; padding: 9px 14px 9px 36px; border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: var(--bg-soft); font-size: .85rem; color: var(--ink); transition: width .25s var(--ease), border-color .2s;
}
.search-box input:focus { width: 230px; border-color: var(--primary); outline: none; }
.search-box .icon { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search-results {
  position: absolute; top: calc(100% + 10px); right: 0; width: 320px; max-height: 360px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: 8px; display: none; z-index: 60;
}
.search-results.is-open { display: block; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.search-results a:hover { background: var(--bg-soft); }
.search-results .sr-tag { font-family: var(--font-mono); font-size: .68rem; color: var(--primary); text-transform: uppercase; }
.search-results .sr-empty { padding: 16px 12px; color: var(--muted); font-size: .88rem; }

@media (max-width: 900px) {
  .nav__links, .search-box { display: none; }
  .menu-toggle { display: grid; }
}

/* ---------------------------- Мобильное меню ----------------------------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  transform: translateX(100%); transition: transform .35s var(--ease);
  display: flex; flex-direction: column; padding: 24px;
}
.mobile-menu.is-open { transform: translateX(0); }
.mobile-menu__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.mobile-menu a { display: block; padding: 16px 4px; font-family: var(--font-display); font-size: 1.3rem; text-decoration: none; border-bottom: 1px solid var(--line); }

/* --------------------------------- Hero ---------------------------------- */
.hero { padding: 64px 0 100px; overflow: hidden; position: relative; }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero__title { font-size: clamp(2.1rem, 4.6vw, 3.4rem); margin-bottom: 22px; }
.hero__title .accent { background: linear-gradient(100deg, var(--primary), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__subtitle { font-size: 1.12rem; color: var(--ink-soft); max-width: 46ch; margin-bottom: 32px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }
.hero__stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero__stat b { display: block; font-family: var(--font-display); font-size: 1.5rem; }
.hero__stat span { font-size: .82rem; color: var(--muted); }

/* Сигнатурная орбита STEAM */
.orbit { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1; margin-inline: auto; }
.orbit__ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px dashed var(--line-strong); }
.orbit__ring--in { inset: 15%; }
.orbit__core {
  position: absolute; inset: 34%; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  display: grid; place-items: center; color: #fff; font-family: var(--font-display);
  font-size: 2.6rem; box-shadow: var(--shadow-lg);
}
.orbit__spin { position: absolute; inset: 0; animation: spin 26s linear infinite; }
@media (prefers-reduced-motion: reduce) { .orbit__spin { animation: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.orbit__node {
  position: absolute; width: 58px; height: 58px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-md); display: grid; place-items: center;
  transform: translate(-50%, -50%); animation: counterspin 26s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .orbit__node { animation: none; } }
@keyframes counterspin { to { transform: translate(-50%, -50%) rotate(-360deg); } }
.orbit__node .icon { width: 24px; height: 24px; }
.orbit__node--0 { color: var(--steam-science); }
.orbit__node--1 { color: var(--steam-tech); }
.orbit__node--2 { color: var(--steam-eng); }
.orbit__node--3 { color: var(--steam-arts); }
.orbit__node--4 { color: var(--steam-math); }

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .orbit { max-width: 300px; margin-top: 20px; }
}

/* -------------------------------- О проекте ------------------------------- */
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about__block { margin-bottom: 26px; }
.about__block h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--primary); }
.about__block p { color: var(--ink-soft); }
.benefit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.benefit-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.benefit-card h4 { font-size: .95rem; margin-bottom: 6px; }
.benefit-card p { font-size: .88rem; color: var(--muted); }
@media (max-width: 900px) { .about__grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .benefit-grid { grid-template-columns: 1fr; } }

/* -------------------------------- STEAM-карты ------------------------------ */
.steam-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.steam-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.steam-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.steam-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--accent, var(--primary)); }
.steam-card__letter {
  font-family: var(--font-display); font-size: 1.6rem; color: var(--accent, var(--primary));
  border: 1.5px solid var(--line-strong); width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 16px;
}
.steam-card__icon { color: var(--accent, var(--primary)); margin-bottom: 10px; }
.steam-card__icon .icon { width: 26px; height: 26px; }
.steam-card h3 { font-size: 1.05rem; }
.steam-card .subtitle { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; color: var(--muted); margin: 4px 0 14px; text-transform: uppercase; }
.steam-card ul { display: flex; flex-direction: column; gap: 8px; }
.steam-card li { font-size: .86rem; color: var(--ink-soft); display: flex; gap: 8px; align-items: flex-start; }
.steam-card li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent, var(--primary)); margin-top: 7px; flex-shrink: 0; }
.steam-card__cta { margin-top: 16px; width: 100%; text-align: center; background: var(--accent, var(--primary)); border-color: transparent; }
.steam-card__cta:hover { filter: brightness(1.08); }

@media (max-width: 1080px) { .steam-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .steam-grid { grid-template-columns: 1fr; } }

/* ------------------------------ Интерактив -------------------------------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 36px; }
.tab-btn {
  padding: 11px 18px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface);
  font-size: .88rem; font-weight: 600; color: var(--ink-soft); display: flex; align-items: center; gap: 8px;
  transition: all .2s;
}
.tab-btn .icon { width: 16px; height: 16px; }
.tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.tab-btn.is-active { background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff; border-color: transparent; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fadeUp .4s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: translateY(0);} }

.panel-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px; box-shadow: var(--shadow-sm);
}

/* Карточки слов */
.flash-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.flashcard { width: 100%; max-width: 420px; height: 230px; perspective: 1200px; }
.flashcard__inner {
  position: relative; width: 100%; height: 100%; transition: transform .55s var(--ease); transform-style: preserve-3d; cursor: pointer;
}
.flashcard.is-flipped .flashcard__inner { transform: rotateY(180deg); }
.flashcard__face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px;
  border: 1px solid var(--line); box-shadow: var(--shadow-md);
}
.flashcard__face--front { background: linear-gradient(135deg, var(--bg-soft), var(--bg-alt)); }
.flashcard__face--back { background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff; transform: rotateY(180deg); }
.flashcard__word { font-family: var(--font-display); font-size: 1.7rem; margin-bottom: 8px; }
.flashcard__hint { font-size: .8rem; color: var(--muted); }
.flashcard__face--back .flashcard__hint { color: rgba(255,255,255,.8); }
.flash-controls { display: flex; align-items: center; gap: 18px; }
.flash-count { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }

/* Викторина / тесты */
.quiz__progress { height: 6px; background: var(--bg-soft); border-radius: var(--radius-pill); overflow: hidden; margin-bottom: 24px; }
.quiz__bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--violet)); transition: width .4s var(--ease); }
.quiz__q { font-size: 1.2rem; margin-bottom: 22px; }
.quiz__options { display: grid; gap: 12px; margin-bottom: 20px; }
.quiz__opt {
  text-align: left; padding: 14px 18px; border-radius: var(--radius-md); border: 1.5px solid var(--line);
  background: var(--bg-soft); font-size: .95rem; transition: all .2s;
}
.quiz__opt:hover { border-color: var(--primary); }
.quiz__opt.is-correct { border-color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--bg-soft)); }
.quiz__opt.is-wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--bg-soft)); }
.quiz__opt[disabled] { cursor: default; }
.quiz__explain { font-size: .88rem; color: var(--ink-soft); background: var(--bg-alt); padding: 14px 16px; border-radius: var(--radius-md); margin-bottom: 18px; display: none; }
.quiz__explain.is-visible { display: block; }
.quiz__footer { display: flex; justify-content: space-between; align-items: center; }
.quiz__score { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }
.quiz__result { text-align: center; padding: 20px 0; }
.quiz__result .icon { width: 52px; height: 52px; color: var(--primary); margin: 0 auto 16px; }

/* Игра «Найди пару» */
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.memory-card {
  aspect-ratio: 1; border-radius: var(--radius-md); background: var(--bg-soft); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: .85rem; text-align: center; padding: 8px; cursor: pointer;
  transition: transform .25s, background .25s, border-color .25s; font-weight: 600;
}
.memory-card.is-flipped { background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff; }
.memory-card.is-matched { background: color-mix(in srgb, var(--success) 16%, var(--bg-soft)); border-color: var(--success); color: var(--success); }
.memory-card.is-hidden-text { font-size: 1.4rem; }
.memory-meta { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: .82rem; color: var(--muted); }
@media (max-width: 560px) { .memory-grid { grid-template-columns: repeat(3, 1fr); } }

/* Кроссворд */
.crossword__list { margin-bottom: 22px; display: grid; gap: 10px; }
.crossword__clue { font-size: .92rem; color: var(--ink-soft); }
.crossword__clue b { color: var(--ink); }
.crossword__row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.crossword__row input {
  width: 40px; height: 44px; text-align: center; text-transform: uppercase; border-radius: 8px;
  border: 1.5px solid var(--line-strong); background: var(--bg-soft); font-weight: 700; letter-spacing: .02em;
}
.crossword__row input.is-correct { border-color: var(--success); color: var(--success); }
.crossword__row input.is-wrong { border-color: var(--danger); }

/* Грамматика */
.grammar-item { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.grammar-item:last-child { border-bottom: none; }
.grammar-item input { width: 90px; padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: var(--bg-soft); text-align: center; }
.grammar-item input.is-correct { border-color: var(--success); }
.grammar-item input.is-wrong { border-color: var(--danger); }
.grammar-item__status .icon { width: 18px; height: 18px; }

/* ------------------------------- Методика --------------------------------- */
.timeline { position: relative; max-width: 800px; margin: 0 auto; }
.timeline::before { content: ''; position: absolute; left: 27px; top: 8px; bottom: 8px; width: 2px; background: var(--line-strong); }
.timeline__item { position: relative; padding-left: 74px; margin-bottom: 40px; opacity: 0; transform: translateY(16px); transition: all .6s var(--ease); }
.timeline__item.is-visible { opacity: 1; transform: translateY(0); }
.timeline__item:last-child { margin-bottom: 0; }
.timeline__num {
  position: absolute; left: 0; top: 0; width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff; font-family: var(--font-display);
  display: grid; place-items: center; font-size: 1.2rem; box-shadow: var(--shadow-md);
}
.timeline__item h3 { font-size: 1.1rem; margin-bottom: 6px; }
.timeline__item p { color: var(--ink-soft); font-size: .94rem; }

/* -------------------------------- Галерея --------------------------------- */
.gallery { position: relative; }
.gallery__track { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; scrollbar-width: none; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide {
  flex: 0 0 auto; width: 220px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 30px 20px; text-align: center; box-shadow: var(--shadow-sm);
}
.gallery__slide .icon-wrap {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center;
  background: var(--bg-soft); color: var(--primary);
}
.gallery__slide .icon-wrap .icon { width: 30px; height: 30px; }
.gallery__slide p { font-size: .88rem; color: var(--ink-soft); }
.gallery__controls { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }

/* -------------------------------- Материалы -------------------------------- */
.materials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.material-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.material-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.material-card .icon-wrap { width: 46px; height: 46px; border-radius: 12px; background: var(--bg-soft); color: var(--primary); display: grid; place-items: center; }
.material-card h3 { font-size: 1rem; }
.material-card p { font-size: .87rem; color: var(--muted); flex: 1; }
.material-card .go { font-size: .85rem; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 6px; }
@media (max-width: 900px) { .materials-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .materials-grid { grid-template-columns: 1fr; } }

/* ---------------------------------- FAQ ------------------------------------ */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.faq-item__q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px 22px; text-align: left; font-weight: 600; font-size: .98rem;
}
.faq-item__q .icon { width: 18px; height: 18px; color: var(--primary); transition: transform .3s var(--ease); flex-shrink: 0; }
.faq-item.is-open .faq-item__q .icon { transform: rotate(180deg); }
.faq-item__a { max-height: 0; overflow: hidden; transition: max-height .35s var(--ease); }
.faq-item__a div { padding: 0 22px 20px; color: var(--ink-soft); font-size: .92rem; }

/* ----------------------------- Личный кабинет ------------------------------- */
.cabinet-cta {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
  background: linear-gradient(135deg, var(--primary), var(--violet)); border-radius: var(--radius-lg);
  padding: 48px; color: #fff; overflow: hidden; position: relative;
}
.cabinet-cta h2 { font-size: 1.7rem; margin-bottom: 12px; }
.cabinet-cta p { opacity: .92; margin-bottom: 22px; max-width: 46ch; }
.cabinet-cta .btn-ghost { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.4); color: #fff; }
.cabinet-badges { display: flex; flex-wrap: wrap; gap: 14px; justify-content: flex-end; }
.cabinet-badge { width: 74px; height: 74px; border-radius: 18px; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.cabinet-badge .icon { width: 30px; height: 30px; }
@media (max-width: 860px) { .cabinet-cta { grid-template-columns: 1fr; } .cabinet-badges { justify-content: flex-start; } }

/* Модальные окна */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 14, 30, .55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 300;
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); max-width: 520px; width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 34px; box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(.98); transition: transform .3s var(--ease);
}
.modal-overlay.is-open .modal { transform: translateY(0) scale(1); }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; gap: 12px; }
.modal__head h3 { font-size: 1.25rem; }
.modal__head p { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 6px; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line-strong);
  background: var(--bg-soft); color: var(--ink);
}
.form-row textarea { resize: vertical; min-height: 100px; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--primary); outline: none; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }

/* Дашборд личного кабинета */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.dash-card { background: var(--bg-soft); border-radius: var(--radius-md); padding: 18px; }
.dash-card h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-family: var(--font-mono); margin-bottom: 10px; }
.progress-bar { height: 8px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; margin-top: 8px; }
.progress-bar__fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--violet)); border-radius: var(--radius-pill); transition: width .5s var(--ease); }
.badge-row { display: flex; gap: 10px; flex-wrap: wrap; }
.badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-alt); color: var(--line-strong); position: relative; }
.badge.is-unlocked { color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--bg-soft)); }
.badge .icon { width: 20px; height: 20px; }
.leaderboard { display: grid; gap: 8px; }
.leaderboard__row { display: flex; justify-content: space-between; font-size: .9rem; padding: 8px 10px; border-radius: 8px; }
.leaderboard__row.is-me { background: color-mix(in srgb, var(--primary) 12%, transparent); font-weight: 700; }
.mini-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; font-size: .78rem; }
.mini-calendar span.day-name { color: var(--muted); font-family: var(--font-mono); font-size: .68rem; }
.mini-calendar span.day-cell { padding: 8px 0; border-radius: 8px; }
.mini-calendar span.has-lesson { background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff; font-weight: 700; }
.mini-calendar span.is-today { border: 1.5px solid var(--primary); }
.certificate {
  border: 2px dashed var(--line-strong); border-radius: var(--radius-md); padding: 26px; text-align: center;
  background: linear-gradient(160deg, var(--bg-soft), var(--bg-alt));
}
.certificate h4 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 4px; }
.certificate .cert-name { font-size: 1.4rem; font-family: var(--font-display); color: var(--primary); margin: 10px 0; }
.certificate small { color: var(--muted); }

/* -------------------------------- Контакты ---------------------------------- */
.contact__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; }
.contact-info { display: grid; gap: 16px; align-content: start; }
.contact-info__row { display: flex; gap: 14px; align-items: flex-start; }
.contact-info__row .icon-wrap { width: 42px; height: 42px; border-radius: 12px; background: var(--bg-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.contact-info__row h4 { font-size: .82rem; text-transform: uppercase; color: var(--muted); font-family: var(--font-mono); letter-spacing: .04em; margin-bottom: 4px; }
.social-row { display: flex; gap: 10px; margin-top: 6px; }
.contact-form-status { font-size: .88rem; padding: 12px 14px; border-radius: 10px; margin-top: 14px; display: none; }
.contact-form-status.is-visible { display: block; }
.contact-form-status.ok { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
@media (max-width: 860px) { .contact__grid { grid-template-columns: 1fr; } }

/* --------------------------------- Подвал ----------------------------------- */
.footer { border-top: 1px solid var(--line); padding: 56px 0 28px; background: var(--bg-soft); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-family: var(--font-mono); margin-bottom: 14px; }
.footer__links { display: grid; gap: 10px; }
.footer__links a { text-decoration: none; color: var(--ink-soft); font-size: .92rem; }
.footer__links a:hover { color: var(--primary); }
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
@media (max-width: 800px) { .footer__grid { grid-template-columns: 1fr 1fr; } }

/* --------------------------------- Утилиты ---------------------------------- */
.back-to-top {
  position: fixed; right: 24px; bottom: 24px; width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: all .3s var(--ease); z-index: 90;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

.toast-stack { position: fixed; top: 90px; right: 20px; display: grid; gap: 10px; z-index: 400; width: min(340px, calc(100vw - 40px)); }
.toast {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px;
  box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: flex-start; animation: toastIn .3s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(16px);} to { opacity: 1; transform: translateX(0);} }
.toast .icon { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; margin-top: 1px; }
.toast strong { display: block; font-size: .88rem; margin-bottom: 2px; }
.toast p { font-size: .82rem; color: var(--muted); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.admin-banner {
  background: var(--violet); color: #fff; font-size: .85rem; text-align: center; padding: 10px; font-family: var(--font-mono);
}
.admin-banner a { text-decoration: underline; color: #fff; }

/* ----------------------------- Панель администратора ------------------------- */
.admin-shell { min-height: 100vh; background: var(--bg-soft); }
.admin-header { background: var(--surface); border-bottom: 1px solid var(--line); padding: 18px 0; }
.admin-header .container { display: flex; align-items: center; justify-content: space-between; }
.admin-layout { display: grid; grid-template-columns: 240px 1fr; gap: 0; min-height: calc(100vh - 73px); }
.admin-side { border-right: 1px solid var(--line); padding: 24px 14px; background: var(--surface); }
.admin-side button {
  width: 100%; text-align: left; padding: 11px 14px; border-radius: 10px; font-size: .9rem; font-weight: 600;
  color: var(--ink-soft); margin-bottom: 4px; display: flex; align-items: center; gap: 10px;
}
.admin-side button.is-active, .admin-side button:hover { background: var(--bg-soft); color: var(--primary); }
.admin-side .icon { width: 17px; height: 17px; }
.admin-main { padding: 32px; max-width: 880px; }
.admin-section { display: none; }
.admin-section.is-active { display: block; }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.admin-card h2 { font-size: 1.15rem; margin-bottom: 4px; }
.admin-card > p.hint { color: var(--muted); font-size: .86rem; margin-bottom: 18px; }
.admin-field { margin-bottom: 16px; }
.admin-field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.admin-field input, .admin-field textarea, .admin-field select {
  width: 100%; padding: 10px 13px; border-radius: 9px; border: 1.5px solid var(--line-strong); background: var(--bg-soft);
}
.admin-field textarea { min-height: 70px; resize: vertical; }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-list-item { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; position: relative; background: var(--bg-soft); }
.admin-list-item__remove { position: absolute; top: 10px; right: 10px; color: var(--danger); }
.admin-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.admin-toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: var(--bg); padding: 14px 20px; border-radius: 10px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: all .3s; z-index: 500; font-size: .9rem; }
.admin-toast.is-visible { opacity: 1; transform: translateY(0); }
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.admin-login__box { max-width: 380px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px; box-shadow: var(--shadow-lg); text-align: center; }
.admin-login__box .icon-wrap { width: 54px; height: 54px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff; display: grid; place-items: center; margin: 0 auto 18px; }
.admin-login__box h1 { font-size: 1.3rem; margin-bottom: 8px; }
.admin-login__box > p { color: var(--muted); font-size: .88rem; margin-bottom: 22px; }
.admin-error { color: var(--danger); font-size: .84rem; margin-top: 10px; display: none; }
.admin-error.is-visible { display: block; }

@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { display: flex; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 12px; gap: 6px; }
  .admin-side button { white-space: nowrap; margin-bottom: 0; }
  .admin-grid-2 { grid-template-columns: 1fr; }
}

/* ===================== Страницы курса и урока ===================== */
.course-hero { background: var(--bg-soft); padding-top: 40px; padding-bottom: 32px; }
.course-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; text-decoration: none; margin-bottom: 18px; }
.course-back:hover { color: var(--ink); }
.course-hero__head { display: flex; align-items: center; gap: 20px; }
.course-hero__icon { width: 64px; height: 64px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent, var(--primary)); flex-shrink: 0; }
.course-hero__icon .icon { width: 32px; height: 32px; }
.course-progress { margin-top: 24px; display: flex; align-items: center; gap: 16px; }
.course-progress__bar { flex: 1; height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; }
.course-progress__fill { height: 100%; background: var(--accent, var(--primary)); border-radius: 6px; transition: width .4s; }
.course-progress span { font-size: .86rem; color: var(--muted); white-space: nowrap; }
.course-login-notice { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; font-size: .9rem; flex-wrap: wrap; }

.lesson-list { display: flex; flex-direction: column; gap: 10px; }
.lesson-list__item { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); transition: all .2s; }
.lesson-list__item:hover { border-color: var(--primary); transform: translateX(3px); }
.lesson-list__num { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-soft); display: grid; place-items: center; font-weight: 700; font-family: var(--font-mono); font-size: .86rem; flex-shrink: 0; color: var(--muted); }
.lesson-list__item.is-current .lesson-list__num { background: var(--primary); color: #fff; }
.lesson-list__item.is-done .lesson-list__num { background: var(--success); color: #fff; }
.lesson-list__item.is-done .lesson-list__num .icon { width: 16px; height: 16px; }
.lesson-list__title { flex: 1; font-weight: 600; }
.lesson-list__badge { font-size: .74rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--primary); background: var(--primary-soft); padding: 4px 10px; border-radius: 20px; }

.lesson-video { margin: 20px 0; border-radius: var(--radius-md); overflow: hidden; background: #000; }
.lesson-video iframe { width: 100%; aspect-ratio: 16/9; display: block; border: 0; }
.lesson-content { line-height: 1.75; font-size: 1.02rem; color: var(--ink-soft); }
.lesson-content p { margin-bottom: 16px; }
.lesson-content h2, .lesson-content h3 { color: var(--ink); margin: 26px 0 12px; }
.lesson-content ul, .lesson-content ol { margin: 0 0 16px 22px; }
.lesson-content img { max-width: 100%; border-radius: 12px; }

.lesson-complete-box { margin: 32px 0; padding: 20px; border-radius: var(--radius-md); background: var(--bg-soft); text-align: center; }
.lesson-complete-box p { margin-bottom: 12px; color: var(--muted); font-size: .9rem; }
.lesson-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); gap: 12px; }
.lesson-nav__link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.lesson-nav__link:hover { color: var(--primary); }
.lesson-nav__link--next { margin-left: auto; }

@media (max-width: 640px) {
  .course-hero__head { flex-direction: column; text-align: center; }
  .course-login-notice { flex-direction: column; text-align: center; }
  .lesson-nav { flex-direction: column; align-items: stretch; }
  .lesson-nav__link--next { margin-left: 0; justify-content: center; }
}
