/* Case study storytelling language — reusable across portfolio essays */

.story {
  --story-prose: min(42rem, 100%);
  --story-wide: min(72rem, 100%);
  --story-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --story-ink: var(--color-ink);
  --story-muted: var(--color-ink-muted);
  --story-faint: var(--color-ink-faint);
  --story-paper: var(--color-paper);
  --story-warm: var(--color-paper-warm);
  --story-ash: #e8e4dc;
  --story-dark: #131210;
  --story-dark-text: #d8d4ce;
  --story-score-hi: rgba(255, 255, 255, 0.9);
  --story-score-depth: 3px;
  /* Reading rail — § + prose stay indented; chapters align to container */
  --story-content-w: calc(min(var(--width-site), 100vw) - 4rem);
  --story-prose-inset: max(
    3.25rem,
    calc((var(--story-content-w) - var(--story-prose) - 4.2rem) / 2)
  );
  --story-sec-col: 2.85rem;
  --story-sec-gap: 1.35rem;
  --story-pull-ink: #9a9288;
  --story-pull-rule: #b5aea3;
  --story-sec-rail: calc(var(--story-sec-col) + var(--story-sec-gap));
}

/* ——— Beats & reveals ——— */
[data-beat] {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.85s var(--story-ease), transform 0.85s var(--story-ease);
}

[data-beat].is-on {
  opacity: 1;
  transform: none;
}

/* Bob-in for paired figures */
[data-bob] {
  opacity: 0;
  transform: translateY(1.35rem);
  transition:
    opacity 0.82s var(--story-ease),
    transform 0.82s var(--story-ease);
}

[data-bob].is-on {
  opacity: 1;
  transform: translateY(0);
}

[data-bob][data-bob-delay="1"] {
  transition-delay: 0.22s;
}

@media (prefers-reduced-motion: reduce) {
  [data-beat],
  [data-bob] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .story-chapter::before {
    transform: scaleX(1);
  }
}

/* ——— Prose column ——— */
.story-prose {
  max-width: var(--story-prose);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--story-muted);
}

.story-rail {
  margin-left: calc(var(--story-prose-inset) + var(--story-sec-rail));
  margin-right: auto;
  max-width: var(--story-prose);
}

.story-prose p { margin: 0 0 1rem; }
.story-prose p:last-child { margin-bottom: 0; }
.story-prose strong { color: var(--story-ink); font-weight: 500; }
.story-prose em { color: var(--story-ink); }

.story-prose h3 {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 500;
  color: var(--story-ink);
  line-height: 1.25;
  margin: 0 0 1rem;
}

.story-prose ul.story-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.story-list li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.5rem;
}

.story-list li::before {
  content: '○';
  position: absolute;
  left: 0;
  top: 0.82em;
  transform: translateY(-50%);
  font-size: 0.75em;
  line-height: 1;
  color: var(--story-faint);
}

/* ——— Section & act markers ——— */
.story-band {
  padding: 4rem var(--case-gutter);
}

.case-interior-article > .story-band:first-child {
  padding-top: 0;
}

.story-band--warm {
  background: var(--story-warm);
  --story-score-hi: rgba(255, 252, 248, 0.95);
}

.story-band--ash {
  background: var(--story-ash);
  --story-score-hi: rgba(255, 255, 255, 0.82);
}
.story-band--dark {
  background: var(--story-dark);
  color: var(--story-dark-text);
}

.story-band--dark .story-prose { color: #8a8780; }
.story-band--dark .story-prose em { color: #c8c4bc; }
.story-band--dark .story-prose strong { color: var(--story-paper); }
.story-band--dark .story-block__lead .story-sec { color: rgba(242, 239, 233, 0.38); }

/* ——— Front matter: one line into the story, not four ——— */
.story .case-interior-hero {
  border-bottom: none;
  min-height: auto;
  padding: 0;
}

.case-intro {
  display: flex;
  flex-direction: column;
  --case-intro-divider-gap: 1.35rem;
  --case-intro-head-pad: 3rem;
  margin-bottom: 3rem;
}

.case-intro__head {
  padding: var(--case-intro-head-pad) var(--case-gutter);
}

.case-intro__threshold {
  margin-inline: var(--case-gutter);
  margin-top: 0;
  width: auto;
  max-width: none;
}

.case-intro .case-interior-jumps {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: var(--case-intro-divider-gap) var(--case-gutter) 0.25rem;
}

.story .case-interior-frontmatter {
  border-top: 1px solid var(--color-rule);
  padding: 0;
  margin-bottom: 0;
}

.story .case-interior-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.35rem 2rem;
  border-bottom: none;
  padding: 1.35rem 0 0;
  margin: 0;
}

.story .case-interior-meta > div {
  min-width: 0;
}

.story .case-interior-meta dt {
  font-size: 0.52rem;
  letter-spacing: 0.13em;
  margin-bottom: 0.32rem;
}

.story .case-interior-meta dd {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
}

@media (min-width: 920px) {
  .case-intro {
    --case-intro-head-pad: 2.75rem;
  }

  .case-intro__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10.5rem, 15.5rem);
    gap: 2rem 3rem;
    align-items: end;
  }

  .story .case-interior-frontmatter {
    border-top: none;
    padding: 0;
    align-self: end;
  }

  .story .case-interior-meta {
    grid-template-columns: 1fr;
    gap: 0.95rem;
    padding: 0 0 0.15rem 2.25rem;
    border-left: 1px solid var(--color-rule);
  }

  .story .case-interior-hero {
    padding: 0;
  }

  .story .case-interior-hero__thesis {
    max-width: 36rem;
  }
}

.case-interior-jumps {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.55rem;
  margin: 0;
  padding: var(--case-intro-divider-gap, 1.35rem) 0 0.25rem;
}

.case-interior-jumps__label {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(19, 18, 16, 0.38);
}

.case-interior-jumps a {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--color-ink-muted);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.15s ease;
}

.case-interior-jumps a:hover {
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-color: rgba(19, 18, 16, 0.25);
  text-underline-offset: 0.18em;
}

.case-interior-jumps a[href="#do-differently"] {
  font-weight: 500;
  color: var(--color-ink);
}

.story-threshold {
  width: 100%;
  max-width: var(--story-content-w);
  height: calc(1px + var(--story-score-depth));
  background: linear-gradient(
    to bottom,
    var(--story-score-hi) 0,
    var(--story-score-hi) 1px,
    var(--color-ink) 1px,
    var(--color-ink) calc(1px + var(--story-score-depth))
  );
}

.case-interior-article--has-jumps .story-chapter--first::before {
  display: none;
}

.case-interior-article--has-jumps .story-chapter--first {
  padding-top: 2.15rem;
}

#the-problem,
#the-artefact,
#productivity-paradox,
#the-hidden-contract,
#support-is-not-support,
#conclusion,
#reflections,
#do-differently,
.case-jump-target {
  scroll-margin-top: calc(var(--play-ribbon-h, 0px) + var(--cx-shell-header-h, 5.111rem) + 0.85rem);
}

.case-jump-target {
  display: block;
  width: 0;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
}

@media (max-width: 919px) {
  .story .case-interior-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 1.35rem;
  }
}

@media (max-width: 520px) {
  .story .case-interior-meta {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ——— Chapter thresholds (Prologue, Act I–V) ——— */
/* Container rail — aligns with logo, meta, site chrome */
.story-chapter {
  position: relative;
  border-top: none;
  padding: 5.5rem 0 3rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: var(--story-content-w);
  margin-inline: 0;
}

/* Embossed score — draws from centre outward on approach */
.story-chapter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(1px + var(--story-score-depth));
  transform: scaleX(var(--score-scale, 0));
  transform-origin: center center;
  background: linear-gradient(
    to bottom,
    var(--story-score-hi) 0,
    var(--story-score-hi) 1px,
    var(--color-ink) 1px,
    var(--color-ink) calc(1px + var(--story-score-depth))
  );
}

.story-chapter--first {
  padding-top: 4.5rem;
}

.story-chapter__label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  color: var(--story-ink);
  margin: 0 0 1.5rem;
}

.story-chapter__title {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 20ch;
}

/* Act V on dark — left-aligned chapter on container rail; principle stays centred */
.story-chapter--dark {
  max-width: var(--story-content-w);
  text-align: left;
  padding: 7rem 0 5rem;
  margin-bottom: 0;
}

.story-chapter--dark::before {
  left: 0;
  transform: scaleX(var(--score-scale, 0));
  transform-origin: center center;
  width: 100%;
  --story-score-hi: rgba(242, 239, 233, 0.5);
  background: linear-gradient(
    to bottom,
    var(--story-score-hi) 0,
    var(--story-score-hi) 1px,
    rgba(0, 0, 0, 0.65) 1px,
    rgba(0, 0, 0, 0.65) calc(1px + var(--story-score-depth))
  );
}

.story-chapter--dark .story-chapter__label {
  font-size: 0.78rem;
  letter-spacing: 0.52em;
  color: rgba(242, 239, 233, 0.42);
  margin-bottom: 2rem;
}

.story-chapter--dark .story-chapter__title {
  color: var(--story-paper);
  max-width: 20ch;
  margin-inline: 0;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
}

.story-chapter--dark[data-sequence="act-v-chapter"] .story-chapter__label {
  opacity: var(--act-label, 0);
  transform: translateY(calc((1 - var(--act-label, 0)) * 1.5rem));
}

.story-chapter--dark[data-sequence="act-v-chapter"] .story-chapter__title {
  opacity: var(--act-title, 0);
  transform: translateY(calc((1 - var(--act-title, 0)) * 1.75rem));
}

/* ——— Section blocks: § aligned to first line of text ——— */
.story-chapter + .story-block {
  margin-top: 0;
}

.story-block {
  margin-top: 3.5rem;
}

.story-block__lead {
  display: grid;
  grid-template-columns: var(--story-sec-col) minmax(0, 1fr);
  gap: 0 var(--story-sec-gap);
  max-width: calc(var(--story-prose) + var(--story-sec-rail));
  margin-left: var(--story-prose-inset);
  margin-right: auto;
}

.story-block__lead .story-prose {
  margin: 0;
  max-width: none;
}

.story-block__body {
  margin-top: 2rem;
  max-width: var(--story-content-w);
}

.story-block__body > .story-prose {
  max-width: var(--story-prose);
  margin-left: calc(var(--story-prose-inset) + var(--story-sec-rail));
  margin-right: auto;
}

.story-sec {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--story-faint);
  margin: 0;
  padding-top: 0.22em;
  text-align: right;
  line-height: 1.75;
  opacity: 0.9;
}

.story-sec-title {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 500;
  color: var(--story-ink);
  line-height: 1.25;
  margin: 0 0 1rem;
}

.story-band--dark .story-sec { color: rgba(242, 239, 233, 0.38); }
.story-band--dark .story-sec-title { color: var(--story-paper); }

@media (max-width: 768px) {
  /* Drop desktop reading-rail inset; keep a compact § column like design-in-depth gutters */
  .story {
    --story-prose-inset: 0;
    --story-sec-col: 2rem;
    --story-sec-gap: 0.75rem;
  }

  .story-block__lead {
    grid-template-columns: var(--story-sec-col) minmax(0, 1fr);
    gap: 0 var(--story-sec-gap);
    margin-left: 0;
    max-width: none;
  }

  .story-block__body > .story-prose,
  .story-rail {
    margin-left: var(--story-sec-rail);
  }

  .story-chapter {
    padding-top: 4rem;
  }

  .story-chapter--dark {
    padding: 5rem 1.5rem 3.5rem;
  }
}

.story-caption {
  font-family: var(--font-serif);
  font-size: 0.6875rem;
  font-style: italic;
  color: var(--story-muted);
  line-height: 1.5;
  text-align: center;
  margin: 0.65rem auto 0;
  max-width: 36rem;
  padding: 0.7rem 0.9rem;
  border-top: 1px dotted rgba(19, 18, 16, 0.17);
  border-radius: 2px;
  box-sizing: border-box;
}

.story-pair > div > .story-caption {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.story-band--dark .story-caption {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #a8a49c;
}

/* ——— Diary pull ——— */
.story-diary {
  max-width: var(--story-prose);
  margin: 2.5rem auto 2.5rem var(--story-prose-inset);
  padding: 1.75rem 2rem;
  background: rgba(26, 25, 23, 0.04);
  border-radius: 2px;
}

.story-diary__label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-variant: small-caps;
  font-style: normal;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: var(--story-faint);
  margin: 0 0 1.45rem;
}

.story-diary__body,
.story-diary p:not(.story-diary__label) {
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--story-muted);
  margin: 0;
}

.story-diary__body em,
.story-diary p:not(.story-diary__label) em {
  color: var(--story-ink);
  font-style: italic;
}

.story-diary__body strong,
.story-diary p:not(.story-diary__label) strong {
  color: var(--story-ink);
  font-weight: 500;
}

.story-diary__body--punch {
  margin-top: 2.5rem;
  font-weight: calc(400 + var(--punch-emphasis, 0) * 280);
  color: color-mix(
    in srgb,
    var(--story-muted) calc(100% - var(--punch-emphasis, 0) * 72%),
    var(--story-ink)
  );
  transition: color 0.2s ease, font-weight 0.2s ease;
}

.story-pull {
  max-width: var(--story-prose);
  margin: 3.75rem auto 6.25rem var(--story-prose-inset);
  padding-left: 1.5rem;
  border-left: 2px solid var(--story-pull-rule);
}

.story-pull p {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-style: italic;
  line-height: 1.6;
  color: var(--story-pull-ink);
  margin: 0;
}

/* ——— Pipeline scan (camera → human, full diagram + pulse) ——— */
.story-block + .story-pipeline--scan {
  margin-top: 1.25rem;
}

.story-pipeline--scan {
  position: relative;
  width: 100%;
  max-width: var(--story-content-w);
  margin: 0 0 0.5rem;
  padding: 0.25rem 0 1rem;
}

.story-pipeline--scan .story-pipeline__viewport {
  width: 100%;
  overflow: visible;
}

.story-pipeline--scan .story-pipeline__track {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  width: calc(100% + 7.5rem);
  margin-left: -7.5rem;
}

.story-pipeline--scan .story-pipeline__cluster {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.story-pipeline--scan .story-pipeline__cluster-strip {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  min-width: 0;
}

.story-pipeline--scan .story-pipeline__item {
  flex: 0 0 auto;
  text-align: center;
  transform: scale(var(--scale, 1));
  transform-origin: center center;
}

.story-pipeline--scan .story-pipeline__item--camera {
  flex: 0 0 auto;
  width: auto;
  margin-right: 0;
  text-align: center;
}

.story-pipeline--scan .story-pipeline__camera-unit {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: auto;
}

.story-pipeline--scan .story-pipeline__item--camera img {
  display: block;
  width: auto;
  height: clamp(84px, 16vw, 203px);
  max-width: min(100%, 203px);
  padding: 25px;
  box-sizing: content-box;
  margin-inline: 0;
  object-fit: contain;
  background: transparent;
}

.story-pipeline--scan .story-pipeline__camera-label {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  text-align: center;
  width: 100%;
}

.story-pipeline--scan .story-pipeline__camera-label-main {
  display: block;
  font-size: clamp(0.55rem, 0.95vw, 0.65rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--story-ink);
  line-height: 1.2;
}

.story-pipeline--scan .story-pipeline__camera-label-sub {
  display: block;
  margin-top: 0.12rem;
  font-size: clamp(0.5rem, 0.85vw, 0.58rem);
  letter-spacing: 0.04em;
  color: var(--story-muted);
}

.story-pipeline--scan .story-pipeline__arrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  width: clamp(10px, 1.2vw, 16px);
  margin-inline: 0.08rem;
  opacity: 0.55;
}

.story-pipeline--scan .story-pipeline__arrow--lead {
  flex: 0 0 auto;
  width: clamp(28px, 4vw, 48px);
  margin: 0 0.25rem 0 0.15rem;
  opacity: 0.65;
}

.story-pipeline--scan .story-pipeline__arrow--lead::before {
  height: 1.5px;
  background: rgba(26, 25, 23, 0.22);
}

.story-pipeline--scan .story-pipeline__arrow--lead::after {
  border-width: 4px;
  border-left-width: 6px;
  border-left-color: rgba(26, 25, 23, 0.22);
}

.story-pipeline--scan .story-pipeline__arrow::before {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--story-faint);
}

.story-pipeline--scan .story-pipeline__arrow::after {
  content: '';
  border: 3px solid transparent;
  border-left: 4px solid var(--story-faint);
  margin-left: -1px;
}

.story-pipeline--scan .story-pipeline__card {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: clamp(76px, 9.2vw, 108px);
  min-height: clamp(54px, 7vw, 74px);
  padding: 0.35rem 0.3rem;
  border: 1px solid rgba(26, 25, 23, calc(0.14 + var(--emphasis, 0.4) * 0.32));
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: clamp(0.52rem, 0.92vw, 0.62rem);
  font-weight: 500;
  line-height: 1.32;
  color: var(--story-ink);
  background: rgba(26, 25, 23, 0.04);
  box-shadow: 0 3px 12px rgba(0, 0, 0, calc(0.03 + var(--emphasis, 0.4) * 0.12));
}

.story-pipeline--scan .story-pipeline__flip {
  perspective: 800px;
  width: clamp(76px, 9.2vw, 108px);
  margin-inline: auto;
}

.story-pipeline--scan .story-pipeline__flip-inner {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(calc(var(--finale-reveal, 0) * 180deg));
  transition: transform 0.65s cubic-bezier(0.33, 1, 0.68, 1);
}

.story-pipeline--scan .story-pipeline__flip-front,
.story-pipeline--scan .story-pipeline__flip-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.story-pipeline--scan .story-pipeline__flip-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  flex-direction: column;
  gap: 0.08rem;
  min-height: clamp(54px, 7vw, 74px);
}

.story-pipeline--scan .story-pipeline__card--finale {
  min-height: clamp(54px, 7vw, 74px);
  width: 100%;
  font-family: var(--font-serif);
  font-size: clamp(0.54rem, 0.95vw, 0.64rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(26, 25, 23, 0.06);
}

.story-pipeline--scan .story-pipeline__item--finale.is-peak .story-pipeline__card--finale {
  border-color: rgba(26, 25, 23, 0.5);
  background: rgba(26, 25, 23, 0.08);
}

.story-pipeline--scan .story-pipeline__card--revealed {
  font-family: var(--font-sans);
  font-size: clamp(0.46rem, 0.82vw, 0.56rem);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.38;
}

.story-pipeline--scan .story-pipeline__outcome--or {
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--story-muted);
  font-size: 0.92em;
}

@media (max-width: 52rem) {
  .story-pipeline--scan .story-pipeline__viewport {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .story-pipeline--scan .story-pipeline__viewport::-webkit-scrollbar {
    display: none;
  }

  .story-pipeline--scan .story-pipeline__track {
    min-width: 36rem;
    margin-left: 0;
    width: 100%;
  }

  .story-pipeline--scan .story-pipeline__item--camera {
    margin-right: 0;
  }

  .story-pipeline--scan .story-pipeline__cluster-strip {
    justify-content: flex-start;
    gap: 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-pipeline--scan .story-pipeline__item,
  .story-pipeline--scan .story-pipeline__card {
    transform: none;
  }

  .story-pipeline--scan .story-pipeline__flip-inner {
    transform: none;
    transition: none;
  }

  .story-pipeline--scan .story-pipeline__flip-back {
    position: static;
    transform: none;
    margin-top: 0.35rem;
  }
}

/* ——— Datagrid pair ——— */
.story-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: var(--story-content-w);
  margin: 2.5rem 0;
}

.story-pair__label {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--story-faint);
  margin: 0 0 0.65rem;
}

.story-pair__frame {
  border: 1px solid var(--color-rule);
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
}

.story-pair__frame img { width: 100%; }

@media (max-width: 700px) {
  .story-pair { grid-template-columns: 1fr; }
}

/* ——— Feed stage (auto-pan + diary rise) ——— */
.story-feed-stage {
  margin: 2rem calc(50% - 50vw) 0;
  width: 100vw;
}

.story-feed-stage__viewport {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 0.72fr);
  min-height: clamp(24rem, 72vh, 40rem);
  overflow: hidden;
  background: var(--story-paper);
}

.story-feed-stage__feed {
  background-image: var(--feed-img);
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: center 0%;
}

.story-feed-stage.is-playing .story-feed-stage__feed {
  animation: story-feed-pan-y 32s ease-in-out forwards;
}

.story-feed-stage__diary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  max-width: none;
  padding: clamp(1.75rem, 4vw, 2.75rem) clamp(3.25rem, 7.5vw, 5rem) clamp(1.75rem, 4vw, 2.75rem) clamp(2.75rem, 6.5vw, 4.5rem);
  background: rgba(26, 25, 23, 0.035);
  border: none;
  border-left: 1px solid rgba(19, 18, 16, 0.08);
  transform: translateY(105%);
  opacity: 0;
}

.story-feed-stage.is-playing .story-feed-stage__diary {
  animation: story-diary-rise 1.15s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

.story-feed-stage__copy > *,
.story-feed-stage__diary > .story-diary__label {
  opacity: 0;
  transform: translateY(1.15rem);
}

.story-feed-stage.is-playing .story-diary__label {
  animation: story-diary-bounce-in 0.95s var(--story-ease) 0.62s forwards;
}

.story-feed-stage.is-playing .story-feed-stage__copy .story-diary__body:first-child {
  animation: story-diary-bounce-in 0.95s var(--story-ease) 0.78s forwards;
}

.story-feed-stage.is-playing .story-diary__body--punch {
  animation: story-diary-bounce-in 0.95s var(--story-ease) 0.94s forwards;
}

.story-feed-stage.is-complete .story-feed-stage__feed {
  animation: none;
  background-position: center 100%;
}

.story-feed-stage.is-complete .story-feed-stage__diary {
  animation: none;
  transform: none;
  opacity: 1;
}

.story-feed-stage.is-complete .story-feed-stage__copy > *,
.story-feed-stage.is-complete .story-feed-stage__diary > .story-diary__label {
  animation: none;
  opacity: 1;
  transform: none;
}

@keyframes story-feed-pan-y {
  from { background-position: center 0%; }
  to { background-position: center 100%; }
}

@keyframes story-diary-rise {
  from {
    transform: translateY(105%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes story-diary-bounce-in {
  0% {
    opacity: 0;
    transform: translateY(1.15rem);
  }
  62% {
    opacity: 1;
    transform: translateY(-0.28rem);
  }
  82% {
    transform: translateY(0.12rem);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .story-feed-stage__viewport {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .story-feed-stage__feed {
    min-height: clamp(16rem, 48vw, 22rem);
  }

  .story-feed-stage__diary {
    border-left: none;
    border-top: 1px solid rgba(19, 18, 16, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-feed-stage__feed {
    background-position: center 50%;
  }

  .story-feed-stage__diary {
    transform: none;
    opacity: 1;
  }

  .story-feed-stage__copy > *,
  .story-feed-stage__diary > .story-diary__label {
    opacity: 1;
    transform: none;
  }

  .story-feed-stage.is-playing .story-feed-stage__feed,
  .story-feed-stage.is-playing .story-feed-stage__diary,
  .story-feed-stage.is-playing .story-diary__label,
  .story-feed-stage.is-playing .story-feed-stage__copy > * {
    animation: none;
  }
}

.story-caption strong {
  color: var(--story-ink);
  font-weight: 500;
}

/* ——— Single figure + caption ——— */
.story-figure {
  max-width: min(46rem, 100%);
  margin: 2.5rem auto 0;
}

.story-figure__frame {
  background: #fff;
  border: 1px solid var(--color-rule);
  border-radius: 6px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(19, 18, 16, 0.04);
}

.story-figure__frame img {
  width: 100%;
  display: block;
}

.story-figure .story-caption {
  border-top: none;
  padding: 0;
  margin-top: 1.35rem;
  max-width: 34rem;
}

/* ——— Event card anatomy ——— */
.story-card-exhibit {
  max-width: var(--story-content-w);
  margin: 1.75rem 0 2rem;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.5rem;
  align-items: start;
}

.story-card-exhibit__visual {
  position: static;
}

.story-card-exhibit__frame {
  border: 1px solid var(--color-rule);
  border-radius: 6px;
  overflow: visible;
  box-shadow: 0 4px 24px rgba(0, 0, 0, calc(0.06 + var(--card-glow, 0) * 0.12));
  transform: scale(calc(0.9 + var(--card-assemble, 0) * 0.1))
    rotate(calc((1 - var(--card-assemble, 0)) * -1.2deg));
  filter: blur(calc((1 - var(--card-assemble, 0)) * 1.5px));
  transition: box-shadow 0.25s;
}

.story-card-stack {
  position: relative;
  aspect-ratio: 1836 / 825;
  width: 100%;
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
  cursor: crosshair;
}

.story-card-stack__base {
  display: none;
}

.story-card-slice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  pointer-events: none;
  opacity: calc(var(--card-assembled, 0) * 0.92);
  filter: none;
  z-index: 1;
  isolation: isolate;
  transition: opacity 0.28s ease, z-index 0s linear 0.28s;
}

.story-card-slice::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: color-mix(in srgb, var(--layer-color, #4b6bff) 30%, transparent);
  mix-blend-mode: multiply;
  -webkit-mask-image: var(--slice-mask);
  mask-image: var(--slice-mask);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  transition: opacity 0.22s ease;
}

.story-card-slice img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  position: relative;
  z-index: 0;
}

.story-card-exhibit.is-assembled .story-card-slice {
  pointer-events: none;
}

.story-card-slice.is-active {
  z-index: 20;
  opacity: 1;
  filter:
    drop-shadow(0 0 2px color-mix(in srgb, var(--layer-color) 26%, transparent))
    drop-shadow(0 0 6px color-mix(in srgb, var(--layer-color) 16%, transparent))
    drop-shadow(0 0 12px color-mix(in srgb, var(--layer-color) 9%, transparent));
}

.story-card-slice.is-active::after {
  opacity: 0.42;
}

.story-card-exhibit.is-assembled .story-card-slice {
  opacity: 1;
}

.story-card-exhibit.is-assembled.is-layered .story-card-slice:not(.is-active) {
  opacity: 0.84;
}

.story-card-exhibit__spec {
  padding-bottom: 0;
}

.story-card-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.6rem;
  line-height: 1.35;
}

.story-card-table thead th {
  font-family: var(--font-sans);
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--story-faint);
  text-align: left;
  padding: 0 0.45rem 0.45rem;
  border-bottom: 1px solid var(--color-rule);
  vertical-align: bottom;
}

.story-card-table thead th:first-child {
  width: 28%;
}

.story-card-table tbody tr {
  cursor: pointer;
  border-bottom: 1px solid color-mix(in srgb, var(--color-rule) 55%, transparent);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.story-card-table tbody tr:last-child {
  border-bottom: 1px solid var(--color-rule);
}

.story-card-table tbody th {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--story-ink);
  text-align: left;
  padding: 0.32rem 0.45rem;
  vertical-align: top;
}

.story-card-table tbody td {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--story-muted);
  padding: 0.32rem 0.45rem;
  vertical-align: top;
}

.story-card-table tbody tr.is-active {
  background: color-mix(in srgb, var(--layer-color, var(--color-accent)) 8%, transparent);
  box-shadow: inset 2px 0 0 var(--layer-color, var(--color-accent));
}

.story-card-table tbody tr.is-active th,
.story-card-table tbody tr.is-active td {
  color: var(--story-ink);
}

@media (max-width: 800px) {
  .story-card-exhibit {
    grid-template-columns: 1fr;
  }
  .story-card-exhibit__visual { position: static; }
  .story-card-exhibit__spec { padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .story-card-exhibit__frame {
    transform: none;
    filter: none;
  }

  .story-card-slice {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    filter: none;
  }

  .story-card-stack__base {
    display: none;
  }
}

/* ——— Dual feeds (compact) ——— */
.story-feeds-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  max-width: var(--story-content-w);
  margin: 2rem 0;
}

.story-feeds-compact img {
  width: 100%;
  border: 1px solid var(--color-rule);
  border-radius: 3px;
}

.story-feeds-compact__tag {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--story-faint);
  margin: 0 0 0.5rem;
}

@media (max-width: 600px) {
  .story-feeds-compact { grid-template-columns: 1fr; }
}

/* ——— "Then…" break ——— */
.story-then {
  background: var(--story-warm);
  text-align: center;
}

.story-band--warm:has(+ .story-then) {
  padding-bottom: 5.5rem;
}

.story-then__track {
  padding: 4rem 2rem 0;
}

.story-then__pin {
  position: sticky;
  top: calc(var(--play-ribbon-h, 0px) + var(--cx-shell-header-h, 5.111rem) + 1.5rem);
  padding: 2.5rem 0 2rem;
}

.story-then__spacer {
  height: 58vh;
  pointer-events: none;
}

.story-then__line {
  font-size: clamp(4rem, 11vw, 8rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  margin: 0;
  opacity: var(--then-on, 0);
  transform: translateY(calc((1 - var(--then-on, 0)) * 2.75rem));
}

.story-then__dot {
  display: inline-block;
  opacity: 0;
  transform: scale(0.55);
  transition: none;
}

.story-then__dot.is-on {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.06s step-end, transform 0.1s cubic-bezier(0.34, 1.45, 0.64, 1);
}

/* ——— Overwhelm stagger ——— */
.story-overwhelm {
  position: relative;
  margin-top: 3.5rem;
  min-height: 168vh;
  padding-bottom: 1.5rem;
}

.story-overwhelm__sticky {
  position: sticky;
  top: calc(var(--play-ribbon-h, 0px) + var(--cx-shell-header-h, 5.111rem));
  min-height: calc(100vh - var(--play-ribbon-h, 0px) - var(--cx-shell-header-h, 5.111rem));
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 1rem 2rem;
  overflow: visible;
}

.story-overwhelm__stack {
  position: relative;
  width: min(92vw, 480px);
  height: 34rem;
  flex-shrink: 0;
}

.story-overwhelm__card {
  position: absolute;
  left: 0;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.15);
  background: #fff;
  opacity: var(--card-in, 0);
  transform:
    translateX(calc(var(--card-tx, 0) * 1px + (1 - var(--card-in, 0)) * var(--card-from-x, 0px)))
    translateY(calc((1 - var(--card-in, 0)) * 22px))
    scale(calc(0.93 + var(--card-in, 0) * 0.07))
    rotate(calc(var(--card-rot, 0) * 1deg));
  transition: box-shadow 0.2s;
  z-index: var(--card-z, 1);
}

.story-overwhelm__card:nth-child(1) { top: 0; }
.story-overwhelm__card:nth-child(2) { top: 5.75rem; }
.story-overwhelm__card:nth-child(3) { top: 11.5rem; }
.story-overwhelm__card:nth-child(4) { top: 17.25rem; }
.story-overwhelm__card:nth-child(5) { top: 23rem; }

@media (max-height: 820px), (max-width: 560px) {
  .story-overwhelm {
    min-height: 182vh;
    padding-bottom: 3rem;
  }

  .story-overwhelm__sticky {
    padding: 0.75rem 1rem 1.5rem;
  }

  .story-overwhelm__stack { height: 25.5rem; }
  .story-overwhelm__card:nth-child(2) { top: 4rem; }
  .story-overwhelm__card:nth-child(3) { top: 8rem; }
  .story-overwhelm__card:nth-child(4) { top: 12rem; }
  .story-overwhelm__card:nth-child(5) { top: 16rem; }

  .story-overwhelm__quote {
    margin-top: 1.5rem;
    transform: translateY(calc((1 - var(--quote-on, 0)) * 2.75rem));
  }

  .story-overwhelm__quote blockquote {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }
}

.story-overwhelm__card img { width: 100%; display: block; }

.story-overwhelm__quote {
  margin-top: 2rem;
  text-align: center;
  flex-shrink: 0;
  opacity: var(--quote-on, 0);
  transform: translateY(calc((1 - var(--quote-on, 0)) * 4.5rem));
}

.story-overwhelm__quote blockquote {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
  color: var(--story-ink);
}

.story-overwhelm__quote cite {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.55rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--story-faint);
  margin-top: 1.25rem;
}

/* ——— Wrongness scroll exhibit ——— */
.story-wrong {
  max-width: 36rem;
  margin: 0 auto 0 var(--story-prose-inset);
}

.story-block + .story-wrong {
  margin-top: 5.5rem;
}

.story-wrong + .story-wrong {
  margin-top: 6.5rem;
}

.story-wrong:last-child {
  margin-bottom: 3rem;
}

.story-wrong__head {
  opacity: var(--w-head, 0);
  transform: translateY(calc((1 - var(--w-head, 0)) * 2.5rem));
  margin-bottom: 1.25rem;
}

.story-wrong__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1.5px solid var(--wrong-color);
  color: var(--wrong-color);
  font-size: 0.875rem;
  margin-right: 0.75rem;
  vertical-align: middle;
}

.story-wrong__title {
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  font-weight: 500;
  display: inline;
  vertical-align: middle;
}

.story-wrong__sub {
  font-style: italic;
  color: var(--story-faint);
  margin: 0.5rem 0 0 2.75rem;
  font-size: 0.95rem;
}

.story-wrong__img {
  opacity: var(--w-img, 0);
  border: 1px solid var(--color-rule);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.07);
  margin-bottom: 0.5rem;
}

.story-wrong__img img { width: 100%; display: block; }

.story-wrong__note {
  opacity: var(--w-note, 0);
  transform: translateX(calc((1 - var(--w-note, 0)) * var(--note-from-x, 3.25rem)));
  margin-top: 1.25rem;
  padding-left: 0.15rem;
}

.story-wrong__arrow {
  display: block;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--story-faint);
  margin-bottom: 0.55rem;
}

.story-wrong__scribble {
  font-family: ui-monospace, 'SFMono-Regular', 'Menlo', monospace;
  font-size: 0.72rem;
  line-height: 1.65;
  color: var(--story-muted);
  white-space: pre-line;
  margin: 0 0 0.75rem;
}

.story-wrong__diag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.85rem;
  border-radius: 100px;
  border: 1px solid var(--wrong-color);
  color: var(--wrong-color);
}

/* ——— Principle climax ——— */
.story-principle {
  min-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem;
}

.story-principle__text {
  font-size: clamp(2.75rem, 9vw, 7rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--story-paper);
  margin: 0;
}

.story-principle__block {
  display: inline-block;
  transform: translateY(calc((1 - var(--principle-block, 0)) * 2rem));
}

.story-principle__lead {
  opacity: var(--principle-lead, 0);
}

.story-principle__rest {
  opacity: 1;
}

/* ——— Surface cards ——— */
.story-surfaces {
  max-width: var(--story-prose);
  margin: 0 auto 2.5rem var(--story-prose-inset);
}

.story-surface {
  border: 1px solid var(--color-rule);
  border-radius: 3px;
  padding: 1.1rem 1.35rem;
  margin-bottom: 0.65rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.75s var(--story-ease), transform 0.75s var(--story-ease);
}

.story-surface.is-on {
  opacity: 1;
  transform: none;
}

.story-surface__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.story-surface__name {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
}

.story-surface__promise {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: var(--story-faint);
  flex-shrink: 0;
}

.story-surface__desc {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--story-faint);
  line-height: 1.5;
  margin: 0;
}

/* ——— Compression tiles ——— */
.story-compress {
  max-width: var(--story-content-w);
  margin: 2.5rem 0;
}

.story-compress__intro {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--story-faint);
  text-align: center;
  margin: 0 0 1.25rem;
}

.story-compress__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.story-compress__tile {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--color-rule);
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}

.story-compress__tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.story-compress__tile:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.story-compress .story-caption {
  margin-top: 1.75rem;
}

@media (max-width: 700px) {
  .story-compress__grid { grid-template-columns: repeat(2, 1fr); }
}
