/* Kairos Hour v17 — one motion system for the whole site.
   One easing curve, a small set of durations, nothing that bounces or spins.
   Everything here switches off for visitors who ask for reduced motion. */

:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: .18s;
  --dur-base: .32s;
  --dur-slow: .9s;
}

/* Buttons: a small lift, a firm press. */
.button {
  transition: background-color var(--dur-fast) var(--ease-soft), border-color var(--dur-fast) var(--ease-soft),
    box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), color var(--dur-fast);
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0) scale(.985); transition-duration: 80ms; }
.text-link span[aria-hidden="true"], .button span[aria-hidden="true"] {
  display: inline-block;
  transition: transform var(--dur-base) var(--ease-out);
}
.text-link:hover span[aria-hidden="true"], .button:hover span[aria-hidden="true"] { transform: translateX(3px); }

/* Scroll reveals: longer travel-free fade, slower settle. */
.awaiting { opacity: 0; transform: translateY(20px); }
.revealed {
  transition: opacity .8s var(--ease-soft), transform var(--dur-slow) var(--ease-out);
}
.grid > .revealed:nth-child(2), .moment-grid.revealed img:nth-child(2) { transition-delay: 90ms; }
.grid > .revealed:nth-child(3), .moment-grid.revealed img:nth-child(3) { transition-delay: 180ms; }

/* Images warm up on hover instead of jumping. */
.video-art img, .moment-grid img {
  transition: transform 1.1s var(--ease-out), filter .6s var(--ease-soft);
}
.replay-link:hover .video-art img { transform: scale(1.035); filter: grayscale(.15); }
.moment-grid img:hover { filter: grayscale(.1); }
.play-disc { transition: transform var(--dur-base) var(--ease-out); }
.replay-link:hover .play-disc { transform: scale(1.08); }
.card { transition: border-color var(--dur-base) var(--ease-soft), box-shadow var(--dur-base) var(--ease-out); }

/* Books dropdown opens with a short fade, not a pop. */
.books-navigation-toggle svg { transition: transform var(--dur-base) var(--ease-out); }

@media (prefers-reduced-motion: no-preference) {
  /* Hero entrance: the headline rises out of its line, the portrait settles in. */
  .hero .hero-line { overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; animation: none; }
  .hero .hero-line > span { display: block; animation: line-rise 1.05s var(--ease-out) both; }
  .hero .hero-line:first-child > span { animation-delay: .12s; }
  .hero .hero-line + .hero-line > span { animation-delay: .22s; }
  .hero-copy .eyebrow { animation: fade-in .7s var(--ease-soft) .05s both; }
  .hero-copy .hero-slogan { animation: arrive .8s var(--ease-out) .42s both; }
  .hero-copy .intro { animation: arrive .8s var(--ease-out) .5s both; }
  .hero-copy .actions { animation: arrive .8s var(--ease-out) .6s both; }
  .hero-copy .hero-community { animation: fade-in .8s var(--ease-soft) .8s both; }
  .hero-art .hero-collage { animation: portrait-settle 1.8s var(--ease-out) both; }
  .schedule.enter { animation: arrive .9s var(--ease-out) .7s both; }

  /* The portrait drifts a little as the page scrolls, where browsers support it. */
  @supports (animation-timeline: scroll()) {
    .hero-art .hero-collage {
      animation: portrait-settle 1.8s var(--ease-out) both, portrait-drift linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 700px;
    }
  }

  /* Live: a slow, soft ring, not a blink. */
  .hero-stage[data-state="live"] .hero-status .signal::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #ff4b3a;
    animation: live-ring 2.4s var(--ease-out) infinite;
  }

  /* Feature images ease in as their section arrives. */
  .revealed .daily-home-art, .revealed .about-photo, .prayer-feature.revealed .prayer-banner-art img {
    animation: image-settle 1.4s var(--ease-out) both;
  }

  .books-navigation-toggle[aria-expanded="true"] + .books-navigation-items {
    animation: menu-in .22s var(--ease-out) both;
  }
}

@keyframes line-rise { from { transform: translateY(105%); } to { transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes portrait-settle { from { opacity: 0; scale: 1.06; } to { opacity: 1; scale: 1; } }
@keyframes portrait-drift { to { translate: 0 60px; } }
@keyframes live-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
@keyframes image-settle { from { scale: 1.05; } to { scale: 1; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
