/* ════════════════════════════════════════════════════════════════
   EduGuard MOTION qatlami (2026-08-30, egasi so'radi).
   Shablon (New Age) fayllariga tegilmagan — hamma harakat shu yerda.

   Uch qavat:
     1. Reveal — bo'limlar skrollda yumshoq kirib keladi (IO).
     2. Scrollytelling — yopishqoq telefon, 4 bob: har bobda ekran
        almashadi va matn tushuntiradi.
     3. Ambient — skroll to'xtaganda ham sahifa «nafas oladi»
        (hero telefonining suzishi).

   ⚠️ prefers-reduced-motion — birinchi darajali fuqaro: hamma
      harakat o'chadi, kontent DOIM ko'rinadi (animatsiya ortida
      yashiringan matn yo'q).
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Reveal ─────────────────────────────────────────────────── */
/* ⚠️ FAIL-SAFE: yashirish faqat JS o'zini tasdiqlagach (.js-motion)
   ishlaydi. JS o'chiq/yiqilgan bo'lsa sahifa ODDIY ko'rinadi —
   kontent hech qachon animatsiya ortida qolib ketmaydi. */
.js-motion [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1),
              transform .7s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.js-motion [data-reveal].in {
  opacity: 1;
  transform: none;
}

/* ── 2. Scrollytelling («Ilova ichida sayohat») ────────────────── */
.story {
  background: #0B1B4D;
  color: #fff;
}
.story .story-head {
  text-align: center;
  padding: 5rem 1.5rem 1rem;
}
.story .story-head h2 {
  font-family: Newsreader, serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
}
.story .story-head p {
  color: #9FB4E8;
  max-width: 560px;
  margin: 1rem auto 0;
}

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 2rem;
}

/* Yopishqoq telefon: bo'limlar o'tganda joyida turadi */
.story-device-col { position: relative; }
.story-device-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-phone {
  width: min(300px, 68vw);
  aspect-ratio: 1080 / 2280;
  border-radius: 2.4rem;
  border: 7px solid #060E2B;
  box-shadow: 0 30px 80px rgba(0,0,0,.55),
              0 0 0 1px rgba(255,255,255,.08);
  overflow: hidden;
  position: relative;
  background: #000;
  transform: translateY(calc(var(--drift, 0) * 1px));
}
.story-phone .scr {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .55s ease;
}
.story-phone .scr.on { opacity: 1; }
.story-phone .scr img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* AI bobi — ekran ichida HTML chat (skrinshot emas, lekin matni
   ilovadagi HAQIQIY oqimni takrorlaydi) */
.scr-ai {
  background: #F6F7FB;
  padding: 14% 7% 0;
  font-size: clamp(9px, 2.6vw, 13px);
}
.scr-ai .bar {
  background: #0A3ED6;
  color: #fff;
  border-radius: 12px;
  padding: 8% 6%;
  font-weight: 700;
  margin-bottom: 8%;
}
.scr-ai .b {
  border-radius: 14px;
  padding: 6% 7%;
  margin-bottom: 6%;
  line-height: 1.45;
  max-width: 88%;
}
.scr-ai .me {
  background: #0A3ED6;
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.scr-ai .bot {
  background: #fff;
  color: #16233A;
  box-shadow: 0 1px 4px rgba(22,35,58,.10);
  border-bottom-left-radius: 4px;
}
.scr-ai .pdf {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #D9E1F2;
  border-radius: 12px;
  padding: 5% 7%;
  color: #16233A;
  font-weight: 700;
  width: 88%;
}
.scr-ai .pdf .ic {
  background: #DE4242;
  color: #fff;
  border-radius: 8px;
  padding: 4px 7px;
  font-size: .8em;
}

/* Boblar ustuni */
.story-steps { padding: 18vh 0 20vh; }
.story-step {
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: .28;
  transition: opacity .45s ease;
}
.story-step.on { opacity: 1; }
.story-step .kicker {
  color: #6FA0FF;
  font-weight: 800;
  letter-spacing: .12em;
  font-size: .8rem;
  text-transform: uppercase;
  margin-bottom: .8rem;
}
.story-step h3 {
  font-family: Newsreader, serif;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  margin-bottom: 1rem;
}
.story-step p { color: #C4D2F2; margin-bottom: 1.2rem; }
.story-step ul { list-style: none; padding: 0; margin: 0; }
.story-step li {
  padding-left: 1.6rem;
  position: relative;
  margin-bottom: .55rem;
  color: #E6EDFC;
}
.story-step li::before {
  content: "";
  position: absolute;
  left: 0; top: .42em;
  width: .8rem; height: .8rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #3D9BFF, #0A3ED6);
}

/* Kichik ekranda telefon har bob ichida ko'rinadi (sticky emas) */
.story-step .inline-shot { display: none; }
@media (max-width: 991px) {
  .story-grid { grid-template-columns: 1fr; }
  .story-device-col { display: none; }
  .story-steps { padding: 2rem 0 4rem; }
  .story-step { min-height: 0; margin-bottom: 3.5rem; opacity: 1; }
  .story-step .inline-shot {
    display: block;
    width: min(260px, 70vw);
    border-radius: 1.6rem;
    border: 5px solid #060E2B;
    margin: 0 0 1.2rem;
    box-shadow: 0 16px 40px rgba(0,0,0,.4);
  }
}

/* ── 3. Ambient: hero telefoni suzadi ──────────────────────────── */
@keyframes eg-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.masthead .device-wrapper {
  animation: eg-float 7s ease-in-out infinite;
}

/* ── Reduced motion: hammasi tinch, hammasi ko'rinadi ──────────── */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important;
    transition: none !important; }
  .story-step { opacity: 1 !important; }
  .story-phone .scr { transition: none !important; }
  .masthead .device-wrapper { animation: none !important; }
}
