/* ==========================================================================
   animations.css
   Entrance (all done within ~1.5s) then gentle ambient motion.
   Everything lives inside prefers-reduced-motion: no-preference, so reduced
   motion users get the finished composition immediately. Nothing depends on
   JS: if main.js fails the page still animates in and stays visible.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {

  /* ---------- 1. Copy: logo first, then a staggered cascade ---------- */
  .logo        { animation: riseFade .8s var(--ease-out) .05s both; }
  .eyebrow     { animation: riseFade .7s var(--ease-out) .22s both; }

  /* headline lines rise into place inside overflow-hidden masks */
  .headline__line--1 { animation: maskRise .9s var(--ease-out) .32s both; }
  .headline__line--2 { animation: maskRise .9s var(--ease-out) .44s both; }

  .divider     { animation: dividerIn .7s var(--ease-out) .62s both; }
  .lede        { animation: riseFade .75s var(--ease-out) .66s both; }
  .pill        { animation: pillIn .75s var(--ease-out) .78s both; }
  .status      { animation: riseFade .7s var(--ease-out) .88s both; }
  .footer      { animation: fadeIn .8s ease .9s both; }

  /* ---------- Background: the photo eases in, then drifts in very slowly; a sheen glides over the silk ---------- */
  body::before { animation: bgIn 1.6s var(--ease-out) both, bgDrift 16s ease-in-out 1.6s infinite alternate; }
  body::after  { animation: sheen 7s ease-in-out 1.8s infinite; }

  /* ---------- 2. Photo cluster: each photo rises out of depth, its image irises open ---------- */
  .float--a { animation: rise3d 1.1s var(--ease-out) .12s both, float3dA 8s ease-in-out 1.4s infinite; }
  .float--b { animation: rise3d 1.1s var(--ease-out) .28s both, float3dB 10s ease-in-out 1.5s infinite; }
  .float--c { animation: rise3d 1.1s var(--ease-out) .44s both, float3dC 7s ease-in-out 1.6s infinite; }
  .card     { animation: iris 1.05s var(--ease-wipe) .12s both; }
  .float--b .card { animation-delay: .28s; }
  .float--c .card { animation-delay: .44s; }
  .card img { animation: settleZoom 1.6s var(--ease-out) .12s both; }

  /* ---------- 3. Ambient: gold light circles each frame, glass sheen sweeps the photos, sparkles twinkle ---------- */
  .frame { animation: fadeIn .8s ease .9s both, ringSpin 6s linear 1s infinite; }
  .float--b .frame { animation-duration: .8s, 7.5s; animation-direction: normal, reverse; }
  .float--c .frame { animation-duration: .8s, 5s; }
  .card::after { animation: cardSheen 7s ease-in-out 1.8s infinite; }
  .float--b .card::after { animation-delay: 2.6s; }
  .float--c .card::after { animation-delay: 3.4s; }
  .spark--1 { animation: twinkle 3.2s ease-in-out 1.2s infinite both; }
  .spark--2 { animation: twinkle 3.2s ease-in-out 2.8s infinite both; }
}

/* ---------- Keyframes ---------- */
@keyframes fadeIn   { from { opacity: 0; } }
@keyframes riseFade { from { opacity: 0; transform: translateY(14px); } }
@keyframes maskRise { from { transform: translateY(108%); } }
@keyframes dividerIn { from { opacity: 0; transform: scaleX(.3); } }
@keyframes pillIn   { from { opacity: 0; transform: translateY(12px) scale(.96); } }

/* photo enters from depth: tipped back, lower, smaller; lands on its own depth (--z) */
@keyframes rise3d {
  from { opacity: 0; transform: translate3d(0, 70px, calc(var(--z) - 160px)) rotateX(-28deg); }
  to   { opacity: 1; transform: translate3d(0, 0, var(--z)); }
}
/* image opens from a soft pill to the full card (negative inset keeps the shadow + white rim) */
@keyframes iris {
  from { clip-path: inset(42% 30% 42% 30% round 999px); filter: blur(8px); }
  to   { clip-path: inset(-90px -90px -90px -90px round 0px); filter: blur(0); }
}
@keyframes settleZoom { from { transform: scale(1.18); } }

/* ambient 3D drift, each photo on its own rhythm (starts where rise3d ends) */
@keyframes float3dA {
  0%, 100% { transform: translate3d(0, 0, var(--z)); }
  50%      { transform: translate3d(0, -10px, var(--z)) rotateX(3deg) rotateY(-3deg); }
}
@keyframes float3dB {
  0%, 100% { transform: translate3d(0, 0, var(--z)); }
  45%      { transform: translate3d(0, 12px, var(--z)) rotateX(-3deg) rotateY(4deg); }
}
@keyframes float3dC {
  0%, 100% { transform: translate3d(0, 0, var(--z)); }
  55%      { transform: translate3d(6px, -9px, var(--z)) rotate(1.2deg); }
}

@keyframes ringSpin { to { --ang: 360deg; } }
@keyframes cardSheen {
  0%       { transform: translateX(-130%); }
  35%, 100% { transform: translateX(130%); }
}
@keyframes twinkle {
  0%, 100% { opacity: .25; transform: translateZ(150px) scale(.6) rotate(0deg); }
  15%      { opacity: 1;   transform: translateZ(150px) scale(1.15) rotate(45deg); }
  32%      { opacity: .25; transform: translateZ(150px) scale(.6) rotate(90deg); }
}

@keyframes bgIn {
  from { opacity: 0; transform: scale(1.06); }
}
/* slow push-in towards the draped saree (scale only, so no edge is ever uncovered) */
@keyframes bgDrift {
  to { transform: scale(1.05); }
}
@keyframes sheen {
  0%       { background-position: 100% 0; opacity: 0; }
  12%      { opacity: 1; }
  60%      { background-position: 0 0; opacity: 1; }
  72%, 100% { background-position: 0 0; opacity: 0; }
}
