/* =========================================================
   1. СБРОС И БАЗОВЫЕ ПРАВИЛА
   ========================================================= */
html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

/* =========================================================
   2. HERO-БАННЕР
   ========================================================= */
.hero-banner {
  min-height: 80vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  position: relative;
  padding-left: 0;
  padding-right: 0;
}

.hero-banner .container { flex: 1; }

.hero-content {
  max-width: 650px;
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1.25;
}

/* ФОНОВОЕ ВИДЕО В HERO */
.hero-video-wrapper {
  position: relative;
  overflow: hidden;
  background-color: #f3f2f7;
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  z-index: 0;
}

.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(243, 242, 247, 0.48) 0%,
    rgba(219, 234, 254, 0.32) 45%,
    rgba(243, 242, 247, 0.15) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.hero-video-wrapper .hero-content {
  position: relative;
  z-index: 2;
}

@media (max-width: 767.98px) {
  .hero-video { display: none; }
  .hero-video-wrapper {
    background-image: url('../img/hero.jpg');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: cover;
  }
}

#tw1 { min-height: 3.3em; line-height: 1.1; }
#tw2 { min-height: 2.5em; line-height: 1.25; }

/* =========================================================
   3. БАЗОВАЯ КАРТОЧКА (algo-card)
   ========================================================= */
.algo-card {
  position: relative;
  height: 100%;
  border-radius: 20px;
  overflow: visible;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.08);
}

.algo-card--gray  { background: #f1f3f5; color: #212529; }
.algo-card--blue  { background: #dbeafe; color: #1e3a8a; }
.algo-card--white { background: #ffffff; color: #212529; }

/* =========================================================
   4. ИЗОБРАЖЕНИЯ КАРТОЧЕК (верхний «вылет»)
   ========================================================= */
.algo-card__img {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  height: auto;
}

.algo-card--s1 { padding: 95px 10px 28px; }
.algo-card--s1 .algo-card__img { top: -70px; width: 150px; max-width: 70%; }

.algo-card--s2 { padding: 130px 30px 30px; }
.algo-card--s2 .algo-card__img { top: -110px; width: 200px; max-width: 280px; }

.algo-card--s3 { padding: 85px 22px 28px; }
.algo-card--s3 .algo-card__img { top: -45px; width: 100px; max-width: 50%; }

.algo-card--s3 {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  cursor: pointer;
}

.algo-card--s3 .algo-card__img {
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center bottom;
}

.algo-card--s3:hover {
  transform: translateY(-6px);
}

.algo-card--s3:hover .algo-card__img {
  transform: translateX(-50%) scale(1.09);
}

.algo-card--stacked { padding: 0 22px 28px; }
.algo-card--stacked .algo-card__img-stacked {
  width: calc(100% + 44px);
  height: 500px;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
  margin: -22px -22px 20px -22px;
}

/* =========================================================
   5. БЕЙДЖИ И МЕЛКИЕ ЭЛЕМЕНТЫ
   ========================================================= */
   .algo-badge-top {
     position: absolute;
     top: -18px;
     right: 24px;
     z-index: 3;
     box-shadow: 0 8px 18px rgba(220, 53, 69, 0.35);
     transform: scale(1); /* или вообще без scale для всех остальных экранов */
   }

   /* Только для XL (≥1200px) */
   @media (min-width: 1200px) {
     .algo-badge-top {
       transform: scale(2);
     }
   }

.algo-card__photo-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
}

.algo-mark {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  font-size: 0.9rem;
}

.algo-eyebrow {
  letter-spacing: 2px;
  font-size: 0.85rem;
}

/* =========================================================
   6. АНИМАЦИИ
   ========================================================= */
.tw-cursor {
  display: inline-block;
  font-weight: 100;
  color: #dc3545;
  margin-left: 3px;
  animation: twBlink 0.7s infinite;
}
@keyframes twBlink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.anim-rocket {
  animation: rocketFly 3s ease-in-out infinite;
  transform-origin: center center;
}
@keyframes rocketFly {
  0%, 100% { transform: translateX(-50%) translateY(0)     rotate(-2deg); }
  50%      { transform: translateX(-50%) translateY(-18px) rotate(3deg);  }
}

.anim-heart {
  animation: heartPulse 1.4s ease-in-out infinite;
  transform-origin: center center;
}
@keyframes heartPulse {
  0%, 100% { transform: translateX(-50%) scale(1);    }
  25%      { transform: translateX(-50%) scale(1.12); }
  35%      { transform: translateX(-50%) scale(1);    }
  45%      { transform: translateX(-50%) scale(1.08); }
  55%      { transform: translateX(-50%) scale(1);    }
}

.anim-building { animation: buildingShine 4s ease-in-out infinite; }
@keyframes buildingShine {
  0%, 100% {
    transform: translateX(-50%);
    filter: brightness(1) drop-shadow(0 0 0 transparent);
  }
  45%, 55% {
    transform: translateX(-50%);
    filter: brightness(1.15) drop-shadow(0 0 12px rgba(255, 200, 50, 0.35));
  }
}

.btn-shine {
  position: relative;
  display: inline-block !important;
  width: auto !important;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 25%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 100%
  );
  transform: skewX(-20deg);
  animation: btnShine 3.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btnShine {
  0%        { left: -100%; }
  50%, 100% { left: 130%;  }
}

.btn-shine:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(220, 53, 69, 0.4) !important;
}
.btn-shine:hover::before { animation-duration: 1.5s; }

.algo-card:hover .anim-shake-no {
  animation: shakeNo 1s ease-in-out 3;
}
@keyframes shakeNo {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  15% { transform: translateX(-50%) rotate(-6deg); }
  35% { transform: translateX(-50%) rotate(5deg);  }
  55% { transform: translateX(-50%) rotate(-4deg); }
  75% { transform: translateX(-50%) rotate(3deg);  }
}

.algo-card:hover .anim-nod-yes {
  animation: nodYes 1s ease-in-out 3;
}
@keyframes nodYes {
  0%, 100% { transform: translateX(-50%) translateY(0)      scale(1);    }
  20% { transform: translateX(-50%) translateY(-12px) scale(1.05); }
  45% { transform: translateX(-50%) translateY(0)      scale(1);    }
  65% { transform: translateX(-50%) translateY(-9px)  scale(1.03); }
  85% { transform: translateX(-50%) translateY(0)      scale(1);    }
}

/* =========================================================
   7. ПОЯВЛЕНИЕ ПРИ ПРОКРУТКЕ (scroll-reveal)
   ========================================================= */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.scroll-reveal.revealed {
  opacity: 1;
  transform: none;
}

.scroll-reveal .algo-card {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-reveal.revealed .algo-card {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal.revealed .algo-card:nth-of-type(1) { transition-delay: 0.1s;  }
.scroll-reveal.revealed .algo-card:nth-of-type(2) { transition-delay: 0.25s; }
.scroll-reveal.revealed .algo-card:nth-of-type(3) { transition-delay: 0.4s;  }
.scroll-reveal.revealed .algo-card:nth-of-type(4) { transition-delay: 0.55s; }
.scroll-reveal.revealed .algo-card:nth-of-type(5) { transition-delay: 0.7s;  }
.scroll-reveal.revealed .algo-card:nth-of-type(6) { transition-delay: 0.85s; }

/* =========================================================
   8. СЕКЦИЯ «ОЛИМПИАДЫ И ВУЗЫ»
   ========================================================= */
@media (min-width: 768px) {
  .uni-section-bg {
    /*
    background-image:
      linear-gradient(
        rgba(255, 255, 255, 0.8),
        rgba(170, 170, 170, 0.8)
      ),
      url('../img/section6.png');*/
      background-image:
        linear-gradient(
          rgba(255, 255, 255, 0.7),
          rgba(217, 236, 255, 0.9)
        ),
        url('../img/section6.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
  }
}

.uni-chips-scroll::-webkit-scrollbar { height: 6px; }
.uni-chips-scroll::-webkit-scrollbar-track { background: transparent; }
.uni-chips-scroll::-webkit-scrollbar-thumb {
  background: #dbeafe;
  border-radius: 10px;
}
.uni-chips-scroll::-webkit-scrollbar-thumb:hover { background: #1e3a8a; }

.marquee-wrapper {
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 0;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
}

.marquee-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: marqueeScroll 35s linear infinite;
}

.marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-content {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 767.98px) {
  .marquee-wrapper {
    mask-image: none;
    -webkit-mask-image: none;
  }
  .marquee-track { animation-duration: 20s; }
}

/* =========================================================
   9. HERO — РАЗБИВКА ПО BREAKPOINTS
   ========================================================= */
@media (min-width: 576px) {
  .hero-banner { padding-left: 1rem; padding-right: 1rem; }
}
@media (min-width: 768px) {
  .hero-banner {
    padding-left: 2rem;  padding-right: 2rem;
    padding-top:  5rem;  padding-bottom: 5rem;
  }
}
@media (min-width: 992px) {
  .hero-banner {
    padding-left: 3rem;  padding-right: 3rem;
    padding-top:  6rem;  padding-bottom: 6rem;
  }
}
@media (min-width: 1200px) {
  .hero-banner {
    padding-left: 4rem;  padding-right: 4rem;
    padding-top:  7rem;  padding-bottom: 7rem;
  }
}
@media (min-width: 1400px) {
  .hero-banner {
    padding-left: 8rem;  padding-right: 8rem;
    padding-top:  8rem;  padding-bottom: 8rem;
  }
}

/* =========================================================
   10. МОБИЛЬНАЯ АДАПТАЦИЯ — БАЗА (max-width: 767.98px)
   ========================================================= */
@media (max-width: 767.98px) {
  body {
    background-image: url('/images/background/bg.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;
  }
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    z-index: -1;
    pointer-events: none;
  }

  .mt-5, .my-5, .mb-5 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
  .pt-5, .py-5, .pb-5 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
  .mt-4, .my-4, .mb-4 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
  .pt-4, .py-4, .pb-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .mt-3, .my-3, .mb-3 { margin-top: 0.75rem !important; margin-bottom: 0.75rem !important; }

  .algo-card--s1 { padding: 45px 15px 18px; }
  .algo-card--s1 .algo-card__img { top: -35px; width: 80px; }

  .algo-card--s2 { padding: 65px 18px 22px; }
  .algo-card--s2 .algo-card__img { top: -45px; width: 110px; }

  .algo-card--s3 { padding: 40px 15px 18px; }
  .algo-card--s3 .algo-card__img { top: -25px; width: 60px; }

  .algo-card--stacked { padding: 0 15px 18px; }
  .algo-card--stacked .algo-card__img-stacked {
    height: 340px;
    margin: -15px -15px 12px -15px;
    width: calc(100% + 30px);
  }

  .algo-badge-top { top: -14px; right: 14px; }
  .algo-card__photo-badge { top: 14px; right: 14px; }

  .hero-banner {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    padding: 0;
    background-image: none !important;
  }
  .hero-banner .container { width: 100%; }

  .hero-content {
    max-width: none;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    text-align: center;
  }
  #tw1 { min-height: 7.5rem; }
  #tw2 { min-height: 4.5rem; }

  .hero-content .btn {
    padding: 0.6rem 1.2rem !important;
    font-size: 1rem !important;
  }
  .hero-content .btn span.rocket { margin-left: 0 !important; }

  @keyframes rocketFly {
    0%, 100% { transform: translateX(-50%) translateY(0)     rotate(-2deg); }
    50%      { transform: translateX(-50%) translateY(-10px) rotate(2deg);  }
  }
  @keyframes heartPulse {
    0%, 100% { transform: translateX(-50%) scale(1);    }
    50%      { transform: translateX(-50%) scale(1.08); }
  }
}

/* =========================================================
   11. АНИМАЦИЯ ПАРЕНИЯ КАРТОЧЕК ЦЕН
   ========================================================= */
.float-anim {
  animation: floatCard 4.5s ease-in-out infinite;
  will-change: transform;
}

.float-anim--delayed { animation-delay: -2.25s; }

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

.float-anim:hover {
  animation-play-state: paused;
  transform: translateY(-8px) scale(1.02);
  transition: transform 0.35s ease;
}

.price-display {
  font-size: clamp(4rem, 11vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.price-display .price-currency {
  font-size: 0.42em;
  vertical-align: super;
  font-weight: 700;
  opacity: 0.9;
  margin-left: 4px;
}

/* MEDIA QUERY ДЛЯ MD И ВЫШЕ (≥768px) — УВЕЛИЧИВАЕМ В 2 РАЗА */
@media (max-width: 768px) {
  .price-display {
    font-size: clamp(8rem, 22vw, 14rem); /* Было 4rem → 8rem, 11vw → 22vw, 7rem → 14rem */
  }
}

.price-block { padding: 3.5rem 1.5rem 3rem !important; }

/* =========================================================
   12. ЭФФЕКТ УМЕНЬШЕНИЯ ФОТО В КАРТОЧКАХ ВОЗРАСТНЫХ ГРУПП
   ========================================================= */
   .algo-card--stacked { overflow: hidden; }

   .algo-card--stacked .algo-card__img-stacked {
     transition: transform 0.6s ease, filter 0.6s ease;
   }

   .algo-card--stacked:hover .algo-card__img-stacked {
     transform: scale(1.06);
     filter: brightness(0.85) contrast(1.05);
   }
