/* ========================================
   ROOT SYSTEM
======================================== */
:root {
  --bg-dark: #020617;
  --text-main: #f8fafc;
  --text-muted: rgba(255,255,255,0.72);
  --ease-lux: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========================================
   HERO BASE
======================================== */
.hero {
  position: relative;
  min-height: 100vh;
  background: var(--bg-dark);
  overflow: hidden;
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ========================================
   BACKGROUND SLIDESHOW & PARALLAX WRAPPER
======================================== */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

/* Kept for your JS parallax effect */
.hero-video-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
  transition: transform 0.1s linear;
}

/* The dark gradient overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(2,6,23,0.85) 0%,
    rgba(2,6,23,0.35) 50%,
    rgba(2,6,23,0.9) 100%
  );
  transition: opacity 0.6s var(--ease-soft);
}

/* --- NEW: Image Crossfade Logic --- */
.hero-slideshow {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  /* Keeps the moody, premium filter */
  filter: brightness(0.55) contrast(1.12) saturate(1.05);
  opacity: 0;
  /* Total 15 seconds, fades endlessly */
  animation: crossfade 15s infinite; 
}

/* Ensure these match your file names in the assets folder! */
.bg-1 {
  background-image: url('../assets/NAT-001.jpg');
  animation-delay: 0s;
}
.bg-2 {
  background-image: url('../assets/NAT-002.jpg');
  animation-delay: 5s;
}
.bg-3 {
  background-image: url('../assets/NAT-003.jpg');
  animation-delay: 10s;
}

@keyframes crossfade {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  33%  { opacity: 1; }
  43%  { opacity: 0; }
  100% { opacity: 0; }
}

/* ========================================
   BRAND NAME (Stays in Hero, Scrolls Away)
======================================== */
.hero-brand-fixed {
  position: absolute; 
  top: 10vh; 
  left: 50%;
  /* Pushed further right (from 50px to 80px) to make room */
  transform: translateX(calc(-50% + 80px)); 
  width: max-content; 
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}

.hero-brand-name {
  font-weight: 900; 
  font-size: clamp(2rem, 5.5vw, 6rem); 
  /* YOUR FIX: Reduced from 0.08em to 0.02em to perfectly fit the characters! */
  letter-spacing: 0.02em; 
  text-transform: uppercase;
  margin: 0;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 80px rgba(255, 255, 255, 0.3), 0 0 120px rgba(255, 255, 255, 0.2);
  white-space: nowrap;
  animation: brandGlow 4s ease-in-out infinite;
  transition: all 0.6s var(--ease-lux);
  position: relative;
}

.hero-brand-name::before {
  content: 'SWEAT ZONE FITNESS';
  position: absolute;
  left: 0.8rem; /* Adjusted for the tighter spacing */
  top: 0.6rem;
  z-index: -1;
  background: linear-gradient(135deg, #f97316 0%, #facc15 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.15;
  filter: blur(2px);
  transform: translate(3px, 3px);
}

/* ========================================
   LOGO (Fixed, Animates to Navbar)
======================================== */
.hero-logo-container {
  position: fixed;
  top: 0; 
  left: 0;
  /* Pushed significantly further left (from -420px to -580px) to clear the "S" entirely */
  transform: translate(calc(50vw - 580px), 12vh); 
  z-index: 1000;
  will-change: transform;
  transition: transform 0.7s var(--ease-lux); 
}

.hero-logo {
  width: 105px; 
  height: auto;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.5));
  transform-origin: center center;
  animation: logoRotateSlow 28s linear infinite;
  transition: width 0.7s var(--ease-lux);
}

/* THE MAGIC FIX: 
   Because we are only transitioning the 'transform' property, 
   the logo moves in a perfectly straight line directly to the navbar! 
*/
.hero-logo-container.shrink {
  transform: translate(6rem, 0.8rem); 
}

.hero-logo-container.shrink .hero-logo {
  width: 50px; 
}

/* ========================================
   CONTENT LAYOUT
======================================== */
.hero-content {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

/* ========================================
   HEADLINE
======================================== */
.hero-middle {
  flex: 1;
  display: flex;
  align-items: flex-end; /* This forces the text down to the bottom of the container */
  padding: 15rem 3rem 1.5rem; /* Drastically reduced bottom padding */
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.hero-main-headline {
  font-weight: 300;
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.35;
  text-shadow: 0 20px 60px rgba(0,0,0,0.6);
  max-width: 800px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 1.8s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards;
}

.hero-main-headline:hover {
  transform: translateY(-5px);
  text-shadow: 0 35px 90px rgba(0,0,0,0.9);
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(40px); }
  60% { opacity: 1; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ========================================
   CTA BUTTON
======================================== */
.hero-bottom {
  padding: 1rem 2rem 6rem; /* Reduced top padding so the button hugs the text above it */
  width: 100%;
  display: flex;
  justify-content: center;
}

.hero-cta-btn {
  position: relative;
  padding: 1.5rem 4.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #f97316, #facc15);
  color: #070707;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.5s var(--ease-lux), box-shadow 0.5s var(--ease-lux), letter-spacing 0.3s var(--ease-soft);
  box-shadow: 0 10px 40px rgba(249,115,22,0.25);
  opacity: 0;
  animation: fadeInUp 1s var(--ease-lux) 0.8s forwards;
}

.hero-cta-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #facc15, #f97316);
  opacity: 0;
  transition: opacity 0.5s var(--ease-soft);
}

.hero-cta-btn:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 30px 70px rgba(249,115,22,0.4);
  letter-spacing: 0.32em;
}

.hero-cta-btn:hover::before { opacity: 1; }

.hero-cta-btn:active {
  transform: translateY(-2px) scale(0.98);
  transition-duration: 0.1s;
}

.btn-text {
  position: relative;
  z-index: 2;
  display: block;
  transition: transform 0.3s var(--ease-soft);
}

.hero-cta-btn:hover .btn-text { transform: scale(1.05); }

.btn-glow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, #f97316, #facc15, #f97316);
  border-radius: 12px;
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.5s var(--ease-soft);
  z-index: 0;
}

.hero-cta-btn:hover .btn-glow { opacity: 0.6; }

/* ========================================
   SCROLL INDICATOR
======================================== */
.hero-scroll-indicator {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.7;
  z-index: 6;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 1rem;
  transition: opacity 0.4s var(--ease-soft), transform 0.4s var(--ease-soft);
  animation: fadeIn 1s var(--ease-soft) 1.5s forwards, float 3s ease-in-out infinite;
}

.hero-scroll-indicator:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 0.7; }
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

.scroll-line {
  width: 1px;
  height: 35px;
  background: linear-gradient(180deg, transparent, white, transparent);
  margin: 0 auto 0.6rem;
  transition: height 0.4s var(--ease-soft);
}

.hero-scroll-indicator:hover .scroll-line { height: 45px; }

.scroll-text {
  display: block;
  padding-top: 0.5rem;
  transition: transform 0.3s var(--ease-soft);
}

.hero-scroll-indicator:hover .scroll-text { transform: translateY(3px); }

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1024px) {
  .hero-brand-fixed { transform: translateX(calc(-50% + 60px)); }
  .hero-logo-container { transform: translate(calc(50vw - 450px), 10vh); }
  .hero-logo { width: 90px; }
  .hero-middle { padding: 12rem 2.5rem 2rem; }
}

@media (max-width: 768px) {
  .hero-brand-name { font-size: clamp(1.8rem, 4.5vw, 3.5rem); letter-spacing: 0.02em; }
  .hero-brand-fixed { transform: translateX(calc(-50% + 40px)); top: 12vh; }
  .hero-logo-container { transform: translate(calc(50vw - 320px), 12vh); }
  .hero-logo { width: 75px; }
  .hero-middle { padding: 10rem 1.5rem 2rem; }
}

@media (max-width: 480px) {
  .hero-brand-name { font-size: clamp(1.2rem, 4vw, 2.2rem); letter-spacing: 0.02em; }
  .hero-brand-fixed { transform: translateX(calc(-50% + 25px)); top: 12vh; }
  .hero-logo-container { transform: translate(calc(50vw - 190px), 12vh); }
  .hero-logo { width: 60px; }
  .hero-middle { padding: 8rem 0.5rem 2rem; }
  .hero-logo-container.shrink .hero-logo { width: 38px; }
}

@media (max-width: 375px) {
  .hero-brand-name { font-size: clamp(1rem, 3.5vw, 1.8rem); letter-spacing: 0.02em; }
  .hero-brand-fixed { transform: translateX(calc(-50% + 20px)); }
  .hero-logo-container { transform: translate(calc(50vw - 150px), 12vh); }
  .hero-logo { width: 50px; }
  .hero-logo-container.shrink .hero-logo { width: 35px; }
}

/* ========================================
   ACCESSIBILITY & TOUCH DEVICES
======================================== */
@media (hover: none) and (pointer: coarse) {
  .hero-cta-btn { padding: 1.3rem 3.5rem; min-height: 48px; font-size: 0.9rem; }
  .hero-cta-btn:hover { transform: none; box-shadow: 0 10px 40px rgba(249,115,22,0.25); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .hero-video-wrapper { transform: translate3d(-50%, -50%, 0) !important; }
  .brandGlow { animation: none !important; }
}

@media (prefers-color-scheme: light) {
  :root { --text-main: #0f172a; --bg-dark: #f8fafc; }
}