/* =====================================================================
   K. S. Wani Institute — animation + typography layer
   Reproduces the original Framer Motion / Tailwind animations in pure CSS.
   ===================================================================== */

body {
  font-family: "Inter", sans-serif;
  background: #f5f1e8;
  overflow-x: hidden;
}

.font-editorial   { font-family: "Manrope", sans-serif; }
.font-serif-italic{ font-family: "Cormorant Garamond", serif; font-style: italic; }

/* ---------- Scroll reveal (Framer "fadeUp" / whileInView) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .8s cubic-bezier(.22,1,.36,1),
              transform .8s cubic-bezier(.22,1,.36,1);
  transition-delay: var(--delay, 0s);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

/* Slide-in variants */
.reveal-x  { opacity: 0; transform: translateX(60px); transition: opacity .9s ease, transform .9s ease; transition-delay: var(--delay,0s); }
.reveal-x.in { opacity: 1; transform: none; }
.reveal-xl { opacity: 0; transform: translateX(35px); transition: opacity .6s ease, transform .6s ease; transition-delay: var(--delay,0s); }
.reveal-xl.in { opacity: 1; transform: none; }

/* Reduced motion: show everything immediately */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-x, .reveal-xl { opacity: 1 !important; transform: none !important; }
  .float, .book-flip, .shelf-book, .printer-paper { animation: none !important; }
}

/* ---------- Hover lift (Framer whileHover y:-8 / scale) ---------- */
.lift  { transition: transform .3s ease, box-shadow .3s ease; }
.lift:hover  { transform: translateY(-8px); }
.lift-sm { transition: transform .3s ease; }
.lift-sm:hover { transform: translateY(-5px); }
.lift-scale { transition: transform .3s ease; }
.lift-scale:hover { transform: translateY(-10px) scale(1.02); }

/* ---------- Floating badge loop (animate y:[0,-10,0] repeat Infinity) ---------- */
@keyframes floaty {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-10px); }
}
.float { animation: floaty 4s ease-in-out infinite; }

@keyframes floaty12 {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-12px); }
}
.float-12 { animation: floaty12 4s ease-in-out infinite; }

/* ---------- Printer paper print-out (original index.css keyframe) ---------- */
@keyframes paperPrint {
  0%   { transform: translateY(-180px); opacity: 0; }
  45%  { opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}
.printer-paper { animation: paperPrint 2.8s cubic-bezier(.22,1,.36,1) forwards; }

/* ---------- Flipping book (Framer rotateY [0,-145,0] loop) ---------- */
@keyframes bookflip {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(-145deg); }
  100% { transform: rotateY(0deg); }
}
.book-flip {
  transform-origin: left center;
  transform-style: preserve-3d;
  animation: bookflip 5s ease-in-out infinite;
}

/* ---------- Animated library shelf (per-book bounce) ---------- */
@keyframes shelfbounce-a {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-5px); }
}
@keyframes shelfbounce-b {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-2px); }
}
.shelf-book { animation-duration: var(--dur, 3s); animation-iteration-count: infinite; animation-timing-function: ease-in-out; }
.shelf-book.up5 { animation-name: shelfbounce-a; }
.shelf-book.up2 { animation-name: shelfbounce-b; }

/* ---------- Modal entry (Framer scale/opacity/y) ---------- */
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(25px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}
.modal-card { animation: modalIn .3s ease forwards; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
body.modal-open { overflow: hidden; }

/* ---------- Hero carousel crossfade ---------- */
.hero-slide {
  position: absolute; inset: 0; height: 100%; width: 100%;
  object-fit: cover; filter: grayscale(1);
  transform: scale(1.05); opacity: 0;
  transition: opacity 2200ms ease, transform 2200ms ease;
}
.hero-slide.active { transform: scale(1); opacity: 1; }
