/* ==========================================================================
   BibleSlide home page: motion layer (front page only, loaded after home.css).
   Patterns inspired by 21st.dev (blur-fade text, shimmer button, spotlight card, aurora background),
   written in plain CSS + ~3 KB of JS because the theme has no React build.
   Rules: only transform/opacity (and a short blur on text) are animated; no image, image URL, <img>/<picture>
   markup, text or link is touched; everything below is inside prefers-reduced-motion: no-preference, so with
   reduced motion (or without JavaScript, where html.bsh-js is never set) the page is exactly the static page.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .bsh {
    --bsm-ease: cubic-bezier(.16, 1, .3, 1);
    --bsm-rise: 22px;
    --bsm-blur: 10px;
  }

  /* ---- 1. hero entrance: blur-fade rise, staggered (hero image only moves; its opacity is never animated, so LCP is not delayed) */
  .bsh-js .bsh-hero h1,
  .bsh-js .bsh-hero .bsh-lead,
  .bsh-js .bsh-hero .bsh-cta-row .bsh-btn,
  .bsh-js .bsh-hero .bsh-langs {
    animation: bsm-rise .9s var(--bsm-ease) backwards;
    animation-delay: var(--bsm-d, 0ms);
  }
  .bsh-js .bsh-hero h1 { --bsm-d: 60ms; }
  .bsh-js .bsh-hero .bsh-lead { --bsm-d: 220ms; }
  .bsh-js .bsh-hero .bsh-cta-row .bsh-btn:nth-child(1) { --bsm-d: 380ms; }
  .bsh-js .bsh-hero .bsh-cta-row .bsh-btn:nth-child(2) { --bsm-d: 480ms; }
  .bsh-js .bsh-hero .bsh-langs { --bsm-d: 700ms; }
  .bsh-js .bsh-hero-art { animation: bsm-art 1.1s var(--bsm-ease) 150ms backwards; }
  @keyframes bsm-rise { from { opacity: 0; transform: translate3d(0, var(--bsm-rise), 0); filter: blur(var(--bsm-blur)); } to { opacity: 1; transform: none; filter: none; } }
  @keyframes bsm-art { from { transform: translate3d(0, 28px, 0) scale(.985); } to { transform: none; } }

  /* ---- 2. scroll reveals: the existing data-reveal gets a soft blur-in; extra blocks use [data-bsm] (added by home-motion.js) */
  .bsh-js [data-reveal] { filter: blur(6px); transition-property: opacity, transform, filter; }
  .bsh-js [data-reveal].is-in, .bsh-reveal-fallback [data-reveal] { filter: none; }
  .bsh-js [data-bsm]:not(.bsm-in) { opacity: 0; transform: translate3d(0, 16px, 0); }
  .bsh-js [data-bsm] { transition: opacity .7s var(--bsm-ease), transform .7s var(--bsm-ease); transition-delay: var(--bsm-delay, 0ms); }
  .bsh-js [data-bsm].bsm-in { opacity: 1; transform: none; }

  /* ---- 3. hover on the existing cards (images are never scaled, cropped or tinted) */
  .bsh-card { position: relative; transition: transform .35s var(--bsm-ease); }
  .bsh-card::before { content: ""; position: absolute; inset: -14px -10px 18px; z-index: -1; border-radius: 22px; opacity: 0; pointer-events: none; transition: opacity .35s ease;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 40%), rgba(229, 165, 27, .26), rgba(6, 73, 184, .12) 45%, transparent 70%); }
  .bsh-card:hover::before, .bsh-card:focus-visible::before { opacity: 1; }
  .bsh-card:hover .bsh-card-img { transform: translateY(-6px); box-shadow: 0 30px 56px -26px rgba(11, 36, 84, .5), 0 0 0 2px rgba(229, 165, 27, .55); }
  .bsh-card:active .bsh-card-img { transform: translateY(-2px) scale(.995); }
  .bsh-card-label { transition: color .25s, transform .35s var(--bsm-ease); }
  .bsh-card:hover .bsh-card-label { color: var(--bsh-blue); transform: translateY(-2px); }
  .bsh-min-card { position: relative; transition: transform .4s var(--bsm-ease), box-shadow .4s, border-color .4s; }
  .bsh-min-card:hover { transform: translateY(-4px); box-shadow: 0 26px 50px -28px rgba(11, 36, 84, .45); border-color: rgba(229, 165, 27, .6); }
  .bsh-features li { transition: transform .35s var(--bsm-ease); }
  .bsh-features li:hover { transform: translateY(-3px); }
  .bsh-feat-ico { transition: transform .5s var(--bsm-ease), stroke .3s; }
  .bsh-features li:hover .bsh-feat-ico { transform: scale(1.1) rotate(-4deg); }
  .bsh-thumb:hover { transform: translateY(-3px); }
  .bsh-faq-item summary { transition: color .2s, padding-left .3s var(--bsm-ease); }
  .bsh-faq-item summary:hover { color: var(--bsh-blue); padding-left: 6px; }
  .bsh-faq-item summary::after { transition: transform .3s var(--bsm-ease); }
  .bsh-faq-item[open] > :not(summary) { animation: bsm-faq .45s var(--bsm-ease) backwards; }
  @keyframes bsm-faq { from { opacity: 0; transform: translate3d(0, -6px, 0); } to { opacity: 1; transform: none; } }

  /* ---- 4. buttons: soft shimmer on the primary, arrow nudge, press feedback */
  .bsh-btn { position: relative; overflow: hidden; isolation: isolate; transition-duration: .25s; }
  .bsh-btn-primary::after { content: ""; position: absolute; inset: 0; z-index: -1; transform: translate3d(-120%, 0, 0); pointer-events: none;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%); }
  .bsh-btn-primary:hover::after, .bsh-btn-primary:focus-visible::after { animation: bsm-shimmer .9s var(--bsm-ease); }
  .bsh-js .bsh-hero .bsh-btn-primary::after { animation: bsm-shimmer 1.4s var(--bsm-ease) 1.6s 1 backwards; }
  @keyframes bsm-shimmer { to { transform: translate3d(120%, 0, 0); } }
  .bsh-btn .bsh-ico, .bsh-btn .bsh-play { transition: transform .3s var(--bsm-ease); }
  .bsh-btn:hover .bsh-ico { transform: translateX(4px); }
  .bsh-btn:hover .bsh-play { transform: scale(1.12); }
  .bsh-btn:active { transform: translateY(0) scale(.97); transition-duration: .08s; }
  .bsh-lang-row button { transition: background-color .2s, transform .2s var(--bsm-ease); }
  .bsh-lang-row button:hover { transform: translateY(-1px); }

  /* ---- 5. background motion: two slow drifting colour glows over the hero's own gradients (the hero artwork is untouched) */
  .bsh-hero { overflow: clip; }
  .bsh-hero::before, .bsh-hero::after { content: ""; position: absolute; z-index: 0; pointer-events: none; border-radius: 50%; filter: blur(60px); opacity: .55; will-change: transform; }
  .bsh-hero::before { width: 46vw; height: 46vw; max-width: 640px; max-height: 640px; left: -8%; top: -18%; background: radial-gradient(circle, rgba(6, 73, 184, .20), transparent 68%); animation: bsm-drift-a 26s ease-in-out infinite alternate; }
  .bsh-hero::after { width: 40vw; height: 40vw; max-width: 560px; max-height: 560px; right: -4%; bottom: 6%; background: radial-gradient(circle, rgba(229, 165, 27, .22), transparent 68%); animation: bsm-drift-b 32s ease-in-out infinite alternate; }
  .bsh-hero-in, .bsh-hero .bsh-langs { position: relative; z-index: 1; }
  .bsh-hero:not(.bsm-live)::before, .bsh-hero:not(.bsm-live)::after { animation-play-state: paused; }
  @keyframes bsm-drift-a { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(9vw, 7vw, 0) scale(1.18); } }
  @keyframes bsm-drift-b { from { transform: translate3d(0, 0, 0) scale(1.1); } to { transform: translate3d(-8vw, -5vw, 0) scale(.92); } }

  /* ---- 6. phones and touch screens: shorter, lighter motion; no pointer glow */
  @media (max-width: 700px) {
    .bsh { --bsm-rise: 14px; --bsm-blur: 5px; }
    .bsh-hero::before, .bsh-hero::after { filter: blur(40px); opacity: .4; }
    .bsh-js .bsh-hero h1 { --bsm-d: 20ms; }
    .bsh-js .bsh-hero .bsh-lead { --bsm-d: 120ms; }
    .bsh-js .bsh-hero .bsh-cta-row .bsh-btn:nth-child(1) { --bsm-d: 220ms; }
    .bsh-js .bsh-hero .bsh-cta-row .bsh-btn:nth-child(2) { --bsm-d: 300ms; }
    .bsh-js .bsh-hero .bsh-langs { --bsm-d: 420ms; }
    .bsh-js [data-reveal] { filter: none; }
  }
  @media (hover: none) {
    .bsh-card::before { display: none; }
    .bsh-card:hover .bsh-card-img, .bsh-min-card:hover, .bsh-features li:hover, .bsh-thumb:hover { transform: none; }
  }
}
