/* ---- built from the ground up (js/build.js): the words laid over the field of squares in #build-stage, and the close ---- */

/* the build: labels at the left of each tier, the line of proof and its captions at the right. The squares are the stage's. */
.bd-in { position: absolute; inset: 0; pointer-events: none; }
.bd-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* a tier's label: its count and its kind. A tier not yet built shows its kind alone, faint, beside its dotted row */
.bd-l { position: absolute; left: 0; top: 0; margin: 0; transform: translateY(-50%); text-align: right; line-height: 1.15; }
.bd-n { display: block; color: var(--brand-navy); font: 800 17px/1.1 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transform: translateY(5px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.bd-w { display: block; margin-top: 3px; color: var(--slate-7); font: 700 11px/1.25 var(--font-display); letter-spacing: .08em; text-transform: uppercase; transition: color .45s var(--ease); }
.bd-l.on .bd-n { opacity: 1; transform: none; }
.bd-l.on .bd-w { color: var(--text-3); }

/* the captions of the line of proof. The newest reads in full; those it has climbed past fold to a reference */
.bd-cap { position: absolute; left: 0; top: 0; margin: 0; opacity: 0; transform: translate(14px, -50%); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.bd-cap.on { opacity: 1; transform: translate(0, -50%); }
.bd-ct { display: block; color: var(--brand-navy); font: 700 14.5px/1.3 var(--font-display); letter-spacing: -0.01em; }
.bd-ct.bd-q { font: 400 15.5px/1.38 var(--font-serif); }
.bd-cs { display: block; margin-top: 4px; color: var(--azure-11); font: 500 11.5px/1.4 var(--font-mono); }
.bd-sh { display: none; color: var(--slate-10); font: 500 12px/1.3 var(--font-mono); white-space: nowrap; }
.bd-cap.on:not(.now) .bd-ct, .bd-cap.on:not(.now) .bd-cs { display: none; }
.bd-cap.on:not(.now) .bd-sh { display: block; }
.bd-full .bd-cap.on .bd-ct, .bd-full .bd-cap.on .bd-cs { display: block; }
.bd-full .bd-cap.on .bd-sh { display: none; }
.bd-full .bd-cap.on:not(.now) .bd-ct { font-size: 13.5px; }
.bd-full .bd-cap.on:not(.now) .bd-ct.bd-q { font-size: 14.5px; }
/* on a short stage the newest caption may have no room to rise clear of the reference beneath it: that one stands aside */
.bd-cap.on.bd-aside, .bd-con.on.bd-aside { opacity: 0; }

/* the line of proof: azure over a white halo, drawn upward a tier at a time */
.bd-seg, .bd-halo { fill: none; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset .6s var(--ease); }
.bd-seg { stroke: var(--brand-azure); stroke-width: 2; }
.bd-halo { stroke: #ffffff; stroke-width: 6; stroke-opacity: .9; }
.bd-seg.on, .bd-halo.on { stroke-dashoffset: 0; }
.bd-con { fill: none; stroke: var(--brand-azure); stroke-width: 1; stroke-dasharray: 2 5; opacity: 0; transition: opacity .5s var(--ease); }
.bd-con.on { opacity: .35; }
.bd-con.now { opacity: .9; }
.bd-ring { fill: none; stroke: var(--brand-azure); stroke-width: 1.5; opacity: 0; transition: opacity .4s var(--ease); }
.bd-ring.on { opacity: 1; }

/* the numbers of the seventeen causes of action, and the amounts of the heads wide enough to carry them */
.bd-num, .bd-amt { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); color: #ffffff; font-style: normal; font-weight: 700; font-family: var(--font-display); line-height: 1; white-space: nowrap; opacity: 0; transition: opacity .4s var(--ease) .3s; }
.bd-amt { font: 700 11px/1 var(--font-mono); letter-spacing: -0.02em; }
.bd-num.on, .bd-amt.on { opacity: 1; }

/* on a narrow stage each label sits over its tier and the line's caption is read at the stage's foot */
.bd-read { display: none; }
.bd-narrow .bd-l { transform: none; text-align: left; white-space: nowrap; }
.bd-narrow .bd-l .bd-n, .bd-narrow .bd-l .bd-w { display: inline; }
.bd-narrow .bd-n { font-size: 15px; }
.bd-narrow .bd-w { margin: 0 0 0 5px; font: 600 14px/1.2 var(--font-display); letter-spacing: 0; text-transform: none; }
.bd-narrow .bd-l:not(.on) .bd-w { margin-left: 0; }
.bd-narrow .bd-cap { display: none; }
.bd-narrow .bd-read { position: absolute; left: 0; right: 0; bottom: 0; display: block; margin: 0; padding: 8px 12px 9px; border-left: 3px solid var(--brand-azure); background: rgb(255 255 255 / .94); }
.bd-narrow .bd-read .bd-ct { font-size: 15px; }
.bd-narrow .bd-read .bd-cs { font-size: 14px; }
.bd-narrow .bd-read .bd-ct.bd-q { font-size: 15.5px; }
/* a short phone: the labels sit on a plate at each tier's right end; the step's own words carry the caption */
.bd-tiny .bd-l { left: auto; right: 0; padding: 1px 0 1px 7px; background: rgb(255 255 255 / .94); transform: translateY(-50%); }
.bd-tiny .bd-read { display: none; }

/* the six squares that go to a step: a target a finger can find, the square itself unchanged */
#build .story-dots button { position: relative; }
#build .story-dots button::after { content: ''; position: absolute; left: -4px; right: -4px; top: -14px; bottom: -14px; }
@media (max-width: 1020px) {
  #build .story-dots { gap: 0; margin-right: -13px; }
  #build .story-dots button { width: 40px; height: 40px; border: 0; background: none; transform: none; }
  #build .story-dots button::after { inset: 0; }
  #build .story-dots button::before { content: ''; position: absolute; left: 13px; top: 13px; width: 14px; height: 14px; box-sizing: border-box; border: 2px solid var(--azure-6); transition: background .25s, border-color .25s, transform .25s var(--spring); }
  #build .story-dots button.done::before { border-color: var(--brand-azure); background: var(--brand-azure); }
  #build .story-dots button.now::before { transform: scale(1.3); border-color: var(--brand-navy); background: var(--brand-navy); }
  #build .story-dots { top: -13px; }
}

/* a window at least as wide as it is tall (a tablet on its side, a small laptop window): the copy and the stage stay side
   by side, as on a desktop. Stacked, the stage would have only the height the copy leaves, which here is next to nothing */
@media (max-width: 1020px) and (min-aspect-ratio: 1/1) and (min-height: 481px) {
  #build .story-in { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); grid-template-rows: none; }
  #build .story-stage { order: 0; height: calc(100vh - 120px); height: calc(100svh - 120px); }
}

/* readers who ask for less motion: the steps are a list and the stage stands beneath it, every tier built. On a narrow
   window the held layout sizes the stage from the pinned screen, which a list does not have, so it is given its own height */
.still .bd-n, .still .bd-cap, .still .bd-num, .still .bd-amt { transition: none; }
@media (max-width: 1020px) {
  .still #build .story-stage { height: min(80vh, 520px); height: min(80svh, 520px); }
}
/* a window too short to hold the section is not held: a phone on its side, a phone upright whose copy would leave the stage
   too little room, a desktop window whose copy would run off the foot of the screen. As with less motion, the steps are a
   list and the stage stands beneath it with every tier built (js/build.js reads the pin's position to know) */
@media (max-height: 480px), (min-width: 1021px) and (max-height: 590px), (max-aspect-ratio: 1/1) and (max-height: 610px), (max-width: 359px) and (max-height: 660px) {
  #build.story { height: auto; padding: var(--sec) 0; }
  #build .story-pin { position: static; height: auto; }
  #build .story-in { display: block; padding: 0 var(--gut); }
  #build .story-steps { gap: 34px; }
  #build .story-steps li { grid-area: auto; opacity: 1; transform: none; pointer-events: auto; }
  #build .story-dots { display: none; }
  #build .story-stage, .still #build .story-stage { height: 380px; margin-top: 40px; }
}

/* ---- the close: the spacer where the tangle settles into the tiers, before the words ---- */
.seen { position: relative; height: 70vh; height: 70svh; pointer-events: none; }
