/* ============================================================
   ESSE INDIA — SUCCESS STORIES (COVERFLOW)
   Location: /assets/css/stories.css
   ============================================================ */

#esseStories {
  position: relative;
  padding: 25px 0;
  background: linear-gradient(180deg, #ffffff 0%, #faf8ff 55%, #f5f1ff 100%);
  overflow: hidden;
  isolation: isolate;
}

/* Ambient blobs */
#esseStories .es-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .35;
  z-index: 0;
  animation: esFloat 14s ease-in-out infinite;
  pointer-events: none;
}
#esseStories .es-blob-1 { width: 320px; height: 320px; background: #c4b5fd; top: -80px; left: -60px; }
#esseStories .es-blob-2 { width: 280px; height: 280px; background: #fde68a; bottom: -100px; right: -30px; animation-delay: 2.4s; }

@keyframes esFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(26px, -20px) scale(1.08); }
}

/* Wrapper grid */
#esseStories .es-wrap {
  position: relative;
  z-index: 1;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: .9fr 1.4fr;
  gap: 48px;
  align-items: center;
}

/* Left column */
#esseStories .es-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
  animation: esFadeUp .7s ease both;
}
#esseStories h2 {
  font-size: 36px;
  font-weight: 800;
  color: #181021;
  margin: 0 0 14px;
  line-height: 1.2;
  letter-spacing: -.5px;
  animation: esFadeUp .7s ease .08s both;
}
#esseStories h2 span {
  background: linear-gradient(90deg, #7c3aed, #d97706);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#esseStories .es-left p {
  color: #6b7280;
  font-size: 15.5px;
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 400px;
  animation: esFadeUp .7s ease .16s both;
}

/* CTA Button */
#esseStories .es-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 13px 28px;
  border-radius: 30px;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(124, 58, 237, .28);
  transition: transform .25s ease, box-shadow .25s ease;
  animation: esFadeUp .7s ease .24s both;
}
#esseStories .es-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(124, 58, 237, .38);
  color: #fff;
}

/* Stats */
#esseStories .es-stats {
  display: flex;
  gap: 22px;
  margin-top: 30px;
  animation: esFadeUp .7s ease .3s both;
  flex-wrap: wrap;
}
#esseStories .es-stat b {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #181021;
}
#esseStories .es-stat b span { color: #d97706; }
#esseStories .es-stat small { color: #6b7280; font-size: 12px; }

@keyframes esFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Trust row */
#esseStories .es-trust {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  animation: esFadeUp .7s ease .36s both;
}
#esseStories .es-trust .es-avatars { display: flex; }
#esseStories .es-trust .es-avatars span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-left: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  font-weight: 700;
}
#esseStories .es-trust .es-avatars span:first-child { margin-left: 0; }
#esseStories .es-trust small { color: #6b7280; font-size: 12px; }

/* ============================================================
   3D COVERFLOW STAGE
   ============================================================ */
#esseStories .es-stage {
  position: relative;
  height: 340px;
  perspective: 1600px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease, transform .8s ease;
  outline: none;
}
#esseStories .es-stage.es-in {
  opacity: 1;
  transform: translateY(0);
}
#esseStories .es-track {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
#esseStories .es-slide {
  position: absolute;
  top: 0;
  left: 50%;
  width: 280px;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.22, .68, 0, 1.04), opacity .7s ease, filter .7s ease;
  cursor: pointer;
}

/* Card base */
#esseStories .es-card {
  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 26px 22px 22px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(124, 58, 237, .12);
  box-shadow: 0 18px 40px rgba(76, 29, 149, .10);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow .5s ease, border-color .5s ease, transform .15s ease-out;
  will-change: transform;
}
#esseStories .es-slide[data-pos="0"] .es-card {
  border-color: rgba(124, 58, 237, .28);
  box-shadow: 0 22px 50px rgba(124, 58, 237, .18), 0 0 0 1px rgba(192, 132, 252, .2);
  animation: esBreathe 4.5s ease-in-out infinite;
}
@keyframes esBreathe {
  0%, 100% { box-shadow: 0 22px 50px rgba(124, 58, 237, .18), 0 0 0 1px rgba(192, 132, 252, .2); }
  50% { box-shadow: 0 26px 56px rgba(217, 119, 6, .15), 0 0 0 1px rgba(217, 119, 6, .22); }
}
#esseStories .es-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #d97706);
  opacity: .9;
}

#esseStories .es-quote {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 42px;
  color: rgba(124, 58, 237, .12);
  font-family: Georgia, serif;
  line-height: 1;
}
#esseStories .es-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
#esseStories .es-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #6d28d9);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(109, 40, 217, .35);
}
#esseStories .es-slide[data-pos="0"] .es-avatar::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(217, 119, 6, .5);
  animation: esPulseRing 2.4s ease-out infinite;
}
@keyframes esPulseRing {
  0% { transform: scale(.9); opacity: .9; }
  100% { transform: scale(1.35); opacity: 0; }
}

#esseStories .es-name {
  font-weight: 700;
  font-size: 15px;
  color: #181021;
  display: flex;
  align-items: center;
  gap: 5px;
}
#esseStories .es-verified { color: #16a34a; font-size: 12px; }
#esseStories .es-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
#esseStories .es-stars {
  color: #d97706;
  font-size: 13px;
  margin: 8px 0 12px;
  letter-spacing: 1px;
}
#esseStories .es-card .es-quote-text {
  font-size: 13.5px;
  color: #374151;
  line-height: 1.65;
  margin: 0;
  position: relative;
}

/* Depth states */
#esseStories .es-slide[data-pos="0"] {
  transform: translateX(-50%) translateZ(0) rotateY(0deg) scale(1);
  opacity: 1;
  z-index: 5;
  filter: blur(0);
}
#esseStories .es-slide[data-pos="-1"] {
  transform: translateX(calc(-50% - 220px)) translateZ(-170px) rotateY(35deg) scale(.86);
  opacity: .75;
  z-index: 4;
  filter: blur(.4px) brightness(.95);
}
#esseStories .es-slide[data-pos="1"] {
  transform: translateX(calc(-50% + 220px)) translateZ(-170px) rotateY(-35deg) scale(.86);
  opacity: .75;
  z-index: 4;
  filter: blur(.4px) brightness(.95);
}
#esseStories .es-slide[data-pos="-2"] {
  transform: translateX(calc(-50% - 380px)) translateZ(-320px) rotateY(42deg) scale(.72);
  opacity: .3;
  z-index: 3;
  filter: blur(.8px) brightness(.9);
}
#esseStories .es-slide[data-pos="2"] {
  transform: translateX(calc(-50% + 380px)) translateZ(-320px) rotateY(-42deg) scale(.72);
  opacity: .3;
  z-index: 3;
  filter: blur(.8px) brightness(.9);
}
#esseStories .es-slide[data-pos="far"] {
  transform: translateX(-50%) translateZ(-500px) scale(.5);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

/* Navigation */
#esseStories .es-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
}
#esseStories .es-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #e5e0f5;
  color: #6d28d9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(76, 29, 149, .08);
  transition: background .2s, transform .2s, box-shadow .2s, color .2s;
  font-size: 16px;
  font-family: inherit;
}
#esseStories .es-arrow:hover {
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(124, 58, 237, .35);
}
#esseStories .es-dots { display: flex; gap: 7px; }
#esseStories .es-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e0dcf0;
  cursor: pointer;
  transition: all .3s;
  border: none;
  padding: 0;
}
#esseStories .es-dot.active {
  width: 24px;
  border-radius: 5px;
  background: linear-gradient(90deg, #7c3aed, #d97706);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  #esseStories .es-wrap { grid-template-columns: 1fr; }
  #esseStories .es-stage { height: 310px; }
  #esseStories .es-slide { width: 76vw; max-width: 310px; }
  #esseStories .es-slide[data-pos="-1"] {
    transform: translateX(calc(-50% - 58vw)) translateZ(-110px) rotateY(30deg) scale(.8);
  }
  #esseStories .es-slide[data-pos="1"] {
    transform: translateX(calc(-50% + 58vw)) translateZ(-110px) rotateY(-30deg) scale(.8);
  }
  #esseStories .es-stats { gap: 16px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  #esseStories .es-slide,
  #esseStories .es-blob {
    transition: none !important;
    animation: none !important;
  }
}