* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

:root {
  /* Базовый системный шрифт для текста (мгновенная загрузка) */
  --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Скруглённый шрифт для заголовков: Apple-эксклюзив первым, Nunito для остальных */
  --font-rounded: ui-rounded, "SF Pro Rounded", "Nunito", sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: #fbfbfd; /* Фирменный светло-серый фон Apple */
  color: #1d1d1f;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================= HEADER ================= */

.header {
  text-align: center;
  padding: 28px 0;
}

.header img {
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.hero-tagline {
  margin: 18px auto 0;
  font-family: var(--font-rounded);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-align: center;
  line-height: 1.2;
  /* Градиент в стиле Apple */
  background-image: linear-gradient(90deg, #74b4fa, #c681eb, #74b4fa);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: taglineFlow 18s ease-in-out infinite;
}

@keyframes taglineFlow {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 150% 0%; }
  100% { background-position: 0% 0%; }
}

/* ================= HERO ================= */

.hero-text {
  position: relative;
  overflow: hidden;
  max-width: 1120px; /* Ограничиваем ширину по контейнеру сайта */
  margin: 0 auto; /* Центрируем на десктопе */
  border-radius: 32px; /* Премиальное скругление углов */
  box-shadow: 0 20px 40px rgba(0,0,0,0.06); /* Мягкая тень Apple */
}

.hero-text img {
  width: 100%;
  height: clamp(420px, 65vh, 780px);
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* Мягкое затемнение фона для читаемости без плашки */
  background: radial-gradient(circle at center, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.15) 100%);
}

.hero-copy {
  max-width: 1000px;
  text-align: center;
  padding: 0 20px;
  background: transparent;
  animation: heroTextRise 1s cubic-bezier(.22,1,.36,1) both;
}

.hero-copy h1 {
  font-family: var(--font-rounded);
  color: #ffffff;
  margin: 0 0 18px;
  font-size: clamp(26px, 3.5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.hero-copy p {
  color: #ffffff;
  margin: 0 0 14px;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 400;
  line-height: 1.55;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-copy p:last-child {
  margin-bottom: 0;
}

@keyframes heroTextRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= MAIN ================= */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ================= SECTION TITLE ================= */

.section-title {
  font-family: var(--font-rounded);
  text-align: center;
  font-size: 40px;
  font-weight: 700;
  margin: 80px 0 40px;
  letter-spacing: -0.02em;
  line-height: 1.08;
  background: linear-gradient(
    90deg,
    #32a8ff 0%,
    #8f52ff 35%,
    #e84a7e 65%,
    #32a8ff 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sectionGradientFlow 10s ease-in-out infinite;
  will-change: background-position, opacity, transform;
  text-rendering: optimizeLegibility;
}

@keyframes sectionGradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ================= REVEAL ================= */

.reveal-init {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity .8s ease,
    transform .8s cubic-bezier(.22, 1, .36, 1);
}

.reveal-in {
  opacity: 1;
  transform: translateY(0);
}

.reveal-soft {
  transform: translateY(22px);
}

.reveal-scale {
  transform: translateY(24px) scale(.985);
}

.reveal-in.reveal-scale,
.reveal-in.reveal-soft {
  transform: translate(0,0) scale(1);
}

.delay-1 { transition-delay: .08s; }
.delay-2 { transition-delay: .16s; }
.delay-3 { transition-delay: .24s; }
.delay-4 { transition-delay: .32s; }

/* ================= LESSONS ================= */

.lesson {
  display: flex;
  align-items: center;
  gap: 48px;
  margin: 48px 0;
}

.lesson:nth-child(even) {
  flex-direction: row-reverse;
}

.lesson img {
  width: 50%;
  border-radius: 24px;
  display: block;
  object-fit: cover;
  box-shadow: 0 16px 36px rgba(0,0,0,0.08);
}

.lesson-text {
  width: 50%;
}

.lesson-text h3 {
  font-family: var(--font-rounded);
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #3a3a3c;
}

.lesson-sub {
  display: block;
  font-weight: 500;
  margin-top: 4px;
}

.lesson-text p {
  color: #515154;
  line-height: 1.6;
  margin-bottom: 12px;
}

.lesson-list {
  margin: 10px 0 14px;
  padding-left: 18px;
  color: #515154;
}

.lesson-list li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* ================= FAQ ================= */

details {
  border-bottom: 1px solid #d2d2d7;
  padding: 24px 0;
}

summary {
  font-family: var(--font-rounded);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
  transition: color .25s ease;
  color: #2c2c2e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid #86868b;
  border-bottom: 2px solid #86868b;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-right: 4px;
}

details[open] summary::after {
  transform: rotate(225deg);
  margin-top: 4px;
}

details[open] summary {
  color: #0071e3;
}

details p {
  color: #515154;
  line-height: 1.6;
  margin-top: 16px;
  font-size: 17px;
  padding-right: 32px;
}

/* ================= REVIEWS ================= */

.reviews {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.review {
  border: none;
  border-radius: 24px;
  padding: 32px;
  font-style: normal;
  font-size: 16px;
  color: #1d1d1f;
  line-height: 1.6;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
  display: flex;
  align-items: flex-start;
}

/* ================= CTA ================= */

.cta {
  text-align: center;
  margin: 100px 0;
}

.cta-main {
  display: inline-block;
  padding: 18px 48px;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  border-radius: 999px;
  background: #0071e3;
  margin-bottom: 24px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.cta-main:hover {
  transform: scale(1.02);
  background: #0077ed;
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.3);
}

.cta-main:active {
  transform: scale(0.96);
  box-shadow: 0 0 24px 8px rgba(0, 113, 227, 0.45);
}

.cta-subtext {
  margin: 24px 0 16px;
  font-size: 14px;
  color: #86868b;
}

.cta-secondary {
  display: inline-block;
  padding: 14px 38px;
  font-size: 16px;
  font-weight: 500;
  color: #1d1d1f;
  text-decoration: none;
  border-radius: 999px;
  background: #f5f5f7;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease, background .2s ease;
}

.cta-secondary:hover {
  transform: scale(1.02);
  background: #e8e8ed;
}

.cta-secondary:active {
  transform: scale(0.96);
}

.cta-price-box {
  max-width: 560px;
  margin: 0 auto 32px;
  padding: 32px;
  border-radius: 32px;
  background: #ffffff;
  border: none;
  box-shadow: 0 12px 36px rgba(0,0,0,0.06);
}

.cta-price-label {
  font-size: 15px;
  font-weight: 600;
  color: #86868b;
  letter-spacing: .01em;
  margin-bottom: 8px;
}

.cta-price-sub {
  margin-top: 8px;
  font-size: 19px;
  font-weight: 600;
  color: #1d1d1f;
}

.cta-price-value {
  margin-top: 18px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0071e3;
}

/* ================= FOOTER ================= */

.footer {
  background: #f5f5f7;
  padding: 48px 20px;
  font-size: 14px;
  border-top: none;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-mail {
  color: #1d1d1f;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
}

.footer-socials {
  display: flex;
  gap: 16px;
}

.footer-socials img {
  width: 24px;
  height: 24px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer-socials a:hover img {
  opacity: 1;
}

/* ================= COVERFLOW ================= */

.more-courses {
  margin-top: 80px;
  overflow: visible;
}

.more-courses .section-title {
  position: relative;
  z-index: 2;
}

.coverflow {
  --card-w: 250px;
  --card-h: 170px;

  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding: 28px 0 34px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  perspective: 1400px;
}

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

.coverflow::before,
.coverflow::after {
  content: "";
  flex: 0 0 calc(50% - (var(--card-w) / 2));
}

.coverflow-item {
  position: relative;
  flex: 0 0 auto;
  width: var(--card-w);
  height: var(--card-h);
  margin: 0 -22px;
  border-radius: 22px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(0,0,0,.12);
  transform-origin: center center;
  transition:
    transform .36s ease,
    opacity .36s ease,
    box-shadow .36s ease;
  will-change: transform;
  scroll-snap-align: center;
  background: #ffffff;
}

.coverflow-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* === ДОБАВЛЕНО ЗАТЕМНЕНИЕ НИЗА === */
.coverflow-item::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Градиент от черного (с альфа 0.6) снизу до прозрачного на 40% высоты */
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 40%);
  z-index: 1; /* Поднимаем над картинкой */
  display: block; /* Включаем отображение (раньше было display: none) */
  pointer-events: none; /* Чтобы градиент не мешал кликам */
}

.coverflow-item .title {
  font-family: var(--font-rounded);
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 2; /* Поднимаем над градиентом */
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  /* Тень текста тоже оставляем для максимального контраста */
  text-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.coverflow-item.is-active {
  transform: translateZ(0) rotateY(0deg) scale(1.04);
  filter: none;
  opacity: 1;
  box-shadow: 0 24px 48px rgba(0,0,0,.15);
  z-index: 5;
}

.coverflow-item.is-left-1 {
  transform: rotateY(32deg) scale(.92);
  filter: none;
  opacity: 1;
  z-index: 4;
}

.coverflow-item.is-right-1 {
  transform: rotateY(-32deg) scale(.92);
  filter: none;
  opacity: 1;
  z-index: 4;
}

.coverflow-item.is-left-2 {
  transform: rotateY(44deg) scale(.84);
  filter: none;
  opacity: 1;
  z-index: 3;
}

.coverflow-item.is-right-2 {
  transform: rotateY(-44deg) scale(.84);
  filter: none;
  opacity: 1;
  z-index: 3;
}

.coverflow-item.is-far {
  transform: scale(.8);
  filter: none;
  opacity: 1;
  z-index: 2;
}

.coverflow-hint {
  text-align: center;
  color: #86868b;
  font-size: 14px;
  margin-top: 8px;
}

/* ================= MOBILE ================= */

@media (max-width: 820px) {

  .hero-tagline {
    font-size: 22px;
    padding: 0 18px;
  }

  .hero-text {
    margin: 0 16px; 
    border-radius: 24px; 
  }

  .hero-text img {
    height: clamp(520px, 70vh, 900px);
  }

  .hero-copy h1 {
    font-size: 22px !important;
  }

  .hero-copy p {
    font-size: 15px !important;
  }

  .lesson {
    flex-direction: column !important;
  }

  .lesson img,
  .lesson-text {
    width: 100%;
  }

  .reviews {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 30px;
  }

  .cta-price-box {
    max-width: 100%;
    margin: 0 auto 24px;
    padding: 24px 18px 22px;
    border-radius: 22px;
  }

  .cta-price-sub {
    font-size: 16px;
  }

  .cta-price-value {
    font-size: clamp(34px, 9vw, 46px);
  }

  .coverflow {
    --card-w: 170px;
    --card-h: 220px;
    padding: 20px 0 24px;
  }

  .coverflow-item {
    margin: 0 -12px;
    border-radius: 18px;
  }

  .coverflow-item .title {
    left: 10px;
    right: 10px;
    bottom: 10px;
    font-size: 13px;
  }

  .coverflow-item.is-active {
    transform: scale(1.03);
  }

  .coverflow-item.is-left-1 {
    transform: rotateY(22deg) scale(.91);
  }

  .coverflow-item.is-right-1 {
    transform: rotateY(-22deg) scale(.91);
  }

  .coverflow-item.is-left-2 {
    transform: rotateY(30deg) scale(.84);
  }

  .coverflow-item.is-right-2 {
    transform: rotateY(-30deg) scale(.84);
  }
}

/* ================= REDUCED MOTION ================= */

@media (prefers-reduced-motion: reduce) {
  .hero-copy,
  .section-title,
  .reveal-init,
  .hero-tagline,
  .cta-main,
  .cta-secondary,
  .coverflow-item {
    animation: none !important;
    transition: none !important;
  }

  .reveal-init {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Анимация для текста в Hero */
.hero-copy h1 {
  opacity: 0;
  animation: heroFadeIn 1s cubic-bezier(.22, 1, .36, 1) 0.2s forwards;
}

.hero-copy p:nth-of-type(1) {
  opacity: 0;
  animation: heroFadeIn 1s cubic-bezier(.22, 1, .36, 1) 0.4s forwards;
}

.hero-copy p:nth-of-type(2) {
  opacity: 0;
  animation: heroFadeIn 1s cubic-bezier(.22, 1, .36, 1) 0.6s forwards;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= DARK MODE (AUTO) ================= */

@media (prefers-color-scheme: dark) {
  body {
    background: #0a0a0c;
    color: #f5f5f7;
  }

  .hero-text {
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  }

  .lesson-text h3 {
    color: #f5f5f7;
  }

  .lesson-text p,
  .lesson-list {
    color: #c7c7cc;
  }

  details {
    border-bottom-color: #38383a;
  }

  summary {
    color: #f5f5f7;
  }

  summary::after {
    border-color: #98989d;
  }

  details[open] summary {
    color: #409cff;
  }

  details p {
    color: #c7c7cc;
  }

  .review {
    background: #1c1c1e;
    color: #f5f5f7;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }

  .cta-main {
    background: #409cff;
  }

  .cta-main:hover {
    background: #5aa9ff;
  }

  .cta-subtext {
    color: #98989d;
  }

  .cta-secondary {
    background: #2c2c2e;
    color: #f5f5f7;
  }

  .cta-secondary:hover {
    background: #3a3a3c;
  }

  .cta-price-box {
    background: #1c1c1e;
    box-shadow: 0 12px 36px rgba(0,0,0,0.3);
  }

  .cta-price-label {
    color: #98989d;
  }

  .cta-price-sub {
    color: #f5f5f7;
  }

  .footer {
    background: #1c1c1e;
  }

  .footer-mail {
    color: #f5f5f7;
  }

  .footer-disclaimer {
    color: #98989d;
  }

  .coverflow-item {
    background: #1c1c1e;
    box-shadow: 0 16px 34px rgba(0,0,0,.4);
  }

  .coverflow-hint {
    color: #98989d;
  }
}