/* ============================================================
   Auroria · wow.css — sitewide UX polish layer (v2)
   Progressive enhancement: most rules are gated behind html.wow
   (added by wow.js) so no-JS visitors and crawlers see a fully
   static, fully visible page. Respects prefers-reduced-motion.
   ============================================================ */

/* ---- Anchor targets never hide under the fixed nav ---- */
section[id], div[id], h2[id], h3[id] { scroll-margin-top: 96px; }

/* ---- Cross-page View Transitions (Chrome/Edge/Safari 18.2+) ----
   Gated behind no-preference so reduced-motion users get an
   instant navigation (no default cross-fade either). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: wow-vt-out .16s ease both; }
  ::view-transition-new(root) { animation: wow-vt-in  .26s cubic-bezier(.16,1,.3,1) both; }
}
@keyframes wow-vt-out { to { opacity: 0; } }
@keyframes wow-vt-in  { from { opacity: 0; transform: translateY(10px); } }

/* ---- Accessible, on-brand focus ring (solid, ≥3:1 on white) ---- */
html.wow :focus-visible { outline: 3px solid #4A3AED; outline-offset: 2px; }

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

  /* ---- Scroll reveal (re-activates the dormant .reveal system) ---- */
  html.wow .reveal {
    transition: opacity .7s cubic-bezier(.16, 1, .3, 1), transform .7s cubic-bezier(.16, 1, .3, 1);
    will-change: opacity, transform;
  }
  html.wow .reveal:not(.in) { opacity: 0; transform: translateY(24px); }
  html.wow .reveal.in { opacity: 1; transform: none; }

  /* ---- Hero headline accent: living gradient ---- */
  html.wow h1 .grad-text { background-size: 220% 220%; animation: wowGrad 7s ease-in-out infinite; }
  @keyframes wowGrad { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

  /* ---- FAQ / details: content fades + slides in when opened ---- */
  html.wow details::details-content {
    opacity: 0; transform: translateY(-4px);
    transition: opacity .3s ease, transform .3s ease, content-visibility .3s allow-discrete;
  }
  html.wow details[open]::details-content { opacity: 1; transform: none; }
}

/* ---- Spotlight cards: cursor-tracking glow + gentle lift ---- */
html.wow .wow-spot { position: relative; transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease, border-color .3s ease; }
html.wow .wow-spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(320px circle at var(--wx, 50%) var(--wy, 50%),
    rgba(121, 97, 236, .14), rgba(236, 72, 153, .07) 45%, transparent 65%);
  transition: opacity .35s ease;
}
@media (hover: hover) {
  html.wow .wow-spot:hover::after { opacity: 1; }
  html.wow .wow-spot:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(26, 18, 53, .10); border-color: rgba(121, 97, 236, .35); }
}

/* ---- Primary CTA: shine sweep + shadow bloom ---- */
html.wow a.au-grad, html.wow button.au-grad { position: relative; overflow: hidden; isolation: isolate; }
html.wow a.au-grad::before, html.wow button.au-grad::before {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -70%; width: 55%; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .40), transparent);
  transform: skewX(-18deg);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  html.wow a.au-grad:hover::before, html.wow button.au-grad:hover::before { animation: wowShine .85s cubic-bezier(.4, 0, .2, 1); }
  html.wow a.au-grad:hover { box-shadow: 0 14px 36px rgba(74, 58, 237, .45); }
}
@keyframes wowShine { from { transform: translateX(0) skewX(-18deg); } to { transform: translateX(420%) skewX(-18deg); } }

/* ---- Sticky mobile CTA bar (persona + capacitaciones pages) ---- */
#wowCta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  display: flex; gap: .5rem; align-items: center;
  padding: .55rem .8rem calc(.55rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  border-top: 1px solid #f0eef6; box-shadow: 0 -8px 30px rgba(26, 18, 53, .08);
  transform: translateY(110%); transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}
html.wow-ctavis #wowCta { transform: translateY(0); }
@media (min-width: 768px) { #wowCta { display: none; } }
.wow-cta-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: .9rem; padding: .8rem 1rem; font-weight: 800; font-size: .9rem; color: #fff;
  background: linear-gradient(135deg, #4A3AED 0%, #6C5CE7 25%, #8B5CF6 50%, #EC4899 80%, #FF6B6B 100%);
  box-shadow: 0 8px 24px rgba(74, 58, 237, .32);
}
/* Lift the FABs + cookie banner above the bar while it is visible (mobile only) */
@media (max-width: 767px) {
  html.wow-ctavis [data-fab-whatsapp] { bottom: calc(env(safe-area-inset-bottom, 0px) + 4.4rem) !important; }
  html.wow-ctavis #scrollTop { bottom: calc(env(safe-area-inset-bottom, 0px) + 7.9rem) !important; }
  html.wow-ctavis #cookie-banner { bottom: calc(env(safe-area-inset-bottom, 0px) + 4.4rem) !important; }
}

/* ---- Reduced motion: everything stays calm and visible ---- */
@media (prefers-reduced-motion: reduce) {
  html.wow .reveal { opacity: 1 !important; transform: none !important; }
  html.wow .wow-spot, html.wow .wow-spot::after { transition: none !important; }
  html.wow .wow-spot:hover { transform: none !important; }
  #wowCta { transition: none !important; } /* bar toggles instantly */
}
