/* RIIM Pune · PGDM + SAP (CXO edition) · motion layer
   Calm, corporate motion for a higher-ed admissions page. Rules from riim-design-pattern.md section 8:
   entrances fade up 16px over 500ms, once per element, 80ms apart; hovers 150-250ms; no bounce or spin;
   prefers-reduced-motion turns all of it off. Each motion has a teaching job:
   - section heads and their cards arrive as you reach them, so the page reads one idea at a time
   - the semester rail draws down: two years, step by step
   - the admission connectors draw left to right: six steps, in order
   - the hero photo settles once on load
   Nothing here hides content without script: js/motion.js adds .rv-on and tags only what is still below the fold. */

/* ---------- reveal on arrival (js/motion.js tags [data-rv] and adds .is-in once) ---------- */
.rv-on [data-rv] { opacity: 0; transform: translateY(16px); }
.rv-on [data-rv].is-in {
  opacity: 1; transform: none;
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
  transition-delay: calc(var(--rv-i, 0) * 80ms);
}

/* photographs: the frame arrives with its group; the picture inside settles from 1.04 (overflow is clipped by the frame) */
.rv-on [data-rv-photo] img { transform: scale(1.04); }
.rv-on [data-rv-photo].is-in img { transform: none; transition: transform 1100ms cubic-bezier(.22,1,.36,1); }

/* ---------- Learning journey: the yellow rail draws down, one semester after another ---------- */
.rv-on .semesters[data-rv-draw] .sem-rail b { transform: scaleY(0); transform-origin: 50% 0; }
.rv-on .semesters[data-rv-draw] .sem-rail i { opacity: 0; transform: scale(.6); }
.rv-on .semesters.is-drawn .sem-rail i {
  opacity: 1; transform: none;
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
  transition-delay: calc(var(--rv-i, 0) * 320ms + 150ms);
}
.rv-on .semesters.is-drawn .sem-rail b {
  transform: none;
  transition: transform 420ms var(--ease);
  transition-delay: calc(var(--rv-i, 0) * 320ms + 300ms);
}

/* ---------- Admission process: each connector draws to the next step ---------- */
.rv-on .steps[data-rv-draw] .step::before { transform: scaleX(0); transform-origin: 0 50%; }
.rv-on .steps.is-drawn .step::before {
  transform: none;
  transition: transform 360ms var(--ease);
  transition-delay: calc(var(--rv-i, 0) * 120ms + 260ms);
}

/* ---------- once on load ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* the hero photo settles inside its frame while the form and text fade up (styles.css .enter) */
  .hero-photo img { animation: rv-settle 1100ms cubic-bezier(.22,1,.36,1) both; }
}
@keyframes rv-settle { from { transform: scale(1.05); } }

/* ---------- hover and press (150-250ms, no bounce) ---------- */
.btn:active { transform: translateY(1px) scale(.985); transition-duration: 90ms; }
/* the CTC markers used an overshooting curve (a bounce); the design pattern rules bounce out */
.pl-marker { transition-timing-function: cubic-bezier(.22,1,.36,1); }
@media (hover: hover) and (pointer: fine) {
  .sap-photo img, .video-feature > img { transition: transform 600ms var(--ease); }
  .sap-photo:hover img, .video-feature:hover > img { transform: scale(1.03); }
}

/* ---------- never moving: reduced motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  .rv-on [data-rv], .rv-on [data-rv-photo] img, .rv-on .sem-rail b, .rv-on .sem-rail i, .rv-on .step::before { opacity: 1 !important; transform: none !important; }
}
@media print {
  .rv-on [data-rv], .rv-on [data-rv-photo] img, .rv-on .sem-rail b, .rv-on .sem-rail i, .rv-on .step::before { opacity: 1 !important; transform: none !important; }
}
