/* Hero Bubbles Module - Updated for Global Background */

:root {
  --color-bg1: rgb(8, 10, 15);
  --color-bg2: rgb(0, 17, 32);
  --color1: 18, 113, 255;
  --color2: 80, 76, 255;
  --color3: 100, 100, 255;
  --color4: 155, 116, 232;
  --color5: 80, 76, 255;
  --color-interactive: 80, 76, 255;
  --circle-size: 80%;
  --blending: hard-light;
}

/* Main module container */
.hero-bubbles-module {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.hero-title {
  font-size: clamp(1.1rem, 3.9vw, 6rem);
  font-weight: 400;
  color: var(--color-secondary);
  text-align: left;
  line-height: 1.3;
  letter-spacing: 0.02em;
  padding: 1rem;
}

/* Global Background Styles - Contained to 100vh with fade out */
#global-bubbles-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 120vh; /* Slightly extended for blending */
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* Allow overflow on mobile to prevent bubble cutoff */
@media (max-width: 768px) {
  #global-bubbles-bg {
    overflow: visible;
    width: 100%;
  }
}

/* Ensure body has proper positioning context */
body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--color-bg1, rgb(8, 10, 15)); /* Fallback background */
}

/* Gradient Background Container */
#global-bubbles-bg .gradient-bg {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(40deg, var(--color-bg1), var(--color-bg2));
}

#global-bubbles-bg .svgBlur {
  display: none;
}

#global-bubbles-bg .noiseBg {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
  mix-blend-mode: soft-light;
  opacity: 0.3;
}

#global-bubbles-bg .gradients-container {
  filter: url(#goo) blur(25px); /* Reduced from 40px for better performance */
  width: 100%;
  height: 120%; /* Match container height */
  /* Performance optimizations */
  contain: paint;
  will-change: opacity;
  /* Fade out mask for smooth blending */
  mask-image: linear-gradient(to bottom, 
    black 0%, 
    black 75%, 
    rgba(0, 0, 0, 0.3) 90%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(to bottom, 
    black 0%, 
    black 75%, 
    rgba(0, 0, 0, 0.3) 90%,
    transparent 100%
  );
  /* Performance: Use GPU acceleration */
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Gradient Overlay for smooth fade to page background */
#global-bubbles-bg #overlay2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%; /* Match the container */
  background: linear-gradient(to bottom, 
    transparent 0%, 
    transparent 50%,
    rgba(8, 10, 15, 0.3) 70%,
    rgba(8, 10, 15, 0.7) 85%, 
    rgba(8, 10, 15, 0.9) 95%,
    rgb(8, 10, 15) 100%
  );
  z-index: 2;
  pointer-events: none;
}

/* Animated Gradient Circles - Original sizes with performance optimizations */
#global-bubbles-bg .g1 {
  position: absolute;
  background: radial-gradient(circle at center, rgba(var(--color1), 0.8) 0, rgba(var(--color1), 0) 50%) no-repeat;
  mix-blend-mode: var(--blending);
  width: var(--circle-size);
  height: var(--circle-size);
  top: calc(50% - var(--circle-size) / 2);
  left: calc(50% - var(--circle-size) / 2);
  transform-origin: center center;
  animation: moveVertical 30s ease infinite;
  opacity: 1;
  will-change: transform; /* Performance optimization */
}

#global-bubbles-bg .g2 {
  position: absolute;
  background: radial-gradient(circle at center, rgba(var(--color2), 0.8) 0, rgba(var(--color2), 0) 50%) no-repeat;
  mix-blend-mode: var(--blending);
  width: var(--circle-size);
  height: var(--circle-size);
  top: calc(50% - var(--circle-size) / 2);
  left: calc(50% - var(--circle-size) / 2);
  transform-origin: calc(50% - 400px);
  animation: moveInCircle 20s reverse infinite;
  opacity: 1;
  will-change: transform; /* Performance optimization */
}

#global-bubbles-bg .g3 {
  position: absolute;
  background: radial-gradient(circle at center, rgba(var(--color3), 0.8) 0, rgba(var(--color3), 0) 50%) no-repeat;
  mix-blend-mode: var(--blending);
  width: var(--circle-size);
  height: var(--circle-size);
  top: calc(50% - var(--circle-size) / 2 + 200px);
  left: calc(50% - var(--circle-size) / 2 - 500px);
  transform-origin: calc(50% + 400px);
  animation: moveInCircle 40s linear infinite;
  opacity: 1;
  will-change: transform; /* Performance optimization */
}

#global-bubbles-bg .g4 {
  position: absolute;
  background: radial-gradient(circle at center, rgba(var(--color4), 0.8) 0, rgba(var(--color4), 0) 50%) no-repeat;
  mix-blend-mode: var(--blending);
  width: var(--circle-size);
  height: var(--circle-size);
  top: calc(50% - var(--circle-size) / 2);
  left: calc(50% - var(--circle-size) / 2);
  transform-origin: calc(50% - 200px);
  animation: moveHorizontal 40s ease infinite;
  opacity: 0.7;
  will-change: transform; /* Performance optimization */
}

#global-bubbles-bg .g5 {
  position: absolute;
  background: radial-gradient(circle at center, rgba(var(--color5), 0.8) 0, rgba(var(--color5), 0) 50%) no-repeat;
  mix-blend-mode: var(--blending);
  width: calc(var(--circle-size) * 2);
  height: calc(var(--circle-size) * 2);
  top: calc(50% - var(--circle-size));
  left: calc(50% - var(--circle-size));
  transform-origin: calc(50% - 800px) calc(50% + 200px);
  animation: moveInCircle 20s ease infinite;
  opacity: 1;
  will-change: transform; /* Performance optimization */
}

#global-bubbles-bg .interactive {
  position: absolute;
  background: radial-gradient(circle at center, rgba(var(--color-interactive), 0.8) 0, rgba(var(--color-interactive), 0) 50%) no-repeat;
  mix-blend-mode: var(--blending);
  width: 100%;
  height: 100%;
  top: -50%;
  left: -50%;
  opacity: 0.7;
  will-change: transform; /* Performance optimization */
}

/* Animations - Reduced movement range */
@keyframes moveInCircle {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(180deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes moveVertical {
  0% {
    transform: translateY(-20%);
  }
  50% {
    transform: translateY(20%);
  }
  100% {
    transform: translateY(-20%);
  }
}

@keyframes moveHorizontal {
  0% {
    transform: translateX(-20%) translateY(-5%);
  }
  50% {
    transform: translateX(20%) translateY(5%);
  }
  100% {
    transform: translateX(-20%) translateY(-5%);
  }
}

/* Mobile-specific animations with reduced movement */
@media (max-width: 768px) {
  @keyframes moveVertical {
    0% {
      transform: translateY(-10%) scale(0.7);
    }
    50% {
      transform: translateY(10%) scale(0.7);
    }
    100% {
      transform: translateY(-10%) scale(0.7);
    }
  }

  @keyframes moveHorizontal {
    0% {
      transform: translateX(-10%) translateY(-3%) scale(0.7);
    }
    50% {
      transform: translateX(10%) translateY(3%) scale(0.7);
    }
    100% {
      transform: translateX(-10%) translateY(-3%) scale(0.7);
    }
  }
  
  @keyframes moveInCircle {
    0% {
      transform: rotate(0deg) scale(0.7);
    }
    50% {
      transform: rotate(180deg) scale(0.7);
    }
    100% {
      transform: rotate(360deg) scale(0.7);
    }
  }
}

/* Hero Content Card */
.card {
  position: relative;
  z-index: 10;
  user-select: none;
  width: 90%;
  padding: 1rem;
  border-radius: 8px;
  overflow: hidden;
  max-width: 1400px;
}

.card .content {
  position: relative;
  z-index: 2;
  text-shadow: -3px 0px 2px rgba(0,0,0,0.1);
  display: flex;
}

/* Visually hidden but accessible */
.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* === Grid Layout for Hero Text === */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto auto;
  grid-auto-rows: min-content;
  grid-template-columns: min-content;
  gap: 0 1.5rem;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.line1 {
  grid-column: 1/3;
  grid-row: 1/2;
  font-size: 8rem;
  font-weight: 500;
  color: var(--color-secondary);
  display: flex;
  justify-content: start;
  align-content: center;
  line-height: 1.1 !important;
}

.line2 {
  grid-column: 2/4;
  grid-row: 2/3;
  font-size: 8rem;
  font-weight: 500;
  color: var(--color-secondary);
  display: flex;
  justify-content: center;
  align-content: center;
  line-height: 1.1 !important;
}

.line3 {
  grid-column: 1/3;
  grid-row: 3/4;
  font-size: 8rem;
  font-weight: 500;
  color: var(--color-secondary);
  background: linear-gradient(to right, var(--color-alternate), var(--color-secondary), var(--color-alternate));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: flex;
  justify-content: start;
  align-content: center;
  line-height: 1.1 !important;
}

.hero-desc {
  grid-column: 3/4;
  grid-row: 3/4;
  color: var(--color-secondary);
  font-size: 0.9rem;
  max-width: 20rem;
  display: flex;
  justify-content: flex-start;
  align-self: center;
  margin: 0 !important;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  text-overflow: ellipsis;
}







/* VIDEO REEL  */



#circle { 
    overflow: hidden;
    padding-bottom: 7%;
    position: absolute;
    width: 100px;
    bottom: -10px;
    right: 16px;
    z-index: 300;
}


#circle circle {
  fill: transparent;
}

#circle text {  
  font-size: 36px; 
  font-weight: bold;
  color: #f7f7f7;
}

#circle svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%;
}

#circle:hover svg {
    cursor: pointer;
  -webkit-animation-name: rotate;
     -moz-animation-name: rotate;
      -ms-animation-name: rotate;
       -o-animation-name: rotate;
          animation-name: rotate;
  -webkit-animation-duration: 5s;
     -moz-animation-duration: 5s;
      -ms-animation-duration: 5s;
       -o-animation-duration: 5s;
          animation-duration: 5s;
  -webkit-animation-iteration-count: infinite;
     -moz-animation-iteration-count: infinite;
      -ms-animation-iteration-count: infinite;
       -o-animation-iteration-count: infinite;
          animation-iteration-count: infinite;
  -webkit-animation-timing-function: linear;
     -moz-animation-timing-function: linear;
      -ms-animation-timing-function: linear;
       -o-animation-timing-function: linear;
          animation-timing-function: linear;

}

@-webkit-keyframes rotate {
    from { -webkit-transform: rotate(360deg); }
    to { -webkit-transform: rotate(0); }
}
@-moz-keyframes rotate {
    from { -moz-transform: rotate(360deg); }
    to { -moz-transform: rotate(0); }
}
@-ms-keyframes rotate {
    from { -ms-transform: rotate(360deg); }
    to { -ms-transform: rotate(0); }
}
@-o-keyframes rotate {
    from { -o-transform: rotate(360deg); }
    to { -o-transform: rotate(0); }
}
@keyframes rotate {
    from { transform: rotate(360deg); }
    to { transform: rotate(0); }
}

@keyframes rotate-text {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}



/* Style for the video overlay to ensure it covers the full screen */
        .video-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.85);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 50;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease;
        }
        .video-overlay.active {
            opacity: 1;
            visibility: visible;
        }
        /* The video will take the full width and height of its container, cropping if necessary */
        #fullscreen-video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            opacity: 0.6;
        }
        
        /* --- SVG Button Styles --- */
        #video-trigger {
            position: absolute;
            z-index: 60; 
            cursor: pointer;
            width: 6rem; /* Control the size of the SVG button */
            /* //height: 200px; */
            display: flex;
            align-items: center;
            justify-content: center;
            right: 2rem;
            bottom: 5svh;
            background-image: url(https://48812126.fs1.hubspotusercontent-na1.net/hubfs/48812126/iconamoon_mouse-light.svg);
            background-repeat: no-repeat;
            background-position: center;
        }

        #video-trigger:hover {
            background-image: none;
        }

        #video-trigger svg#circle-svg {
            width: 100%;
            height: 100%;
            transition: all 0.3s ease;
        }

        #video-trigger #circle-background {
            transition: fill 0.3s ease;
        }
        
        #video-trigger:hover #circle-background {
            fill: rgba(0, 0, 0, 0.7); /* Solid background on hover */
        }

        #video-trigger #circle-text {
                fill: #f7f7f7;
              font-weight: 500;
              letter-spacing: 5px;
              transition: opacity .3s ease;
              font-size: 34px;
              will-change: transform;
              backface-visibility: hidden;
        }

        #video-trigger:hover #circle-text {
            opacity: 0; /* Hide text on hover */
        }
        
        /* Styles for the mute/unmute icons inside the SVG button */
        .control-icon {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none; /* Prevent icons from stealing mouse events */
        }
        
        #video-trigger:hover .control-icon.visible {
            opacity: 1; /* Show the active icon on hover */
        }




/* VIDEO REEL  END */













/* Responsive Styles */
@media(max-width:1400px) {
  .line1, .line2, .line3 {
    font-size: clamp(4rem, 9vw, 10rem);
  }
  .hero-desc {
    font-size: clamp(0.75rem, 1vw, 1.25rem);
  }
}

@media(max-width:1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    text-align: center;
    gap: 0.5rem 0;
  }
  .line1 { grid-column: 1; grid-row: 1; justify-content: center; }
  .line2 { grid-column: 1; grid-row: 2; justify-content: center; }
  .line3 { grid-column: 1; grid-row: 3; justify-content: center; }
  .hero-desc {
    grid-column: 1;
    grid-row: 4;
    max-width: 28rem;
    margin: 5rem auto 0;
    text-align: center;
    font-size: clamp(0.75rem, 2vw, 1.25rem);
    justify-self: center;
  }
}

@media(max-width:767px) {
  .hero-bubbles-module {
    min-height: 100vh;
  }
  
  .card {
    width: 100%;
    padding: 0;
  }

  .hero-grid {
    padding: 2rem 1rem;
  }
  
  .line1, .line2, .line3 {
    font-size: clamp(1.5rem, 15vw, 10rem);
  }
  
  .hero-desc {
    font-size: clamp(0.5rem, 1vw, 1rem);
    margin-top: 1.5rem;
    width: 80%;
  }
  
  /* Mobile bubble adjustments to prevent cutoff */
  #global-bubbles-bg .gradients-container {
    width: 150%; /* Wider container on mobile */
    left: -25%; /* Center the wider container */
    position: relative;
  }
  
  /* Scale down bubbles on mobile but keep them complete */
  #global-bubbles-bg .g1,
  #global-bubbles-bg .g2,
  #global-bubbles-bg .g3,
  #global-bubbles-bg .g4,
  #global-bubbles-bg .g5 {
    transform: scale(0.7);
  }
  
  /* Adjust interactive bubble for mobile */
  #global-bubbles-bg .interactive {
    transform: scale(0.6);
  }

  #video-trigger {
    bottom: 25svh;
  }
}

@media(max-width:572px) {
  .hero-desc {
    font-size: 0.8rem;
    margin-top: 2.5rem !important;
    width: 100%;
  }

  .hero-bubbles-module {
    height: 80vh;
  }
  .hero-bubbles-module .card {
        margin-top: -20vh;
  }
  #video-trigger {
    width: 5rem;
    bottom: 25svh;
  }
  #circle svg {
    -webkit-animation-name: rotate;
      -moz-animation-name: rotate;
        -ms-animation-name: rotate;
        -o-animation-name: rotate;
            animation-name: rotate;
    -webkit-animation-duration: 5s;
      -moz-animation-duration: 5s;
        -ms-animation-duration: 5s;
        -o-animation-duration: 5s;
            animation-duration: 5s;
    -webkit-animation-iteration-count: infinite;
      -moz-animation-iteration-count: infinite;
        -ms-animation-iteration-count: infinite;
        -o-animation-iteration-count: infinite;
            animation-iteration-count: infinite;
    -webkit-animation-timing-function: linear;
      -moz-animation-timing-function: linear;
        -ms-animation-timing-function: linear;
        -o-animation-timing-function: linear;
            animation-timing-function: linear;
  }
  #text-group {
      /* This defines the center of rotation. 
        It's the center of your 300x300 SVG. 
      transform-origin: 150px 150px; 
      
            /* This applies the animation we're about to create.
        'rotate-text' is the name.
        '20s' is the duration (you can make it faster or slower).
        'linear' means it rotates at a constant speed.
        'infinite' means it loops forever. 
      animation: rotate-text 20s linear infinite;*/
    }
  }
  
  /* Reduced motion support */
  @media (prefers-reduced-motion: reduce) {
    #global-bubbles-bg .g1,
    #global-bubbles-bg .g2,
    #global-bubbles-bg .g3,
    #global-bubbles-bg .g4,
    #global-bubbles-bg .g5 {
      animation-duration: 60s !important;
    }
    
    #global-bubbles-bg .interactive {
      display: none;
    }
    
    .hero-bubbles-module #textPath {
      animation: none;
    }
  }
  
  /* Low-end device optimizations */
  #global-bubbles-bg.reduced-motion .g1,
  #global-bubbles-bg.reduced-motion .g2,
  #global-bubbles-bg.reduced-motion .g3,
  #global-bubbles-bg.reduced-motion .g4,
  #global-bubbles-bg.reduced-motion .g5 {
    animation-duration: var(--animation-duration, 60s);
  }

@media (max-width: 991px) {
  /* Drop expensive blur & blend on mobile */
  #global-bubbles-bg .gradients-container {
    filter: none !important;
    mix-blend-mode: normal !important;
  }
}