/* ==========================================================================
   Fenix Training Gym — motion & polish layer (sits on top of Tailwind CDN)
   ========================================================================== */

html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

::selection {
  background: #FF3D00;
  color: #0D0D0D;
}

/* ---- Scroll progress bar ---- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #FF3D00, #FFD600);
  z-index: 60;
  transform-origin: left;
}

/* ---- Buttons ---- */
.btn-primary {
  background-color: #FF3D00;
  color: #0D0D0D;
  position: relative;
  overflow: hidden;
  transition: box-shadow .35s cubic-bezier(.19,1,.22,1), background-color .35s cubic-bezier(.19,1,.22,1);
}
.btn-primary:hover {
  background-color: #ff562c;
  box-shadow: 0 0 24px rgba(255, 61, 0, 0.45);
}
.btn-outline {
  border: 2px solid #e5e2e1;
  color: #e5e2e1;
  background: transparent;
  transition: border-color .35s cubic-bezier(.19,1,.22,1), color .35s cubic-bezier(.19,1,.22,1);
}
.btn-outline:hover {
  border-color: #FF3D00;
  color: #FF3D00;
}
.neon-border {
  border: 1px solid #262626;
  transition: all 0.3s ease;
}
.neon-border:hover, .neon-border-active {
  border-color: #FF3D00;
  box-shadow: 0 0 4px rgba(255, 61, 0, 0.4);
}

.magnetic {
  will-change: transform;
}
.magnetic:active {
  transform: scale(.97);
}

/* ---- Nav ---- */
.nav-bar {
  transition: background-color .4s ease, box-shadow .4s ease;
}
.nav-bar.nav-scrolled {
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.nav-logo-mark {
  height: clamp(32px, 8vw, 44px);
  width: auto;
  flex-shrink: 0;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
}
.nav-logo:hover .nav-logo-mark {
  transform: rotate(-8deg) scale(1.08);
}
.nav-link {
  position: relative;
  padding-bottom: 4px;
  transition: color .3s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0%;
  background: #FF3D00;
  transition: width .35s cubic-bezier(.19,1,.22,1);
}
.nav-link:hover {
  color: #FF3D00;
}
.nav-link:hover::after {
  width: 100%;
}

/* ---- Hamburger ---- */
.hamburger {
  width: 28px;
  height: 20px;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}
.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  transition: transform .35s cubic-bezier(.19,1,.22,1), opacity .25s ease;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ---- Mobile menu ---- */
.mobile-menu {
  position: fixed;
  inset: 0;
  top: 80px;
  background: #0D0D0D;
  z-index: 45;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 40px;
  clip-path: circle(0px at calc(100% - 40px) 40px);
  transition: clip-path .6s cubic-bezier(.19,1,.22,1);
  pointer-events: none;
}
.mobile-menu.open {
  clip-path: circle(150% at calc(100% - 40px) 40px);
  pointer-events: auto;
}
.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 28px;
  text-align: center;
}
.mobile-link {
  font-family: 'Anton', sans-serif;
  font-size: 28px;
  letter-spacing: .02em;
  color: #e5e2e1;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .4s ease, color .3s ease;
}
.mobile-menu.open .mobile-link {
  animation: mobileLinkIn .5s cubic-bezier(.19,1,.22,1) forwards;
}
.mobile-menu.open .mobile-link:nth-child(1) { animation-delay: .08s; }
.mobile-menu.open .mobile-link:nth-child(2) { animation-delay: .14s; }
.mobile-menu.open .mobile-link:nth-child(3) { animation-delay: .20s; }
.mobile-menu.open .mobile-link:nth-child(4) { animation-delay: .26s; }
.mobile-menu.open .mobile-link:nth-child(5) { animation-delay: .32s; }
.mobile-menu.open .mobile-link:nth-child(6) { animation-delay: .38s; }
@keyframes mobileLinkIn {
  to { opacity: 1; transform: translateY(0); }
}
.mobile-link:hover {
  color: #FF3D00;
}

/* ---- Hero ---- */
.hero-bg {
  transform: scale(1.12);
  will-change: transform;
}
.hero-title {
  overflow: visible;
  font-size: clamp(2.5rem, 7.2vw, 5.25rem);
  line-height: 0.98;
}
.headline-lg-fluid {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
}
.hero-line {
  display: block;
  overflow: hidden;
}
.hero-line > span {
  display: inline-block;
  max-width: 100%;
  transform: translateY(115%);
  will-change: transform;
}
.hero-fade-item {
  opacity: 0;
  transform: translateY(24px);
}

.embers {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.ember {
  position: absolute;
  bottom: -10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #FF3D00;
  box-shadow: 0 0 8px 2px rgba(255,61,0,.7);
  opacity: 0;
  animation-name: emberRise;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}
@keyframes emberRise {
  0% { opacity: 0; transform: translate(0,0) scale(.6); }
  10% { opacity: .9; }
  80% { opacity: .5; }
  100% { opacity: 0; transform: translate(var(--drift, 20px), -110vh) scale(1); }
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  opacity: .7;
}
.scroll-indicator span {
  display: block;
  width: 1px;
  height: 46px;
  background: linear-gradient(to bottom, #FF3D00, transparent);
  position: relative;
  overflow: hidden;
}
.scroll-indicator span::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, #e5e2e1, transparent);
  animation: scrollLine 2.2s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { top: -100%; }
  100% { top: 100%; }
}

/* ---- Reveal on scroll ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
}
.reveal-fade {
  opacity: 0;
}

/* ---- Facilities carousel: continuous CSS marquee, paused on hover ----
   Two identical <ul class="carousel-track"> groups sit side by side inside
   an overflow:hidden viewport; both run the same translateX(0 -> -100%)
   animation in lockstep, so as the first group slides fully out of view
   the second — pixel-identical — is exactly in position to continue the
   motion with no visible seam. */
.carousel {
  display: flex;
  overflow: hidden;
  max-width: 1280px;
  margin: 0 auto;
}
.carousel-track {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  animation: carousel-spin 50s linear infinite;
}
.carousel:hover .carousel-track {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    animation: none;
  }
}
@keyframes carousel-spin {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
.carousel-slide {
  flex: 0 0 280px;
  margin-right: 16px;
  aspect-ratio: 4 / 3;
  border-radius: 0.25rem;
  overflow: hidden;
  border: 1px solid #262626;
  background: #1E1E1E;
  transition: border-color .35s ease, box-shadow .45s ease;
}
.carousel-slide:hover {
  border-color: #FF3D00;
  box-shadow: 0 16px 40px -20px rgba(255,61,0,.5);
}
.carousel-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.19,1,.22,1);
}
.carousel-slide:hover .carousel-img {
  transform: scale(1.07);
}
@media (min-width: 768px) {
  .carousel-slide { flex-basis: 340px; }
}
@media (min-width: 1100px) {
  .carousel-slide { flex-basis: 380px; }
}

/* ---- Value / discipline / plan cards ---- */
.value-card, .discipline-card, .plan-card {
  transition: transform .45s cubic-bezier(.19,1,.22,1), border-color .35s ease, box-shadow .45s ease;
}
.value-card:hover {
  transform: translateY(-6px);
  border-color: #FF3D00;
  box-shadow: 0 16px 40px -20px rgba(255,61,0,.5);
}
.value-icon {
  transition: transform .45s cubic-bezier(.34,1.56,.64,1);
}
.value-card:hover .value-icon {
  transform: scale(1.15) rotate(-6deg);
}
.discipline-card:hover {
  transform: translateY(-6px);
  border-color: #FF3D00;
  box-shadow: 0 16px 40px -20px rgba(255,61,0,.5);
}
.plan-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.6);
}
.plan-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #1E1E1E;
  transition: border-color .35s ease, box-shadow .45s ease;
}
@media (min-width: 768px) {
  .plan-photo {
    aspect-ratio: auto;
    height: 100%;
  }
}
.plan-photo:hover {
  border-color: #FF3D00;
  box-shadow: 0 16px 40px -20px rgba(255,61,0,.5);
}
.plan-photo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.19,1,.22,1);
}
.plan-photo:hover .plan-photo-img {
  transform: scale(1.05);
}

/* ---- FAQ accordion ---- */
.faq-item {
  transition: border-color .3s ease;
}
.faq-trigger {
  background: none;
  border: none;
  color: inherit;
}
.faq-icon {
  transition: transform .4s cubic-bezier(.19,1,.22,1);
}
.faq-trigger[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
}
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s cubic-bezier(.19,1,.22,1);
}
.faq-item.open .faq-panel {
  grid-template-rows: 1fr;
}
.faq-panel-inner {
  overflow: hidden;
  min-height: 0;
}
.faq-item.open {
  border-color: #FF3D00;
}

/* ---- Form ---- */
.form-field input,
.form-field select {
  transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}
.form-field input:focus,
.form-field select:focus {
  border-color: #FF3D00;
  box-shadow: 0 0 0 3px rgba(255,61,0,.15);
  outline: none;
}
.form-success {
  transition: opacity .4s ease, transform .4s ease;
}

.map-embed iframe {
  display: block;
}

/* ---- WhatsApp FAB ---- */
.whatsapp-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border-radius: 9999px;
  background: #25D366;
  color: #0D0D0D;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 55;
  box-shadow: 0 10px 30px -8px rgba(37,211,102,.6);
  transform: scale(0) translateY(20px);
  opacity: 0;
  transition: transform .5s cubic-bezier(.34,1.56,.64,1), opacity .4s ease, box-shadow .3s ease;
}
.whatsapp-fab.visible {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.whatsapp-fab:hover {
  box-shadow: 0 14px 36px -6px rgba(37,211,102,.75);
  transform: scale(1.08);
}
.whatsapp-fab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: #25D366;
  animation: fabPulse 2.6s ease-out infinite;
  z-index: -1;
}
@keyframes fabPulse {
  0% { transform: scale(1); opacity: .55; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-line > span {
    transform: none;
  }
  [data-reveal], .reveal-fade, .hero-fade-item {
    opacity: 1;
    transform: none;
  }
}
