/* ==========================================================================
   Why We Work Section
   Premium Dark Aesthetic | GSAP Scroll Animation (Tedy Style)
   ========================================================================== */

.why-we-work-section {
  position: relative;
  width: 100%;
  background: #050816;
  overflow: clip;
}

/* Ambient glow background */
.why-we-work-section .www-bg-glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 1;
}

.why-we-work-section .glow-primary {
  top: -10%;
  left: -10%;
  background: radial-gradient(circle, #ef3139 0%, transparent 70%);
}

.why-we-work-section .glow-secondary {
  bottom: -10%;
  right: -10%;
  background: radial-gradient(circle, #022d62 0%, transparent 70%);
}

/* Desktop Pin Container */
@media (min-width: 992px) {
  .why-we-work-section {
    height: 200vh;
  }

  .www-pin-container {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }

  .www-center-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 560px;
    padding: 45px;
    border-radius: 32px;
    background: rgba(6, 9, 25, 0.65);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
    color: #fff;
    opacity: 0;
    transform: scale(0.8);
    will-change: transform, opacity;
  }

  .www-cards-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
  }

  .www-card {
    position: absolute;
    pointer-events: auto;
    border-radius: 32px;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    will-change: transform, opacity;
    z-index: 5;
  }

  /* Distinct aspect ratios for each card to create organic Tedy layout */
  .card-1 { width: 17vw; height: 23vh; left: 7vw; top: 7vh; }
  .card-2 { width: 14vw; height: 19vh; left: 30vw; top: 5vh; }
  .card-3 { width: 18vw; height: 24vh; left: 75vw; top: 7vh; }
  .card-4 { width: 15vw; height: 21vh; left: 5vw; top: 41vh; }
  .card-5 { width: 16vw; height: 23vh; left: 79vw; top: 39vh; }
  .card-6 { width: 15vw; height: 21vh; left: 8vw; top: 72vh; }
  .card-7 { width: 17vw; height: 18vh; left: 32vw; top: 77vh; }
  .card-8 { width: 18vw; height: 23vh; left: 74vw; top: 70vh; }
}

/* Card inner for smooth scale hover animation */
.www-card-inner {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.www-card:hover .www-card-inner {
  transform: scale(1.12);
}

.www-card:hover {
  border-color: rgba(239, 49, 57, 0.35);
  box-shadow: 0 25px 55px rgba(239, 49, 57, 0.2);
}

/* Content Styling */
.www-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #ef3139;
  margin-bottom: 16px;
}

.www-badge::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 3px;
  background: #ef3139;
  border-radius: 2px;
  flex-shrink: 0;
}

.www-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

.www-title span {
  color: #ef3139;
  background: linear-gradient(135deg, #ef3139 0%, #ff5252 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.www-desc {
  font-size: 14.5px;
  line-height: 1.65;
  color: #a0aec0;
  margin-bottom: 28px;
}

.btn-premium-www {
  display: inline-flex;
  align-items: center;
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  background: #ef3139;
  border: 1px solid #ef3139;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 20px rgba(239, 49, 57, 0.25);
  cursor: pointer;
  text-decoration: none;
}

.btn-premium-www:hover {
  background: transparent;
  color: #ef3139;
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(239, 49, 57, 0.35);
}

/* Mobile Responsiveness (< 992px) */
@media (max-width: 991.98px) {
  .why-we-work-section {
    height: 180vh;
  }

  .www-pin-container {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }

  .www-center-content {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 70vw;
    max-width: 280px;
    padding: 20px 16px;
    border-radius: 20px;
    background: rgba(6, 9, 25, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    color: #fff;
    opacity: 0;
    transform: scale(0.8);
    will-change: transform, opacity;
  }

  .www-badge {
    font-size: 9px;
    letter-spacing: 2px;
    margin-bottom: 8px;
  }

  .www-title {
    font-size: 18px;
    margin-bottom: 8px;
    line-height: 1.3;
  }

  .www-desc {
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 12px;
  }

  .btn-premium-www {
    padding: 6px 16px;
    font-size: 11px;
    border-radius: 8px;
  }

  .www-cards-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
  }

  .www-card {
    position: absolute;
    pointer-events: auto;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    will-change: transform, opacity;
    z-index: 5;
    height: auto !important;
    aspect-ratio: 4/3;
  }

  /* Mobile card positions (all 8 cards distributed symmetrically surrounding the center text card, safely within viewport bounds) */
  .card-1 { width: 24vw; left: 2vw; top: 18vh; }
  .card-2 { width: 24vw; left: 38vw; top: 16vh; }
  .card-3 { width: 24vw; left: 74vw; top: 18vh; }
  .card-4 { width: 24vw; left: 1vw; top: 44vh; }
  .card-5 { width: 24vw; left: 75vw; top: 44vh; }
  .card-6 { width: 24vw; left: 2vw; top: 70vh; }
  .card-7 { width: 24vw; left: 38vw; top: 72vh; }
  .card-8 { width: 24vw; left: 74vw; top: 70vh; }
}

@media (max-width: 575.98px) {
  .www-center-content {
    padding: 12px 10px;
  }

  .www-title {
    font-size: 16px;
  }

  .www-desc {
    font-size: 10px;
    margin-bottom: 10px;
    line-height: 1.4;
  }

  .btn-premium-www {
    padding: 5px 12px;
    font-size: 10px;
  }
}
