/* ===== Success Stories Page — Premium Cinematic Redesign ===== */

/* ---------- Parallax Hero ---------- */
.stories-parallax {
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.2), transparent 32%),
    linear-gradient(180deg, #d8ebff 0%, #aac8e6 36%, #4c6f99 72%, #132643 100%);
}

.stories-parallax-layer-title {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 2;
  padding: 18vh 1.5rem 0;
}

.stories-parallax-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: auto;
  max-width: none;
  color: var(--color-white);
  text-align: center;
  text-shadow:
    0 2px 20px rgba(8, 20, 44, 0.42),
    0 8px 34px rgba(8, 20, 44, 0.22);
  z-index: 3;
}

.stories-parallax-title {
  font-size: clamp(3.6rem, 7vw, 6.2rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin: 0 auto;
  max-width: 12ch;
  text-transform: none;
  color: rgba(255, 255, 255, 0.96);
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.6);
  paint-order: stroke fill;
}

.stories-parallax-title .bigger {
  display: inline-block;
  font-size: 1.22em;
  line-height: 1.02;
  margin-top: 0.05em;
  white-space: nowrap;
}

.stories-parallax-midground {
  z-index: 1;
}

.stories-parallax-foreground {
  z-index: 3;
  width: 58%;
  height: auto;
  top: 18%;
  left: 21%;
}

/* ---------- Hero ---------- */
.stories-hero {
  position: relative;
  text-align: center;
  padding: var(--space-3xl) var(--space-md) var(--space-2xl);
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(59, 113, 245, 0.12) 0%, transparent 70%),
    linear-gradient(165deg, #090f1f 0%, #111b3a 40%, #1a1240 100%);
  color: var(--color-white);
  overflow: hidden;
}

/* Ring — outer (deep purple → violet) */
.stories-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 4px;
  background: linear-gradient(180deg, #1a0a3e 0%, #6d28d9 50%, #a78bfa 100%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

/* Ring — middle (deep blue → blue) */
.stories-hero::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: inherit;
  padding: 4px;
  background: linear-gradient(180deg, #0c1a3d 0%, #2563eb 50%, #60a5fa 100%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

/* Ring — inner (deep teal → cyan) */
.stories-hero .stories-ring-inner {
  position: absolute;
  inset: 28px;
  border-radius: inherit;
  padding: 4px;
  background: linear-gradient(180deg, #0c2d3e 0%, #0891b2 50%, #22d3ee 100%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.stories-hero-content {
  position: relative;
  z-index: 1;
}

.stories-hero-title:not(.stories-parallax-title) {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: 700;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.03em;
  line-height: var(--leading-tight);
}

.stories-hero-subtitle {
  font-family: var(--font-accent);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  opacity: 0.7;
  max-width: 440px;
  margin: 0 auto;
  letter-spacing: 0.01em;
}

.stories-hero-panel {
  padding: var(--space-xl) var(--space-md);
}

.stories-hero-panel-subtitle {
  opacity: 0.9;
}

/* ---------- Section ---------- */
.stories-section {
  padding: var(--space-xl) var(--space-md);
}

.stories-section-title {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-3xl));
  font-weight: 700;
  color: var(--color-text-dark);
  text-align: center;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.02em;
}

/* ---------- Grid ---------- */
.stories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .stories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

@media (min-width: 1400px) {
  .stories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

/* ---------- Card — Base ---------- */
.story-card {
  position: relative;
  background: linear-gradient(168deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 26px;
  padding: 28px 26px 26px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 4px 16px rgba(0, 0, 0, 0.04),
    0 12px 40px rgba(0, 0, 0, 0.03);
  transition:
    transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    border-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

/* Top accent strip */
.story-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, #3d71f5, #5b93ff);
  opacity: 0.55;
  transition: opacity 0.4s ease;
}

/* Hover — desktop only */
@media (hover: hover) {
  .story-card:hover {
    transform: translateY(-5px);
    border-color: rgba(61, 113, 245, 0.15);
    box-shadow:
      0 2px 4px rgba(0, 0, 0, 0.03),
      0 8px 24px rgba(61, 113, 245, 0.08),
      0 20px 48px rgba(0, 0, 0, 0.06);
  }

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

  .story-card:hover .story-avatar {
    box-shadow: 0 0 0 3px rgba(61, 113, 245, 0.2);
  }

  .story-card:hover .story-badge {
    background: linear-gradient(135deg, #c7d8ff, #dbeafe);
  }
}

/* ---------- Card — Female variant ---------- */
.story-card--female {
  border-color: rgba(139, 92, 246, 0.08);
}

.story-card--female::before {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

@media (hover: hover) {
  .story-card--female:hover {
    border-color: rgba(139, 92, 246, 0.18);
    box-shadow:
      0 2px 4px rgba(0, 0, 0, 0.03),
      0 8px 24px rgba(139, 92, 246, 0.08),
      0 20px 48px rgba(0, 0, 0, 0.06);
  }

  .story-card--female:hover .story-avatar {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
  }

  .story-card--female:hover .story-badge {
    background: linear-gradient(135deg, #ddd6fe, #ede9fe);
  }
}

/* ---------- Card Header ---------- */
.story-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.story-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3d71f5, #1d4ed8);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: box-shadow 0.35s ease;
}

.story-avatar--female {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.story-name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.story-age {
  font-family: var(--font-main);
  font-size: var(--text-sm);
  color: var(--color-slate-400, #64748b);
  margin-top: 1px;
}

.story-badge {
  margin-left: auto;
  font-family: var(--font-accent);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 5px 14px;
  border-radius: 100px;
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  color: #1d4ed8;
  white-space: nowrap;
  transition: background 0.35s ease;
}

.story-badge--female {
  background: linear-gradient(135deg, #ede9fe, #f3e8ff);
  color: #7c3aed;
}

/* ---------- Card Body ---------- */
.story-body {
  padding-top: 2px;
}

.story-body p {
  font-family: var(--font-main);
  font-size: var(--text-base);
  line-height: 1.72;
  color: var(--color-text-dark-neutral);
  margin: 0 0 10px;
}

.story-body p:last-child {
  margin-bottom: 0;
}

.story-body em {
  color: var(--color-text-dark);
  font-style: italic;
  font-weight: 500;
}

/* ---------- Highlight (emotional climax) ---------- */
.story-highlight {
  position: relative;
  font-weight: 600;
  color: var(--color-text-dark) !important;
  line-height: 1.65 !important;
  background: linear-gradient(135deg, rgba(61, 113, 245, 0.04) 0%, rgba(59, 130, 246, 0.02) 100%);
  border-left: 3px solid #3d71f5;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px 14px 18px !important;
  margin: 18px 0 0 !important;
}

.story-card--female .story-highlight {
  border-left-color: #8b5cf6;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.04) 0%, rgba(168, 85, 247, 0.02) 100%);
}

/* ---------- Wins List ---------- */
.story-wins {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.story-wins li {
  font-family: var(--font-accent);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 100px;
  background: rgba(22, 163, 74, 0.06);
  color: #166534;
  border: 1px solid rgba(22, 163, 74, 0.14);
}

.story-card--female .story-wins li {
  background: rgba(139, 92, 246, 0.06);
  color: #6b21a8;
  border-color: rgba(139, 92, 246, 0.14);
}

/* ---------- CTA ---------- */
.stories-cta {
  position: relative;
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  background:
    radial-gradient(ellipse 70% 50% at 50% 60%, rgba(59, 113, 245, 0.1) 0%, transparent 70%),
    linear-gradient(165deg, #090f1f 0%, #111b3a 40%, #1a1240 100%);
  color: var(--color-white);
  overflow: hidden;
}

/* CTA Ring — outer (deep purple → violet) */
.stories-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 4px;
  background: linear-gradient(180deg, #1a0a3e 0%, #6d28d9 50%, #a78bfa 100%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

/* CTA Ring — middle (deep blue → blue) */
.stories-cta::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: inherit;
  padding: 4px;
  background: linear-gradient(180deg, #0c1a3d 0%, #2563eb 50%, #60a5fa 100%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

/* CTA Ring — inner (deep teal → cyan) */
.stories-cta .stories-ring-inner {
  position: absolute;
  inset: 28px;
  border-radius: inherit;
  padding: 4px;
  background: linear-gradient(180deg, #0c2d3e 0%, #0891b2 50%, #22d3ee 100%);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.stories-cta > *:not(.stories-ring-inner) {
  position: relative;
  z-index: 1;
}

.stories-cta-title {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-3xl));
  font-weight: 700;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.02em;
}

.stories-cta-subtitle {
  font-family: var(--font-accent);
  font-size: var(--text-xl);
  opacity: 0.65;
  margin-bottom: var(--space-lg);
}

.stories-cta .main_button {
  display: inline-flex;
  max-width: 260px;
  margin: 0 auto;
  padding: 16px 40px;
  font-size: var(--text-lg);
  border-radius: var(--radius-md);
  transition:
    background-color 0.3s ease,
    transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
    box-shadow 0.3s ease;
}

.stories-cta .main_button:focus-visible {
  outline: 2px solid #93bbff;
  outline-offset: 3px;
}

/* ---------- GSAP initial states (set via JS, fallback for no-JS) ---------- */
.stories-hero-title,
.stories-hero-subtitle,
.stories-section-title,
.stories-cta-title,
.stories-cta-subtitle,
.stories-cta .main_button {
  will-change: transform, opacity;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .story-card,
  .story-card::before,
  .story-avatar,
  .story-badge,
  .stories-cta .main_button {
    transition: none !important;
  }

  .story-card:hover {
    transform: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 639px) {
  .stories-parallax .parallax__header {
    min-height: 70svh;
    padding: 24px 18px;
  }

  .stories-parallax-layer-title {
    justify-content: center;
    align-items: flex-start;
    padding: 6.8rem 1rem 0;
  }

  .stories-parallax-copy {
    width: auto;
    text-align: center;
  }

  .stories-parallax-title {
    font-size: clamp(2.7rem, 8.8vw, 4.2rem);
    max-width: 11ch;
  }

  .stories-parallax-title .bigger {
    font-size: 1.16em;
  }

  .stories-parallax-foreground {
    width: 84%;
    top: 30%;
    left: 8%;
  }

  .stories-hero-panel {
    padding: var(--space-lg) var(--space-sm);
  }

  .stories-hero {
    padding: var(--space-2xl) var(--space-sm) var(--space-xl);
  }

  /* Tighten rings on small screens so they don't eat into content */
  .stories-hero::before,
  .stories-cta::before {
    inset: 8px;
  }

  .stories-hero .stories-ring-inner,
  .stories-cta .stories-ring-inner {
    inset: 18px;
  }

  .stories-section {
    padding: var(--space-lg) var(--space-sm);
  }

  .story-card {
    padding: 22px 20px 20px;
    border-radius: 22px;
  }

  .story-badge {
    margin-left: 0;
    flex-basis: 100%;
    text-align: center;
    margin-top: -4px;
  }

  .story-highlight {
    padding: 12px 14px 12px 14px !important;
  }

  .stories-cta {
    padding: var(--space-xl) var(--space-sm);
  }

  .stories-cta .main_button {
    padding: 14px 28px;
    font-size: var(--text-base);
    max-width: 220px;
  }
}

@media (min-width: 640px) and (max-width: 1059px) {
  .stories-section {
    padding: var(--space-xl) var(--space-sm);
  }
}

/* ============================================================ */
/* MOBILE PASS — small-phone polish (≤430px + ≤360px)          */
/* ============================================================ */

@media (max-width: 430px) {
  /* Parallax hero — keep title legible and image well-framed */
  .stories-parallax .parallax__header {
    min-height: 64svh;
    padding: 18px 14px;
  }

  .stories-parallax-layer-title {
    padding: 5.6rem 0.75rem 0;
  }

  .stories-parallax-title {
    font-size: clamp(2.3rem, 11vw, 3.4rem);
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.55);
  }

  .stories-parallax-foreground {
    width: 92%;
    top: 33%;
    left: 4%;
  }

  /* Cinematic ring sections — tighten ring insets so content has more room */
  .stories-hero::before,
  .stories-cta::before {
    inset: 6px;
  }

  .stories-hero .stories-ring-inner,
  .stories-cta .stories-ring-inner {
    inset: 14px;
  }

  .stories-hero {
    padding: var(--space-xl) var(--space-sm) var(--space-lg);
  }

  .stories-hero-subtitle {
    font-size: 1rem;
    line-height: 1.55;
  }

  /* Section titles */
  .stories-section-title {
    font-size: clamp(1.5rem, 6.4vw, 1.85rem);
  }

  /* Story cards */
  .story-card {
    padding: 20px 18px 18px;
    border-radius: 20px;
  }

  .story-card::before {
    left: 18px;
    right: 18px;
  }

  .story-card-header {
    gap: 11px;
    margin-bottom: 16px;
    padding-bottom: 14px;
  }

  .story-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.02rem;
  }

  .story-name {
    font-size: 1.02rem;
  }

  .story-age {
    font-size: 0.82rem;
  }

  .story-badge {
    font-size: 0.62rem;
    padding: 4px 11px;
    letter-spacing: 0.06em;
  }

  .story-body p {
    font-size: 0.95rem;
    line-height: 1.66;
  }

  .story-highlight {
    padding: 11px 12px 11px 13px !important;
    margin-top: 14px !important;
    font-size: 0.95rem;
  }

  .story-wins {
    gap: 6px;
    margin: 12px 0;
  }

  .story-wins li {
    font-size: 0.78rem;
    padding: 4px 11px;
  }

  /* CTA */
  .stories-cta {
    padding: var(--space-lg) var(--space-sm);
  }

  .stories-cta-title {
    font-size: clamp(1.45rem, 6.4vw, 1.85rem);
  }

  .stories-cta-subtitle {
    font-size: 1rem;
    margin-bottom: var(--space-md);
  }

  .stories-cta .main_button {
    padding: 13px 26px;
    font-size: 0.95rem;
    max-width: 220px;
  }
}

@media (max-width: 360px) {
  .stories-parallax-title {
    font-size: 2rem;
  }

  .stories-parallax-title .bigger {
    font-size: 1.1em;
  }

  .stories-parallax-foreground {
    width: 100%;
    left: 0;
    top: 36%;
  }

  .story-card {
    padding: 18px 16px 16px;
  }

  .story-card-header {
    gap: 9px;
  }

  .story-name {
    font-size: 0.98rem;
  }

  .story-badge {
    font-size: 0.6rem;
    padding: 4px 9px;
  }
}
