/* ===================== problem ===================== */
/* the problem section, scoped: it was built as a page of its own */
#problem{--spine:clamp(34px,9vw,52px);--spine-gap:clamp(14px,4vw,24px);
  position:relative;border-top:1px solid var(--rule)}
/* One screen that never scrolls. A tall track behind it turns scroll distance into a
   timeline. One hairline runs through the whole section: it draws itself under the
   headline, splits open where the headline says "the gaps", each break widens in turn to
   hold a gap, and at the closer every break seals and the line is whole again.
   Text arrives by sliding out from behind a mask. No blur anywhere.
   Tokens are the sra design system. */
/* ---------- the track gives the scroll its length; the stage never moves ---------- */
#problem .track{position:relative;height:560svh}
#problem .stage{position:sticky;top:0;height:100svh;overflow:hidden;
  display:grid;grid-template-rows:minmax(0,1fr);
  padding-left:max(16px,env(safe-area-inset-left,0px));
  padding-right:max(16px,env(safe-area-inset-right,0px));
  padding-top:max(18px,env(safe-area-inset-top,0px));
  padding-bottom:max(16px,env(safe-area-inset-bottom,0px))}
#problem .inner{width:100%;max-width:1120px;margin-inline:auto;position:relative;min-height:0;
  padding-block:clamp(10px,2.2vh,24px)}
/* ---------- the beats share one frame ---------- */
#problem .beat{position:absolute;inset:0;display:grid;align-content:center;gap:0;
  pointer-events:none;will-change:opacity}
#problem .beat[hidden]{display:none}
#problem .beat[data-b="1"]{align-content:stretch}
/* words slide out from behind a mask, never blur */
#problem .w{display:inline-block;overflow:hidden;vertical-align:bottom;
  padding-bottom:.16em;margin-bottom:-.16em}
#problem .wi{display:inline-block;transform:translateY(145%);will-change:transform}
/* headline + closer, clear of the line */
#problem .say{font-family:var(--display);font-weight:var(--w-disp);margin:0;letter-spacing:-.025em;
  font-size:clamp(2.3rem,8.4vw,4.4rem);line-height:1.04;max-width:17ch;text-wrap:balance}
[dir="rtl"] #problem .say{letter-spacing:0;line-height:1.32;font-size:clamp(1.95rem,7.4vw,3.6rem)}
#problem .say u{text-decoration:none;background-image:linear-gradient(var(--clay),var(--clay));
  background-size:100% .6em;background-position:0 92%;background-repeat:no-repeat;
  -webkit-box-decoration-break:clone;box-decoration-break:clone;padding-inline:.08em}
#problem .beat[data-b="0"] .say, #problem .beat[data-b="2"] .say{padding-inline-start:calc(var(--spine) + var(--spine-gap))}
/* ---------- one line, three breaks ---------- */
#problem .gaps{height:100%;min-height:0;display:grid;gap:0;
  grid-template-rows:repeat(3,minmax(0,1fr))}
#problem .gap{position:relative;min-width:0;min-height:0;
  display:grid;grid-template-columns:var(--spine) minmax(0,1fr) auto;
  grid-template-rows:auto auto;align-content:center;
  column-gap:var(--spine-gap);row-gap:clamp(6px,1vh,12px)}
/* the hairline is taken out of the grid so it spans the row edge to edge: the grid packs
   its rows to the middle, and a spine inside it would stop where the text stops, leaving
   a hole between one gap and the next. Absolute, so the three rows join into one line. */
#problem .spine{position:absolute;inset-block:0;inset-inline-start:0;width:var(--spine);
  display:flex;flex-direction:column;align-items:center;min-height:0}
#problem .seg{flex:1;width:1px;background:var(--rule);transform-origin:50% 0;will-change:transform}
#problem .open{flex:none;width:100%;height:0;overflow:hidden;position:relative;
  display:grid;place-items:center}
/* the break does not just stop: a branch runs off it and dies */
#problem .branch{position:absolute;inset:0;width:100%;height:100%;color:var(--flame);
  pointer-events:none}
[dir="rtl"] #problem .branch{transform:scaleX(-1)}
#problem .num{font-family:var(--display);font-weight:var(--w-disp);font-variant-numeric:tabular-nums;
  font-size:clamp(1.6rem,5.6vw,2.8rem);line-height:1;color:var(--flame);position:relative;
  will-change:transform,opacity}
#problem .fig{grid-column:2;grid-row:1;display:flex;align-items:center;min-width:0;overflow:hidden}
#problem .lab{font-size:var(--t-meta);font-weight:var(--w-med);letter-spacing:.18em;text-transform:uppercase;
  color:var(--brand-text);margin:0;min-width:0;will-change:transform}
[dir="rtl"] #problem .lab{letter-spacing:0;font-size:var(--t-sec)}
#problem .stmt{grid-column:2;grid-row:2;margin:0;
  font-family:var(--display);font-weight:var(--w-disp);letter-spacing:-.02em;
  font-size:clamp(1.2rem,5.2vw,2.2rem);line-height:1.14;max-width:21ch;text-wrap:balance}
[dir="rtl"] #problem .stmt{letter-spacing:0;line-height:1.5;font-size:clamp(1.05rem,4.5vw,1.8rem)}
#problem .mark{grid-column:3;grid-row:1 / span 2;align-self:center;justify-self:end;
  width:clamp(52px,13vw,96px);height:clamp(52px,13vw,96px);color:var(--flame);
  will-change:transform,opacity}
[dir="rtl"] #problem .mark{justify-self:start}
@media (min-width:860px){
/* rows: line, spacer, label, statement, spacer, mark. The two equal spacers hold the
   label and statement in the vertical middle between the line and the mark. The three
   gaps share these rows (subgrid), so the labels stay level with each other and the
   block is centred on the longest statement. */
#problem .gaps{grid-template-columns:repeat(3,minmax(0,1fr));
    grid-template-rows:auto minmax(0,1fr) auto auto minmax(0,1fr) auto;row-gap:clamp(12px,1.8vh,24px)}
#problem .gap{grid-template-columns:minmax(0,1fr);grid-row:1 / -1;
    grid-template-rows:subgrid;align-content:stretch;
    column-gap:0;row-gap:clamp(12px,1.8vh,24px)}
#problem .gap > :not(.spine){padding-inline:clamp(10px,1.6vw,26px)}
#problem .spine{position:static;inset:auto;grid-column:1;grid-row:1;align-self:center;
    flex-direction:row;width:100%;min-height:0;margin-top:40px}
#problem .seg{flex:1;height:1px;width:auto;transform-origin:0 50%}
[dir="rtl"] #problem .seg{transform-origin:100% 50%}
/* clip only the sides, which is what the opening animation needs: overflow:hidden also
   cut off the top of the numerals and of branch 2, which rises above the line */
#problem .open{width:0;height:auto;overflow:visible;clip-path:inset(-80px 0)}
/* branch 2 rises through the middle of the break: drop its numeral below the curve */
#problem .gap:nth-child(2) .num{top:.4em}
/* the break is wide and short, so rotating the element itself swaps its width and
   height about its centre: the branch starts well inside the break instead of at
   the line's end, and its tail hangs below, where overflow:hidden cuts it. Rotate
   the path inside its square viewBox instead. That maps exactly at any aspect,
   because the stretch to the box happens after the rotation. */
#problem .branch{transform:none}
[dir="rtl"] #problem .branch{transform:none}
#problem .branch path{transform:rotate(-90deg);transform-box:view-box;transform-origin:50% 50%}
/* a true mirror of the above, not a rotation the other way: rotate, then flip */
[dir="rtl"] #problem .branch path{transform:scaleX(-1) rotate(-90deg)}
/* these keep grid-column:2 from the stacked layout unless it is reset, which leaves
   the spine's own column at 0 wide: no room for the line to draw and none for the
   numeral, so both get clipped on desktop */
#problem .fig{grid-column:1;grid-row:3}
#problem .stmt{grid-column:1;grid-row:4;max-width:17ch;align-self:start}
/* 1.5x the original clamp(72px,7vw,112px), centred in its column, 40px off the bottom */
#problem .mark, [dir="rtl"] #problem .mark{grid-column:1;grid-row:6;align-self:end;justify-self:center;
    width:clamp(108px,10.5vw,168px);height:clamp(108px,10.5vw,168px);margin-bottom:40px}
#problem .beat[data-b="0"] .say, #problem .beat[data-b="2"] .say{padding-inline-start:0;
    padding-block-start:clamp(24px,6vh,64px)}
}
/* ---------- reduced motion: the same content, stacked and still ---------- */
@media (prefers-reduced-motion:reduce){
#problem .track{height:auto}
#problem .stage{position:static;height:auto;display:block;padding-block:40px}
#problem .inner{display:grid;gap:40px}
#problem .beat{position:static;inset:auto;opacity:1!important;pointer-events:auto;align-content:start}
#problem .beat[hidden]{display:grid!important}
#problem .gaps{height:auto;grid-template-rows:none;grid-template-columns:none;gap:28px}
#problem .gap{align-content:start}
#problem .spine{position:static;inset:auto}
#problem .seg{transform:none!important}
#problem .open{height:auto!important;width:auto!important}
#problem .branch{display:none}
#problem .wi, #problem .lab{transform:none!important}
#problem .num, #problem .mark{opacity:1!important;transform:none!important}
}
/* it had no site header above it when it was built: pin below ours */
#problem .stage{top:var(--sra-hdr-h);height:calc(100svh - var(--sra-hdr-h))}
@media (prefers-reduced-motion:reduce){#problem .stage{top:auto;height:auto}}
