/* ============================================
   BAY AUDIO VIDEO — Visual Flair & Effects
   Companion to style.css
   ============================================ */

/* ===========================================
   1. ANIMATED SHIMMER GRADIENT
   =========================================== */

@keyframes shimmer {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: -200% center;
  }
}

.text-gradient,
.section-label {
  background: linear-gradient(
    120deg,
    var(--teal-dark) 0%,
    var(--teal) 25%,
    var(--teal-light) 50%,
    var(--teal) 75%,
    var(--teal-dark) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
}

/* (Section 2 — cursor glow — removed) */

/* ===========================================
   2b. NAV LOGO SHIMMER
   =========================================== */

.nav__logo img {
  position: relative;
  filter: drop-shadow(0 0 6px rgba(20, 184, 166, 0.3));
  animation: logo-shimmer 4s ease-in-out infinite;
}

@keyframes logo-shimmer {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(20, 184, 166, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(20, 184, 166, 0.6))
           drop-shadow(0 0 4px rgba(94, 234, 212, 0.3));
  }
}

/* ===========================================
   3. 3D TILT EFFECT ON CARDS
   =========================================== */

.tilt-card {
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.35s ease;
}

.tilt-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
              0 0 30px var(--teal-glow);
}

/* ===========================================
   4. SCROLL PROGRESS BAR
   =========================================== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--teal-dark),
    var(--teal),
    var(--teal-light)
  );
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 9999;
  pointer-events: none;
  transition: transform 0.1s linear;
}

/* ===========================================
   5. PARALLAX DEPTH
   =========================================== */

.parallax-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%; /* extra height for parallax travel */
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
}

/* ===========================================
   6. MAGNETIC PULL ON BUTTONS
   =========================================== */

.magnetic {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ===========================================
   7. ANIMATED GLOWING ROTATING BORDER
   =========================================== */

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.glow-border {
  position: relative;
  overflow: hidden;
  z-index: 1;
  background: var(--bg-card);
}

.glow-border::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  /* Offset to center the oversized gradient */
  transform: translate(-50%, -50%) rotate(0deg);
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    var(--teal) 10%,
    var(--teal-light) 15%,
    transparent 25%,
    transparent 50%,
    var(--teal-dark) 60%,
    var(--teal) 65%,
    transparent 75%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -2;
  animation: rotate 4s linear infinite;
  pointer-events: none;
}

.glow-border::after {
  content: '';
  position: absolute;
  /* Inset by 2px to reveal the gradient border */
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: var(--bg-card);
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
}

.glow-border:hover::before {
  opacity: 1;
}

/* If the card has a border-radius, inherit it */
.glow-border[style*="border-radius"]::after,
.glow-border::after {
  border-radius: inherit;
}

/* ===========================================
   8. SUBTLE FILM GRAIN OVERLAY
   =========================================== */

.film-grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.035;
  /* 
     Inline SVG noise pattern — a 100x100 fractalNoise tile.
     This avoids any external file dependency.
  */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ===========================================
   9. SMOOTH PAGE LOAD FADE-IN
   =========================================== */

body {
  opacity: 0;
  transition: opacity 0.6s ease;
}

body.loaded {
  opacity: 1;
}

/* ===========================================
   10. BACK TO TOP BUTTON
   =========================================== */

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--bg-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9990;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.35s ease,
              transform 0.35s ease,
              background-color 0.2s ease,
              box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(20, 184, 166, 0.25);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--teal-light);
  box-shadow: 0 6px 24px rgba(20, 184, 166, 0.4);
  transform: translateY(-2px);
}

.back-to-top:active {
  transform: translateY(0);
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===========================================
   11. FLOATING TEAL PARTICLES CANVAS
   =========================================== */

.particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2; /* Between hero overlay (1) and hero content (3+) */
}

/* ===========================================
   12. FORM STATES
   =========================================== */

/* Success message after contact form submission */
.form-success {
  margin-top: 20px;
  padding: 16px 24px;
  border: 1px solid var(--teal);
  border-radius: 10px;
  background: rgba(20, 184, 166, 0.08);
  color: var(--teal-light);
  text-align: center;
  font-size: 0.95rem;
}

/* Honeypot field — hidden from real users, traps bots */
.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

/* Invalid required field highlight */
.form__input.error,
.form__textarea.error,
.form__select.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* ===========================================
   13. UTILITY CLASSES
   =========================================== */

/* "Call or text us today" sub-text under CTAs */
.cta-subtext {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* Services section "View All" link wrapper */
.services-view-all {
  text-align: center;
  margin-top: 48px;
}

/* Footer DBA line (italic muted) */
.footer-dba {
  font-style: italic;
  color: var(--text-muted);
}

/* Center-aligned reviews section */
.reviews-center {
  text-align: center;
}

/* Center-aligned with smaller top margin (36px instead of 48px) */
.reviews-center-sm {
  text-align: center;
  margin-top: 36px;
}

/* Hours note under contact info */
.contact-hours-note {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Embedded iframes (maps, etc.) in contact section */
.contact-iframe {
  border: 0;
  border-radius: 12px;
  margin-top: 12px;
}

/* Full-width submit button */
.submit-btn-full {
  width: 100%;
  justify-content: center;
}

/* Form disclaimer text under submit */
.form-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}

/* Mobile nav CTA button */
.nav-mobile-cta {
  margin-top: 16px;
}

/* Contact section header spacing */
.contact-section-header {
  margin-bottom: 40px;
}

/* Center CTA button groups in flex containers */
.cta-btn-group-center {
  justify-content: center;
}

/* ===========================================
   14. IMAGE HOVER SHINE / GLINT EFFECT
   =========================================== */

/*
   A diagonal light sweep that slides across images on hover.
   Applied to containers that hold images; uses ::after pseudo-element.
   The container must be position: relative + overflow: hidden.
   
   NOTE: .service-card and .team-card already use both pseudo-elements
   for .glow-border, so the shine effect only targets .portfolio-item
   and .team-feature__image (proper container divs without glow-border).
*/

.portfolio-item,
.team-feature__image {
  position: relative;
  overflow: hidden;
}

.portfolio-item::after,
.team-feature__image::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 40%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.08) 60%,
    transparent 100%
  );
  transform: skewX(-15deg);
  transition: none;
  z-index: 2;
  pointer-events: none;
}

.portfolio-item:hover::after,
.team-feature__image:hover::after {
  animation: shine-glint 0.75s ease-out forwards;
}

@keyframes shine-glint {
  0% {
    left: -100%;
  }
  100% {
    left: 150%;
  }
}


/* ===========================================
   15. IMAGE HOVER ZOOM
   =========================================== */

/*
   Subtle scale-up on hover. The container needs overflow: hidden.
   For service/team cards, overflow:hidden is already on .service-card / .team-card.
   .service-card__image and .team-card__image are classes on the <img> itself.
   .portfolio-item img and .team-feature__image img are inside wrapper containers.
*/

.service-card .service-card__image,
.team-card .team-card__image,
.portfolio-item img,
.team-feature__image img {
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.service-card:hover .service-card__image,
.team-card:hover .team-card__image,
.portfolio-item:hover img,
.team-feature__image:hover img {
  transform: scale(1.05);
}


/* ===========================================
   16. BRAND LOGO INFINITE MARQUEE
   =========================================== */

.brands-marquee {
  overflow: hidden;
  padding: 20px 0;
  /* Fade edges with a mask for seamless visual blend */
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
}

.brands-track {
  display: flex;
  align-items: center;
  gap: 60px;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.brands-marquee:hover .brands-track {
  animation-play-state: paused;
}

.brands-track img {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.5;
  transition: opacity var(--transition-medium), filter var(--transition-medium);
  flex-shrink: 0;
}

.brands-track img:hover {
  opacity: 0.9;
  filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(140deg);
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}


/* ===========================================
   17. IMAGE SCROLL REVEAL (CLIP-PATH WIPE)
   =========================================== */

/*
   Images start clipped (hidden from right) and wipe open
   when they enter the viewport. JS adds .img-reveal class
   to target elements and .revealed when in view.
*/

.img-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.img-reveal.revealed {
  clip-path: inset(0 0 0 0);
}


/* ===========================================
   18. ENHANCED SECTION ENTRANCE ANIMATIONS
   =========================================== */

/*
   Upgrades the existing .reveal transitions in style.css
   with an added subtle scale for more dramatic appearance.
   Uses higher specificity so it cleanly overrides.
*/

.reveal {
  transform: translateY(30px) scale(0.97);
}

.reveal.visible {
  transform: translateY(0) scale(1);
}

.reveal-left {
  transform: translateX(-40px) scale(0.97);
}

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

.reveal-right {
  transform: translateX(40px) scale(0.97);
}

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


/* ===========================================
   19. HERO TITLE STAGGERED WORD REVEAL
   =========================================== */

/*
   JS wraps each word in hero__title inside a <span class="hero-word">.
   Words start invisible and cascade in with a staggered delay.
*/

.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: hero-word-in 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes hero-word-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ===========================================
   RESPONSIVE — TOUCH DEVICES
   =========================================== */

@media (hover: none) {
  /* Film grain is barely visible and costs paint — disable */
  .film-grain {
    display: none;
  }

  /* Disable tilt on touch */
  .tilt-card {
    perspective: none;
    transform: none !important;
  }

  /* Disable magnetic effect on touch */
  .magnetic {
    transform: none !important;
  }

  /* Disable shine glint on touch (no hover) */
  .portfolio-item::after,
  .team-feature__image::after {
    display: none;
  }

  /* Disable hover zoom on touch */
  .service-card .service-card__image,
  .team-card .team-card__image,
  .portfolio-item img,
  .team-feature__image img {
    transform: none !important;
  }
}

/* Reduced motion: disable all animations */
@media (prefers-reduced-motion: reduce) {
  .img-reveal {
    clip-path: none;
    transition: none;
  }

  .hero-word {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .brands-track {
    animation: none;
  }

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

/* Back-to-top button positioning on small screens */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
  }

  .back-to-top svg {
    width: 20px;
    height: 20px;
  }

  /* Smaller brand logos on mobile */
  .brands-track img {
    height: 28px;
  }

  .brands-track {
    gap: 40px;
  }
}
