/* Booth By Booth — site layer. Builds on booth-by-booth.css (brand tokens + components); every colour is a token. */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; }
.bbb h1, .bbb h2, .bbb h3 { text-wrap: balance; }

.h-display { font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 4.6vw, 48px); line-height: 1.08; letter-spacing: -0.015em; }
.lead { font-size: 20px; line-height: 30px; color: var(--ink); max-width: 62ch; }
.caption { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-muted); margin-top: var(--space-6); }
.bbb-header { margin-bottom: var(--space-12); gap: var(--space-4); }

/* A colour key drawn as a small booth glyph */
.key { white-space: nowrap; font-weight: 600; }
.key::before {
  content: ""; display: inline-block; width: 10px; height: 8px; margin-right: 5px; vertical-align: 0;
  border: 2.5px solid currentColor; border-top: 0; box-sizing: border-box;
}
.key--ink::before { border-color: var(--data-1); }
.key--stone::before { border-color: var(--data-3); }
.key--light::before { border-color: var(--stone-300); }
.key--violet { color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20; background: var(--surface);
  border-bottom: var(--stroke-hairline) solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); min-height: 64px; }
.site-header a { text-decoration: none; }
.site-header .bbb-btn--primary { color: var(--action-ink); }
.site-nav { display: flex; align-items: center; gap: var(--space-6); }
.site-nav a:not(.bbb-btn) { color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.site-nav a:not(.bbb-btn):hover { color: var(--accent); }
.site-nav__cta { min-height: 40px; padding-block: 8px; font-size: 15px; white-space: nowrap; }
@media (max-width: 860px) { .site-nav a:not(.bbb-btn) { display: none; } }
.cta-short { display: none; }
@media (max-width: 899px) {
  .ladder .ladder__meter { display: none; }      /* each card's eyebrow already names the level */
  .step { padding-bottom: 24px !important; }
  .step .bbb-eyebrow { letter-spacing: 0.18em; }
}
@media (max-width: 480px) {
  .cta-long { display: none; } .cta-short { display: inline; }
  .site-nav__cta { padding-inline: var(--space-4); font-size: 14px; }
  .site-header .bbb-lockup { font-size: 17px !important; }
}

/* ---------- The ladder ---------- */
.ladder { position: relative; background: var(--surface); }
.ladder__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.ladder__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ladder__steps { position: relative; margin-top: -100vh; margin-top: -100svh; }
.step { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; }
.step__body {
  width: min(400px, 36vw); margin-left: max(var(--space-12), calc((100vw - 1200px) / 2 + var(--space-12)));
  display: flex; flex-direction: column; gap: var(--space-3);
  transition: opacity var(--duration-move) ease-out;
}
.step__body p { font-size: 17px; line-height: 27px; }
.step__title { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; font-weight: 700; letter-spacing: -0.012em; }
.step__title--xl { font-size: clamp(40px, 5.6vw, 68px); line-height: 1.02; letter-spacing: -0.022em; }
.step__body .step__lead { font-size: 20px; line-height: 30px; }
.step__hint { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-muted); margin-top: var(--space-4) !important; }
.step__hint::after { content: ""; display: block; width: 1px; height: 32px; background: var(--line-strong); margin-top: var(--space-3); }
.step__body .step__note { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 26px; padding-top: var(--space-3); border-top: var(--stroke-hairline) solid var(--line); }
.step__body .step__source { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.ladder.is-live .step:not(.is-active) .step__body { opacity: 0.18; }
.step--hero .step__body { width: min(560px, 44vw); }
.step--hero { min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); }

.ladder__note {
  position: absolute; right: var(--space-6); bottom: var(--space-4); margin: 0;
  font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-muted); text-align: right; max-width: 60vw;
}
.ladder__meter {
  position: absolute; left: max(var(--space-12), calc((100vw - 1200px) / 2 + var(--space-12))); bottom: var(--space-4);
  display: flex; gap: var(--space-4);
  font-family: var(--font-display); font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
}
.ladder__meter span { color: var(--stone-300); transition: color var(--duration-move) ease-out; position: relative; }
.ladder__meter span.is-on { color: var(--ink); }
.ladder__meter span.is-on::before {
  content: ""; position: absolute; left: 50%; top: -12px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent);
}

@media (max-width: 899px) {
  .step { align-items: flex-end; padding-bottom: 56px; box-sizing: border-box; }
  .step__body {
    width: auto; margin-inline: var(--space-4); padding: var(--space-6);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: var(--stroke-hairline) solid var(--line); border-radius: var(--radius-lg);
  }
  .step__body .step__source { display: none; }
  .step__body { padding: var(--space-4) var(--space-6); gap: var(--space-2); }
  .step__body p { font-size: 16px; line-height: 24px; }
  .step__title:not(.step__title--xl) { font-size: 26px; }
  .step--hero .step__body { width: auto; }
  .step--hero .bbb-eyebrow, .step--hero .step__hint::after { display: none; }
  .step__title--xl { font-size: clamp(32px, 9.4vw, 40px); }
  .step__body .step__lead { font-size: 17px; line-height: 25px; }
  .step__hint { display: none; }
  .step--hero .step__body { background: transparent; border: 0; padding-inline: 0; }
  .ladder.is-live .step:not(.is-active) .step__body { opacity: 0; }
  .ladder__meter { left: var(--space-4); right: var(--space-4); justify-content: space-between; gap: 0; bottom: 20px; font-size: 10px; letter-spacing: 0.08em; }
  .ladder__note { top: 76px; bottom: auto; left: var(--space-4); right: var(--space-4); text-align: left; max-width: none; }
}

/* ---------- Insight to action ---------- */
.journey__tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-8); }
.journey__tabs button {
  font: 600 15px/20px var(--font-display); color: var(--ink-muted); background: transparent; cursor: pointer;
  border: var(--stroke-hairline) solid var(--line-strong); border-radius: var(--radius-pill); padding: 10px 18px; min-height: 44px;
}
.journey__tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.journey__tabs button:focus-visible { outline: var(--stroke-rule) solid var(--focus); outline-offset: 2px; }

.journey__panel {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-12); align-items: start;
  background: var(--surface); border: var(--stroke-hairline) solid var(--line); border-radius: var(--radius-lg); padding: var(--space-8);
}
@media (max-width: 960px) { .journey__panel { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); padding: var(--space-6); } }
.journey__stage { position: relative; min-height: 200px; transition: height var(--duration-move) ease-out; }
.journey__units { position: absolute; inset: 0; }
.ju {
  position: absolute; left: 0; top: 0; width: 14px; height: 12px; box-sizing: border-box; transform-origin: 0 0;
  border: 3px solid var(--data-1); border-top: 0; border-radius: 0 0 2px 2px;
  transition: transform 800ms cubic-bezier(.2,.7,.2,1) var(--d, 0ms), border-color var(--duration-move) ease-out, opacity var(--duration-move) ease-out;
}
.journey:not([data-stage="0"]) .ju.is-hot { border-color: var(--data-2); }
.journey:not([data-stage="0"]) .ju:not(.is-hot) { border-color: var(--data-muted); }
.journey__plan { position: absolute; right: 0; }
.journey__stage { margin-top: var(--space-2); }
.jplan__row {
  position: absolute; left: 0; height: 20px; font: 500 11px/20px var(--font-display); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-muted); opacity: 0; transition: opacity var(--duration-move) ease-out;
}
.journey[data-stage="2"] .jplan__row, .journey[data-stage="3"] .jplan__row { opacity: 1; }
.jchain { position: absolute; left: 0; right: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.jchain__i {
  font: 600 15px/20px var(--font-display); color: var(--ink); padding: 6px 0; opacity: 0; transform: translateY(4px);
  transition: opacity var(--duration-move) ease-out, transform var(--duration-move) ease-out;
}
.jchain__i + .jchain__i::before { content: "→"; color: var(--ink-muted); margin-right: var(--space-2); font-weight: 400; }
.jchain__i--ink { color: var(--accent); }
.journey[data-stage="3"] .jchain__i { opacity: 1; transform: none; }
.journey[data-stage="3"] .jchain__i:nth-child(2) { transition-delay: 300ms; }
.journey[data-stage="3"] .jchain__i:nth-child(3) { transition-delay: 600ms; }
.journey[data-stage="3"] .jchain__i:nth-child(4) { transition-delay: 900ms; }

.journey__steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.jstep {
  display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4) 0 var(--space-4) var(--space-6);
  border-left: var(--stroke-rule) solid var(--line); cursor: pointer; opacity: 0.32;
  transition: opacity var(--duration-move) ease-out, border-color var(--duration-move) ease-out;
}
.jstep.is-on { opacity: 1; }
.jstep.is-now { border-left-color: var(--accent); }
.jstep:focus-visible { outline: var(--stroke-rule) solid var(--focus); outline-offset: 2px; }
.jstep__k { font: 500 12px/16px var(--font-display); letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-muted); }
.jstep__t { font-size: 17px; line-height: 26px; }
.jstep--macro .jstep__t { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 27px; }

/* ---------- Arithmetic ---------- */
.arith__grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
@media (max-width: 960px) { .arith__grid { grid-template-columns: minmax(0, 1fr); } }
.arith__controls { gap: var(--space-8); position: sticky; top: 88px; }
@media (max-width: 960px) { .arith__controls { position: static; } }
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); }
.field label { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.field output { font-size: 22px; font-weight: 500; }
.field__help { font-size: 14px; line-height: 22px; color: var(--ink-muted); }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 28px; }
.arith__sum { border-top: var(--stroke-hairline) solid var(--line); padding-top: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); }
.arith__sum .num { font-size: 15px; color: var(--ink-muted); }
.arith__verdict { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 27px; }
.arith__panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); }
@media (max-width: 640px) { .arith__panels { grid-template-columns: minmax(0, 1fr); } }
.panel { margin: 0; }
.panel--wide { grid-column: 1 / -1; }
.margin { display: flex; flex-direction: column; gap: var(--space-2); padding-block: var(--space-4); }
.margin__track { position: relative; height: 12px; background: var(--surface-sunken); border-radius: var(--radius-sm); }
.margin__zero { position: absolute; left: 50%; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--ink); }
.margin__bar { position: absolute; top: 0; bottom: 0; background: var(--data-3); border-radius: var(--radius-sm); transition: left 200ms ease-out, width 200ms ease-out, background-color 200ms; }
.margin__bar.is-won { background: var(--data-2); }
.margin__axis { display: flex; justify-content: space-between; font-size: 12px; line-height: 16px; color: var(--ink-muted); font-weight: 500; }
#hemicycle { width: 100%; max-width: 440px; height: auto; display: block; margin-inline: auto; }
.seat { fill: var(--data-muted); transition: fill 200ms ease-out; }
.seat--held { fill: var(--data-1); }
.seat--target { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.seat--won { fill: var(--accent); }
.seats-of { font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--ink-muted); }

/* ---------- Ladder aside: the evidence, kept to the side ---------- */
.step__aside { border-left: var(--stroke-rule) solid var(--accent); padding-left: var(--space-4); }
.step__aside p { font-size: 15px !important; line-height: 23px !important; }
.step__aside strong { font-family: var(--font-display); font-size: 20px; color: var(--accent); }

/* ---------- Thesis: outside vs inside your control ---------- */
.control { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--space-6); }
@media (max-width: 760px) { .control { grid-template-columns: minmax(0, 1fr); } }
.control__col { border-radius: var(--radius-lg); padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-4); }
.control__col--out { border: var(--stroke-hairline) dashed var(--line-strong); }
.control__col--in { background: var(--surface); border: var(--stroke-rule) solid var(--ink); }
.control__k { font: 500 12px/16px var(--font-display); letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-muted); }
.control__col--in .control__k { color: var(--accent); }
.control ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.control li { font-family: var(--font-display); font-weight: 600; font-size: 21px; line-height: 28px; display: flex; gap: var(--space-3); align-items: baseline; }
.control li::before {
  content: ""; flex: none; width: 14px; height: 12px; box-sizing: border-box; transform: translateY(-1px);
  border: var(--stroke-booth) solid var(--data-1); border-top: 0; border-radius: 0 0 2px 2px;
}
.control__col--out li { color: var(--ink-muted); font-weight: 500; }
.control__col--out li::before { border-color: var(--stone-300); border-style: dashed; border-top: 0; }
.control__note { margin-top: auto !important; padding-top: var(--space-4); border-top: var(--stroke-hairline) solid var(--line); color: var(--ink-muted); font-size: 15px; }
.control__col--in .control__note { color: var(--ink); font-weight: 600; }

.evidence { margin-top: var(--space-12); max-width: 760px; display: flex; flex-direction: column; gap: var(--space-3); }
.evidence__line { font-size: 18px; line-height: 28px; }
.evidence__n { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin-right: 6px; }
.evidence__close { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.25; margin-top: var(--space-4) !important; }
.evidence .caption { margin-top: 0; }

/* ---------- How we work: booth to button ---------- */
.approach { list-style: none; margin: 0; padding: 0; position: relative; }
.approach__item {
  display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--space-6); align-items: baseline;
  padding-block: var(--space-6); border-top: var(--stroke-hairline) solid var(--line);
}
.approach__item h3 { font-size: 24px; line-height: 30px; font-weight: 700; margin-bottom: var(--space-2) !important; }
.approach__item p { max-width: 60ch; font-size: 17px; line-height: 27px; }
.approach__level { font: 500 12px/16px var(--font-display); letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); }
.approach__src { font-size: 13px !important; line-height: 20px !important; color: var(--ink-muted); margin-top: var(--space-2) !important; }
@media (max-width: 640px) { .approach__item { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); } }

.approach__eg {
  margin-top: var(--space-4) !important; padding: var(--space-3) var(--space-4); border-left: var(--stroke-rule) solid var(--accent);
  background: var(--surface); font-size: 16px !important; line-height: 25px !important;
}
.approach__eg-k { display: block; font: 500 11px/16px var(--font-display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 4px; }

/* One booth, ten votes: three sources of votes, drawn as voter dots */
.turn {
  margin-top: var(--space-8); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-6) var(--space-12);
  padding-block: var(--space-8); border-top: var(--stroke-rule) solid var(--ink);
}
.turn__head { display: flex; flex-direction: column; gap: var(--space-2); }
.turn__t { font-size: clamp(24px, 2.8vw, 32px); line-height: 1.2; font-weight: 700; }
.turn__head p:last-child { max-width: 46ch; font-size: 17px; line-height: 27px; }
.turn__dots { grid-column: 2; display: flex; gap: 10px; align-items: center; }
.turn__dots i { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: opacity 0.4s var(--ease-out, ease-out), transform 0.4s var(--ease-out, ease-out); }
.turn__dots i[data-g="b"] { background: var(--ink-muted); }
.turn__dots i[data-g="c"] { background: var(--accent); }
.turn__dots i[data-g="a"] + i[data-g="b"], .turn__dots i[data-g="b"] + i[data-g="c"] { margin-left: 12px; }
.turn.is-waiting .turn__dots i { opacity: 0; transform: translateY(6px); }
.turn__parts { grid-column: 2; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.turn__parts li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--space-3); align-items: baseline; font-size: 16px; line-height: 25px; }
.turn__n { font: 700 20px/1 var(--font-display); color: var(--ink); }
.turn__parts li[data-g="b"] .turn__n { color: var(--ink-muted); }
.turn__parts li[data-g="c"] .turn__n { color: var(--accent); }
.turn__sum { grid-column: 2; font: 500 18px/27px var(--font-display); padding-top: var(--space-4); border-top: var(--stroke-hairline) solid var(--line); }
.turn__head { grid-row: 1 / span 3; }
@media (max-width: 760px) {
  .turn { grid-template-columns: minmax(0, 1fr); }
  .turn__head { grid-row: auto; }
  .turn__dots, .turn__parts, .turn__sum { grid-column: 1; }
  .turn__dots { gap: 7px; } .turn__dots i { width: 15px; height: 15px; }
}

.button-moment {
  margin-top: var(--space-8); display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--space-8); align-items: center;
  background: var(--surface); border: var(--stroke-rule) solid var(--ink); border-radius: var(--radius-lg); padding: var(--space-8);
}
@media (max-width: 640px) { .button-moment { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); } }
.button-moment__mark { width: 96px; height: auto; }
.button-moment .bm-booth { fill: var(--ink); }
.button-moment .bm-voter { fill: var(--accent); }
.button-moment > div { display: flex; flex-direction: column; gap: var(--space-2); }
.button-moment__t { font-size: clamp(24px, 2.8vw, 32px); line-height: 1.2; font-weight: 700; }
.button-moment p:last-child { font-size: 18px; }

/* ---------- Close ---------- */
.close { background: var(--surface); }
.close__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-12); align-items: center; }
@media (max-width: 860px) { .close__inner { grid-template-columns: minmax(0, 1fr); } }
.close__mark .bbb-mark { width: min(280px, 60vw); margin-inline: auto; }
.close__mark.is-waiting .m-booth, .close__mark.is-waiting .m-voter { opacity: 0; }
.close__copy { display: flex; flex-direction: column; gap: var(--space-4); }
.close .lead { color: var(--ink); }
.brief { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-4); }
.brief__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); }
@media (max-width: 600px) { .brief__row { grid-template-columns: minmax(0, 1fr); } }
.brief input {
  font: 400 16px/24px var(--font-body); color: var(--ink); background: var(--surface-sunken);
  border: var(--stroke-hairline) solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; box-sizing: border-box; width: 100%;
}
.brief input:focus-visible { outline: var(--stroke-rule) solid var(--focus); outline-offset: 2px; }
.brief .field label { font-size: 14px; }
.brief__status { font-size: 14px; color: var(--ink-muted); min-height: 22px; }

/* ---------- Footer ---------- */
.site-footer { border-top: var(--stroke-hairline) solid var(--line); background: var(--surface); }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-6); font-size: 14px; color: var(--ink-muted); }

/* ---------- Phones: booth stories ---------- */
@media (max-width: 640px) {
  .journey__tabs {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin-inline: calc(-1 * var(--space-4)); padding-inline: var(--space-4); scroll-padding-inline: var(--space-4);
  }
  .journey__tabs::-webkit-scrollbar { display: none; }
  .journey__tabs button { flex: none; white-space: nowrap; }
  .journey__panel { padding: var(--space-4); gap: var(--space-4); }
  .journey__stage {
    position: sticky; top: 64px; z-index: 2; background: var(--surface);
    border-bottom: var(--stroke-hairline) solid var(--line); padding-bottom: var(--space-3);
  }
  .jstep { padding-block: var(--space-3); }
}
