/* builds: the six kinds of work as a tablist beside one large stage. The stage draws what goes in (ink, on the
   recessed ground) and what comes out (azure; gold only where a person approves). The finished drawing is the markup;
   js/builds.js plays a kind's transformation once when the visitor chooses it. */
.builds { --builds-have-ground: color-mix(in oklab, var(--color-paper) 45%, var(--color-paper-2)); padding-block: var(--section-gap); }

.builds__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-md) var(--gap-columns); margin-bottom: var(--space-2xl); }
.builds__lede { font-size: var(--text-lead); line-height: 1.45; color: var(--color-ink-2); }

.builds__body { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--gap-columns); align-items: start; }

/* ===== The list: two groups, three kinds each ===== */
.builds__tabs { display: flex; flex-direction: column; }
.builds__group { margin: 0; padding: var(--space-lg) 0 var(--space-xs); font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); }
.builds__group:first-child { padding-top: 0; }
.builds__tab { position: relative; display: grid; gap: var(--space-2xs); width: 100%; min-height: 44px; padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-lg); border: 0; border-top: 1px solid var(--color-rule); background: transparent; color: var(--color-ink-2); text-align: left; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); }
.builds__tab::before { content: ""; position: absolute; left: 0; top: -1px; bottom: 0; width: 3px; background: var(--color-ink); transform: scaleY(0); transform-origin: top; transition: transform var(--dur-short) var(--ease-out); }
.builds__group + .builds__tab { border-top-color: var(--color-rule-2); }
.builds__tab-name { font-size: var(--text-lg); font-weight: 500; line-height: 1.25; }
.builds__tab:hover { background: var(--color-paper-2); color: var(--color-ink); }
.builds__tab:active { background: var(--color-paper-3); }
.builds__tab[aria-selected="true"] { background: var(--color-paper-2); color: var(--color-ink); }
.builds__tab[aria-selected="true"]::before { transform: none; }
.builds__tab:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; transition: none; }
.builds__tab:disabled { opacity: 0.5; cursor: not-allowed; }
html:not(.js) .builds__tabs { display: none; }

/* ===== The stage ===== */
.builds__stage { background: var(--color-paper-2); box-shadow: var(--shadow-card); }
.js .builds__panel[data-later] { display: none; }
.builds__board { width: 100%; height: auto; aspect-ratio: 1000 / 480; }
/* the two lines are set into their halves of the board: the left on the drawing's recessed ground, the right on the stage */
.builds__caption { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.builds__name { grid-column: 1 / -1; margin: 0; padding: var(--space-lg) var(--space-lg) 0; font-size: var(--text-title); font-weight: 500; }
.js .builds__name { display: none; } /* with script on, the selected tab (which labels the panel) carries the name */
.builds__pair { display: contents; }
.builds__side { display: grid; align-content: start; gap: var(--space-2xs); margin: 0; padding: var(--space-xs) var(--space-xl) var(--space-lg); }
.builds__side:first-child { background: var(--builds-have-ground); }
.builds__side + .builds__side { box-shadow: inset 1.5px 0 0 var(--color-rule); }
.builds__who { font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); }
.builds__line { margin: 0; min-height: 2.8em; font-size: var(--text-lg); line-height: 1.4; color: var(--color-ink-2); }
.builds__side--get .builds__line { color: var(--color-ink); }

/* the three facts: how the work goes, in the page's two actors. One row under the drawing, parted by hairlines;
   each opens with a short bar in its actor's light */
.builds__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--color-rule); }
.builds__fact { display: grid; align-content: start; gap: var(--space-xs); margin: 0; padding: var(--space-lg) var(--space-xl) var(--space-xl); }
.builds__fact + .builds__fact { box-shadow: inset 1px 0 0 var(--color-rule); }
.builds__fact dt { display: flex; flex-direction: column; gap: var(--space-sm); font-size: var(--text-md); font-weight: 500; line-height: 1.3; }
.builds__fact dt::before { content: ""; width: 24px; height: 2px; background: currentColor; }
.builds__fact dd { margin: 0; font-size: var(--text-md); line-height: 1.5; color: var(--color-ink-2); }
.builds__fact--you dt { color: var(--color-ink); }
.builds__fact--agents dt { color: var(--color-accent); }
.builds__fact--people dt { color: var(--color-gold); }

/* with scripting off every kind is shown, one after another */
html:not(.js) .builds__body { grid-template-columns: minmax(0, 1fr); }
html:not(.js) .builds__stage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); background: none; box-shadow: none; }
html:not(.js) .builds__facts { grid-template-columns: minmax(0, 1fr); }
html:not(.js) .builds__fact + .builds__fact { box-shadow: inset 0 1px 0 var(--color-rule); }
html:not(.js) .builds__panel { background: var(--color-paper-2); color: var(--color-ink); box-shadow: var(--shadow-card); }

/* ===== The close: a statement at body scale and the link ===== */
.builds__close { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-md) var(--space-xl); margin-top: var(--space-xl); }
.builds__statement { font-size: var(--text-lead); line-height: 1.45; color: var(--color-ink); max-width: none; }
.builds__more { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--text-md); }

/* ===== The drawing hand: one stroke family for all six ===== */
.bk-defs { position: absolute; }
.bk-ground { fill: var(--builds-have-ground); }
.bk-seamline { stroke: var(--color-rule); stroke-width: 1.5; fill: none; }
.bk-chev { fill: none; stroke: var(--color-rule-2); stroke-width: 4; stroke-linecap: square; }
.bk-chev--on { stroke: var(--color-accent); }
.bk-label { font-family: var(--font-body); font-size: 17px; font-weight: 500; fill: var(--color-ink); }
.bk-label--in { font-size: 15px; fill: var(--color-ink-2); }

/* what you have: ink */
.bk-in { fill: none; stroke: var(--color-ink-2); stroke-width: 3.5; }
.bk-in-thin { fill: none; stroke: var(--color-rule-2); stroke-width: 2; }
.bk-in-fill { fill: var(--color-rule); }
.bk-in-mark { fill: color-mix(in oklab, var(--color-muted) 22%, var(--color-paper)); }
.bk-in-solid { fill: var(--color-ink-2); }
.bk-in-val { fill: none; stroke: var(--color-muted); stroke-width: 6; }
.bk-in-sketch { fill: none; stroke: var(--color-muted); stroke-width: 4; stroke-dasharray: 6 5; }
.bk-dash { stroke-dasharray: 12 8; }
.bk-person { fill: var(--color-paper); }
.bk-code { fill: none; stroke: var(--color-ink-2); stroke-width: 8; }
.bk-code--note { stroke: var(--color-rule-2); }
.bk-card { fill: var(--color-paper-3); stroke: var(--color-ink-2); stroke-width: 2.5; }
.bk-tangle { fill: none; stroke: var(--color-muted); stroke-width: 2.5; }
.bk-hatch { stroke: none; }
.bk-hatch-line { stroke: var(--color-rule-2); stroke-width: 2; }

/* what you get: azure */
.bk-wash { fill: color-mix(in oklab, var(--color-accent) 16%, var(--color-paper-2)); stroke: var(--color-accent); stroke-width: 3.5; }
.bk-wash-solid { fill: var(--color-accent); }
.bk-core-cut { fill: var(--color-paper-2); }
.bk-solid { fill: var(--color-accent); }
.bk-test { fill: var(--color-accent); }
.bk-edge { fill: none; stroke: var(--color-accent); stroke-width: 4; }
.bk-template { fill: none; stroke: var(--color-accent-2); stroke-width: 2; stroke-dasharray: 8 7; }
.bk-wire { fill: none; stroke: var(--color-accent); stroke-width: 4; }
.bk-main { fill: none; stroke: var(--color-accent); stroke-width: 6; }
.bk-tie { fill: none; stroke: var(--color-accent-2); stroke-width: 2.5; }
.bk-out-thin { fill: none; stroke: color-mix(in oklab, var(--color-accent) 55%, var(--color-paper-2)); stroke-width: 2; }
.bk-out-bar { fill: none; stroke: var(--color-accent); stroke-width: 9; }
.bk-ink-bar { fill: none; stroke: var(--color-ink); stroke-width: 6; }
.bk-mute-bar { fill: none; stroke: var(--color-muted); stroke-width: 6; }
.bk-dark-bar { fill: none; stroke: var(--color-accent-ink); stroke-width: 6; }
.bk-label--out { fill: var(--color-ink); }
/* where a person decides: the merge */
.bk-gold { fill: var(--color-gold); }
.bk-gold-tick { fill: none; stroke: var(--color-gold-ink); stroke-width: 3; }

/* the read: an azure trace over what you have, seen only while it plays */
.bk-trace { fill: none; stroke: var(--color-accent); stroke-width: 4; }
.bk-hl { fill: color-mix(in oklab, var(--color-accent) 16%, transparent); stroke: var(--color-accent); stroke-width: 2.5; }

@media (max-width: 72rem) {
  .builds__body { grid-template-columns: minmax(0, 1fr); }
  .builds__tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-template-rows: auto repeat(3, auto); column-gap: var(--gap-columns); }
  html:not(.js) .builds__tabs { display: none; }
  .builds__group:first-child, .builds__group { padding-top: 0; }
}
@media (max-width: 40rem) {
  .builds__tabs { display: flex; flex-direction: column; }
  .builds__group:not(:first-child) { padding-top: var(--space-md); }
  .builds__tab { padding: var(--space-xs) var(--space-md); }
  .builds__tab-name { font-size: var(--text-md); }
  .builds__side { padding: 0 var(--space-md) var(--space-lg); }
  .builds__board text { display: none; } /* shapes only: labels this small could not be read */
  .builds__line { font-size: var(--text-md); }
  .builds__facts { grid-template-columns: minmax(0, 1fr); }
  .builds__fact { padding: var(--space-md) var(--space-md) var(--space-lg); }
  .builds__fact + .builds__fact { box-shadow: inset 0 1px 0 var(--color-rule); }
  html:not(.js) .builds__stage { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) { .builds__line { min-height: 0; } }
@media (max-width: 40rem) { .js .builds__stage { margin-inline: calc(-1 * var(--gutter)); } }
