/* =========================================================
 * Tuwy — Animaciones y micro-interacciones
 * ========================================================= */

/* ---------- Easing tokens ---------- */
:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-sine: cubic-bezier(0.37, 0, 0.63, 1);
  --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --tuwy-teal: #008080;
  --tuwy-teal-dark: #0a4a4a;
}

/* ---------- Scroll reveal base ---------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
  will-change: opacity, transform;
}

.reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
  will-change: opacity, transform;
}

.reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
  will-change: opacity, transform;
}

.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.08s; }
.stagger-2 { transition-delay: 0.16s; }
.stagger-3 { transition-delay: 0.24s; }
.stagger-4 { transition-delay: 0.32s; }
.stagger-5 { transition-delay: 0.40s; }
.stagger-6 { transition-delay: 0.48s; }

/* ---------- Hero entrance ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-badge {
  animation: fadeInDown 0.7s var(--ease-out-expo) both;
}

.hero-title {
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.15s both;
}

.hero-lead {
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.3s both;
}

.hero-buttons {
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.45s both;
}

.hero-mockup {
  animation: fadeIn 1s var(--ease-out-expo) 0.5s both;
}

/* ---------- Floating mockup ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(1deg); }
}

.float-gentle {
  animation: float 5s var(--ease-in-out-sine) infinite;
}

/* ---------- Animated gradient background ---------- */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-gradient {
  background: linear-gradient(135deg, #008080 0%, #0a4a4a 35%, #005f5f 65%, #0a4a4a 100%);
  background-size: 300% 300%;
  animation: gradientShift 12s ease infinite;
}

/* ---------- Soft glowing orbs ---------- */
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  animation: orbFloat 10s var(--ease-in-out-sine) infinite;
}

.hero-orb-1 {
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, 0.25);
  top: 10%;
  right: 5%;
  animation-delay: 0s;
}

.hero-orb-2 {
  width: 240px;
  height: 240px;
  background: rgba(0, 224, 224, 0.2);
  bottom: 15%;
  right: 25%;
  animation-delay: -3s;
}

.hero-orb-3 {
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.15);
  top: 40%;
  right: 45%;
  animation-delay: -6s;
}

/* ---------- Navbar scroll state ---------- */
.navbar {
  transition: background-color 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.navbar-brand {
  transition: transform 0.3s var(--ease-out-expo);
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.nav-link {
  position: relative;
  transition: color 0.25s ease;
}

.nav-link:not(.btn)::after {
  content: '';
  position: absolute;
  bottom: 0.25rem;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--tuwy-teal);
  transition: width 0.3s var(--ease-out-expo), left 0.3s var(--ease-out-expo);
}

.nav-link:not(.btn):hover::after {
  width: 80%;
  left: 10%;
}

/* ---------- Card interactions ---------- */
.card-hover {
  transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s var(--ease-out-expo);
  will-change: transform, box-shadow;
}

.card-hover:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12) !important;
}

.feature-icon-wrap {
  transition: transform 0.4s var(--ease-elastic), background-color 0.3s ease;
}

.card-hover:hover .feature-icon-wrap {
  transform: scale(1.15) rotate(-4deg);
  background-color: rgba(0, 128, 128, 0.18);
}

/* ---------- Popular plan glow ---------- */
@keyframes popularPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 128, 128, 0.25); }
  50% { box-shadow: 0 0 25px 5px rgba(0, 128, 128, 0.18); }
}

.plan-popular {
  animation: popularPulse 3s var(--ease-in-out-sine) infinite;
}

.plan-popular:hover {
  animation: none;
  box-shadow: 0 25px 50px rgba(0, 128, 128, 0.22) !important;
}

/* ---------- Buttons ---------- */
.btn {
  transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-pulse {
  animation: btnPulse 2s var(--ease-in-out-sine) infinite;
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
}

/* ---------- PreFooter gradient ---------- */
.prefooter-gradient {
  background: linear-gradient(135deg, #008080 0%, #006b6b 50%, #0a4a4a 100%);
  background-size: 250% 250%;
  animation: gradientShift 10s ease infinite;
}

/* ---------- Section headings underline draw ---------- */
.section-title {
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--tuwy-teal);
  border-radius: 2px;
  margin: 0.75rem auto 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.6s var(--ease-out-expo);
}

.section-title.is-visible::after {
  transform: scaleX(1);
}

/* ---------- Footer ---------- */
.footer-link {
  transition: color 0.25s ease, transform 0.25s ease;
  display: inline-block;
}

.footer-link:hover {
  color: var(--tuwy-teal) !important;
  transform: translateX(4px);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1;
    transform: none;
  }
}
