/* ===================================
   GLOBAL SUCCESS STORIES SECTION - ULTRA TIGHT
   ==================================== */
.stories-section {
  position: relative;
  padding: 3rem 0 !important;
  background: #111111;
  color: #ffffff;
  font-family: "Montserrat", sans-serif;
  overflow: hidden !important;
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s ease;
}

.stories-section.section-visible {
  opacity: 1;
  transform: translateY(0);
}

.stories-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 1;
}

/* ===================================
   CENTERED HEADING
   ==================================== */
.stories-header {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 100;
  opacity: 0;
  transform: translateY(-30px);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stories-header.animate {
  opacity: 1;
  transform: translateY(0);
}

/* Grey background word */
.stories-bg-word {
  font-size: 8rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -2px;
  color: rgb(39, 39, 39);
  line-height: 1;
  margin-bottom: -3.5rem;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  font-family: "BeyondInfinity", "Beyond Infinity", cursive;
}

/* Main title */
.stories-title {
  font-size: 3rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.3rem 0;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

/* SVG underline */
.stories-underline {
  width: 180px;
  height: 18px;
  margin: 0.5rem auto 0;
  position: relative;
  pointer-events: none;
}

.stories-underline::after {
  content:'';
  position:absolute;
  left:-10px; 
  right:-10px; 
  bottom:0;
  height:100%;
  background-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1418 125'><path d='M1412.29 72.17c-11.04-5.78-20.07-14.33-85.46-25.24-22.37-3.63-44.69-7.56-67.07-11.04-167.11-22.06-181.65-21.24-304.94-30.56C888.78 1.39 822.57 1.1 756.44 0c-46.63-.11-93.27 1.56-139.89 2.5C365.5 13.55 452.86 7.68 277.94 23.15 202.57 33.32 127.38 45.01 52.07 55.69c-11.23 2.41-22.63 4.17-33.71 7.22C6.1 66.33 5.64 66.19 3.89 67.79c-7.99 5.78-2.98 20.14 8.72 17.5 33.99-9.47 32.28-8.57 178.06-29.66 4.26 4.48 7.29 3.38 18.42 3.11 13.19-.32 26.38-.53 39.56-1.12 53.51-3.81 106.88-9.62 160.36-13.95 18.41-1.3 36.8-3.12 55.21-4.7 23.21-1.16 46.43-2.29 69.65-3.40 120.28-2.16 85.46-3.13 234.65-1.52 23.42.99 1.57-.18 125.72 6.9 96.61 8.88 200.92 27.94 295.42 46.12 40.87 7.91 116.67 23.2 156.31 36.78 3.81 1.05 8.28-.27 10.51-3.58 3.17-3.72 2.66-9.7-.78-13.13-3.25-3.12-8.14-3.44-12.18-5.08-17.89-5.85-44.19-12.09-63.67-16.56l26.16 3.28c23.02 3.13 46.28 3.92 69.34 6.75 10.8.96 25.43 1.81 34.34-4.39 2.26-1.54 4.86-2.75 6.21-5.27 2.76-4.59 1.13-11.06-3.59-13.68ZM925.4 23.77c37.64 1.4 153.99 10.85 196.64 14.94 45.95 5.51 91.89 11.03 137.76 17.19 24.25 4.77 74.13 11.21 101.72 18.14-11.87-1.15-23.77-1.97-35.65-3.06-133.46-15.9-266.8-33.02-400.47-47.21Z' fill='%23f36e36'></path></svg>");
  background-size:100% 100%;
  background-repeat:no-repeat;
  background-position:center bottom;
  opacity: 1;
}

/* Subtitle */
.stories-subtitle {
  max-width: 700px;
  margin: 0.3rem auto 0;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

/* ===================================
   MAIN ROW: GLOBE + CARDS (OVERLAPPING LAYOUT)
   ==================================== */
.stories-main {
  position: relative;
  width: 100%;
  min-height: 65vh !important;
  margin-top: 0;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  perspective: 1200px; /* 3D perspective for narrow effect */
}

/* ===================================
   LEFT: EARTH GLOBE CONTAINER - HIGHEST Z-INDEX
   ==================================== */
.stories-left {
  width: 55% !important;
  height: 65vh !important;
  min-height: 450px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  z-index: 100 !important;
  isolation: isolate;
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease;
  pointer-events: auto;
}

.stories-left.animate {
  opacity: 1;
  transform: translateX(0);
}

#container {
  width: 100% !important;
  height: 100% !important;
  cursor: grab;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 100 !important;
  isolation: isolate;
}

#container:active {
  cursor: grabbing;
}

#container canvas {
  display: block !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 auto !important;
  position: relative !important;
  z-index: 100 !important;
}

/* ===================================
   RIGHT: SCROLLING CARDS - macOS NARROW STYLE
   ==================================== */
.stories-right {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 100% !important;
  overflow: visible !important;
  display: flex;
  align-items: center;
  z-index: 1 !important;
  opacity: 0;
  transition: opacity 0.8s ease 0.2s;
  pointer-events: none;
  transform-style: preserve-3d; /* Enable 3D transforms */
}

.stories-right.animate {
  opacity: 1;
}

.stories-cards-mask {
  width: 100%;
  overflow: visible !important;
  padding: 0;
  position: relative;
  z-index: 1 !important;
  transform-style: preserve-3d; /* Enable 3D transforms */
  /* SMOOTH FADE + macOS NARROW EFFECT */
  -webkit-mask-image: linear-gradient(to right, 
    transparent 0%, 
    rgba(0,0,0,0.01) 30%, 
    rgba(0,0,0,0.03) 33%, 
    rgba(0,0,0,0.08) 36%, 
    rgba(0,0,0,0.15) 39%, 
    rgba(0,0,0,0.25) 42%, 
    rgba(0,0,0,0.35) 45%, 
    rgba(0,0,0,0.45) 48%, 
    rgba(0,0,0,0.55) 51%, 
    rgba(0,0,0,0.65) 54%, 
    rgba(0,0,0,0.75) 57%, 
    rgba(0,0,0,0.85) 60%, 
    rgba(0,0,0,0.92) 63%, 
    rgba(0,0,0,0.97) 66%, 
    rgba(0,0,0,1) 69%, 
    rgba(0,0,0,1) 100%
  );
  mask-image: linear-gradient(to right, 
    transparent 0%, 
    rgba(0,0,0,0.01) 30%, 
    rgba(0,0,0,0.03) 33%, 
    rgba(0,0,0,0.08) 36%, 
    rgba(0,0,0,0.15) 39%, 
    rgba(0,0,0,0.25) 42%, 
    rgba(0,0,0,0.35) 45%, 
    rgba(0,0,0,0.45) 48%, 
    rgba(0,0,0,0.55) 51%, 
    rgba(0,0,0,0.65) 54%, 
    rgba(0,0,0,0.75) 57%, 
    rgba(0,0,0,0.85) 60%, 
    rgba(0,0,0,0.92) 63%, 
    rgba(0,0,0,0.97) 66%, 
    rgba(0,0,0,1) 69%, 
    rgba(0,0,0,1) 100%
  );
}

.stories-cards-track {
  display: flex;
  gap: 2rem;
  animation: scroll-right-to-left 45s linear infinite; 
  width: max-content;
  position: relative;
  z-index: 1 !important;
  transform-style: preserve-3d; /* Enable 3D transforms */
}

.stories-cards-track:hover {
  animation-play-state: paused;
}

/* ===================================
   CARD STYLING - macOS NARROW PERSPECTIVE EFFECT
   ==================================== */
.stories-card {
  width: 360px;
  flex-shrink: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
  position: relative;
  z-index: 1 !important;
  pointer-events: auto;
  /* macOS NARROW EFFECT - Cards get narrower as they approach globe */
  transform: perspective(1200px) rotateY(15deg) scale(0.85); /* Narrow perspective */
  transform-origin: center center;
  transform-style: preserve-3d;
}

/* Remove any pseudo-element overlays */
.stories-card::before,
.stories-card::after {
  display: none !important;
}

/* Visible cards (right side) - Full size */
.stories-card:nth-child(n+3) {
  transform: perspective(1200px) rotateY(0deg) scale(1); /* Normal size */
}

.stories-card:hover {
  transform: perspective(1200px) rotateY(0deg) scale(1.05) translateY(-10px) !important;
  border-color: rgba(243, 110, 54, 0.6);
  box-shadow: 0 25px 60px rgba(243, 110, 54, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

/* ===================================
   CARD MEDIA - NO BLACK OVERLAY
   ==================================== */
.stories-card-media {
  height: 240px;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: transparent;
}

/* Remove any overlay pseudo-elements */
.stories-card-media::before,
.stories-card-media::after {
  display: none !important;
}

.stories-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  opacity: 1 !important;
  filter: none !important;
}

.stories-card:hover .stories-card-media img {
  transform: scale(1.1);
}

/* Year badge */
.stories-year {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: #f36e36;
  color: #fff;
  font-weight: 800;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 2;
}

/* ===================================
   CARD CONTENT
   ==================================== */
.stories-card-content {
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.stories-card h3 {
  font-size: 1.7rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: #ffffff;
}

.stories-card p {
  font-size: 1.05rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

/* ===================================
   BOTTOM ROW: LOGO SCROLL
   ==================================== */
.stories-logos-section {
  width: 100%;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem 0;
  margin-top: 0;
  position: relative;
  z-index: 5;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease 0.4s;
}

.stories-logos-section.animate {
  opacity: 1;
  transform: translateY(0);
}

.stories-logos-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: scroll-logos 30s linear infinite;
  will-change: transform;
}

.stories-logo {
  padding: 0 2.5rem;
}

.stories-logo img {
  height: 60px;
  display: block;
  filter: grayscale(1) brightness(1.5);
  opacity: 0.6;
  transition: all 0.3s ease;
}

.stories-logo:hover img {
  opacity: 1;
  filter: grayscale(0) brightness(1);
  transform: scale(1.1);
}

/* ===================================
   ANIMATION KEYFRAMES
   ==================================== */
@keyframes scroll-right-to-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); } 
}

@keyframes scroll-logos {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===================================
   RESPONSIVE DESIGN
   ==================================== */
@media (max-width: 1024px) {
  .stories-section {
    padding: 2.5rem 0 !important;
  }
  
  .stories-header {
    margin-bottom: 1.2rem;
  }
  
  .stories-main {
    flex-direction: column;
    min-height: auto !important;
    perspective: none;
  }
  
  .stories-left {
    width: 100% !important;
    height: 45vh !important;
    min-height: 380px !important;
    z-index: 100 !important;
    position: relative !important;
  }
  
  .stories-right {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    margin-top: 1rem;
    z-index: 1 !important;
  }
  
  .stories-cards-mask {
    -webkit-mask-image: none;
    mask-image: none;
  }
  
  .stories-card {
    transform: none !important;
  }
  
  .stories-card:hover {
    transform: translateY(-10px) scale(1.02) !important;
  }
  
  #container {
    height: 100% !important;
    z-index: 100 !important;
  }
  
  .stories-bg-word {
    font-size: 4.5rem;
    margin-bottom: -2.2rem;
  }
  
  .stories-title {
    font-size: 3rem;
  }
  
  .stories-container {
    gap: 0;
  }
}

@media (max-width: 768px) {
  .stories-section {
    padding: 2rem 0 !important;
  }
  
  .stories-header {
    margin-bottom: 1rem;
  }
  
  .stories-main {
    padding: 0.3rem 0;
    margin-bottom: 0.8rem;
  }
  
  .stories-left {
    height: 40vh !important;
    min-height: 340px !important;
    z-index: 100 !important;
  }
  
  .stories-right {
    z-index: 1 !important;
  }
  
  .stories-bg-word {
    font-size: 3.2rem;
    margin-bottom: -1.8rem;
  }
  
  .stories-title {
    font-size: 2.3rem;
  }
  
  .stories-subtitle {
    font-size: 0.92rem;
  }
  
  .stories-card {
    width: 300px;
  }
  
  .stories-card-media {
    height: 220px;
  }
}

@media (max-width: 600px) {
  .stories-section {
    padding: 1.5rem 0 !important;
  }
  
  .stories-header {
    margin-bottom: 0.8rem;
  }
  
  .stories-main {
    padding: 0.2rem 0;
    margin-bottom: 0.8rem;
  }
  
  .stories-left {
    height: 38vh !important;
    min-height: 320px !important;
    z-index: 100 !important;
  }
  
  #container {
    height: 100% !important;
    z-index: 100 !important;
  }
  
  .stories-bg-word {
    font-size: 2.3rem;
    margin-bottom: -1rem;
  }
  
  .stories-title {
    font-size: 1.9rem;
  }
  
  .stories-subtitle {
    font-size: 0.88rem;
  }
  
  .stories-card {
    width: 280px;
  }
  
  .stories-card-media {
    height: 200px;
  }
  
  .stories-card-content {
    padding: 1.2rem;
  }
  
  .stories-card h3 {
    font-size: 1.5rem;
  }
  
  .stories-card p {
    font-size: 0.98rem;
    line-height: 1.4;
  }
  
  .stories-logo img {
    height: 45px;
  }
  
  .stories-logo {
    padding: 0 1.5rem;
  }
  
  .stories-container {
    gap: 0;
  }
  
  .stories-logos-section {
    padding: 0.8rem 0;
  }
}

@media (max-width: 480px) {
  .stories-card {
    width: 260px;
  }
  
  .stories-card-media {
    height: 180px;
  }
  
  .stories-left {
    height: 35vh !important;
    min-height: 300px !important;
    z-index: 100 !important;
  }
  
  .stories-section {
    padding: 1.2rem 0 !important;
  }
  
  .stories-card-content {
    padding: 1rem;
  }
  
  .stories-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
  }
  
  .stories-card p {
    font-size: 0.92rem;
  }
}
