/* EdgeRx Women HRT funnel — motion layer. Loads after funnel.css.
   Everything here is gated on prefers-reduced-motion: no-preference. */

/* Scroll progress (always present, harmless when static) */
html { overflow-x: clip; }
.scroll-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.scroll-bar span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--sp, 0)); background: linear-gradient(90deg, var(--rose), var(--deep-rose)); }

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

  /* ---------- Hero entrance ---------- */
  .js-motion .hero__copy > * { opacity: 0; transform: translateY(22px); animation: mRise .9s var(--ease) forwards; }
  .js-motion .hero__copy > *:nth-child(1) { animation-delay: .05s; }
  .js-motion .hero__copy > *:nth-child(2) { animation-delay: .15s; }
  .js-motion .hero__copy > *:nth-child(3) { animation-delay: .27s; }
  .js-motion .hero__copy > *:nth-child(4) { animation-delay: .37s; }
  .js-motion .hero__copy > *:nth-child(5) { animation-delay: .45s; }
  .js-motion .hero__copy > *:nth-child(6) { animation-delay: .53s; }
  .js-motion .hero__copy > *:nth-child(7) { animation-delay: .6s; }
  .js-motion .hero .checks li { opacity: 0; transform: translateX(-10px); animation: mSlide .6s var(--ease) forwards; }
  .js-motion .hero .checks li:nth-child(1) { animation-delay: .45s; }
  .js-motion .hero .checks li:nth-child(2) { animation-delay: .55s; }
  .js-motion .hero .checks li:nth-child(3) { animation-delay: .65s; }
  .js-motion .hero .checks li:nth-child(4) { animation-delay: .75s; }

  /* Headline: words rise in one by one (spans added by motion.js) */
  .js-motion .hero h1 .w { display: inline-block; opacity: 0; transform: translateY(.45em) rotate(2deg); animation: mWord .8s var(--ease) forwards; animation-delay: calc(.12s + var(--wi) * .07s); }

  /* Hero image: soft wipe in, then a slow breathing zoom */
  .js-motion .hero__media { clip-path: inset(8% 8% 8% 8% round var(--radius)); opacity: 0; animation: mWipe 1.2s var(--ease) .1s forwards; }
  .js-motion .hero__media img { transform: scale(1.12); animation: mZoom 1.6s var(--ease) .1s forwards, mBreath 14s ease-in-out 1.8s infinite alternate; }
  .js-motion .hero__badge { opacity: 0; animation: mPop .7s var(--ease) .9s forwards, mFloat 5s ease-in-out 1.8s infinite; }

  /* Ambient blush glow behind hero */
  .hero { position: relative; isolation: isolate; overflow-x: clip; }
  .hero::before { content: ''; position: absolute; z-index: -1; width: 46vw; height: 46vw; max-width: 640px; max-height: 640px; right: -8vw; top: -6vw; border-radius: 50%; background: radial-gradient(circle, rgba(183,127,134,.22), rgba(183,127,134,0) 68%); animation: mDrift 18s ease-in-out infinite alternate; pointer-events: none; }

  /* ---------- Buttons ---------- */
  .btn-primary { position: relative; overflow: hidden; }
  .btn-primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); pointer-events: none; }
  .btn-primary:hover::after { animation: mShine .9s var(--ease); }
  .hero__cta .btn-primary::after, .close .btn-primary::after { animation: mShine 1.1s var(--ease) 2.2s, mShineLoop 6s var(--ease) 4s infinite; }
  .btn .arw { display: inline-block; transition: transform .3s var(--ease); }
  .btn:hover .arw { transform: translateX(4px); }
  .btn:not([disabled]):active { transform: scale(.97); }
  .btn { transition: transform .2s var(--ease), background-color .2s var(--ease), box-shadow .25s var(--ease), color .2s var(--ease); }
  .btn-primary:not([disabled]):hover { box-shadow: 0 10px 26px rgba(126,70,78,.24); transform: translateY(-1px); }

  /* ---------- Staggered reveals ---------- */
  .reveal.stagger { opacity: 1; transform: none; }
  .reveal.stagger > * { opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
  .reveal.stagger.in > * { opacity: 1; transform: none; }
  .reveal.media-in { opacity: 1; transform: none; clip-path: inset(12% 0 0 0 round var(--radius)); transition: clip-path 1.1s var(--ease); }
  .reveal.media-in img { transform: scale(1.14); transition: transform 1.6s var(--ease); }
  .reveal.media-in.in { clip-path: inset(0 0 0 0 round var(--radius)); }
  .reveal.media-in.in img { transform: scale(1.12); }
  .steps li.reveal { transform: translateX(-18px); }
  .steps li.reveal.in { transform: none; }
  .steps li.reveal .steps__n { transition: color .6s var(--ease) .3s; }
  .sec-head.reveal h2 em { display: inline-block; background: linear-gradient(transparent 62%, rgba(183,127,134,.28) 62%) no-repeat 0 0 / 0% 100%; transition: background-size 1s var(--ease) .45s; }
  .sec-head.reveal.in h2 em { background-size: 100% 100%; }

  /* Parallax wrapper (transform set by motion.js) */
  [data-parallax] img { will-change: transform; }

  /* ---------- Symptom tiles ---------- */
  .sym { transition: transform .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease); }
  .sym:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(47,43,44,.08); }
  .sym[aria-pressed="true"] { animation: mPress .4s var(--ease); }
  .sym-count.bump { animation: mBump .35s var(--ease); }

  /* ---------- Plan cards ---------- */
  .plan { transition: transform .35s var(--ease), box-shadow .35s var(--ease); transform-style: preserve-3d; }
  .plan:hover { box-shadow: 0 22px 48px rgba(47,43,44,.12); }
  .plan--feature { position: relative; }
  .plan--feature::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; background: conic-gradient(from var(--ang, 0deg), var(--rose), transparent 30%, transparent 70%, var(--rose)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: mSpin 6s linear infinite; pointer-events: none; }
  [data-price].flip { display: inline-block; animation: mFlip .45s var(--ease); }

  /* ---------- FAQ ---------- */
  .faq details p { animation: mRise .45s var(--ease); }
  .faq summary { transition: color .2s var(--ease), padding-left .25s var(--ease); }
  .faq summary:hover { padding-left: 4px; }

  /* ---------- Close ---------- */
  .close__mark { animation: mFloat 6s ease-in-out infinite; }

  /* ---------- Quiz ---------- */
  .quiz:not([hidden]) { animation: mQuizIn .45s var(--ease); }
  .quiz .step:not([hidden]) .q, .quiz .step:not([hidden]) .q-sub { animation: mRise .5s var(--ease) both; }
  .quiz .step:not([hidden]) .q-sub { animation-delay: .06s; }
  .quiz .step:not([hidden]) .opt, .quiz .step:not([hidden]) .field, .quiz .step:not([hidden]) .consent { animation: mRise .5s var(--ease) both; animation-delay: calc(.1s + var(--i, 0) * 45ms); }
  .opt span { transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
  .opt:hover span { transform: translateX(3px); }
  .opt input:checked + span { animation: mPress .35s var(--ease); }
  .opt input:checked + span::after { animation: mTick .3s var(--ease); }
  .quiz__progress span { background: linear-gradient(90deg, var(--deep-rose), var(--rose)); transition: width .6s var(--ease); position: relative; }
  .quiz__progress span::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: mShineLoop 2.4s linear infinite; }
  .field input:focus, .field select:focus { box-shadow: 0 0 0 4px rgba(183,127,134,.18); transition: box-shadow .2s var(--ease); }

  /* Result */
  .result:not([hidden]) .eyebrow, .result:not([hidden]) > .q { animation: mRise .55s var(--ease) both; }
  .result:not([hidden]) > .q { animation-delay: .08s; }
  .result:not([hidden]) .rcard { animation: mCard .8s var(--ease) .15s both; }
  .result:not([hidden]) .rcard > * { animation: mRise .5s var(--ease) both; animation-delay: calc(.35s + var(--i, 0) * 55ms); }
  .result:not([hidden]) .next li { animation: mSlide .5s var(--ease) both; animation-delay: calc(.8s + var(--i, 0) * 90ms); }
  .rcard { position: relative; }
  .result:not([hidden]) .rcard > .petal, .petal { position: absolute; width: 10px; height: 14px; border-radius: 60% 60% 60% 0; background: var(--rose); pointer-events: none; opacity: 0; animation: mPetal 1.4s var(--ease) forwards; }
  .rcard [data-intake] { animation: mPulse 2.6s ease-in-out 1.4s infinite; }

  /* Dock */
  .dock { transition: transform .5s var(--ease); }
}

@keyframes mRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes mSlide { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes mWord { to { opacity: 1; transform: none; } }
@keyframes mWipe { to { opacity: 1; clip-path: inset(0 0 0 0 round var(--radius)); } }
@keyframes mZoom { to { transform: scale(1.05); } }
@keyframes mBreath { from { transform: scale(1.05); } to { transform: scale(1.09); } }
@keyframes mPop { 0% { opacity: 0; transform: translateY(10px) scale(.9); } 70% { opacity: 1; transform: translateY(-2px) scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes mFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes mDrift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-6vw, 4vw) scale(1.15); } }
@keyframes mShine { to { transform: translateX(120%); } }
@keyframes mShineLoop { 0% { transform: translateX(-120%); } 30%, 100% { transform: translateX(120%); } }
@keyframes mPress { 0% { transform: scale(1); } 40% { transform: scale(.96); } 100% { transform: scale(1); } }
@keyframes mBump { 50% { transform: scale(1.15); color: var(--deep-rose); } }
@keyframes mTick { 0% { transform: scale(.4); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes mFlip { 0% { opacity: 0; transform: translateY(-.4em) rotateX(70deg); } 100% { opacity: 1; transform: none; } }
@keyframes mSpin { to { --ang: 360deg; } }
@keyframes mQuizIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes mCard { 0% { opacity: 0; transform: translateY(26px) scale(.96); } 100% { opacity: 1; transform: none; } }
@keyframes mPetal { 0% { opacity: 0; transform: translate(0, 0) rotate(0) scale(.5); } 15% { opacity: .95; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); } }
@keyframes mPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(183,127,134,.45); } 50% { box-shadow: 0 0 0 10px rgba(183,127,134,0); } }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
