/* Global page overflow fix to prevent horizontal scroll bugs from oversized visual elements */
html,
body,
.wp-site-blocks,
#page,
.wp-block-group {
  overflow-x: clip !important;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

/* Global Outline & Tap Highlight Reset — Prevents browser focus squares on click */
*, *::before, *::after {
  -webkit-tap-highlight-color: transparent;
}
a, button, [role="button"] {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
a:focus, a:active, button:focus, button:active {
  outline: none !important;
}

/* Hide Native Scrollbar completely */
html {
  scrollbar-width: none !important; /* Firefox */
}
html::-webkit-scrollbar {
  display: none !important; /* Chrome, Safari, Edge */
}

/* Custom Floating Scrollbar Track */
.custom-scroll-track {
  position: fixed;
  right: 6px;
  top: 6px;
  bottom: 6px;
  width: 8px;
  z-index: 99999999;
  background: transparent;
  pointer-events: auto;
  border-radius: 10px;
  transition: width 0.2s ease, background 0.2s ease;
}

.custom-scroll-track:hover {
  width: 12px;
  background: rgba(255, 255, 255, 0.05); /* Very subtle glass hover track */
  box-shadow: inset 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Custom Scrollbar Thumb */
.custom-scroll-thumb {
  position: absolute;
  width: 100%;
  border-radius: 10px;
  background: rgba(120, 120, 120, 0.35); /* Translucent neutral grey glass */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: grab;
  transition: background 0.2s ease;
}

.custom-scroll-thumb:active {
  cursor: grabbing;
  background: rgba(120, 120, 120, 0.65);
}

.custom-scroll-track:hover .custom-scroll-thumb {
  background: rgba(120, 120, 120, 0.5);
}

/* Prevent cursor/highlight flashing when dragging */
.scroll-dragging,
.scroll-dragging * {
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: grabbing !important;
}

/* Prevent FOUC on hero before GSAP takes over */
body.home.scroll-locked .capital-hero-header .logo,
body.home.scroll-locked .capital-hero-header .nav-menu a,
body.home.scroll-locked .capital-hero-header .btn-signin,
body.home.scroll-locked .capital-hero .hero-title,
body.home.scroll-locked .capital-hero .hero-subtitle,
body.home.scroll-locked .capital-hero .btn-cta {
  opacity: 0;
}

/* Main Hero Section */
.capital-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  background: transparent;
  /* Show fixed background underneath */
}

/* Fixed Background Layer escaping GSAP container boundaries */
.hero-bg-fixed {
  position: fixed;
  top: -8vh;
  /* Shifted up to move background content higher */
  left: -5vw;
  width: 110vw;
  /* Scaled up horizontally */
  height: 116vh;
  /* Scaled up vertically */
  background-image: url('../images/back.jpg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  z-index: -10;
  /* Behind everything */
  pointer-events: none;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Fixed Building Layer: always visible, GSAP animates its Y position */
.hero-building-fixed {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 58%);
  width: 100%;
  max-width: 100%;
  z-index: 15; /* Moved in front of the text (z-index: 10) */
  pointer-events: none;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  visibility: hidden; /* Hidden until JS positions layers off-screen */
}

.hero-building-fixed img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Masked building wrapper & Star container GPU isolation */
.clipped-building-wrapper.bg-masked {
  contain: layout paint;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.star-container {
  contain: layout paint;
  will-change: opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Hero Body & Content */
.capital-hero .hero-body {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 400px 24px; /* Increased from 320px to 400px to push the content higher and clear the building */
  position: relative;
  z-index: 10;
  box-sizing: border-box;
}

.capital-hero .hero-content {
  width: 100%;
  max-width: 95%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.capital-hero .hero-title {
  font-size: clamp(3rem, 7.5vw, 6.6rem);
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #111111;
  margin: 0 0 20px 0;
  white-space: nowrap;
  text-align: center;
  width: 100%;
  overflow: hidden; /* Cutout mask reveal */
  padding-bottom: 8px; /* Safe buffer to prevent descenders (g, y, p) from being cropped */
}

.capital-hero .hero-subtitle {
  font-size: clamp(1.1rem, 2.3vw, 1.45rem);
  font-weight: 600;
  color: #111111;
  line-height: 1.5;
  margin: 0 0 38px 0;
  overflow: hidden; /* Cutout mask reveal */
  padding-bottom: 4px; /* Safe buffer to prevent descenders from being cropped */
}

.capital-hero .hero-subtitle .light-text {
  color: #777777;
  font-weight: 450;
}

/* CTA Button */
.capital-hero .btn-cta {
  display: inline-flex;
  align-items: center;
  background-color: #111111;
  color: #ffffff !important;
  font-size: 17px;
  font-weight: 600;
  padding: 15px 34px;
  border-radius: 100px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.capital-hero .btn-cta:hover {
  background-color: #222222;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Slide-Up Text Animation Styles for CTA */
.capital-hero .btn-cta .slide {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  position: relative;
  height: 19px; /* Fixed height for clean 17px text clipping */
  line-height: 19px;
}

.capital-hero .btn-cta .slide > span {
  display: block;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.capital-hero .btn-cta .slide > span > span {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
}

.capital-hero .btn-cta:hover .slide > span {
  transform: translateY(-100%);
}

.capital-hero .btn-cta .arrow-icon {
  margin-left: 10px;
  transition: transform 0.25s ease;
}

.capital-hero .btn-cta:hover .arrow-icon {
  transform: translateX(4px);
}

.capital-hero .hero-visuals {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20; /* Moved in front of the building (z-index: 15) to keep clouds/smoke on top */
}

.capital-hero .layer {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}



/* Smoke Overlay Layout */
.capital-hero .layer-smoke {
  z-index: 500;
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translate(-50%, 76%);
  visibility: hidden; /* Hidden until JS positions layers off-screen */
  /* Solid, pushed down so the top edge is slightly visible */
  width: 100%;
  opacity: 0.6;
  /* Made more transparent per request */
  /* Hidden initially, revealed near end of GSAP scroll */
  pointer-events: none;
}

.capital-hero .layer-smoke-top {
  z-index: 500;
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translate(-50%, -76%) rotate(180deg);
  /* Flipped and pushed up so the edge is slightly visible */
  width: 100%;
  opacity: 0.6;
  /* Made more transparent per request */
  pointer-events: none;
  visibility: hidden; /* Hidden until JS positions layers off-screen */
}

.capital-hero .layer-smoke,
.capital-hero .layer-smoke-top {
  position: absolute;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.capital-hero .layer-smoke img,
.capital-hero .layer-smoke-top img {
  width: 100%;
  height: auto;
  opacity: 1;
  mix-blend-mode: screen;
  transform: translateZ(0);
}

/* Cloud Overlays Layout */
.capital-hero .layer-cloud {
  position: absolute;
  transform: none;
  left: auto;
  z-index: 9;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  visibility: hidden; /* Hidden until JS positions layers off-screen */
}

/* Drawing Star Canvas Overlay */
.capital-hero .star-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 25; /* Sits over building and clouds */
  pointer-events: none;
}

.capital-hero .star-canvas .clipped-building {
  /* Premium filter to make the building pop inside the vector star */
  filter: brightness(1.2) contrast(1.1);
  will-change: opacity, transform;
  transform: translate(0%, 58%); /* Matches the Y start position of the background building */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.capital-hero .cloud-left {
  left: -12%;
  bottom: 28%;
  width: 55%;
  max-width: 1000px;
  opacity: 0.9;
}

.capital-hero .cloud-left img {
  animation: float-cloud-left 12s ease-in-out infinite alternate;
}

.capital-hero .cloud-right {
  right: -12%;
  bottom: 28%;
  width: 55%;
  max-width: 1000px;
  opacity: 0.95;
}

.capital-hero .cloud-right img {
  animation: float-cloud-right 14s ease-in-out infinite alternate;
}

.capital-hero .layer-cloud img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.04));
  transform: translateZ(0);
}

/* Animations */
@keyframes float-cloud-left {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
  }

  100% {
    transform: translateY(12px) translateX(15px) rotate(0.5deg);
  }
}

@keyframes float-cloud-right {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
  }

  100% {
    transform: translateY(-15px) translateX(-18px) rotate(-0.5deg);
  }
}

@keyframes drift-smoke {
  0% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 0.85;
  }

  50% {
    transform: translateX(-48%) translateY(-4px) scale(1.02);
    opacity: 0.95;
  }

  100% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 0.85;
  }
}

/* Responsive Scaling */
@media (max-width: 991px) {
  .capital-hero .hero-body {
    padding-bottom: 240px;
  }



  .capital-hero .cloud-left {
    width: 38%;
    bottom: 8%;
  }

  .capital-hero .cloud-right {
    width: 40%;
    bottom: 15%;
  }
}

@media (max-width: 575px) {
  .capital-hero .hero-body {
    padding-bottom: 180px;
    padding-top: 100px;
  }



  .capital-hero .cloud-left {
    width: 45%;
    bottom: 5%;
  }

  .capital-hero .cloud-right {
    width: 48%;
    bottom: 10%;
  }
}

/* Services Section (White Theme) */
.services-capital {
  background-color: #ffffff;
  color: #111111;
  padding: 0px 0px 30px 0px; /* Reduced from 120px to make gap before image compact & elegant */
  /* Set top padding to 0px to completely eliminate top spacing */
  position: relative;
  z-index: 30; /* Moved in front of the building (15) and clouds (20) to cover them cleanly */
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin-top: -1px;
  /* Prevents tiny line gaps between sections */
}

/* Huge Smoke Transition between Hero and Services */
.services-smoke-transition {
  position: absolute;
  bottom: 100%;
  /* Anchor to the very top edge of services-capital */
  left: 50%;
  /* Centered and scaled, completely static and taped to the section top */
  transform: translate(-50%, 0) scale(1.4);
  width: 100%;
  /* Match parent viewport width exactly */
  z-index: 1;
  /* Render behind the services content */
  pointer-events: none;
  /* Screen blend mode makes it act as mist over the sunset hero, and invisible over white */
  mix-blend-mode: screen;
  margin-bottom: -5px;
  /* Slight overlap to ensure no 1px gap */
  opacity: 1; /* Always visible and naturally scrolling with the container */
}

.services-smoke-transition img {
  width: 100%;
  height: auto;
  display: block;
  transform: scaleX(-1);
  /* Mirrored horizontally per request */
}

.services-container {
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 5;
  padding: 0 80px;
  /* Extra padding for full-width edges */
}

/* Split Header Layout */
.services-header-split {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 35px; /* Reduced from 80px */
  align-items: start;
  opacity: 0;
  /* Hidden initially, GSAP will fade it in */
}

.header-split-right {
  max-width: 1100px;
  text-align: left; /* Keep left-aligned within its block */
}



.header-split-left {
  padding-top: 6px;
}

.services-tag {
  font-family: 'Inter', sans-serif !important;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: #111111;
  text-transform: none;
  display: inline-block;
}

.services-split-title {
  font-family: 'Instrument Sans', 'Instrument Sans Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: clamp(1.6rem, 2.4vw, 2.5rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.035em;
  margin: 0;
  color: #111111;
  text-align: left;
  max-width: 100%;
}

@media (min-width: 768px) {
  .services-split-title {
    max-width: 80rem; /* Controlled width */
    margin-left: auto; /* Push text block to right side */
    text-wrap: balance;
  }
}

.services-split-bold .word {
  display: inline-block;
  color: #d2d4d8;
  /* Start gray, GSAP will animate to black */
  transition: none;
}

.services-split-bold {
  font-weight: 500;
  color: #111111;
}

.services-split-muted {
  color: #b0b0b0;
  font-weight: 500;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  position: relative;
  z-index: 10;
}

.service-card {
  background-color: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 40px;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  opacity: 0;
  /* Hidden initially, GSAP will stagger fade it in */
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #008877, #00bbff);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-card:hover {
  transform: translateY(-8px);
  border-color: rgba(0, 136, 119, 0.2);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
}

.service-card:hover::before {
  opacity: 1;
}

.card-num {
  font-size: 14px;
  font-weight: 700;
  color: #008877;
  margin-bottom: 25px;
  opacity: 0.8;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 15px 0;
  color: #111111;
  letter-spacing: -0.01em;
}

.card-text {
  font-size: 15px;
  line-height: 1.6;
  color: #555555;
  margin: 0 0 30px 0;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #008877;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s ease;
}

.card-link:hover {
  color: #006655;
}

.link-arrow {
  transition: transform 0.2s ease;
}

.card-link:hover .link-arrow {
  transform: translate(3px, -3px);
}

@media (max-width: 991px) {
  .services-header-split {
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .services-capital {
    padding: 40px 0px 15px 0px;
  }
  
  .services-container {
    padding: 0 24px;
  }
}

/* --- Services Gap Cutout (Framed Parallax Window with Side Padding) --- */
.services-gap-container {
  width: 100%;
  padding: 0 60px;
  box-sizing: border-box;
  background-color: #ffffff;
  position: relative;
  z-index: 20;
  margin: 0 !important;
}

.services-gap-cutout {
  position: relative;
  width: 100%;
  height: clamp(560px, 75vh, 880px);
  background-color: #090a0c;
  border-radius: 0 !important;
  overflow: hidden;
  display: block;
  z-index: 20;
}

.gap-cutout-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  animation: floatyMedia 9s ease-in-out infinite alternate;
}

@keyframes floatyMedia {
  0% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.015);
  }
  100% {
    transform: translateY(0px) scale(1);
  }
}

.gap-cutout-img {
  position: absolute;
  top: -25%;
  left: 0;
  width: 100%;
  height: 150%;
  object-fit: cover;
  object-position: center bottom;
  will-change: transform;
  transform: scale(1.18) translateY(0);
}

.gap-cutout-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.22) 0%,
    rgba(0, 0, 0, 0.03) 25%,
    rgba(0, 0, 0, 0.03) 75%,
    rgba(0, 0, 0, 0.28) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.services-gap-cover {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  z-index: 5;
  pointer-events: none;
}

@media (max-width: 991px) {
  .services-gap-container {
    padding: 0 20px;
    margin: 0 !important;
  }
  .services-gap-cutout {
    height: clamp(380px, 60vh, 550px);
    border-radius: 0 !important;
  }
}

/* Why Section (Dark Theme, Right Aligned Content) */
.why-capital {
  background-color: #090a0c;
  color: #ffffff;
  padding: 140px 40px;
  position: relative;
  z-index: 10;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  margin-top: -1px;
  /* Prevents tiny line gaps */
}

.why-container {
  max-width: 1200px;
  margin: 0 auto;
}

.why-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 50px;
  align-items: center;
}

.why-content {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.why-label {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.15em;
  color: #00ffcc;
  margin-bottom: 15px;
}

.why-headline {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 25px 0;
  color: #ffffff;
}

.why-text {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.65;
  color: #c5c8ce;
  margin: 0 0 20px 0;
  font-weight: 450;
  max-width: 600px;
}

.why-text-sub {
  font-size: 15px;
  line-height: 1.6;
  color: #6d7077;
  margin: 0;
  max-width: 500px;
  font-weight: 400;
}

@media (max-width: 991px) {
  .why-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .why-visual-placeholder {
    display: none;
    /* Hide empty grid spacer on tablet/mobile */
  }

  .why-content {
    text-align: left;
    align-items: flex-start;
  }

  .why-capital {
    padding: 80px 24px;
  }
}

/* --- Flowing Menu Services Section --- */
.flowing-menu-section {
  background-color: #1c1c1c; /* Changed from black/111 to #1c1c1c */
  color: #ffffff;
  padding: 120px 0;
  position: relative;
  z-index: 10;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.flowing-menu-container {
  padding-bottom: 80px;
}

.flowing-header-split {
  margin-bottom: 0;
  opacity: 1 !important;
  /* Override GSAP initial state so it doesn't get stuck hidden */
  transform: none !important;
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.flowing-left-header .services-tag {
  font-size: 1.6rem; /* Make it slightly smaller */
  transform: translateY(-24px); /* Shift it up to sit beside the first line of 'How CAPITAL' */
}

.flowing-right {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.flowing-tag {
  color: #ffffff;
}

.flowing-title {
  font-family: 'Instrument Sans', 'Instrument Sans Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  color: #ffffff;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.035em;
  margin: 0;
  text-align: right;
  max-width: none;
}

.flowing-title .services-split-bold {
  color: #ffffff;
}

.flowing-title .services-split-muted {
  color: #888888;
}

.flowing-menu-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.flowing-menu-item {
  position: relative;
  width: 100%;
  box-sizing: border-box; /* Fixes the padding issue that shifts the center point */
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 80px 80px;
  overflow: hidden;
  cursor: pointer;
  background-color: transparent;
  transition: background-color 0.4s ease;
}

.flowing-menu-item:last-child {
  border-bottom: none;
}

@keyframes slowZoom {
  0% { transform: scale(1.1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1.1); }
}

.flowing-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.35;
  transform: scale(1.1);
  clip-path: inset(100% 0 0 0);
  /* The image is completely clipped from the top down (hidden at the bottom edge) */
  transition: clip-path 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
  pointer-events: none;
}

.flowing-menu-item:hover .flowing-bg-image {
  clip-path: inset(0 0 0 0);
  /* Fills the container smoothly from bottom to top */
  animation: slowZoom 25s ease-in-out infinite;
}

.flowing-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.flowing-left {
  max-width: 32rem; /* Reduced significantly so text wraps more vertically */
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.flowing-menu-item:hover .flowing-left {
  /* Removed hover transform so it stays fixed */
}

.flowing-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.5); /* Made border fatter */
  border-radius: 50%;
  font-size: 1.2rem; /* Made the number slightly smaller */
  font-weight: 600;
  flex-shrink: 0;
}

.flowing-text {
  position: relative;
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 150%;
  text-align: left;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

@media (min-width: 768px) {
  .flowing-number {
    width: 48px;
    height: 48px;
    font-size: 1.4rem; /* Scaled slightly but kept smaller than before */
  }
  
  .flowing-text {
    max-width: 28rem; /* Restricted the width so it forces more line breaks (sentences) instead of long horizontal lines */
    font-size: 1.4rem; /* Scaled down to remain clean and readable */
    letter-spacing: -.01em;
    text-wrap: balance;
  }
}

.flowing-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  text-align: center;
}

.flowing-huge-text {
  font-size: clamp(6rem, 12vw, 12rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  margin: 0;
  line-height: 1;
  color: #ffffff;
  transition: transform 0.4s ease, opacity 0.4s ease;
  position: relative;
  display: inline-block;
  pointer-events: auto;
}

.flowing-huge-text::after {
  content: '';
  position: absolute;
  bottom: 0%; /* Lowered the line to sit at the absolute bottom bounding box, further from the letters */
  left: 0;
  width: 100%;
  height: max(4px, 0.4vw);
  background-color: #ffffff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.flowing-menu-item:hover .flowing-huge-text {
  transform: scale(1.02);
}

.flowing-menu-item:hover .flowing-huge-text::after {
  transform: scaleX(1);
}

.flowing-right-arrow {
  flex: 1;
  max-width: 400px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0; /* Prevents the massive text from squishing the arrow out of existence */
}

.flowing-right-arrow svg {
  width: 120px; /* Increased arrow size per request */
  height: 120px;
  min-width: 120px;
  color: #ffffff;
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.flowing-menu-item:hover .flowing-right-arrow svg {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile Optimization for Flowing Menu */
@media (max-width: 991px) {
  .flowing-menu-section {
    padding: 60px 0 0 0; /* Removed bottom padding to eliminate huge gap */
  }
  .flowing-menu-container {
    padding-bottom: 40px;
  }
  .flowing-header-split {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .flowing-right {
    position: relative;
    left: 0;
    transform: none;
    text-align: left;
  }
  .flowing-title {
    text-align: left;
    font-size: clamp(2rem, 8vw, 2.5rem);
  }
  .flowing-left-header .services-tag {
    transform: none;
  }
  .flowing-menu-item {
    padding: 40px 20px;
    min-height: 50vh; /* Make each item tall to fit the image and text */
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .flowing-menu-item:last-child {
    border-bottom: none; /* Remove the awkward line in the middle */
  }
  .flowing-bg-image {
    clip-path: inset(0 0 0 0) !important; /* Make image visible by default on mobile */
    opacity: 0.3 !important; /* Keep it dark so white text pops */
    animation: none !important; /* Disable zoom animation on mobile */
  }
  .flowing-content {
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between; /* Space out top paragraph and bottom text */
    height: 100%;
    min-height: 40vh; /* Ensure it stretches */
  }
  .flowing-left {
    max-width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .flowing-number {
    margin-bottom: 5px;
  }
  .flowing-center {
    position: relative;
    left: 0;
    transform: none;
    align-items: flex-end;
    justify-content: flex-start;
    width: 100%;
    margin-top: 30px; /* Push it down from the paragraph */
  }
  .flowing-huge-text {
    font-size: clamp(4rem, 22vw, 8rem);
    line-height: 0.85; /* Tighten to the bottom */
  }
  .flowing-huge-text::after {
    display: none; /* Hide the underline effect on mobile */
  }
  .flowing-right-arrow {
    display: flex;
    position: absolute;
    bottom: 0;
    right: 0;
    width: auto;
    max-width: none;
    align-items: flex-end;
    opacity: 1; /* Make arrow visible */
    transform: none;
  }
  .flowing-right-arrow svg {
    opacity: 1;
    transform: none;
    width: 60px; /* Reduced size for mobile */
    height: 60px;
    min-width: 60px;
  }
}