/* Kidara landing v2 — pulido visual, animaciones modernas y rendimiento */

/* 1. Wordmark limpio sin hack de recorte por margen negativo */
.brand-wordmark{display:block;height:29px;width:auto;object-fit:contain}
.footer-top .brand-wordmark{height:30px}

/* 2. Respiro exacto bajo el header fijo (sin duplicar scroll-padding + scroll-margin) */
html{scroll-padding-top:0}
#gratis{scroll-margin-top:66px}
#en-tu-dia{scroll-margin-top:84px}
#kidara-sleep{scroll-margin-top:96px}
#premium{scroll-margin-top:76px}
#planes{scroll-margin-top:24px}
#preguntas{scroll-margin-top:52px}

/* 3. Scroll-spy real y elegante en el menú de escritorio */
.desktop-nav{gap:24px}
.desktop-nav a{transition:color .25s ease}
.desktop-nav a::after{height:2px;border-radius:2px;transition:transform .3s cubic-bezier(.22,1,.36,1)}
.desktop-nav a.is-active{color:var(--purple)}
.desktop-nav a.is-active::after{transform:scaleX(1)}

/* 4. Hero: nítido desde el primer instante + animaciones suaves y modernas */
.motion-ready .hero-copy,
.motion-ready .hero-art,
.motion-ready .scroll-hint{animation:none;opacity:1}

.motion-ready .hero-copy > *{
  animation:kidara-hero-rise .58s cubic-bezier(.22,1,.36,1) both;
}
.motion-ready .hero-copy > :nth-child(1){animation-delay:0ms}
.motion-ready .hero-copy > :nth-child(2){animation-delay:55ms}
.motion-ready .hero-copy > :nth-child(3){animation-delay:110ms}
.motion-ready .hero-copy > :nth-child(4){animation-delay:165ms}
.motion-ready .hero-copy > :nth-child(5){animation-delay:215ms}

@keyframes kidara-hero-rise{
  from{opacity:.78;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}

/* Flotación orgánica sutil del teléfono del Hero + respiración suave del arco salvia */
.hero-phone-float{animation:kidara-phone-float 5.8s ease-in-out 1.15s infinite;will-change:transform}
.hero-art:hover .hero-phone-float{animation-play-state:paused}
.hero-arch{animation:kidara-arch-breathe 10s ease-in-out infinite alternate}
.hero-ring{animation:kidara-ring-breathe 12s ease-in-out infinite alternate}
.phone-entry{animation:kidara-phone-arrive .95s cubic-bezier(.22,1,.36,1) .05s both}

@keyframes kidara-phone-float{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-7px)}
}
@keyframes kidara-arch-breathe{
  0%{transform:rotate(4deg) translateY(0) scale(1)}
  100%{transform:rotate(5deg) translateY(-4px) scale(1.015)}
}
@keyframes kidara-ring-breathe{
  0%{transform:rotate(-4deg) translateY(0)}
  100%{transform:rotate(-2.5deg) translateY(5px)}
}

/* 5. Botones modernos con respuesta táctil y brillo sutil en hover */
.button{position:relative;overflow:hidden;isolation:isolate;transition:background .25s ease,transform .25s cubic-bezier(.22,1,.36,1),box-shadow .28s ease}
.button-purple{box-shadow:0 8px 22px -10px #7c3aed66}
.button-purple:hover{box-shadow:0 14px 28px -10px #6929d180;transform:translateY(-2px)}
.button-purple::before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(110deg,transparent 25%,rgba(255,255,255,.22) 50%,transparent 75%);
  transform:translateX(-120%);
  transition:transform .65s cubic-bezier(.22,1,.36,1);
  pointer-events:none;
}
.button-purple:hover::before{transform:translateX(120%)}
.button .play-icon{width:16px;height:16px;fill:currentColor;stroke:none;flex-shrink:0}
.button:hover .play-icon{transform:none}

/* Flechas refinadas y direccionalmente coherentes (↓ para bajar en la misma página, → para otra ruta) */
.button .icon,
.text-link .icon:last-child{width:16px;height:16px;stroke-width:1.85;transition:transform .24s cubic-bezier(.22,1,.36,1)}
.icon-down{transform:rotate(90deg)}
.button:hover .icon-down,
.text-link:hover .icon-down{transform:rotate(90deg) translateX(3px)}
.button-lime{gap:10px}

/* 6. Rating limpio sin caja junto a Empezar gratis + línea sutil debajo */
.hero-actions{display:flex;align-items:center;flex-wrap:wrap;gap:14px 22px}
.hero-rating-inline{
  display:inline-flex;
  align-items:center;
  gap:7px;
  font-size:13.5px;
  font-weight:500;
  color:#5b4d6b;
  line-height:1.3;
  white-space:nowrap;
  padding:4px 2px;
  transition:color .2s ease;
}
.hero-rating-inline strong{font-weight:700;color:var(--ink)}
.hero-rating-inline:hover{color:var(--purple)}
.hero-rating-inline:hover strong{color:var(--purple)}
.star-gold{width:15px;height:15px;fill:#eab308;stroke:none;flex-shrink:0}
.hero-footnote{margin-top:16px;font-size:12px;color:#786c84}

/* 7. Animaciones below-the-fold fluidas y en cascada */
.motion-ready .reveal{
  opacity:0;
  transform:translateY(22px) scale(.99);
  transition:opacity .65s cubic-bezier(.22,1,.36,1),transform .65s cubic-bezier(.22,1,.36,1);
}
.motion-ready .reveal.is-visible{opacity:1;transform:none}

/* Cascada en los 8 módulos */
.module-grid .module-item:nth-child(1){transition-delay:0ms}
.module-grid .module-item:nth-child(2){transition-delay:45ms}
.module-grid .module-item:nth-child(3){transition-delay:90ms}
.module-grid .module-item:nth-child(4){transition-delay:135ms}
.module-grid .module-item:nth-child(5){transition-delay:180ms}
.module-grid .module-item:nth-child(6){transition-delay:225ms}
.module-grid .module-item:nth-child(7){transition-delay:270ms}
.module-grid .module-item:nth-child(8){transition-delay:315ms}

.module-item{transition:transform .3s cubic-bezier(.22,1,.36,1)}
.module-item img{transition:transform .35s cubic-bezier(.22,1,.36,1),filter .35s ease}
.module-item:hover img{transform:translateY(-6px) scale(1.06);filter:drop-shadow(0 10px 14px rgba(84,48,132,.14))}

/* Tamaño unificado para TODOS los celulares de la página (Hero, Registro/Banco/Informes, Sleep, IA) */
:root{--phone-w:252px}
.device-frame{display:inline-block;max-width:100%}
.phone-entry,
.demo-panel .device-frame,
.sleep-visual .device-frame,
.premium-screen .device-frame{width:min(var(--phone-w),100%)}
.demo-panel .device-frame .app-capture,
.sleep-visual .device-frame img,
.premium-screen .device-frame img{width:100%;height:auto;max-height:none;max-width:100%;display:block}
.sleep-visual .device-frame{display:block}

/* Transiciones refinadas de pestañas y capturas */
.demo-panel{animation:kidara-panel-fade .34s cubic-bezier(.22,1,.36,1) both}
.story-tabs button{position:relative;transition:color .22s ease,border-color .22s ease}
.story-tabs button:hover{color:var(--ink)}
.story-tabs button[aria-selected="true"]{color:var(--purple);border-color:var(--purple)}

@keyframes kidara-panel-fade{
  from{opacity:0;transform:translateY(10px) scale(.985)}
  to{opacity:1;transform:none}
}

/* Micro-elevación en tarjetas de planes, sueño, premium y cierre */
.plan-card{transition:transform .32s cubic-bezier(.22,1,.36,1),box-shadow .32s ease,border-color .25s ease}
.plan-card:hover{transform:translateY(-4px);box-shadow:0 20px 40px -24px rgba(49,33,60,.18)}
.paid-plan:hover{border-color:#c6aee6;box-shadow:0 22px 44px -22px rgba(124,58,237,.24)}

.premium-orbit{animation:kidara-orbit-drift 18s ease-in-out infinite alternate}
@keyframes kidara-orbit-drift{
  from{transform:translate(0,0) scale(1)}
  to{transform:translate(-18px,14px) scale(1.04)}
}

.premium-benefits article{transition:transform .28s cubic-bezier(.22,1,.36,1)}
.premium-benefits article:hover{transform:translateY(-3px)}
.premium-benefits article:nth-child(2){transition-delay:70ms}
.premium-benefits article:nth-child(3){transition-delay:140ms}

.care-stamp{transition:transform .45s cubic-bezier(.22,1,.36,1)}
.care-illustration:hover .care-stamp{transform:rotate(4deg) scale(1.04)}
.care-copy strong{font-weight:600;color:var(--ink)}

.closing-flower{animation:kidara-gentle-sway 7s ease-in-out infinite alternate}
.closing-heart{animation:kidara-gentle-sway 8.5s ease-in-out infinite alternate-reverse}
@keyframes kidara-gentle-sway{
  from{transform:rotate(10deg) translateY(0)}
  to{transform:rotate(18deg) translateY(-7px)}
}

/* Acordeón FAQ más pulido */
.faq-list details summary{transition:color .2s ease}
.faq-list details summary:hover{color:var(--purple)}

/* Nota discreta iOS */
.ios-note{margin-top:14px;font-size:12px;color:#7a678b}
.ios-note a{color:#6f36b6;text-decoration:underline;text-underline-offset:3px;font-weight:600}

/* Página 404 limpia */
.not-found-shell{padding-top:90px;padding-bottom:110px;max-width:740px}
.not-found-shell .eyebrow{color:#78648d;margin-bottom:20px}
.not-found-shell h1{font-size:clamp(34px,5vw,52px);line-height:1.12}
.not-found-shell p{margin-top:20px;font-size:16px;color:var(--muted);max-width:520px}
.not-found-shell .hero-actions{margin-top:30px}

/* 8. Responsivo, header holgado en laptops medianos, Hero ligero en móvil y celulares 100% uniformes */
@media(max-width:1180px){
  .nav-wrap{padding-inline:24px;gap:16px}
  .desktop-nav{gap:18px;font-size:12.5px}
  .nav-download{min-width:0;padding:11px 16px;font-size:12.5px}
}
@media(min-width:960px) and (max-height:740px){
  :root{--phone-w:212px}
  .phone-entry,.demo-panel .device-frame,.sleep-visual .device-frame,.premium-screen .device-frame{width:min(var(--phone-w),100%)}
}
@media(max-width:1000px){
  :root{--phone-w:230px}
  .desktop-nav{gap:14px;font-size:12px}
  .phone-entry,.demo-panel .device-frame,.sleep-visual .device-frame,.premium-screen .device-frame{width:min(var(--phone-w),100%)}
}
@media(max-width:640px){
  :root{--phone-w:min(244px,74vw)}
  html{scroll-padding-top:0}
  #gratis{scroll-margin-top:56px}
  #en-tu-dia{scroll-margin-top:76px}
  #kidara-sleep{scroll-margin-top:84px}
  #premium{scroll-margin-top:70px}
  #planes{scroll-margin-top:30px}
  #preguntas{scroll-margin-top:50px}
  .brand-wordmark{height:25px}
  .hero{padding-top:16px;padding-bottom:52px;gap:18px}
  .hero .eyebrow{margin-bottom:13px}
  .hero-description{margin-top:15px;font-size:15px}
  .hero-actions{margin-top:18px;gap:10px 16px;flex-wrap:wrap}
  .hero-actions .button{padding:13px 18px;font-size:13.5px;gap:8px;min-height:48px}
  .hero-rating-inline{font-size:13px;gap:6px}
  .hero-footnote{margin-top:14px;font-size:11.5px}
  .hero-art{min-height:460px;padding-top:2px;padding-bottom:14px}
  .phone-entry,.demo-panel .device-frame,.sleep-visual .device-frame,.premium-screen .device-frame{width:var(--phone-w)}
  .demo-panel .device-frame .app-capture,.sleep-visual .device-frame img,.premium-screen .device-frame img{width:100%;height:auto;max-height:none;max-width:100%}
  .hero-footnote>span{display:inline}
  .hero-phone-float{animation:kidara-phone-float 6.2s ease-in-out 1s infinite}
  .phone-entry{animation:kidara-phone-mobile .65s cubic-bezier(.22,1,.36,1) .04s both}
  .plan-card:hover,.premium-benefits article:hover{transform:none}
}
@media(max-width:360px){
  :root{--phone-w:min(226px,76vw)}
  .phone-entry,.demo-panel .device-frame,.sleep-visual .device-frame,.premium-screen .device-frame{width:var(--phone-w)}
}

@media(prefers-reduced-motion:reduce){
  .motion-ready .hero-copy > *,
  .hero-phone-float,
  .hero-arch,
  .hero-ring,
  .premium-orbit,
  .closing-flower,
  .closing-heart,
  .demo-panel{animation:none!important}
  .button::before{display:none}
  .motion-ready .reveal{opacity:1;transform:none;transition:none}
  .module-item:hover img,.plan-card:hover,.premium-benefits article:hover{transform:none}
}
