/* ============================================
   Школа Матрица — критический CSS (первый экран + карусель услуг)
   Остальное: style-deferred.css (подгружается отложенно)
   ============================================ */

:root {
  --color-primary: #1e3a5f;
  --color-primary-light: #2d4a6f;
  --color-accent: #e8a735;
  --color-accent-hover: #d49428;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7fa;
  --color-text: #2c3e50;
  --color-text-muted: #6b7c8f;
  --color-border: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(30, 58, 95, 0.08);
  --shadow-md: 0 4px 20px rgba(30, 58, 95, 0.12);
  --shadow-lg: 0 8px 32px rgba(30, 58, 95, 0.15);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.25s ease;
  --header-height: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

#teachers,
#reviews {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

/* Появление блоков при прокрутке (классы добавляет script.js) */
.reveal {
  opacity: 0;
  transform: translate3d(0, 3rem, 0) scale(0.92);
  transition:
    opacity 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal.reveal--from-left {
  transform: translate3d(-2.75rem, 2rem, 0) scale(0.92);
}

.reveal.reveal--from-right {
  transform: translate3d(2.75rem, 2rem, 0) scale(0.92);
}

.hero .reveal.reveal--hero {
  transform: translate3d(0, 4rem, 0) scale(0.86);
}

.reveal.reveal--visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Конечное состояние сильнее начальных вариантов (hero / слева / справа) */
.hero .reveal.reveal--hero.reveal--visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.reveal.reveal--from-left.reveal--visible,
.reveal.reveal--from-right.reveal--visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero .reveal.reveal--hero {
    transform: none;
  }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-top: 250px;
  padding: 0 20px;
}

.section {
  padding: 48px 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.about--after-news {
  border-top: 1px solid var(--color-border);
  padding-top: 52px;
}

/* Страница услуги (внутренняя) */
.service-page {
  padding: 32px 0 64px;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 24px;
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.service-page__title {
  margin: 0 0 24px;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
}

.service-page__content {
  max-width: 720px;
  margin: 0 0 32px;
}

.service-page__content p {
  margin: 0 0 16px;
}

.service-page__content p:last-child {
  margin-bottom: 0;
}

.service-page__content ul {
  margin: 0 0 16px;
  padding-left: 1.5em;
}

.service-page__cta {
  margin-top: 32px;
}

.section__title {
  margin: 0 0 32px;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
  min-height: 48px;
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

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

.btn--large {
  padding: 16px 32px;
  font-size: 1.125rem;
}

.btn--full {
  width: 100%;
}

.btn--whatsapp {
  background: #25d366;
  color: #fff;
}

.btn--whatsapp:hover {
  background: #20bd5a;
}

.btn--telegram {
  background: #0088cc;
  color: #fff;
}

.btn--telegram:hover {
  background: #006699;
}

.btn--vk {
  background: #0077ff;
  color: #fff;
}

.btn--vk:hover {
  background: #0066dd;
}

/* ========== Хедер ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
}


.nav__list {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.logo:hover {
  color: var(--color-primary);
}

.logo__place {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(30, 58, 95, 0.08);
  overflow: hidden;
}

.logo__img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.logo__text {
  display: inline-block;
}

.nav__link {
  padding: 8px 12px;
  color: var(--color-text);
}

.nav__link:hover {
  color: var(--color-accent);
}

.header__cta {
  display: none;
}

.burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 48px;
  height: 48px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity var(--transition);
}

.burger:hover {
  opacity: 0.8;
}

.burger__line {
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.burger.is-open .burger__line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger.is-open .burger__line:nth-child(2) {
  opacity: 0;
}

.burger.is-open .burger__line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

.nav-overlay.is-visible {
  display: block;
}

/* Мобильное меню открыто (только до 768px) */
@media (max-width: 767px) {
  body.menu-open .nav__list {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--color-bg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    gap: 8px;
  }

  body.menu-open .nav__link {
    display: block;
    padding: 16px;
    font-size: 1.125rem;
    border-radius: var(--radius);
  }

  .nav__cta-mobile {
    display: none;
  }

  body.menu-open .nav__cta-mobile {
    display: block;
    margin-top: 8px;
  }
}

.nav__cta-btn {
  width: 100%;
  margin: 0;
}

@media (min-width: 768px) {
  .nav__cta-mobile {
    display: none !important;
  }
}

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-height) + 32px) 0 48px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 50%, #3d5a80 100%);
}

.hero__bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
}

.hero__text-wrap,
.hero .hero__text-wrap {
  /* Turn off any blur that might be inherited from a parent */
  filter: none !important;
  backdrop-filter: none !important;

  /* If a blur is being added via a CSS variable, reset it */
  --blur-amount: 0 !important;
}

/* In case a generic rule like “.hero * { filter: blur(...)}” exists,
   explicitly cancel it for the wrapper and its children. */
.hero__text-wrap,
.hero__text-wrap * {
  filter: none !important;
  backdrop-filter: none !important;
}

.hero__title {
  margin: 0 0 20px;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.hero__subtitle {
  margin: 0;
  font-size: 1.125rem;
  opacity: 0.95;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero__cta {
  box-shadow: var(--shadow-lg);
}

/* Карусель фото в карточке услуги */
.service__slider {
  position: relative;
  overflow: hidden;
  margin: 0 0 16px;
  border-radius: var(--radius);
}

.service__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
  -webkit-overflow-scrolling: touch;
}

.service__track::-webkit-scrollbar {
  height: 6px;
}

.service__track::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.service__item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.service__item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.service__item--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.service__nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.service__arrow {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-primary);
  background: var(--color-bg);
  color: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background var(--transition), color var(--transition);
}

.service__arrow:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Карусель на странице услуги (крупнее) */
.service-page__slider.service__slider {
  margin-bottom: 32px;
}

.service-page__slider .service__item img {
  height: 240px;
}

.service-page__slider .service__nav {
  margin-top: 16px;
}

.service-page__slider .service__arrow {
  width: 44px;
  height: 44px;
  font-size: 0.875rem;
}
