/* Progress rail */
.progress-rail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--cream-dark);
  z-index: 100;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--coral);
  transition: width 0.1s linear;
}

/* Nav */
.story-nav {
  position: sticky;
  top: 4px;
  z-index: 90;
  background: rgba(253, 248, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cream-dark);
}

.story-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1080px;
  margin: 0 auto;
}

.story-back-btn {
  padding: 9px 18px;
  font-size: 0.85rem;
}

/* Hero */
.story-hero {
  padding: 100px 0 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.story-hero .container {
  position: relative;
  z-index: 1;
}

.story-hero .eyebrow { margin-bottom: 18px; }

/* Hero decoration: a tiled organic pattern with a vignette to protect text legibility */
.hero-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-pattern-svg {
  display: block;
  animation: heroPatternDrift 40s linear infinite;
}

@keyframes heroPatternDrift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-120px, -120px); }
}

.hero-decor-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 65% at center, var(--cream) 0%, var(--cream) 30%, rgba(253, 248, 242, 0.75) 52%, rgba(253, 248, 242, 0) 72%);
}

.story-hero h1 {
  font-size: 2.8rem;
  line-height: 1.15;
  max-width: 18ch;
  margin: 0 auto 22px;
}

.story-hero-lead {
  font-size: 1.1rem;
  max-width: 58ch;
  margin: 0 auto 40px;
}

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scroll-cue span {
  animation: bounce 1.8s ease-in-out infinite;
  font-size: 1.1rem;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Sequence wrapper: holds the traveling squiggle behind all 5 sections */
.story-sequence {
  position: relative;
}

.story-squiggle-wrap {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1080px;
  padding: 0 24px;
  pointer-events: none;
  z-index: 1;
}

.story-squiggle-svg {
  position: absolute;
  top: 0;
  left: 24px;
  width: 160px;
  height: 100%;
  overflow: visible;
}

.story-squiggle-svg path {
  fill: none;
  stroke: var(--coral);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.45;
  transition: stroke-dashoffset 0.4s ease, stroke 0.4s ease;
}

/* Strength story sections */
.story-strength {
  padding: 60px 0;
  border-top: 1px solid var(--cream-dark);
  overflow: hidden;
  position: relative;
}

.story-strength:nth-of-type(even) { background: var(--white); }

.story-strength[data-domain="strategic-thinking"] { --accent: var(--green); }
.story-strength[data-domain="executing"] { --accent: var(--coral); }

.story-strength-inner {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px 24px;
  position: relative;
  z-index: 2;
}

.story-content {
  border-left: 4px solid var(--accent);
  padding-left: 24px;
}

/* Icon badge: scales/rotates in, then drifts gently and pulses while active */
.story-icon-badge {
  width: 100px;
  height: 100px;
  justify-self: center;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent);
  flex-shrink: 0;
  opacity: 0;
  --parallax-y: 0px;
  transform: translateY(var(--parallax-y)) scale(0.55) rotate(-10deg);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
  will-change: transform;
}

.story-strength[data-domain="strategic-thinking"] .story-icon-badge { background: linear-gradient(rgba(71, 97, 44, 0.12), rgba(71, 97, 44, 0.12)), var(--cream); }
.story-strength[data-domain="executing"] .story-icon-badge { background: linear-gradient(rgba(201, 106, 58, 0.12), rgba(201, 106, 58, 0.12)), var(--cream); }

.story-icon-badge svg {
  width: 44px;
  height: 44px;
  color: var(--accent);
}

.story-strength.in-view .story-icon-badge {
  opacity: 1;
  transform: translateY(var(--parallax-y)) scale(1) rotate(0deg);
}

.story-strength.is-active .story-icon-badge {
  animation: iconPulse 2.4s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
  50% { box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.03); }
}

/* Cascading reveal for text content */
.story-domain,
.story-content h2,
.story-definition,
.story-lead,
.story-bullets li {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.story-domain {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 10px;
}

.story-content h2 {
  font-size: 2.4rem;
  margin-bottom: 18px;
}

.story-definition {
  font-size: 1.02rem;
  font-style: italic;
  color: var(--ink);
  max-width: 46ch;
  margin-bottom: 18px;
}

.story-lead {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  max-width: 48ch;
  margin-bottom: 16px;
}

.story-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 48ch;
}

.story-bullets li {
  position: relative;
  padding-left: 22px;
  font-size: 0.98rem;
  color: var(--ink-soft);
  transform: translateX(-12px) translateY(0);
}

.story-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.story-strength.in-view .story-domain { opacity: 1; transform: none; transition-delay: 0.05s; }
.story-strength.in-view .story-content h2 { opacity: 1; transform: none; transition-delay: 0.15s; }
.story-strength.in-view .story-definition { opacity: 1; transform: none; transition-delay: 0.25s; }
.story-strength.in-view .story-lead { opacity: 1; transform: none; transition-delay: 0.35s; }
.story-strength.in-view .story-bullets li { opacity: 1; transform: none; }
.story-strength.in-view .story-bullets li:nth-child(1) { transition-delay: 0.45s; }
.story-strength.in-view .story-bullets li:nth-child(2) { transition-delay: 0.55s; }
.story-strength.in-view .story-bullets li:nth-child(3) { transition-delay: 0.65s; }

/* Closing */
.story-closing {
  padding: 100px 0;
  text-align: center;
  background: var(--ink);
}

.story-closing .eyebrow {
  background: rgba(253, 248, 242, 0.1);
  color: var(--peach);
}

.story-closing h2 {
  color: var(--cream);
  font-size: 2.1rem;
  max-width: 20ch;
  margin: 0 auto 22px;
}

.story-closing p {
  color: #c9c1b4;
  max-width: 56ch;
  margin: 0 auto 36px;
}

.story-closing-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.story-closing .btn-secondary {
  border-color: var(--white);
  color: var(--white);
}

.story-closing .btn-secondary:hover {
  border-color: var(--peach);
  color: var(--peach);
}

/* Responsive */
@media (max-width: 900px) {
  .story-squiggle-wrap { display: none; }
  .story-strength-inner { grid-template-columns: 140px 1fr; }
}

@media (max-width: 780px) {
  .story-hero { padding: 70px 0 60px; }
  .story-hero h1 { font-size: 2.1rem; }
  .story-strength { padding: 44px 0; }
  .story-strength-inner {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 10px 24px;
  }
  .story-icon-badge { width: 76px; height: 76px; }
  .story-icon-badge svg { width: 34px; height: 34px; }
  .story-content { padding-left: 20px; }
  .story-content h2 { font-size: 1.9rem; }
}
