/* =============================================
   CSS — MaxAI Landing
   Светлая тема, фиолетово-синие акценты
   Полный адаптив
   ============================================= */

/* --- VARIABLES --- */
:root {
  --white: #ffffff;
  --bg: #f6f6fb;
  --bg-alt: #f0f1f7;
  --bg-card: #ffffff;
  --text: #131326;
  --text-2: #43445c;
  --text-3: #6f7089;
  --accent: #6a5cff;
  --accent-dark: #5243d6;
  --accent-light: #a18dff;
  --accent-2: #d946ef;
  --gradient: linear-gradient(120deg, #6a5cff 0%, #a855f7 55%, #d946ef 100%);
  --gradient-soft: linear-gradient(120deg, rgba(106, 92, 255, 0.12), rgba(217, 70, 239, 0.12));
  --gradient-vibrant: linear-gradient(120deg, #6a5cff 0%, #a855f7 55%, #d946ef 100%);
  --border: #e7e7f2;
  --border-hover: #cfcfe7;
  --shadow-sm: 0 2px 10px rgba(19, 19, 38, 0.05);
  --shadow-md: 0 18px 48px rgba(19, 19, 38, 0.1);
  --shadow-lg: 0 32px 80px rgba(19, 19, 38, 0.16);
  --shadow-glow: 0 12px 32px rgba(106, 92, 255, 0.28);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Unbounded', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h: 72px;
}

/* Scroll progress bar */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient);
  z-index: 1600;
  border-radius: 0 3px 3px 0;
  transition: width 0.08s linear;
}

/* --- RESET --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* Gallery styles start */
.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 48px;
}
.gallery-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.gallery-row .gallery-item {
  flex: 1 1 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: transparent;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-row .gallery-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}
.gallery-row .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
  border-radius: var(--radius-md);
}
.gallery-row:has(.gallery-item:nth-child(1):only-child) .gallery-item { flex: 0 0 100%; }
.gallery-row.three .gallery-item { flex: 0 0 calc(33.333% - 9.33px); }
.gallery-row.two .gallery-item { flex: 0 0 calc(50% - 7px); }
.gallery-row:nth-child(2) .gallery-item:nth-child(2) { transform: translateY(8px); }
.gallery-row:nth-child(3) .gallery-item:nth-child(3) { transform: translateY(-8px); }
.gallery-row:nth-child(5) .gallery-item:nth-child(2) { transform: translateY(6px); }
.gallery-row .gallery-item img { max-height: 520px; }

@media (max-width: 1024px) {
  .gallery-row.three .gallery-item { flex: 0 0 calc(33.333% - 9.33px); }
  .gallery-row.two .gallery-item { flex: 0 0 calc(50% - 7px); }
  .gallery-row { gap: 12px; }
}

@media (max-width: 640px) {
  .gallery-row { flex-wrap: wrap; gap: 10px; }
  .gallery-row .gallery-item { flex: 0 0 calc(50% - 6px); }
  .gallery-row:has(.gallery-item:nth-child(1):only-child) .gallery-item { flex: 0 0 100%; }
  .gallery-row .gallery-item img { max-height: 360px; }
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.accent-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-break {
  display: block;
}
.center-cta { text-align: center; margin-top: 3rem; }

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 50px;
  padding: 12px 28px;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(106, 92, 255, 0.4);
}
.btn-trial-wide { min-width: 220px; }
.btn-outline {
  border: 2px solid var(--border);
  color: var(--text);
  background: var(--white);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-white {
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  box-shadow: var(--shadow-md);
}
.btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }

/* ===================
   NAVBAR
   =================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(246, 246, 251, 0.78);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 8px 30px rgba(19, 19, 38, 0.06);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}
.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
  flex-shrink: 0;
}
.logo-name {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-sub {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3px;
}
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-links > li { display: flex; align-items: center; }
.nav-link { line-height: 1.2; }
.nav-item { position: relative; }
.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
  padding: 8px 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color 0.25s;
}
.nav-dropdown-btn:hover { color: var(--accent); }
.nav-dropdown-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s var(--ease);
}
.has-dropdown.open .nav-dropdown-chevron { transform: translateY(2px) rotate(225deg); }
.dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  min-width: 190px;
  padding: 8px;
  transform: translate(-50%, 8px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 20;
}
.has-dropdown.open .dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.dropdown-link {
  display: block;
  padding: 10px 14px;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  transition: background 0.2s, color 0.2s;
}
.dropdown-link:hover,
.dropdown-link.is-active {
  background: var(--gradient-soft);
  color: var(--accent-dark);
}
.nav-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
  transition: color 0.25s;
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}
.nav-link:hover { color: var(--accent); }
.nav-home.active { color: var(--accent); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-btn { display: block; }

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  z-index: 1100;
}
.burger span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--text);
  border-radius: 4px;
  transition: all 0.3s var(--ease);
}
.burger.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ===================
   HERO
   =================== */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 60px) 0 80px;
  overflow: hidden;
  background: var(--bg);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(106, 92, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106, 92, 255, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 20% 20%, rgba(106, 92, 255, 0.12), transparent 32%),
    radial-gradient(circle at 80% 10%, rgba(217, 70, 239, 0.08), transparent 30%);
  background-size: 26px 26px, 26px 26px, 100% 100%, 100% 100%;
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
  pointer-events: none;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 15%, rgba(106,92,255,0.10), transparent 24%),
              radial-gradient(circle at 85% 10%, rgba(217,70,239,0.08), transparent 26%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--gradient-soft);
  border: 1px solid rgba(106, 92, 255, 0.22);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.hero-kicker::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gradient);
  flex-shrink: 0;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.hero-desc {
  font-size: 1.1rem;
  color: var(--text-2);
  max-width: 540px;
  margin-bottom: 32px;
}
.hero-desc strong { color: var(--text); }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 48px; }

/* Stats */
.hero-stats {
  display: flex;
  gap: 24px;
  align-items: center;
}
.stat-item { text-align: center; }
.stat-item strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-item span { font-size: 0.8rem; color: var(--text-3); font-weight: 500; }
.stat-divider { width: 1px; height: 36px; background: var(--border); }
.hero-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 560px;
  margin: 0 0 0;
}
#hero:has(.hero-benefits) .hero-buttons { margin-bottom: 20px; }
.hero-benefit {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}
.hero-benefit-icon {
  display: block;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

/* Hero photo */
.hero-photo {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-photo::before {
  content: '';
  position: absolute;
  inset: 8% 4% 4% 8%;
  border-radius: 40px;
  background: var(--gradient);
  filter: blur(56px);
  opacity: 0.3;
  z-index: 0;
}
.hero-photo-frame {
  width: min(440px, 100%);
  aspect-ratio: 4 / 5;
  padding: 6px;
  background: var(--gradient);
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 2;
}
.hero-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
}
.hero-float {
  position: absolute;
  padding: 10px 18px;
  background: var(--white);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 3;
  animation: float 3s ease-in-out infinite;
  white-space: nowrap;
}
.hero-float-1 { top: 10%; left: -10%; animation-delay: 0s; }
.hero-float-2 { bottom: 25%; right: -8%; animation-delay: 1s; }
.hero-float-3 { bottom: 5%; left: 5%; animation-delay: 2s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ===================
   SECTIONS — общие
   =================== */
.section {
  padding: 90px 0;
}
.section-alt {
  background: var(--white);
}
.section-label {
  display: inline-block;
  padding: 6px 16px;
  background: var(--gradient-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.section-desc {
  font-size: 1.08rem;
  color: var(--text-2);
  max-width: 640px;
  margin-bottom: 48px;
}
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 40px) 0 40px;
  background: var(--bg);
}
.error-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 60px 32px;
  text-align: center;
  max-width: 700px;
}
.error-number {
  font-size: 180px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 0.9;
  margin-bottom: 20px;
  letter-spacing: -0.05em;
}
.error-card .section-title {
  max-width: 760px;
  margin: 0 auto 20px;
}
.error-card .section-desc {
  margin: 0 auto 18px;
  max-width: 680px;
  color: var(--text-2);
  font-size: 1.05rem;
}
.link-home {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  transition: all 0.2s var(--ease);
}
.link-home:hover {
  color: var(--accent-dark);
  border-bottom-color: var(--accent-dark);
}
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 18px;
}
@media (max-width: 640px) {
  .error-number {
    font-size: 100px;
    margin-bottom: 16px;
  }
  .error-card {
    padding: 40px 20px;
  }
}
.subsection-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 56px 0 28px;
}

/* ===================
   ABOUT
   =================== */
.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 40px;
}
.about-img-wrap {
  position: relative;
  padding: 6px;
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--gradient);
  aspect-ratio: 3/4;
}
.about-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
}
.about-text .lead {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--text);
}
.about-text p {
  color: var(--text-2);
  margin-bottom: 14px;
}
.about-text p strong { color: var(--text); }
.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.tag {
  padding: 10px 18px;
  background: var(--gradient-soft);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* ===================
   FORMAT BANNER
   =================== */
.format-banner {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 36px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.format-banner .format-icon { font-size: 2.4rem; flex-shrink: 0; }
.format-banner h3 { font-size: 1.2rem; margin-bottom: 8px; }
.format-banner p { color: var(--text-2); }
.format-banner p strong { color: var(--text); }

/* ===================
   CARDS
   =================== */
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 20px;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.cards-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  transition: all 0.3s var(--ease);
  position: relative;
}
.card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}
.direction-card {
  display: block;
  color: inherit;
  overflow: hidden;
}
.direction-card[data-brand="ai"] { --brand-color: #4285f4; }
.direction-card[data-brand="python"] { --brand-color: #3776ab; }
.direction-card[data-brand="roblox"] { --brand-color: #242424; }
.direction-card[data-brand="minecraft"] { --brand-color: #4f8f38; }
.direction-card[data-brand="scratch"] { --brand-color: #f28c28; }
.direction-card[data-brand="construct"] { --brand-color: #007f86; }
/* Логотипы направлений: assets/logos/<ключ>.svg (см. courses.js). Цвет при наведении — --brand-color выше. */
body[data-homepage="true"] #directions .direction-card {
  border: 2.5px solid var(--brand-color);
}
body[data-homepage="true"] #directions .direction-card[data-brand="ai"] { --brand-color: var(--accent); }
.direction-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brand-color, var(--gradient));
  transform: translateY(100%);
  transition: transform 0.35s var(--ease);
  z-index: 0;
}
.direction-card > * { position: relative; z-index: 1; }
.direction-card-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  color: #fff;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition: max-height 0.35s var(--ease), margin-top 0.35s var(--ease), opacity 0.25s, transform 0.35s var(--ease);
}
.direction-card-cta span { font-size: 1.2rem; transition: transform 0.25s; }
.direction-card:hover::before { transform: translateY(0); }
.direction-card:hover { box-shadow: 0 18px 42px rgba(19, 19, 38, 0.16); }
.direction-card:hover h4,
.direction-card:hover p,
.direction-card:hover .age-badge { color: #fff; }
.direction-card:hover .age-badge { background: rgba(255, 255, 255, 0.18); }
.direction-card:hover .direction-card-cta {
  max-height: 28px;
  margin-top: 18px;
  opacity: 1;
  transform: translateY(0);
}
.direction-card:hover .direction-card-cta span { transform: translateX(4px); }
.card-glow {
  background: var(--gradient-soft);
  border-color: rgba(124,58,237,0.15);
}
.card-icon {
  font-size: 2rem;
  margin-bottom: 14px;
}
.direction-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.direction-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card h4 {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.card p {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.55;
}
.age-badge {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 14px;
  background: var(--gradient-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 50px;
}

/* ===================
   CAROUSEL
   =================== */
.carousel-heading {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.carousel {
  position: relative;
  overflow: visible;
}
.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius-md);
}
.carousel-track {
  display: flex;
  gap: 20px;
  transition: transform 0.5s var(--ease);
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 calc(33.333% - 14px);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.carousel-slide img {
  width: 100%;
  display: block;
  height: auto;
  object-fit: contain;
}
.carousel-slide iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
}
.carousel-slide video {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.carousel-caption {
  padding: 14px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
}
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: 1.4rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease);
}
.carousel-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }

/* ===================
   COMPARISON TABLE
   =================== */
.comparison {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  margin-top: 40px;
}
.comp-row {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.comp-row:last-child { border-bottom: none; }
.comp-header-row {
  background: var(--gradient-soft);
  font-weight: 700;
}
.comp-cell {
  padding: 18px 20px;
  font-size: 0.9rem;
}
.comp-label-cell {
  font-weight: 700;
  color: var(--text);
  background: rgba(124,58,237,0.03);
  border-right: 1px solid var(--border);
}
.comp-me-cell { color: var(--text); }
.comp-school-cell {
  color: var(--text-3);
  border-left: 1px solid var(--border);
}
.check { color: #22c55e; margin-right: 6px; }
.cross { color: #ef4444; margin-right: 6px; }

/* ===================
   FAQ ACCORDION
   =================== */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease);
}
.faq-item:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-md);
}
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  background: var(--white);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  border: none;
}
.faq-question:hover {
  background: var(--gradient-soft);
  color: var(--accent);
}
.faq-question.open {
  background: var(--gradient-soft);
  color: var(--accent);
}
.faq-q-text {
  flex: 1;
}
.faq-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--accent);
  transition: transform 0.3s var(--ease);
  margin-left: 16px;
  flex-shrink: 0;
}
.faq-question.open .faq-arrow {
  transform: rotate(180deg);
}
.faq-answer {
  display: none;
  padding: 20px 24px 24px 24px;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.65;
  animation: slideDown 0.3s var(--ease);
}
.faq-answer.open {
  display: block;
}
.faq-answer p {
  margin-bottom: 12px;
}
.faq-answer p:last-child {
  margin-bottom: 0;
}
.faq-answer p a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.faq-answer p a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}
.faq-list {
  list-style: none;
  margin: 12px 0;
  padding-left: 0;
}
.faq-list li {
  padding-left: 24px;
  position: relative;
  margin-bottom: 8px;
}
.faq-list li:before {
  content: "▪";
  position: absolute;
  left: 6px;
  color: var(--accent);
  font-weight: bold;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================
   FINAL CTA
   =================== */
.final-section {
  padding: 90px 0;
}
.final-card {
  text-align: center;
  padding: 64px 40px;
  background: var(--gradient);
  border-radius: var(--radius-xl);
  color: #fff;
  box-shadow: 0 8px 40px rgba(124,58,237,0.25);
}
.final-card-with-goose {
  position: relative;
  overflow: hidden;
}
.final-card-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}
.final-card-goose {
  position: absolute;
  right: 24px;
  bottom: 0;
  width: clamp(170px, 18vw, 240px);
  max-height: 100%;
  object-fit: contain;
  object-position: bottom;
  pointer-events: none;
}
.final-card h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.final-card p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 480px;
  margin: 0 auto 32px;
}

/* ===================
   FOOTER
   =================== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer p { font-size: 0.85rem; color: var(--text-3); }
.footer-brand { display: grid; gap: 10px; }
.footer-email {
  width: fit-content;
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 600;
  transition: color 0.2s;
}
.footer-email:hover { color: var(--accent); }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
}
.footer-nav a {
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 700;
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--accent); }

.price-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 26px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.price-card-featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.price-card h3 {
  margin: 18px 0 12px;
  font-size: 1.05rem;
  line-height: 1.35;
}
.price-card-value {
  margin: 0;
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 800;
}
.price-card-note {
  flex: 1;
  margin: 6px 0 20px;
  color: var(--text-2);
  font-size: 0.9rem;
}
.price-card .btn { margin-top: auto; }
.price-card-badge {
  display: inline-block;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--gradient-soft);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.scroll-direction {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1700;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease), visibility 0.2s;
}
.scroll-direction.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.scroll-direction.is-visible:hover { transform: translateY(-3px); }

/* ===================
   MODAL
   =================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10, 14, 26, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s var(--ease);
  position: relative;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 1.3rem;
  color: var(--text-3);
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }
.modal-box h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.modal-sub {
  font-size: 0.92rem;
  color: var(--text-3);
  margin-bottom: 28px;
}
.modal-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.modal-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.modal-link:hover { transform: scale(1.03); }
.ml-badge {
  display: inline-flex;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.ml-badge svg { width: 22px; height: 22px; fill: currentColor; }
.ml-badge img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.ml-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  object-fit: contain;
}
.ml-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ml-icon-svg svg { width: 22px; height: 22px; fill: currentColor; }
.ml-icon-svg {
  background: url('assets/wa.svg') center / contain no-repeat;
}
.ml-icon-svg svg { display: none; }
.phone-icon { background: none; }
.phone-icon svg { display: block; }
.badge-wa {
  background: url('assets/wa.svg') center / contain no-repeat;
}
.badge-wa svg { display: none; }

/* Отзывы — общий слайдер (reviews.js). --per-view: 1 на мобильных, 2 на широких экранах */
.review-slider { --per-view: 1; max-width: 760px; margin: 0 auto; }
.review-viewport {
  overflow: hidden;
  touch-action: pan-y;
  border-radius: 10px;
  outline: none;
}
.review-viewport:focus-visible { box-shadow: 0 0 0 3px rgba(106, 92, 255, 0.35); }
.review-track {
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 0.35s var(--ease);
  will-change: transform;
}
.review-slide {
  flex: 0 0 calc(100% / var(--per-view));
  padding: 0 8px;
  min-width: 0;
}
.review-slide img {
  width: 100%;
  height: min(72vh, 680px);
  object-fit: contain;
  object-position: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
}
.review-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}
.review-slider.is-static .review-controls { display: none; }
.review-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  font-size: 1.7rem;
  line-height: 1;
  padding-bottom: 3px;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.review-arrow:not(:disabled):hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.review-arrow:disabled { opacity: 0.38; cursor: default; }
.review-dots { display: flex; align-items: center; gap: 8px; }
.review-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 50%;
  background: var(--border-hover);
  transition: background 0.2s, transform 0.2s;
}
.review-dot.is-active { background: var(--accent); transform: scale(1.25); }
@media (min-width: 900px) {
  .review-slider { max-width: 1100px; }
  .review-slide img { height: min(70vh, 620px); }
}
.ml-wa { background: #25D366; box-shadow: 0 4px 16px rgba(37,211,102,0.3); }
.ml-vk { background: #0077FF; box-shadow: 0 4px 16px rgba(0,119,255,0.3); }
.ml-tg { background: #2AABEE; box-shadow: 0 4px 16px rgba(42,171,238,0.3); }
.ml-max { background: var(--gradient); box-shadow: 0 4px 16px rgba(124,58,237,0.3); }
.ml-threads { background: #000000; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.modal-phone {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  transition: color 0.2s;
}
.modal-phone:hover { color: var(--accent-dark); }

/* ===================
   GALLERY MODAL
   =================== */
#galleryModal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.feedback-form {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
  text-align: left;
}
.feedback-form label {
  display: grid;
  gap: 6px;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 700;
}
.feedback-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(92px, 0.6fr);
  gap: 10px;
}
.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}
.feedback-form input:focus,
.feedback-form select:focus,
.feedback-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(106, 92, 255, 0.12); }
.feedback-form textarea { resize: vertical; }
.feedback-submit { width: 100%; }
#galleryModal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.gallery-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  padding: 12px;
  animation: galleryZoom 0.3s var(--ease);
}
.gallery-modal-content img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
#galleryModal .modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  font-size: 2rem;
  color: var(--white);
  padding: 8px 16px;
  border-radius: 8px;
  transition: color 0.2s;
}
#galleryModal .modal-close:hover { color: var(--accent-light); }
@keyframes galleryZoom {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ===================
   GALLERY (COLLAGE)
   =================== */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 48px;
}
.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-alt);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  cursor: pointer;
  flex: 0 0 auto;
}
.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--white);
}
/* Landscape фото - на всю ширину */
.gallery-item.landscape {
  flex: 0 0 calc(100% - 0px);
  height: 280px;
}
/* Portrait фото - по две в ряд */
.gallery-item.portrait {
  flex: 0 0 calc(50% - 7px);
  height: 240px;
}
/* Криво расположенные ряды - чередующееся смещение */
.gallery-item.portrait:nth-child(4n+3) {
  margin-top: 10px;
}
.gallery-item.portrait:nth-child(4n+4) {
  margin-top: -10px;
}
.gallery-item.portrait:nth-child(8n+7) {
  margin-top: 12px;
}
.gallery-item.portrait:nth-child(8n+8) {
  margin-top: -12px;
}
/* Старые классы для совместимости */
.gallery-item-1, .gallery-item-2, .gallery-item-5, .gallery-item-6,
.gallery-item-9, .gallery-item-10 { }
.gallery-item-3, .gallery-item-4, .gallery-item-7, .gallery-item-8,
.gallery-item-11, .gallery-item-12 { }

/* ===================
   SCROLL ANIMATIONS
   =================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===================
   RESPONSIVE
   =================== */

/* Tablet */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; }
  .hero-benefits { margin-left: auto; margin-right: auto; }
  .hero-stats { justify-content: center; }
  .hero-photo { order: -1; }
  .hero-photo-frame { width: 280px; height: 320px; }
  .hero-float-1 { left: 5%; }
  .hero-float-2 { right: 5%; }

  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .about-img-wrap {
    max-width: 280px;
    margin: 0 auto;
  }
  .about-tags { justify-content: center; }

  .cards-3 { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }

  .carousel-slide {
    flex: 0 0 calc(50% - 10px);
  }

  .comp-row {
    grid-template-columns: 1fr;
  }
  .comp-header-row { display: none; }
  .comp-row { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
  .comp-cell { padding: 4px 0; }
  .comp-label-cell {
    font-size: 0.95rem;
    border-right: none;
    border-bottom: none;
  }
  .comp-school-cell {
    border-left: none;
  }

  .faq-container {
    max-width: 100%;
  }

  .gallery-item.landscape {
    flex: 0 0 calc(100% - 0px);
    height: 220px;
  }
  .gallery-item.portrait {
    flex: 0 0 calc(50% - 7px);
    height: 180px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  :root { --nav-h: 64px; }

  #hero:has(.hero-benefits) .hero-content { order: 1; }
  #hero:has(.hero-benefits) .hero-photo { order: 2; }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: min(86vw, 360px);
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: -12px 0 32px rgba(18, 24, 38, 0.14);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    padding: 76px 20px 28px;
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s var(--ease), opacity 0.28s var(--ease);
    z-index: 2100;
  }
  .price-cards { grid-template-columns: 1fr; }
  .price-card { padding: 22px; }
  .nav-links > li { width: 100%; }
  .nav-item { width: 100%; }
  .nav-dropdown-btn {
    width: 100%;
    padding: 14px 16px;
    text-align: left;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    justify-content: space-between;
  }
  .dropdown {
    position: static;
    display: none;
    min-width: 0;
    padding: 0 0 0 12px;
    transform: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
  }
  .has-dropdown.open .dropdown { display: block; }
  .dropdown-link { padding: 10px 16px; }
  .dropdown-link.is-active { background: var(--gradient-soft); color: var(--accent-dark); }
  .review-slide { padding: 0 4px; }
  .review-slide img { height: min(70vh, 600px); }
  .direction-card:hover::before { transform: translateY(100%); }
  .direction-card:hover h4,
  .direction-card:hover p,
  .direction-card:hover .age-badge { color: inherit; }
  .direction-card:hover .age-badge { background: var(--gradient-soft); }
  .direction-card:hover .direction-card-cta { max-height: 0; margin-top: 0; opacity: 0; }
  .nav-links.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links::before {
    display: none;
  }
  .nav-link {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    padding: 14px 16px;
    border-radius: 12px;
    transition: all 0.2s var(--ease);
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: transparent;
  }
  .nav-link:hover {
    background: var(--gradient-soft);
    color: var(--accent);
  }
  .nav-link::after {
    display: none;
  }
  .nav-btn { display: none; }
  .burger {
    display: flex;
    position: relative;
    z-index: 2200;
  }

  .hero { padding: calc(var(--nav-h) + 32px) 0 56px; }
  .hero h1 { font-size: 1.65rem; }
  .hero-desc { font-size: 0.95rem; }
  .hero-photo-frame { width: 220px; height: 260px; }
  .hero-float { display: none; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .stat-divider { width: 40px; height: 1px; }

  .section { padding: 56px 0; }
  .section-title { font-size: 1.5rem; }
  .section-desc { font-size: 0.95rem; }

  .format-banner {
    flex-direction: column;
    padding: 24px;
    text-align: center;
  }

  .cards-grid { grid-template-columns: 1fr; }
  .cards-4 { grid-template-columns: 1fr; }

  .gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
  }
  .gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-alt);
    box-shadow: var(--shadow-sm);
    height: auto;
  }
  .gallery-item.landscape {
    flex: 0 0 calc(100% - 0px);
    height: 200px;
  }
  .gallery-item.portrait {
    flex: 0 0 calc(50% - 7px);
    height: 180px;
  }
  .gallery-item.portrait:nth-child(4n+3) {
    margin-top: 8px;
  }
  .gallery-item.portrait:nth-child(4n+4) {
    margin-top: -8px;
  }
  .gallery-item-1, .gallery-item-2, .gallery-item-5, .gallery-item-6,
  .gallery-item-9, .gallery-item-10 {
    grid-column: auto !important;
    grid-row: auto !important;
  }
  .gallery-item-3, .gallery-item-4, .gallery-item-7, .gallery-item-8,
  .gallery-item-11, .gallery-item-12 {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .carousel-slide {
    flex: 0 0 calc(100% - 0px);
  }
  .carousel-prev { left: 4px; }
  .carousel-next { right: 4px; }

  .final-card { padding: 40px 24px; }
  .final-card h2 { font-size: 1.6rem; }
  .final-card-goose { display: none; }

  .faq-container {
    max-width: 100%;
  }
  .faq-question {
    padding: 16px 18px;
    font-size: 0.95rem;
  }
  .faq-answer {
    padding: 20px 18px 18px 18px;
    font-size: 0.9rem;
  }
  .faq-list li {
    padding-left: 20px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  .footer-nav { justify-content: center; }
  .scroll-direction { right: 16px; bottom: 16px; }

  .modal-box { padding: 28px 20px; }
  .feedback-fields { grid-template-columns: 1fr; }
}

/* Small phones */
@media (max-width: 380px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 1.4rem; }
  .hero-benefits { grid-template-columns: 1fr; }
  .btn-lg { padding: 14px 24px; font-size: 0.95rem; }
  
  #gallery { display: none; }
  
  #galleryModal .modal-close {
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
  }
}
/* Tools strip — страница «О преподавателе» */
.tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}
.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.tool-chip img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}
/* Breadcrumbs — страница «О преподавателе» */
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 24px;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-3);
}
.breadcrumbs { position: relative; z-index: 1; }
.hero-content .breadcrumbs { margin-bottom: 12px; text-align: left; }
.hero-content .breadcrumbs ol { justify-content: flex-start; }
/* Первый блок страницы не должен уезжать под фиксированную шапку (var(--nav-h)).
   Повышенная специфичность, чтобы мобильное правило .section { padding: 56px 0 } его не перебивало. */
.section.about-hero { padding-top: calc(var(--nav-h) + 28px); }
.breadcrumbs { scroll-margin-top: calc(var(--nav-h) + 16px); }
.breadcrumbs li + li::before {
  content: "›";
  margin: 0 8px;
  color: var(--text-3);
}
.breadcrumbs a {
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}.tool-chip-emoji {
  font-size: 1.05rem;
  line-height: 1;
}
/* ===================
   ПРЕИМУЩЕСТВА (главная) — advantages.js
   =================== */
.advantages-section {
  padding: calc(var(--nav-h) + 28px) 0 0;
}
.advantages-section + #directions { padding-top: 64px; }
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.advantage-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.advantage-icon { flex: 0 0 44px; width: 44px; height: 44px; }
.advantage-title {
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 4px;
}
.advantage-text { font-size: 0.86rem; line-height: 1.45; color: var(--text-2); }
@media (max-width: 1024px) {
  .advantages-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .advantages-section { padding-top: calc(var(--nav-h) + 20px); }
  .advantages-section + #directions { padding-top: 44px; }
  .advantages-grid { gap: 10px; }
  .advantage-card { flex-direction: column; gap: 8px; padding: 14px; }
  .advantage-icon { width: 38px; height: 38px; flex-basis: auto; }
  .advantage-title { font-size: 0.9rem; }
  .advantage-text { font-size: 0.8rem; }
}
