/* ===== Homepage motion layer (motion.js adds .mo to <html>) =====
   Everything here is opt-in via .mo, so no-JS and reduced-motion visitors
   get the plain static page. */

/* --- Hero: text is visible from the first paint and drifts up into place.
   Pure CSS (no JS gate) so it never delays when Google sees the main content. --- */
@keyframes moHeroRise { from { opacity: .55; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.home-hero-text > *, .about-hero-text > *, section.hero .hero-content > * {
  animation: moHeroRise .9s cubic-bezier(.2,.7,.2,1) both; }
.home-hero-text > :nth-child(2), .about-hero-text > :nth-child(2), section.hero .hero-content > :nth-child(2) { animation-delay: .08s; }
.home-hero-text > :nth-child(3), .about-hero-text > :nth-child(3), section.hero .hero-content > :nth-child(3) { animation-delay: .16s; }
.home-hero-text > :nth-child(4), .about-hero-text > :nth-child(4), section.hero .hero-content > :nth-child(4) { animation-delay: .24s; }
.home-hero-text > :nth-child(n+5), .about-hero-text > :nth-child(n+5), section.hero .hero-content > :nth-child(n+5) { animation-delay: .32s; }

.home-hero-image, .mo-halo-host { position: relative; }
.mo-halo-host { display: inline-block; line-height: 0; }
.mo-halo-host > img { position: relative; z-index: 1; }
.mo .mo-halo-host > img { animation: moFloat 7s ease-in-out infinite; }
.mo-halo { position: absolute; left: 50%; top: 50%; width: calc(var(--portrait, 400px) * 1.3); aspect-ratio: 1;
  margin: calc(var(--portrait, 400px) * -0.65) 0 0 calc(var(--portrait, 400px) * -0.65); z-index: 0; pointer-events: none; color: var(--gold);
  opacity: .35; animation: moSpin 90s linear infinite; }
.mo-halo svg, .mo-mandala svg { width: 100%; height: 100%; display: block; }
.home-hero-image img { position: relative; z-index: 1; }
.mo .home-hero-image img { animation: moFloat 7s ease-in-out infinite; }
@keyframes moSpin { to { transform: rotate(360deg); } }
@keyframes moFloat { 50% { transform: translateY(-10px); } }

/* --- Tarot fan: three cards that deal out and flip --- */
.ftb-fan { position: relative; height: 170px; width: 300px; margin: 0 auto 1.4rem; perspective: 900px; }
.ftb-card { position: absolute; left: 50%; bottom: 0; width: 96px; height: 160px; margin-left: -48px;
  transform-origin: 50% 110%; transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(.2,.8,.2,1); }
.ftb-card-inner { position: absolute; inset: 0; transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.3,.7,.2,1); transition-delay: inherit; }
.ftb-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 8px;
  backface-visibility: hidden; box-shadow: 0 10px 28px rgba(0,0,0,.45), 0 0 0 1px rgba(201,168,76,.35); }
.ftb-card .ftb-front { transform: rotateY(180deg); }
/* Static (no-JS) state shows the fan already dealt, faces up. */
.ftb-card:nth-child(1) { transform: translateX(-62px) rotate(-14deg); }
.ftb-card:nth-child(3) { transform: translateX(62px) rotate(14deg); }
.ftb-card .ftb-card-inner { transform: rotateY(180deg); }
/* With motion: start stacked face-down, deal when in view. */
.mo .ftb-fan:not(.mo-in) .ftb-card { transform: none; }
.mo .ftb-fan:not(.mo-in) .ftb-card-inner { transform: none; }
.mo .ftb-fan .ftb-card:nth-child(1) { transition-delay: .15s; }
.mo .ftb-fan .ftb-card:nth-child(2) { transition-delay: .45s; }
.mo .ftb-fan .ftb-card:nth-child(3) { transition-delay: .75s; }
.mo .ftb-fan.mo-in .ftb-card-inner { transition-delay: calc(var(--d, 0s) + .9s); }
.ftb-card:nth-child(1) .ftb-card-inner { --d: 0s; }
.ftb-card:nth-child(2) .ftb-card-inner { --d: .25s; }
.ftb-card:nth-child(3) .ftb-card-inner { --d: .5s; }
.ftb-fan:hover .ftb-card:nth-child(2) { transform: translateY(-8px); }
@media (max-width: 480px) { .ftb-fan { transform: scale(.85); margin-bottom: .6rem; } }

/* Homepage card of the day (tarot-daily.js) */
.cotd { position: relative; padding: 5rem 1.5rem; overflow: hidden; color: #fff;
  background: radial-gradient(ellipse at 30% 50%, rgba(201,168,76,.16), transparent 55%), linear-gradient(160deg, #1E1230, #2A1B3D 60%, #1A0F28); }
.cotd-inner { max-width: 960px; margin: 0 auto; display: grid; grid-template-columns: 300px 1fr; gap: 3.5rem; align-items: center; }
.cotd-card { perspective: 1200px; justify-self: center; position: relative; }
.cotd-card::before { content: ""; position: absolute; inset: -18%; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,213,160,.28), transparent 65%); animation: cotdPulse 4s ease-in-out infinite; }
.cotd-flip { position: relative; width: 240px; height: 400px; transform-style: preserve-3d; transform: rotateY(180deg);
  transition: transform 1.4s cubic-bezier(.3,.7,.2,1); }
.cotd-in .cotd-flip { transform: rotateY(0deg) rotate(-3deg); }
.cotd-flip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 14px; backface-visibility: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,.55), 0 0 0 2px rgba(201,168,76,.55); }
.cotd-back { transform: rotateY(180deg); }
.cotd-eyebrow { font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: .6rem; }
.cotd-name { font-family: 'Cormorant Garamond','Cormorant Fallback', 'Cormorant Fallback Android', serif; font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 600; line-height: 1; color: #fff; margin-bottom: .6rem; }
.cotd-keys { font-size: .95rem; color: var(--gold-light, #E8D5A0); margin-bottom: 1.1rem; }
.cotd-meaning { font-family: 'Cormorant Garamond','Cormorant Fallback', 'Cormorant Fallback Android', serif; font-size: 1.35rem; font-style: italic; line-height: 1.55; color: rgba(255,255,255,.92); margin-bottom: 1.1rem; }
.cotd-note { font-size: .88rem; color: rgba(255,255,255,.6); margin-bottom: 1.4rem; }
.cotd-ctas { display: flex; gap: .9rem; flex-wrap: wrap; }
.cotd-text > * { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s ease; }
.cotd-in .cotd-text > * { opacity: 1; transform: none; }
.cotd-in .cotd-text > :nth-child(1) { transition-delay: .9s; } .cotd-in .cotd-text > :nth-child(2) { transition-delay: 1.05s; }
.cotd-in .cotd-text > :nth-child(3) { transition-delay: 1.2s; } .cotd-in .cotd-text > :nth-child(4) { transition-delay: 1.35s; }
.cotd-in .cotd-text > :nth-child(5) { transition-delay: 1.5s; } .cotd-in .cotd-text > :nth-child(6) { transition-delay: 1.65s; }
@keyframes cotdPulse { 50% { opacity: .55; transform: scale(1.06); } }
@media (max-width: 768px) {
  .cotd { padding: 3.5rem 1.2rem; }
  .cotd-inner { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .cotd-flip { width: 180px; height: 300px; }
  .cotd-ctas { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .cotd-flip, .cotd-text > * { transition: none; } .cotd-card::before { animation: none; } }

/* --- Staggered rise for card grids, pills and reviews --- */
.mo .mo-stagger > * { opacity: 0; transform: translateY(26px) scale(.98);
  transition: opacity .7s ease, transform .8s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--i, 0) * 110ms); }
.mo .mo-stagger.mo-in > * { opacity: 1; transform: none; }
/* Restore snappy hover after the entrance has played. */
.mo .mo-stagger.mo-done > * { transition-delay: 0s; transition-duration: .3s; }

/* Service icons glow on as their card lands */
.mo .services-hub .hub-icon { transition: text-shadow 1s ease .6s, transform 1s ease .6s; }
.mo .services-hub.mo-in .hub-icon { text-shadow: 0 0 18px rgba(201,168,76,.55); }

/* --- Proof bar: soft gold underline draws under each number --- */
.proof-item-home strong { position: relative; display: inline-block; font-variant-numeric: tabular-nums; }
.mo .proof-item-home strong::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -4px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0); transition: transform 1.4s ease .3s; }
.mo .proof-bar-home.mo-in strong::after { transform: scaleX(1); }

/* --- Mandala behind About + Heal to Empower images (turns with scroll) --- */
.about-teaser-grid > div:first-child, .hte-promo-visual, .story-image-wrap { position: relative; }
.mo-mandala { position: absolute; z-index: 0; pointer-events: none; color: var(--gold);
  width: 130%; aspect-ratio: 1; left: 50%; top: 50%; opacity: .22;
  transform: translate(-50%, -50%) rotate(calc(var(--mo-rot, 0) * 1deg)); }
.about-teaser-img, .hte-promo-visual img, .story-image-wrap img { position: relative; z-index: 1; }
.mo .about-teaser-img, .mo .hte-promo-visual img, .mo .story-image-wrap img { transform: translateY(calc(var(--mo-par, 0) * 1px)); }
#heal-to-empower { overflow: hidden; }
#about { overflow: hidden; }

/* --- Final CTA: breathing glow on the main button --- */
.mo .home-cta .cta-btn { animation: moGlow 3.2s ease-in-out infinite; }
@keyframes moGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(201,168,76,.0), 0 6px 20px rgba(201,168,76,.18); }
  50% { box-shadow: 0 0 0 10px rgba(201,168,76,.08), 0 6px 34px rgba(201,168,76,.42); } }

@media (prefers-reduced-motion: reduce) {
  .home-hero-text > *, .about-hero-text > *, section.hero .hero-content > * { animation: none !important; }
  .mo-halo, .mo .mo-halo-host > img, .mo .home-hero-image img, .mo .home-cta .cta-btn { animation: none !important; }
}
