/* GYMRAT — Mejoras visuales y animaciones solo en la home */

/* ─── Fondos fotográficos gym ─── */
.section-has-bg {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.section-has-bg > .container,
.section-has-bg > .hero-glow-grid,
.section-has-bg > .hero-particles,
.section-has-bg > .hero-grid {
  position: relative;
  z-index: 2;
}
.section-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.05);
  will-change: transform;
}
.section-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(6, 8, 12, 0.94) 0%, rgba(6, 8, 12, 0.72) 45%, rgba(6, 8, 12, 0.88) 100%),
    linear-gradient(to top, rgba(6, 8, 12, 0.95), transparent 40%);
}
.section-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 80% 20%, rgba(204, 255, 0, 0.08), transparent 55%);
  z-index: 1;
  pointer-events: none;
}
.section-bg-hero {
  background-image: url('/site/static/assets/images/hero-gym.jpg');
  animation: kenBurns 22s ease-in-out infinite alternate;
}
.section-bg-roles {
  background-image: url('/site/static/assets/images/gym-floor.jpg');
}
.section-bg-features {
  background-image: url('/site/static/assets/images/weights.jpg');
}
.section-bg-steps {
  background-image: url('/site/static/assets/images/training.jpg');
}
.section-bg-quotes {
  background-image: url('/site/static/assets/images/dumbbells.jpg');
}
.section-bg-cta {
  background-image: url('/site/static/assets/images/hero-gym.jpg');
  animation: kenBurns 28s ease-in-out infinite alternate-reverse;
}
.section-bg-features::after,
.section-bg-quotes::after {
  background:
    linear-gradient(180deg, rgba(6, 8, 12, 0.9) 0%, rgba(6, 8, 12, 0.82) 50%, rgba(6, 8, 12, 0.92) 100%),
    linear-gradient(to right, rgba(6, 8, 12, 0.85), transparent 60%);
}
@keyframes kenBurns {
  from { transform: scale(1.05) translate(0, 0); }
  to { transform: scale(1.12) translate(-1%, -1%); }
}
@media (min-width: 901px) {
  .section-bg-parallax { background-attachment: fixed; }
  .section-bg-hero,
  .section-bg-features,
  .section-bg-cta { background-attachment: fixed; }
}
body.page-home .section-has-bg .glass-card,
body.page-home .section-has-bg .showcase-item,
body.page-home .section-has-bg .step,
body.page-home .section-has-bg .quote {
  background: rgba(18, 24, 32, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
body.page-home .section-has-bg .showcase-item {
  background: rgba(18, 24, 32, 0.75);
}

body.page-home .bg-mesh {
  animation: meshDrift 18s ease-in-out infinite alternate;
  opacity: 0.45;
}

@keyframes meshDrift {
  0% {
    background:
      radial-gradient(ellipse 60% 45% at 85% 5%, rgba(204, 255, 0, 0.11), transparent),
      radial-gradient(ellipse 50% 40% at 5% 95%, rgba(0, 212, 255, 0.09), transparent),
      var(--bg);
  }
  100% {
    background:
      radial-gradient(ellipse 55% 50% at 75% 15%, rgba(204, 255, 0, 0.14), transparent),
      radial-gradient(ellipse 45% 45% at 15% 85%, rgba(0, 212, 255, 0.12), transparent),
      var(--bg);
  }
}

/* Grid de gym en el hero */
.hero-glow-grid {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.35;
}
.hero-glow-grid::before {
  content: '';
  position: absolute;
  inset: -50% -20%;
  background-image:
    linear-gradient(rgba(204, 255, 0, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(204, 255, 0, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(500px) rotateX(58deg);
  transform-origin: center top;
  animation: gridScroll 20s linear infinite;
}
@keyframes gridScroll {
  from { background-position: 0 0; }
  to { background-position: 0 48px; }
}

/* Partículas flotantes */
.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  animation: particleFloat var(--dur, 8s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes particleFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.35; }
  50% { transform: translate(var(--tx, 12px), var(--ty, -24px)) scale(1.15); opacity: 0.7; }
}

/* Marquee fitness */
.marquee-wrap {
  border-block: 1px solid var(--border);
  background: rgba(18, 24, 32, 0.65);
  backdrop-filter: blur(8px);
  overflow: hidden;
  padding: 14px 0;
  margin-bottom: 8px;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
  gap: 0;
}
.marquee-track span {
  flex-shrink: 0;
  padding: 0 28px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.marquee-track span.accent { color: var(--brand); }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Hero mejorado */
body.page-home .hero {
  padding: 48px 0 64px;
  overflow: hidden;
  position: relative;
}

.hero-content > * {
  opacity: 0;
  transform: translateY(20px);
  animation: heroIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-content > *:nth-child(1) { animation-delay: 0.05s; }
.hero-content > *:nth-child(2) { animation-delay: 0.15s; }
.hero-content > *:nth-child(3) { animation-delay: 0.25s; }
.hero-content > *:nth-child(4) { animation-delay: 0.35s; }
.hero-content > *:nth-child(5) { animation-delay: 0.45s; }

@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

body.page-home .hero h1 .highlight {
  background-size: 200% auto;
  animation: shimmerText 4s linear infinite;
}
@keyframes shimmerText {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero-badge {
  animation: badgePulse 3s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(204, 255, 0, 0); }
  50% { box-shadow: 0 0 20px 2px rgba(204, 255, 0, 0.15); }
}

body.page-home .btn-primary.btn-glow {
  position: relative;
  overflow: hidden;
}
body.page-home .btn-primary.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-120%);
  animation: btnShine 3.5s ease-in-out infinite;
}
@keyframes btnShine {
  0%, 70%, 100% { transform: translateX(-120%); }
  85% { transform: translateX(120%); }
}

/* Stats animados */
.hero-stat {
  position: relative;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(26, 34, 48, 0.6);
  border: 1px solid var(--border);
  transition: border-color 0.3s, transform 0.3s;
}
.hero-stat:hover {
  border-color: rgba(204, 255, 0, 0.35);
  transform: translateY(-3px);
}
.hero-stat strong {
  font-variant-numeric: tabular-nums;
}

/* Visual hero */
.hero-visual-wrap {
  position: relative;
  animation: heroVisualIn 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}
@keyframes heroVisualIn {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.hero-ring {
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  border: 1px dashed rgba(204, 255, 0, 0.2);
  animation: ringSpin 24s linear infinite;
}
.hero-ring-2 {
  inset: -4%;
  border-color: rgba(0, 212, 255, 0.15);
  animation-direction: reverse;
  animation-duration: 18s;
}
@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

.hero-visual-wrap img {
  position: relative;
  z-index: 1;
  animation: heroImgFloat 5s ease-in-out infinite;
}
@keyframes heroImgFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-chip {
  position: absolute;
  z-index: 2;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(18, 24, 32, 0.92);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}
.hero-chip.chip-1 {
  top: 12%;
  right: -4%;
  animation: chipBob 4s ease-in-out infinite;
  border-color: rgba(204, 255, 0, 0.3);
  color: var(--brand);
}
.hero-chip.chip-2 {
  bottom: 18%;
  left: -6%;
  animation: chipBob 4.5s ease-in-out 0.5s infinite;
  border-color: rgba(0, 212, 255, 0.3);
  color: var(--blue);
}
.hero-chip .chip-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
  margin-top: 6px;
  overflow: hidden;
}
.hero-chip .chip-bar span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  animation: barGrow 2s ease-out 0.8s both;
}
@keyframes chipBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes barGrow {
  from { width: 0; }
  to { width: var(--w, 72%); }
}

body.page-home .float-badge {
  animation: float 4s ease-in-out infinite, badgeGlow 2s ease-in-out infinite alternate;
  z-index: 3;
}
@keyframes badgeGlow {
  from { box-shadow: 0 0 12px rgba(204, 255, 0, 0.1); }
  to { box-shadow: 0 0 24px rgba(204, 255, 0, 0.25); }
}

/* Stagger en cards */
body.page-home .stagger-grid .glass-card {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease, border-color 0.25s;
}
body.page-home .stagger-grid .glass-card.visible {
  opacity: 1;
  transform: translateY(0);
}
body.page-home .glass-card {
  position: relative;
  overflow: hidden;
}
body.page-home .glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(204, 255, 0, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
body.page-home .glass-card:hover::before { opacity: 1; }
body.page-home .glass-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}
body.page-home .card-icon {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
body.page-home .glass-card:hover .card-icon {
  transform: scale(1.12) rotate(-4deg);
}

/* Feature showcase strip */
.showcase-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}
.showcase-item {
  text-align: center;
  padding: 20px 12px;
  border-radius: var(--radius-sm);
  background: rgba(18, 24, 32, 0.5);
  border: 1px solid var(--border);
  transition: transform 0.3s, border-color 0.3s;
}
.showcase-item:hover {
  transform: scale(1.04);
  border-color: rgba(0, 212, 255, 0.35);
}
.showcase-item .num {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--brand);
  line-height: 1.2;
}
.showcase-item .lbl {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}

/* Steps animados */
body.page-home .step {
  transition: transform 0.3s, border-color 0.3s;
}
body.page-home .step:hover {
  transform: translateX(6px);
  border-color: rgba(204, 255, 0, 0.3);
}
body.page-home .step::before {
  transition: transform 0.3s;
}
body.page-home .step:hover::before {
  transform: scale(1.15);
}

/* Quotes */
body.page-home .quote {
  transition: transform 0.35s, box-shadow 0.35s;
}
body.page-home .quote:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

/* CTA band animado */
body.page-home .cta-band {
  position: relative;
  overflow: hidden;
}
body.page-home .cta-band::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: conic-gradient(from 0deg, var(--brand), var(--blue), var(--brand));
  opacity: 0.15;
  animation: ctaSpin 8s linear infinite;
  z-index: 0;
}
body.page-home .cta-band > * {
  position: relative;
  z-index: 1;
}
@keyframes ctaSpin {
  to { transform: rotate(360deg); }
}

/* Nav al scroll */
body.page-home .site-nav.scrolled {
  background: rgba(6, 8, 12, 0.95);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* Section alt con degradado */
.section-glow {
  position: relative;
}
.section-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: 0.4;
}

@media (max-width: 900px) {
  .showcase-strip { grid-template-columns: repeat(2, 1fr); }
  .hero-chip.chip-1 { right: 0; }
  .hero-chip.chip-2 { left: 0; }
  .hero-ring { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-content > * { opacity: 1; transform: none; }
}
