/* pinned scroll story — one stage, four acts */
.story {
  position: relative;
  height: 320vh;
  padding-bottom: 60px;
  background: var(--paper);
}
.story-stage {
  position: sticky; top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 56px;
  padding: 80px 56px 56px;
  align-items: center;
  overflow: hidden;
}
/* pastel wash — shifts hue per act */
.story-stage::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at var(--wash-x, 70%) 30%, var(--wash-c, rgba(223,213,234,0.42)) 0%, transparent 70%);
  transition: background 900ms ease;
  z-index: 0;
}
.story-copy, .story-visual { position: relative; z-index: 1; }

/* left column: act copy crossfade */
.story-copy { position: relative; min-height: 360px; }
.act-copy {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  opacity: 0; transform: translateY(14px);
  transition: opacity 520ms ease, transform 520ms cubic-bezier(.2,.7,.2,1);
  pointer-events: none;
}
.act-copy[data-active="true"] { opacity: 1; transform: none; pointer-events: auto; }
.act-copy .eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 22px;
  display: flex; align-items: center; gap: 10px;
}
.act-copy .eyebrow i {
  display: inline-block; width: 24px; height: 2px;
  background: var(--teal); border-radius: 2px;
}
.act-copy h2 {
  font-family: 'Inter'; font-weight: 300;
  font-size: clamp(36px, 4.4vw, 60px);
  line-height: 1.02; letter-spacing: -0.032em;
  color: var(--ink);
  max-width: 18ch; margin-bottom: 22px;
}
.act-copy h2 em { font-style: italic; color: var(--teal); font-weight: 400; }
.act-copy p {
  font-size: 17px; color: var(--body); line-height: 1.55; max-width: 42ch;
}
.act-copy .link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--teal); font-weight: 500; margin-top: 20px;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms;
}
.act-copy .link:hover { border-color: var(--teal); }

/* right column: visual layers */
.story-visual {
  position: relative;
  align-self: center;
  width: 100%;
  aspect-ratio: 4/3;
  max-height: 62vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.story-visual .v-tag {
  position: absolute; top: 16px; left: 16px; z-index: 20;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase;
  background: rgba(255,255,255,0.86); backdrop-filter: blur(6px);
  padding: 5px 9px; border-radius: 4px;
}
.story-visual .v-idx {
  position: absolute; top: 16px; right: 16px; z-index: 20;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--teal); letter-spacing: 0.14em; text-transform: uppercase;
}

/* act layers — opacity + scale morph */
.act-layer {
  position: absolute; inset: 0;
  opacity: 0; transform: scale(0.985);
  transition: opacity 620ms ease, transform 720ms cubic-bezier(.2,.7,.2,1);
}
.act-layer[data-active="true"] { opacity: 1; transform: none; }

/* act 1: audit grid */
/* act 1: workflow audit */
.act-audit {
  padding: 48px 44px;
  background: #fff;
  font-family: 'JetBrains Mono', monospace;
  display: flex; flex-direction: column; gap: 0;
}
.audit-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px; border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
}
.audit-label {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.audit-status {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px; font-weight: 500;
}
.audit-status.red {
  background: #fce8e4; color: var(--red-note);
}
.audit-list {
  display: flex; flex-direction: column;
}
.audit-row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px; color: var(--ink-2);
}
.audit-row:last-child { border-bottom: none; }
.audit-idx {
  color: var(--muted); font-size: 10px; flex-shrink: 0;
  width: 20px;
}
.audit-type {
  color: var(--ink); font-weight: 500; flex-shrink: 0;
  width: 100px;
}
.audit-detail {
  color: var(--body); font-style: italic;
}
.audit-row.highlight {
  background: var(--gold-soft); margin: 0 -12px;
  padding: 12px 12px; border-radius: 4px;
  border-bottom: none;
}
.audit-row.highlight .audit-type { color: #8a6d0b; }
.audit-row.highlight .audit-detail { color: #8a6d0b; }
.audit-foot {
  padding-top: 16px; margin-top: 6px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px; color: var(--red-note);
  letter-spacing: 0.06em; opacity: 0.8;
}

/* act 2: scope sheet */
.act-scope {
  padding: 48px 56px; background: #fff;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-2);
  line-height: 1.85;
  border-left: 3px solid var(--teal);
  margin: 24px; border-radius: 6px;
  height: calc(100% - 48px);
  display: flex; flex-direction: column; gap: 6px;
}
.act-scope .h { font-family: 'Inter'; font-size: 18px; font-weight: 500; color: var(--ink); }
.act-scope .small {
  font-size: 10px; color: var(--muted); letter-spacing: 0.14em;
  text-transform: uppercase; margin-bottom: 8px;
}
.act-scope ul { list-style: none; }
.act-scope li {
  display: flex; align-items: baseline; gap: 12px; padding: 3px 0;
}
.act-scope li .k { color: var(--muted); font-size: 10px; width: 28px; }
.act-scope li .v { flex: 1; }
.act-scope li.in { color: var(--ink); }
.act-scope li.out { color: var(--muted); text-decoration: line-through; }
.act-scope li.out .v::after { content: " \2715"; color: var(--red-note); text-decoration: none; }
.act-scope hr { border: none; border-top: 1px dashed var(--line); margin: 10px 0; }

/* act 3: timeline */
.act-timeline {
  padding: 56px 48px;
  display: flex; flex-direction: column; justify-content: center;
  gap: 12px; height: 100%;
}
.act-timeline .week {
  display: grid; grid-template-columns: 70px 1fr;
  align-items: center; gap: 14px;
}
.act-timeline .week .wk {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase;
  text-align: right;
}
.act-timeline .week .bar {
  height: 28px; border-radius: 4px; background: var(--paper-2);
  border: 1px solid var(--line-soft);
  display: flex; align-items: center; padding: 0 14px;
  font-size: 12px; color: var(--ink-2);
  transition: background 380ms, border-color 380ms, color 380ms;
  position: relative; overflow: hidden;
}
.act-timeline .week .bar.filled {
  background: var(--teal-soft); border-color: rgba(13,92,99,0.2);
  color: var(--teal-deep);
}
.act-timeline .week .bar.pending {
  background: var(--gold-soft); border-color: rgba(201,162,39,0.3);
  color: #7a5f13;
}
.act-timeline .week .bar .fill {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--teal-soft), rgba(227,238,239,0.2));
  transform: scaleX(var(--f, 0)); transform-origin: left;
  transition: transform 600ms cubic-bezier(.2,.7,.2,1);
}

/* act 4: handoff doc */
.act-handoff {
  padding: 28px; height: 100%;
  display: flex; flex-direction: column;
}
.act-handoff .doc-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: #fafaf7;
  border: 1px solid var(--line-soft); border-radius: 6px 6px 0 0;
}
.act-handoff .doc-head .t { font-size: 13px; font-weight: 500; }
.act-handoff .doc-head .m {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--muted); letter-spacing: 0.1em;
}
.act-handoff .doc-body {
  flex: 1; padding: 18px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  border: 1px solid var(--line-soft); border-top: none;
  border-radius: 0 0 6px 6px; background: #fff;
}
.act-handoff .block {
  border: 1px solid var(--line-soft); border-radius: 5px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px; background: #fafaf7;
  transition: background 380ms, border-color 380ms, transform 380ms;
  opacity: 0.3; transform: translateY(8px);
}
.act-handoff .block.on { opacity: 1; transform: none; }
.act-handoff .block h5 {
  font-size: 10px; color: var(--muted); letter-spacing: 0.14em;
  text-transform: uppercase;
}
.act-handoff .block .line {
  height: 4px; background: var(--line); border-radius: 2px;
}
.act-handoff .block .line.s { width: 55%; }
.act-handoff .block.teal {
  background: var(--teal-soft); border-color: rgba(13,92,99,0.2);
}
.act-handoff .block.teal .line { background: var(--teal); opacity: 0.3; }

/* progress rail */
.story-rail {
  position: absolute; left: 56px; right: 56px; bottom: 36px; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--muted); letter-spacing: 0.16em; text-transform: uppercase;
}
.story-rail .tick {
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 14px; position: relative;
  border-top: 2px solid var(--line);
  transition: border-color 380ms ease, color 380ms ease;
}
.story-rail .tick[data-active="true"] {
  border-top-color: var(--teal);
  color: var(--ink);
}
.story-rail .tick[data-done="true"] {
  border-top-color: var(--teal); opacity: 0.7;
}
.story-rail .tick b { font-weight: 500; color: var(--ink); }
.story-rail .tick[data-active="true"] b { color: var(--teal); }

/* scroll hint */
.scroll-cue {
  position: absolute; left: 50%; bottom: 18px;
  transform: translateX(-50%);
  display: inline-flex; gap: 8px; align-items: center;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--muted); letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 1; transition: opacity 400ms ease;
  z-index: 11;
}
.scroll-cue.hidden { opacity: 0; pointer-events: none; }
.scroll-cue .wheel {
  width: 14px; height: 20px;
  border: 1.5px solid var(--muted); border-radius: 10px;
  position: relative;
}
.scroll-cue .wheel::after {
  content: ""; position: absolute; top: 4px; left: 50%;
  width: 2px; height: 4px; background: var(--muted);
  transform: translateX(-50%); border-radius: 2px;
  animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel {
  0% { transform: translate(-50%, 0); opacity: 1; }
  70% { transform: translate(-50%, 8px); opacity: 0; }
  100% { opacity: 0; }
}
