/* The bill comparison becomes the mark, within a bounded native scroll span. */
.equation-section {
  border-top: 1px solid var(--rule-2);
  --story-inset: 16px;
  --story-clearance: 32px;
  scroll-margin-top: calc(var(--story-inset) - 100px);
}
.equation-sticky,
.equation-still {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - var(--story-clearance));
  padding-block: 44px 28px;
  margin-block: 0;
}
.equation-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex: none;
}
.equation-top .chapter-label { margin: 0; }
.scene-count { color: var(--muted); font: 11px var(--mono); }
.equation-section h2 {
  font-size: clamp(34px, 4.3vw, 64px);
  margin-top: 22px;
  max-width: 23ch;
  min-height: 2.16em;
  flex: none;
}
.equation-visual {
  position: relative;
  min-height: 360px;
  flex: 1;
  display: grid;
  align-items: center;
  margin-block: 20px;
}
.equation-formula {
  display: flex;
  align-items: start;
  justify-content: center;
  gap: clamp(18px, 2.6vw, 36px);
}
.equation-formula > div { display: grid; gap: 16px; }
.equation-formula strong {
  font-size: clamp(24px, 3.4vw, 46px);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1;
  white-space: nowrap;
}
.equation-formula span { font: 12px var(--mono); color: var(--muted); }
.equation-formula > b {
  color: var(--muted);
  font-size: clamp(24px, 3.4vw, 46px);
  line-height: 1;
  font-weight: 400;
}
.equation-formula .observed strong { color: var(--ice); }
.equation-bars {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: auto;
  max-height: 100%;
  opacity: 0;
  overflow: visible;
}
.equation-svg-label { font: 18px var(--sans); fill: var(--soft); }
.equation-svg-label .difference { fill: var(--coral); }
.story-annotations { font: 500 22px var(--sans); fill: var(--paper); letter-spacing: -.015em; }
.story-annotation-note { font: 12px var(--mono); fill: var(--muted); letter-spacing: 0; }
.equation-bottom { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex: none; }
.equation-bottom > p { color: var(--soft); font-size: 16px; line-height: 1.5; max-width: 56ch; min-height: 48px; }
.equation-sticky[data-phase="1"] .equation-bottom > p { font: 12px/1.7 var(--mono); max-width: 72ch; }
.equation-continue { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; flex: none; color: var(--muted); font-size: 12px; }
.equation-controls { display: flex; flex: none; }
.equation-controls button { width: 44px; height: 44px; display: grid; place-items: center; }
.equation-controls button span { width: 5px; height: 5px; background: #62676c; }
.equation-controls button:hover span { background: var(--muted); }
.equation-controls button[aria-pressed="true"] span { background: var(--paper); }
.story-scroll { height: 320svh; }
.story-scroll .equation-sticky {
  position: sticky;
  top: var(--story-inset);
  height: calc(100svh - var(--story-clearance));
  min-height: 0;
}
.story-scroll .equation-visual { min-height: 0; }
.equation-still { border-bottom: 1px solid var(--rule-2); }
.equation-still:last-child { border-bottom: 0; }
.equation-static-bars { width: min(100%, 820px); margin-inline: auto; }
.equation-static-bars > div { display: grid; grid-template-columns: 1fr auto; gap: 15px; margin-bottom: 30px; }
.equation-static-bars > div > span { flex: 1; color: var(--soft); }
.equation-static-bars strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.equation-static-bars i { grid-column: 1 / -1; display: block; height: 24px; background: var(--paper); }
.equation-static-bars .static-billed { width: 100%; background: var(--coral); }
.static-billed b { display: block; height: 100%; background: var(--soft); }
.equation-static-bars > p { display: flex; justify-content: space-between; color: var(--coral); gap: 16px; }
.equation-static-mark { width: min(100%, 600px); margin: auto; }
.equation-static-mark .mark,
.equation-static-lockup .mark { display: block; position: relative; }
.equation-static-mark .mark > *,
.equation-static-lockup .mark > * { position: absolute; left: 0; top: 0; }
.equation-static-mark .mark { width: 100%; height: auto; aspect-ratio: 5.5 / 3; margin-block: 16px; }
.equation-static-mark .mark i { width: 72.727%; height: 33.333%; }
.equation-static-mark .mark i:nth-child(2) { top: 66.666%; }
.equation-static-mark .mark b { width: 18.181%; height: 33.333%; left: 81.818%; top: 66.666%; }
.equation-static-mark small { display: block; font: 11px/2 var(--mono); color: var(--muted); }
.equation-static-mark > div { display: flex; justify-content: space-between; gap: 16px; }
.equation-static-lockup { width: min(100%, 700px); display: flex; align-items: center; gap: 6%; margin-inline: auto; }
.equation-static-lockup .mark { width: 30%; height: auto; aspect-ratio: 130 / 72; flex: none; }
.equation-static-lockup .mark i { width: 73%; height: 33%; }
.equation-static-lockup .mark i:nth-child(2) { top: 66%; }
.equation-static-lockup .mark b { width: 18%; height: 33%; top: 66%; left: 82%; }
.equation-static-lockup img { width: 64%; height: auto; }
@media (max-width: 800px) {
  .equation-section { --story-clearance: calc(32px + env(safe-area-inset-bottom)); }
  .equation-sticky { padding-block: 12px 16px; }
  .equation-section h2 { font-size: clamp(26px, 5.6vw, 42px); margin-top: 12px; }
  .equation-bottom { gap: 16px; min-height: 66px; }
  .equation-bottom > p { font-size: 13px; min-height: 0; }
  .equation-sticky[data-phase="1"] .equation-bottom > p { font-size: 11px; line-height: 1.6; }
  .equation-section .chapter-label { font-size: 10px; gap: 8px; }
  .equation-visual { margin-block: 14px; }
  .equation-formula strong, .equation-formula > b { font-size: 26px; }
  .equation-formula { gap: 20px; }
  .equation-continue { gap: 8px; font-size: 11px; }
  .equation-still { padding-block: 40px; }
}
@media (max-width: 600px) {
  .equation-top { gap: 4px; }
  .equation-top .chapter-label { font-size: 9px; gap: 6px; }
  .equation-formula { display: grid; grid-template-columns: 24px 1fr; justify-content: start; gap: clamp(14px, 2.5svh, 24px) 14px; }
  .equation-formula > div { gap: 9px; }
  .equation-formula > div:first-child { grid-column: 2; }
  .equation-formula strong, .equation-formula > b { font-size: clamp(25px, 6vw, 34px); }
  .equation-formula span { font-size: 11px; }
  .equation-static-mark p, .equation-static-bars { font-size: 13px; }
  .equation-static-mark > div > p { flex: 1; }
  .equation-static-mark > div > p:last-child { text-align: right; }
}
