/* MICE — motion layer (UI/UX animation). Loaded after cinematic.css / cinematic-inner.css.
   Rules: content is visible by default; every effect is decorative; reduced motion switches it off. */

:root { --mo-gold: #023EBA; --mo-ease: cubic-bezier(.22, .8, .24, 1); }

/* ---------- Smooth anchors ---------- */
@media (prefers-reduced-motion: no-preference) {
  html {  }
}

/* ---------- Scroll progress bar ---------- */
.mo-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1100;
  background: linear-gradient(90deg, var(--mo-gold), #00B4D8);
  transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none; will-change: transform;
}

/* ---------- Header: compacts and blurs after scrolling ---------- */
body.cinematic-home .site-header { transition: background-color .35s ease, box-shadow .35s ease, padding .35s ease; }
body.cinematic-home .site-header.mo-scrolled {
  background: rgba(244, 251, 254, .82) !important;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(3, 4, 94, .12);
}
body.cinematic-home .site-header .brand img { transition: transform .35s var(--mo-ease); }
body.cinematic-home .site-header.mo-scrolled .brand img { transform: scale(.88); }

/* ---------- Nav links: gold underline grows on hover ---------- */
body.cinematic-home .nav-links > a { position: relative; }
body.cinematic-home .nav-links > a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--mo-gold); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .35s var(--mo-ease);
}
body.cinematic-home .nav-links > a:not(.btn):hover::after { transform: scaleX(1); }

/* ---------- Buttons: lift, glow, press ---------- */
body.cinematic-home .btn { transition: transform .3s var(--mo-ease), box-shadow .3s ease, background-color .3s ease, border-color .3s ease, color .3s ease; }
body.cinematic-home .btn:hover { transform: translateY(-3px); }
body.cinematic-home .btn:active { transform: translateY(0) scale(.97); }
body.cinematic-home .btn.primary:hover,
body.cinematic-home .btn.whatsapp:hover,
body.cinematic-home .hero-actions .btn:first-child:hover { box-shadow: 0 12px 34px rgba(251, 176, 45, .5); }
body.cinematic-home .btn.secondary:hover { border-color: var(--mo-gold) !important; color: var(--mo-gold) !important; }
body.cinematic-home .btn.primary { position: relative; overflow: hidden; }
body.cinematic-home .btn.primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%); pointer-events: none;
}
body.cinematic-home .btn.primary:hover::after { transform: translateX(120%); transition: transform .8s ease; }

/* ---------- Cards: lift + gold border + cursor spotlight ---------- */
body.cinematic-home .course-card,
body.cinematic-inner .cast-grid article,
body.cinematic-inner .showtimes li,
body.cinematic-inner .lookup-card,
body.cinematic-inner .course-band,
body.cinematic-home .proof-grid article,
body.cinematic-home .batch-timetable > * {
  position: relative;
  transition: transform .45s var(--mo-ease), border-color .35s ease, box-shadow .45s ease;
}
body.cinematic-inner .cast-grid article:hover,
body.cinematic-inner .showtimes li:hover { transform: translateY(-6px); border-color: var(--mo-gold) !important; box-shadow: 0 18px 44px rgba(3, 4, 94, .14); }
body.cinematic-home .course-card:hover { box-shadow: 0 22px 50px rgba(3, 4, 94, .14); }
.mo-glow {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; z-index: 1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 180, 216, .16), transparent 45%);
  transition: opacity .35s ease;
}
.mo-spot:hover > .mo-glow { opacity: 1; }

/* ---------- Staggered reveal for grids (only while scroll-reveal is active) ---------- */
body.cine-motion-ready [data-cine-reveal]:not(.is-visible) .mo-stagger > * { opacity: 0; transform: translateY(26px); }
.mo-stagger > * { transition: opacity .8s var(--mo-ease), transform .8s var(--mo-ease); transition-delay: calc(var(--mo-i, 0) * 90ms); }

/* ---------- Gold accent words: slow shimmer ---------- */
@media (prefers-reduced-motion: no-preference) {
  body.cinematic-home h1 em, body.cinematic-home h2 em {
    background: linear-gradient(100deg, #023EBA 20%, #00B4D8 45%, #023EBA 70%);
    background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: moShimmer 7s ease-in-out infinite;
  }
  /* outlined title word on course pages keeps its outline style */
  body.cinematic-inner .course-detail-title h1 em { background: none; -webkit-text-fill-color: transparent; animation: none; }
}
@keyframes moShimmer { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

/* ---------- Film grain (very subtle, static) ---------- */
body.cinematic-home::after {
  content: ""; position: fixed; inset: 0; z-index: 4; pointer-events: none; opacity: .03; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Hero parallax (JS sets --mo-parallax) ---------- */
body.cinematic-home .hero-media img { translate: 0 var(--mo-parallax, 0px); }

/* ---------- Floating "back to top" ---------- */
.mo-top {
  position: fixed; right: 20px; bottom: 90px; z-index: 900; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(3, 4, 94, .35);
  background: rgba(244, 251, 254, .85); color: #03045E; font-size: 1.2rem; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .3s ease, transform .3s var(--mo-ease), visibility .3s, border-color .3s, color .3s;
}
.mo-top.is-on { opacity: 1; visibility: visible; transform: none; }
.mo-top:hover { border-color: var(--mo-gold); color: var(--mo-gold); }
@media (min-width: 861px) { .mo-top { bottom: 28px; } }

/* ---------- Touch devices: no hover lifts ---------- */
@media (hover: none) {
  body.cinematic-home .btn:hover { transform: none; }
  body.cinematic-inner .cast-grid article:hover, body.cinematic-inner .showtimes li:hover { transform: none; }
}

/* ---------- Reduced motion: everything off ---------- */
@media (prefers-reduced-motion: reduce) {
  .mo-progress { display: none; }
  .mo-stagger > * { transition: none !important; opacity: 1 !important; transform: none !important; }
  body.cinematic-home .btn, body.cinematic-home .btn::after, body.cinematic-home .site-header,
  body.cinematic-home .course-card, body.cinematic-inner .cast-grid article, body.cinematic-inner .showtimes li { transition: none !important; }
  body.cinematic-home .hero-media img { translate: none; }
}

/* =====================================================================
   Stronger, clearly visible motion (v2)
   ===================================================================== */

/* Hero entrance: each line comes in sharp from blur */
@media (prefers-reduced-motion: no-preference) {
  body.cinematic-home .hero-copy > * { animation: moHeroIn 1.1s var(--mo-ease) both !important; }
  body.cinematic-home .hero-copy > .eyebrow { animation-delay: .15s !important; }
  body.cinematic-home .hero-copy > h1 { animation: none !important; }
  body.cinematic-home .hero h1 > * { display: block; animation: moHeroIn 1.2s var(--mo-ease) both; }
  body.cinematic-home .hero h1 > :nth-child(1) { animation-delay: .3s; }
  body.cinematic-home .hero h1 > :nth-child(2) { animation-delay: .5s; }
  body.cinematic-home .hero h1 > :nth-child(3) { animation-delay: .75s; }
  body.cinematic-home .hero-copy > .hero-text { animation-delay: 1s !important; }
  body.cinematic-home .hero-copy > .hero-actions { animation-delay: 1.2s !important; }

  /* Slow gold light beam sweeping over the hero photo */
  body.cinematic-home .hero-media::after {
    content: ""; position: absolute; inset: -10% -30%; pointer-events: none; mix-blend-mode: screen;
    background: linear-gradient(105deg, transparent 42%, rgba(0, 180, 216, .22) 50%, transparent 58%);
    animation: moBeam 9s ease-in-out infinite alternate;
  }
}
@keyframes moHeroIn { from { opacity: 0; transform: translateY(46px); filter: blur(12px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes moBeam { from { transform: translateX(-55%); } to { transform: translateX(55%); } }

/* Scroll cue at the bottom of the hero */
.mo-scroll-cue {
  position: absolute; left: 50%; bottom: 26px; z-index: 3; width: 26px; height: 44px; margin-left: -13px;
  border: 1.5px solid rgba(3, 4, 94, .6); border-radius: 14px; pointer-events: none;
}
.mo-scroll-cue::after {
  content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--mo-gold);
  animation: moCue 1.7s ease-in-out infinite;
}
@keyframes moCue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(16px); opacity: 0; } 100% { opacity: 0; } }
@media (max-width: 860px) { .mo-scroll-cue { display: none; } }

/* Headings wipe in, labels slide in, photos zoom out into place (only while scroll-reveal is active) */
body.cine-motion-ready [data-cine-reveal]:not(.is-visible) h2 { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateX(-24px); }
body.cine-motion-ready [data-cine-reveal]:not(.is-visible) .eyebrow { opacity: 0; transform: translateX(-30px); }
[data-cine-reveal] h2 { clip-path: inset(0 0 0 0); transition: opacity .9s var(--mo-ease), clip-path 1.1s var(--mo-ease), transform .9s var(--mo-ease); }
[data-cine-reveal] .eyebrow { transition: opacity .7s var(--mo-ease), transform .7s var(--mo-ease); }
body.cine-motion-ready [data-cine-reveal]:not(.is-visible) figure img { transform: scale(1.18); }
[data-cine-reveal] figure img { transition: transform 1.8s var(--mo-ease); }

/* Bigger grid entrance */
body.cine-motion-ready [data-cine-reveal]:not(.is-visible) .mo-stagger > * { opacity: 0; transform: translateY(52px) scale(.94); }

/* 3D tilt on cards (desktop pointer only; JS sets --rx / --ry) */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .mo-spot:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-8px) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .mo-scroll-cue::after { animation: none; }
  [data-cine-reveal] h2, [data-cine-reveal] .eyebrow, [data-cine-reveal] figure img { transition: none !important; clip-path: none !important; }
}
