/* =============================================================================
   SATQUERY — ANATOMY OF A RUN
   Scrollytelling instrument: one sticky plate, eight stages of state.
   Experience first; explanation second.
   ============================================================================= */

.runbar {
  position: sticky; top: var(--bar); z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 9px var(--gut);
  background: rgba(251, 249, 245, 0.93);
  border-bottom: 1px solid var(--rule);
}
.runbar__q {
  font-family: var(--f-display); font-variation-settings: 'opsz' 52, 'SOFT' 10;
  font-style: italic; font-size: clamp(15px, 1.6vw, 19px);
  color: var(--ink-900); margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.runbar__meta { margin-left: auto; display: flex; align-items: center; gap: 14px; flex: none; }
.runbar__meta b { font-size: 10.5px; color: var(--ink-900); font-weight: 500; }

.runhead { padding: clamp(44px, 7vw, 92px) var(--gut) clamp(30px, 4vw, 52px); }
.runhead__h { font-size: clamp(42px, 7.4vw, 104px); margin: 14px 0 20px; font-variation-settings: 'opsz' 144, 'WONK' 1; }
.runhead__l { max-width: 60ch; margin: 0 0 22px; }
.runhead__note { display: flex; flex-wrap: wrap; gap: 7px; }

/* ── layout ──────────────────────────────────────────────────────────────── */
.run {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 420px);
  gap: clamp(24px, 3.4vw, 56px);
  padding: 0 var(--gut) 40px;
  align-items: start;
}
.run__left { position: sticky; top: calc(var(--bar) + 62px); }
.run__stage { display: flex; flex-direction: column; gap: 12px; }
.run__stage #plot { height: min(56vh, 540px); min-height: 320px; }

/* ── plate overlays ──────────────────────────────────────────────────────── */
.qplate {
  position: absolute; left: 26px; top: 54px; z-index: 6;
  max-width: 52%;
  transition: opacity 0.6s var(--e-out);
}
.qplate__q {
  font-family: var(--f-display); font-variation-settings: 'opsz' 96, 'SOFT' 12;
  font-style: italic; font-size: 30px; line-height: 1.12; color: var(--ink-900);
  margin: 4px 0 0; color: #FBF9F5; text-shadow: 0 1px 20px rgba(0, 0, 0, 0.45);
  transition: font-size 0.6s var(--e-out);
}
#plot.is-s1 .qplate__q, #plot.is-s2 .qplate__q, #plot.is-s3 .qplate__q,
#plot.is-s4 .qplate__q, #plot.is-s5 .qplate__q, #plot.is-s6 .qplate__q, #plot.is-s7 .qplate__q { font-size: 17px; }

.lattice {
  position: absolute; right: 22px; top: 22px; z-index: 6;
  width: min(320px, 46%); height: auto;
  opacity: 0; transition: opacity 0.6s var(--e-out);
}
#plot.is-s2 .lattice { opacity: 1; }
#plot.is-s3 .lattice { opacity: 1; }
#plot.is-s4 .lattice, #plot.is-s5 .lattice, #plot.is-s6 .lattice, #plot.is-s7 .lattice { opacity: 0.3; }

.confbadge {
  position: absolute; right: 26px; bottom: 60px; z-index: 7;
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  background: rgba(251, 249, 245, 0.9); border: 1px solid var(--rule-2);
  padding: 8px 11px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.6s var(--e-out), transform 0.6s var(--e-out);
}
.confbadge b { font-size: 21px; color: var(--ochre); font-weight: 400; line-height: 1; }
#plot.is-s6 .confbadge, #plot.is-s7 .confbadge { opacity: 1; transform: none; }

.answerplate {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8;
  padding: 16px 22px 18px;
  background: linear-gradient(0deg, rgba(251, 249, 245, 0.97) 45%, rgba(251, 249, 245, 0.84));
  border-top: 1px solid var(--ochre-rule);
  transform: translateY(101%);
  transition: transform 0.8s var(--e-out);
}
#plot.is-s7 .answerplate { transform: none; }
.answerplate__t {
  font-family: var(--f-display); font-variation-settings: 'opsz' 60, 'SOFT' 12;
  font-size: clamp(15px, 1.5vw, 19px); line-height: 1.42; color: var(--ink-900);
  margin: 8px 0 0; max-width: 70ch;
}

#l-t1 { transform: translate(var(--ox, 0px), var(--oy, 0px)); transition: transform 0.9s var(--e-out); }
#plot.is-s0 #l-t1, #plot.is-s1 #l-t1, #plot.is-s2 #l-t1 { filter: saturate(0.55) brightness(0.72); }
#plot.is-s4 #l-diff, #plot.is-s5 #l-diff, #plot.is-s6 #l-diff, #plot.is-s7 #l-diff { opacity: 0.42; }

/* ── rail ────────────────────────────────────────────────────────────────── */
.vrail { display: flex; gap: 3px; border-top: 1px solid var(--rule); padding-top: 11px; }
.vrail__i {
  flex: 1; display: flex; flex-direction: column; gap: 7px;
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
}
.vrail__i .bar { height: 2px; background: var(--ink-300); transition: background 0.5s var(--e-out); }
.vrail__i .nm {
  font-family: var(--f-mono); font-size: 8.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-400);
  transition: color 0.5s var(--e-out); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vrail__i.is-done .bar { background: var(--ochre-rule); }
.vrail__i.is-done .nm { color: var(--ink-500); }
.vrail__i.is-active .bar { background: var(--ochre); }
.vrail__i.is-active .nm { color: var(--ink-900); }

/* ── steps ───────────────────────────────────────────────────────────────── */
.rstep {
  min-height: 58vh;
  padding: 44px 0 48px;
  border-bottom: 1px solid var(--rule);
  display: flex; flex-direction: column; justify-content: center;
  opacity: 0.3;
  transition: opacity 0.7s var(--e-out);
}
.rstep.is-active { opacity: 1; }
.rstep:last-child { border-bottom: 0; }
.rstep__hd { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.rstep__n { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--ochre); flex: none; }
.rstep__hd h2 {
  font-family: var(--f-display); font-variation-settings: 'opsz' 96;
  font-size: clamp(24px, 3vw, 38px); font-weight: 400; margin: 0; letter-spacing: -0.015em;
}
.rstep__lead { color: var(--ink-700); font-size: 14.5px; line-height: 1.65; max-width: 46ch; margin: 0 0 20px; }
.rstep__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.rstep__cta .btn i { font-style: normal; margin-left: 6px; }

/* ── closing ─────────────────────────────────────────────────────────────── */
.runclose__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 60px); }
.runclose__grid h4 { margin: 0 0 14px; }
.plainlist { list-style: none; margin: 0; padding: 0; }
.plainlist li {
  font-size: 13.5px; color: var(--ink-500); padding: 8px 0 8px 15px;
  border-left: 1px solid var(--rule-2); margin-bottom: 2px;
}

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1020px) {
  .run { grid-template-columns: 1fr; }
  .run__left { position: sticky; top: calc(var(--bar) + 54px); z-index: 20; background: var(--surface-1); padding-bottom: 10px; }
  .run__stage #plot { height: 42vh; }
  .rstep { min-height: auto; padding: 34px 0; }
  .runclose__grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .runbar__meta { display: none; }
  .qplate__q { font-size: 20px !important; }
  .lattice { display: none; }
  .vrail__i .nm { display: none; }
}
