/* Enhanced Hero Section Styles */
.hero-grid {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: var(--dark-bg);
  padding-top: 50px;
}

/* Hero Video Background */
.hero-video-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  background-color: var(--dark-bg);
  /* Ensure isolated compositing layer for video */
  isolation: isolate;
}

/* Only show poster image when video fails */
.hero-video-background.video-fallback {
  background-image: url("construction_table_scene.png");
  background-size: cover;
  background-position: center;
}

/* Subtle overlay effect for text readability */
.hero-video-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.35) 50%,
    rgba(0, 0, 0, 0.5) 100%
  );
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 1;
  pointer-events: none;
}

.hero-video-background video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* GPU acceleration for smooth playback */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Performance optimization: hint browser to prioritize video rendering */
  contain: layout paint;
  /* Prevent flickering during playback */
  background-color: transparent;
}

/* Hero Overlay Content */
.hero-overlay {
  padding: 4rem 2rem 3rem;
  gap: 2.5rem;
  /* Use solid background instead of gradient to reduce render calculations */
  background: rgba(0, 0, 0, 0.03);
  /* Ensure overlay stays on its own compositing layer */
  isolation: isolate;
}

/* Hero Logo Styling */
.hero-logo {
  width: 340px;
  height: 340px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Soften the square logo with rounded corners and shadow */
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Add slight rounding to image edges */
  border-radius: 16px;
}

/* Hero Text Container */
.hero-text-content {
  max-width: 920px;
  width: min(95%, 920px);
  padding: 3.5rem 3rem 2.5rem;
  background: transparent;
  border-radius: 20px;
}

/* Ensure hero video fills viewport on mobile */
@media (max-width: 768px) {
  .hero,
  .hero-video-background,
  .hero-video-background video {
    min-height: 100vh;
    height: 100vh;
  }

  .hero-parallax-container {
    display: none;
  }

  .hero-text-content {
    max-width: 920px;
    width: min(95%, 920px);
    padding: 3.5rem 3rem 2.5rem;
    background: transparent;
    border-radius: 20px;
  }
}

/* Hero Headline - Animate In */
.hero-content__headline {
  font-size: clamp(5rem, 7vw, 9rem);
  font-weight: 800;
  margin: 0 0 0.75rem;
  color: var(--text-primary);
  text-shadow: 0 5px 18px rgba(0, 0, 0, 0.75);
  line-height: 1.02;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  max-width: 900px;
}

/* Hero Copy */
.hero-copy {
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 2rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Hero CTA Button */
.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.hero-button {
  padding: 1.3rem 3.2rem;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-primary);
  transition: all var(--transition-base);
  pointer-events: auto;
}

.hero-button:hover {
  background: var(--gradient-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary-lg);
}

.hero-button:active {
  transform: translateY(0);
}

/* Rating Card */
.hero-rating-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-rating-stars {
  color: var(--primary);
  font-size: 1rem;
}

.hero-rating-card p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Floating shapes for parallax background */
.parallax-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Ensure parallax layer is isolated from video compositing */
  isolation: isolate;
}

.floating-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: -100px;
  right: -100px;
  /* Animation removed for video playback performance */
}

.shape-2 {
  width: 200px;
  height: 200px;
  background: var(--primary);
  bottom: 20%;
  left: -50px;
  /* Animation removed for video playback performance */
}

.shape-3 {
  width: 150px;
  height: 150px;
  background: var(--primary);
  top: 30%;
  right: 10%;
  /* Animation removed for video playback performance */
}

/* Floating shapes for parallax background - static for video performance */
/* Animations removed to prevent interference with video playback */
@media (max-width: 768px) {
  /* Mobile-only: immersive landing — hide navbar on hero until scroll */
  #navbar {
    background: transparent !important;
    box-shadow: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-6px) !important;
    transition:
      opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      background 0.3s ease,
      box-shadow 0.3s ease !important;
  }

  /* Reveal on any scroll — same behaviour as desktop */
  #navbar.visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }

  /* Solid background after 50 px scroll threshold */
  #navbar.scrolled {
    background: var(--dark-bg) !important;
    box-shadow: var(--shadow-md) !important;
  }

  #navbar .nav-links {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0.25rem 0.5rem !important;
    gap: 0.25rem !important;
  }

  #navbar .nav-links li {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    text-align: center !important;
  }

  #navbar .nav-links a {
    min-width: max-content !important;
    padding: 0.5rem 0.5rem !important;
  }

  /* Mobile: reset desktop center wrapper and CTA button */
  #navbar .nav-center-wrapper {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 0 !important;
  }

  .nav-links a.nav-cta-btn {
    background: var(--gradient) !important;
    color: white !important;
    padding: 0.6rem 1.4rem !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
    box-shadow: var(--shadow-primary) !important;
    transition: all var(--transition-base) !important;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
  }

  .nav-links a.nav-cta-btn:hover {
    background: var(--gradient-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-primary-lg) !important;
  }

  .nav-links a.nav-cta-btn:active {
    background: var(--gradient) !important;
    transform: scale(0.97) !important;
    opacity: 0.88 !important;
  }

  /* Nav overlay — fully centered, immersive */
  .hero-overlay {
    padding: 0;
    gap: 1.25rem;
    background: transparent;
  }

  /* Hero logo — large and centered */
  .hero-logo {
    width: 240px;
    height: 240px;
    margin-bottom: 0.5rem;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  }

  .hero-logo img {
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.5));
    border-radius: 12px;
  }

  /* Hero text — slogan only, centered */
  .hero-text-content {
    padding: 0 1rem;
    background: transparent;
    width: 98%;
  }

  .hero-content__headline {
    font-size: clamp(1.6rem, 6vw, 2.8rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.06em;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.8);
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    padding: 0 0.5rem;
  }

  .hero-subtitle {
    font-size: clamp(1.3rem, 4vw, 2rem);
    line-height: 1.2;
    letter-spacing: 0.08em;
    opacity: 0;
    animation: heroFadeIn 0.8s ease-out 0.3s forwards;
  }

  .hero-copy {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-rating-card {
    padding: 0.8rem 1.5rem;
  }

  .hero-button {
    padding: 1rem 2rem;
    font-size: 1rem;
  }

  /* Show hero CTA and rating card on mobile, same as desktop */
  .hero-cta-group {
    display: flex;
  }

  .hero-rating-card {
    display: inline-flex;
  }

  /* Hide sticky CTA - nav button and hero button both serve as CTA */
  .sticky-cta {
    display: none;
  }
}

/* ==========================================
    ANIMATED STAT COUNTERS
    ========================================== */
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  max-width: 100%;
}

.stat-number {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
  text-align: center;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.stat-number.counted {
  color: var(--primary-light);
}

.stat-label {
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  word-break: break-word;
  hyphens: auto;
}

/* Mobile-specific fixes for stat counters to prevent overlap */
@media (max-width: 768px) {
  .stat-item {
    padding: 0.5rem 0.25rem !important;
    min-width: 0 !important;
    flex: 1 1 0 !important;
  }

  .stat-number {
    font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
    line-height: 1.1 !important;
    padding: 0 0.25rem !important;
  }

  .stat-label {
    font-size: clamp(0.65rem, 2vw, 0.8rem) !important;
    line-height: 1.3 !important;
    max-width: 100% !important;
  }
}

/* Extra small screens */
@media (max-width: 380px) {
  .stat-number {
    font-size: clamp(1.4rem, 7vw, 1.75rem);
  }

  .stat-label {
    font-size: 0.6rem;
  }
}

/* ==========================================
     STANDALONE STATS SECTION
     ========================================== */
.stats-section {
  padding: 3rem 1rem;
  background: var(--dark-bg);
  border-top: 1px solid var(--dark-600);
  border-bottom: 1px solid var(--dark-600);
  width: 100%;
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stats-container .stat-item {
  flex: 1 1 auto;
  min-width: 120px;
  max-width: 200px;
  padding: 1rem;
  text-align: center;
}

.stats-container .stat-number {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.stats-container .stat-label {
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Mobile adjustments for stats section */
@media (max-width: 768px) {
  .stats-section {
    padding: 2rem 0.75rem;
  }

  .stats-container {
    gap: 1rem;
  }

  .stats-container .stat-item {
    flex: 1 1 calc(33.333% - 1rem);
    min-width: calc(33.333% - 1rem);
    max-width: calc(33.333% - 1rem);
    padding: 0.75rem 0.25rem;
  }

  .stats-container .stat-number {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .stats-container .stat-label {
    font-size: clamp(0.6rem, 2vw, 0.75rem);
  }
}

/* Extra small screens */
@media (max-width: 380px) {
  .stats-container .stat-item {
    flex: 1 1 100%;
    max-width: 100%;
    padding: 0.5rem;
  }

  .stats-container .stat-number {
    font-size: clamp(1.25rem, 6vw, 1.5rem);
  }
}

/* Ensure testimonials section has proper spacing below stats */
@media (max-width: 768px) {
  .testimonials-slider {
    margin-bottom: 1rem !important;
  }

  .testimonial-stats {
    margin-bottom: 1.5rem !important;
  }
}

/* Fix testimonial stats container on mobile to prevent overflow */
@media (max-width: 768px) {
  .testimonial-stats {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 0.5rem !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .testimonial-stats .stat-item {
    flex: 1 1 auto !important;
    min-width: calc(33.333% - 0.5rem) !important;
    max-width: calc(33.333% - 0.5rem) !important;
    padding: 0.25rem !important;
  }

  /* Fallback for older markup with div wrappers */
  .testimonial-stats div {
    flex: 1 1 auto !important;
    min-width: calc(33.333% - 0.5rem) !important;
    max-width: calc(33.333% - 0.5rem) !important;
    padding: 0.25rem !important;
  }
}

/* Counter animation */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-number.animating {
  animation: countUp 0.4s ease-out forwards;
}

/* ==========================================
    STICKY MOBILE GET FREE QUOTE CTA BAR
    ========================================== */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  background: var(--dark-bg);
  border-top: 1px solid var(--dark-600);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

/* iOS safe area - prevent black bar at bottom */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .sticky-cta {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  }
}

.sticky-cta.visible {
  transform: translateY(0);
}

.sticky-cta__text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.sticky-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.5rem;
  background: var(--gradient);
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-primary);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.sticky-cta__btn:hover {
  background: var(--gradient-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-primary-lg);
}

.sticky-cta__btn:active {
  transform: translateY(0);
}

/* ==========================================
   BREADCRUMB NAVIGATION
   ========================================== */
.breadcrumb-nav {
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}

.breadcrumb-list li {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.breadcrumb-list li a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-list li a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--dark-400);
  margin: 0 0.25rem;
}

.breadcrumb-list li[aria-current="page"] {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .breadcrumb-nav {
    display: none;
  }

  .hero-copy {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Desktop: hide the sticky CTA bar */
@media (min-width: 769px) {
  .sticky-cta {
    display: none;
  }
}

/* Desktop navbar visibility - ensure navbar shows on desktop */
@media (min-width: 769px) {
  #navbar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    transition:
      background 0.3s ease,
      box-shadow 0.3s ease !important;
  }

  #navbar.scrolled {
    background: rgba(10, 10, 10, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.4) !important;
  }

  #navbar .nav-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 0.75rem 2rem !important;
    gap: 3rem !important;
  }

  #navbar .nav-center-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3rem !important;
  }

  #navbar .nav-links {
    display: flex !important;
  }

  .nav-logo {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    flex-shrink: 0 !important;
  }

  .nav-logo img {
    width: 72px !important;
    height: 72px !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* Hide nav content on initial page load; reveal on first scroll */
  #navbar .nav-links,
  #navbar .nav-logo {
    opacity: 0 !important;
    transform: translateY(-6px) !important;
    transition:
      opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  #navbar.visible .nav-links,
  #navbar.visible .nav-logo {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
}

/* ==========================================
    FORM MICRO-INTERACTIONS
    ========================================== */
.form-group {
  position: relative;
}

.form-group input,
.form-group select,
.form-group textarea {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(235, 146, 54, 0.15) !important;
  background-color: rgba(235, 146, 54, 0.03) !important;
  outline: none;
}

.form-group input.success,
.form-group select.success {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* Floating label effect */
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label {
  color: var(--primary);
}

/* Submit button hover lift */
#contactForm button[type="submit"] {
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

#contactForm button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary-lg);
}

#contactForm button[type="submit"]:active {
  transform: translateY(0);
}

/* ==========================================
    SCROLL ANIMATION POLISH
    ========================================== */
section {
  opacity: 1;
}

.service-card,
.testimonial-slide,
.about-content,
.about-image,
.contact-info,
.contact-form {
  will-change: opacity, transform;
}
