/* About story: full-viewport immersive panel, scroll-driven video, side steps */

.story { margin-top: clamp(2.5rem, 6vw, 4rem); }

.story-hint {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.story-track { height: 480vh; }

/* The sticky panel covers the whole viewport in dark ink while scrubbing */
.story-sticky {
  position: sticky;
  top: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  padding: 5.5rem 0 2rem;
}

.story-layout {
  width: min(100% - 3rem, 92rem);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(16rem, 0.7fr);
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  align-items: center;
}

.story-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2rem 5rem rgb(0 0 0 / 0.45);
}

.story-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-progressbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.25rem;
  background: rgb(255 255 255 / 0.14);
}

.story-progressbar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--highlight-on-dark);
}

/* Side steps on dark: numbered heads, active one opens its explanation */
.story-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.story-step { border-left: 3px solid rgb(255 255 255 / 0.14); }

.story-step-head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.9rem;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.story-step-head:focus-visible {
  outline: 2px solid var(--highlight-on-dark);
  outline-offset: 2px;
}

.story-step-num {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgb(157 179 170 / 0.75);
}

.story-step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgb(201 214 208 / 0.72);
  transition: color 0.25s ease;
}

.story-step-body {
  max-height: 0;
  margin: 0;
  padding: 0 0.9rem 0 2.6rem;
  overflow: hidden;
  opacity: 0;
  color: var(--text-on-dark);
  font-size: 0.93rem;
  line-height: 1.5;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

.story-step.is-active { border-left-color: var(--highlight-on-dark); }
.story-step.is-active .story-step-num { color: var(--highlight-on-dark); }
.story-step.is-active .story-step-title { color: #ffffff; }

.story-step.is-active .story-step-body {
  max-height: 9em;
  opacity: 1;
  padding-bottom: 0.7rem;
}

/* Static fallback: same dark panel, plain player, all explanations open */
.story-static .story-track { height: auto; }

.story-static .story-sticky {
  position: static;
  height: auto;
  padding: 3rem 0;
}

.story-static .story-step-body {
  max-height: none;
  opacity: 1;
  padding-bottom: 0.7rem;
}

.story-static .story-progressbar { display: none; }

@media (prefers-reduced-motion: reduce) {
  .story-step-title, .story-step-body { transition: none; }
}

@media (max-width: 56rem) {
  .story-track { height: 420vh; }

  .story-sticky {
    padding: 4.75rem 0 1.25rem;
    align-items: flex-start;
  }

  .story-layout {
    width: min(100% - 2rem, 92rem);
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
  }

  .story-frame {
    width: min(100%, 62vh);
    margin-inline: auto;
  }

  .story-step-head { min-height: 2.5rem; padding: 0.4rem 0.75rem; }
  .story-step-body { font-size: 0.88rem; }
}
