/* ══ every sentence readable, and pages you move through ══
   Loaded after style.css. One spacing scale for every component built or rebuilt this round: blocks never touch because
   their gaps come from here. Text sits in normal flow; SVG labels are measured by ui.js (fit); tables of prose became
   cards (flip) or labelled rows. */
:root { --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 72px; }
h1, h2, h3, h4, .sb-q, .sign h2, figcaption > b { text-wrap: balance; }
p, li, dd, figcaption, .lead, .note { text-wrap: pretty; overflow-wrap: break-word; }
.block { padding-top: var(--sp-5); margin-top: var(--sp-7); }
.sign { flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
.sign .meta { flex: 1 1 18ch; }
.note { margin: var(--sp-4) 0 0; }
/* the ticket's cells wrap instead of cutting a position with an ellipsis */
.ticket b { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; }

/* the Scoreboard's two scores: each side is a column with its own gaps, the score's line box holds its digits */
.sb-panel { row-gap: var(--sp-5); }
.sb-side { gap: var(--sp-3); }
.sb-score { line-height: 1.08; padding-block: var(--sp-1); }
.sb-q { line-height: 1.1; margin-bottom: var(--sp-2); }
.sb-q small { margin-top: var(--sp-2); }
.sb-caption { margin-top: var(--sp-4); }

/* ── reveals: sections and cards arrive one after another (ui.js adds .rv only when motion is allowed) ── */
.rv { opacity: 0; transform: translateY(14px); transition: opacity 560ms var(--ease) calc(var(--i, 0) * 70ms), transform 560ms var(--ease) calc(var(--i, 0) * 70ms); }
.rv.in { opacity: 1; transform: none; }

/* ── charts on a narrow screen scroll sideways inside their own frame, so their labels keep a readable size ── */
.fig-scroll { overflow-x: auto; padding-bottom: var(--sp-1); }
@media (max-width: 760px) { .fig-scroll > svg { min-width: 640px; } }

/* ── flip card: front = the question or the name and its status, back = how it was tested and what it found ── */
.flip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: var(--sp-4); align-items: stretch; margin: var(--sp-4) 0 0; padding: 0; list-style: none; }
.flip-grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.flip { display: block; min-width: 0; }
.flip-btn { appearance: none; display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit;
  text-align: left; cursor: pointer; perspective: 1400px; border-radius: 4px; }
.flip-btn:focus-visible { outline: 3px solid var(--sidi); outline-offset: 3px; }
.flip-in { display: grid; height: 100%; transform-style: preserve-3d; transition: transform 560ms var(--ease); }
.flip-btn[aria-pressed="true"] .flip-in { transform: rotateY(180deg); }
.flip-face { grid-area: 1 / 1; display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; padding: var(--sp-4); border-radius: 4px;
  background: var(--slab); border: 1px solid var(--joint-2); border-top: 3px solid var(--ink); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease); }
.flip-back { transform: rotateY(180deg); background: var(--ground-2); border-top-color: var(--gold); }
.flip-btn:hover .flip-face { border-color: var(--ink-3); }
.flip-face > span { display: block; min-width: 0; }
.flip.held .flip-front { border-top-style: dashed; border-top-color: var(--ink-3); }
.flip.beta .flip-front { border-top-color: var(--gold); }
.flip-hint { display: block; margin-top: auto; padding-top: var(--sp-3); font: 700 0.72rem/1 var(--sign); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.flip-hint::before { content: "\21BB\00a0"; }
.fc-chips { display: flex !important; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: center; }
.fc-state { display: inline-block; font: 700 0.76rem/1 var(--sign); letter-spacing: 0.1em; text-transform: uppercase; padding: 6px 8px; border: 1.5px solid var(--ink); border-radius: 2px; color: var(--ink); }
.flip.ok .fc-state { background: var(--ink); color: var(--ground); }
.flip.held .fc-state { border-style: dashed; border-color: var(--ink-3); color: var(--ink-2); }
.fc-q { font: 700 1.05rem/1.3 var(--font); color: var(--ink); text-wrap: balance; }
.fc-name { font: 800 1.2rem/1.1 var(--sign); letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink); text-wrap: balance; }
.fc-sub { font-size: 0.88rem; line-height: 1.35; color: var(--ink-2); text-wrap: pretty; }
.fc-l { font: 700 0.74rem/1 var(--sign); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin-top: var(--sp-1); }
.fc-t { font-size: 0.92rem; line-height: 1.4; color: var(--ink); text-wrap: pretty; font-variant-numeric: tabular-nums; }
.flip-back .fc-t + .fc-l { margin-top: var(--sp-3); }
.fc-pitch svg { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) {
  /* no turning: the two faces trade places, only one is drawn at a time, and both stay in the page for a screen reader */
  .flip-in { transform: none !important; transition: none; }
  .flip-face { backface-visibility: visible; transition: none; }
  .flip-back { transform: none; opacity: 0; pointer-events: none; }
  .flip-btn[aria-pressed="true"] .flip-front { opacity: 0; }
  .flip-btn[aria-pressed="true"] .flip-back { opacity: 1; }
}

/* ── stepper / slides: one idea per slide; wider screens stack the slides and cross-fade, phones scroll-snap ── */
.stepper { display: grid; gap: var(--sp-4); min-width: 0; }
.step-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); }
.step-count { margin: 0; font: 700 0.9rem/1.2 var(--sign); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.step-count b { font-size: 1.35rem; color: var(--ink); }
.step-title { text-transform: none; letter-spacing: 0; font: 600 0.95rem/1.3 var(--font); color: var(--ink-2); }
.step-dots { display: flex; flex-wrap: wrap; gap: 0; }
.step-dot { appearance: none; display: grid; place-items: center; margin: 0; padding: var(--sp-2); border: 0; background: none; cursor: pointer; border-radius: 50%; }
.step-dot i { display: block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink-3); background: transparent; transition: transform 200ms var(--ease), background-color 200ms var(--ease), border-color 200ms var(--ease); }
.step-dot:hover i { border-color: var(--ink); }
.step-dot[aria-current] i { background: var(--crimson); border-color: var(--crimson); transform: scale(1.3); }
.step-dot:focus-visible, .step-btn:focus-visible { outline: 3px solid var(--sidi); outline-offset: 2px; }
.step-nav { display: flex; gap: var(--sp-2); margin-left: auto; }
.step-btn { appearance: none; display: grid; place-items: center; width: 42px; height: 42px; margin: 0; padding: 0; border: 1.5px solid var(--ink); border-radius: 3px; background: transparent; color: var(--ink); cursor: pointer; transition: background-color 160ms var(--ease), color 160ms var(--ease); }
.step-btn:hover:not([aria-disabled="true"]) { background: var(--ink); color: var(--ground); }
.step-btn[aria-disabled="true"] { border-style: dashed; border-color: var(--ink-3); color: var(--ink-3); cursor: default; }
.step-track { display: grid; position: relative; min-width: 0; touch-action: pan-y; }
.step-slide { grid-area: 1 / 1; min-width: 0; visibility: hidden; opacity: 0; transition: opacity 320ms var(--ease), visibility 0s linear 320ms; padding-top: var(--sp-3); border-top: 2px solid var(--ink); }
.step-slide[data-on] { visibility: visible; opacity: 1; transition: opacity 320ms var(--ease); }
.step-slide h3 { margin: 0 0 var(--sp-2); font: 800 1.35rem/1.1 var(--sign); letter-spacing: 0.02em; text-transform: uppercase; }
.step-slide p { margin: 0 0 var(--sp-3); max-width: 64ch; color: var(--ink-2); text-wrap: pretty; }
.step-slide .step-res { color: var(--ink); font: 700 1.05rem/1.35 var(--sign); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.step-slide .step-res span { color: var(--ink-3); font: 500 0.88rem/1.35 var(--font); letter-spacing: 0; }
.step-slide .step-kicker { margin: 0 0 var(--sp-2); font: 700 0.74rem/1 var(--sign); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.step-slide.small h3 { font: 700 1.1rem/1.2 var(--font); text-transform: none; letter-spacing: 0; }
@media (max-width: 760px) {
  .step-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(-1 * var(--sp-3)); overscroll-behavior-x: contain; touch-action: auto; }
  .step-track::-webkit-scrollbar { display: none; }
  .step-slide { flex: 0 0 100%; visibility: visible; opacity: 1; scroll-snap-align: start; padding-inline: var(--sp-3); }
  .step-count { flex: 1 0 100%; }
}
@media (prefers-reduced-motion: reduce) { .step-slide, .step-slide[data-on] { transition: none; } .step-track { scroll-behavior: auto; } }

/* the chart a stepper is about: the active step's point is lit, the others recede (never by opacity on text) */
.sb-vision[data-active] .pt:not(.on) .val, .sb-vision[data-active] .pt:not(.on) .stepn { fill: var(--ink-3); }
.sb-vision .pt.on .dot { stroke: var(--ink); stroke-width: 3; }
.sb-vision .pt.on .stepn, .sb-vision .pt.on .val { fill: var(--crimson-ink); }
.step-vision { margin-top: var(--sp-4); }

/* short first: the answer in a line, the detail on demand */
.more { margin: 0 0 var(--sp-3); }
.more-short { margin: 0 0 var(--sp-2); font-weight: 600; color: var(--ink); max-width: 72ch; }
.more-d summary { cursor: pointer; display: inline-block; padding: var(--sp-1) 0; font: 700 0.85rem/1.2 var(--sign); letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); }
.more-d summary:hover { color: var(--ink); }
.more-d summary:focus-visible { outline: 3px solid var(--sidi); outline-offset: 3px; }
.more-body { padding: var(--sp-3) 0 0 var(--sp-4); border-left: 3px solid var(--joint-2); margin-top: var(--sp-2); }
.more-body > p, .more-body > ol { margin: 0 0 var(--sp-3); max-width: 72ch; color: var(--ink-2); }
.more-body > :last-child { margin-bottom: 0; }

/* the two stands, with their labels as ordinary text beside the drawing instead of text laid on it */
.sb-key { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; gap: var(--sp-3); }
.sb-key li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--sp-3); align-items: start; padding-top: var(--sp-3); border-top: 2px solid var(--ink); }
.sb-key i { width: 18px; height: 14px; margin-top: 4px; border-radius: 3px; background: var(--tl-in); }
.sb-key .proj i { background: transparent; border: 2px dashed var(--tl-in); }
.sb-key b { display: block; font: 800 1.15rem/1.1 var(--sign); letter-spacing: 0.06em; text-transform: uppercase; }
.sb-key em { font: 800 2rem/1.1 var(--sign); font-style: normal; font-variant-numeric: tabular-nums; margin-right: var(--sp-1); }
.sb-key span { display: block; margin-top: var(--sp-1); color: var(--ink-2); }
.sb-standstext p { margin: 0 0 var(--sp-3); }

/* Data & Vision: the path from a feed to the call washes one column of the board in gold (no text is dimmed) */
.cn-stage { fill: var(--gold); fill-opacity: 0; transition: fill-opacity 300ms var(--ease); pointer-events: none; }
.cn-board[data-stage="feed"] .cn-stage.feed, .cn-board[data-stage="tables"] .cn-stage.tables, .cn-board[data-stage="modules"] .cn-stage.modules { fill-opacity: 0.2; }
.cn-board[data-stage="call"] .cn-mod[data-m="The call"] rect { stroke-width: 3.5; stroke: var(--crimson); }
.cn-board[data-stage="call"] .cn-flow.out[data-m="The call"] { stroke-width: 3; }
.cn-path { margin: var(--sp-4) 0 var(--sp-5); }
.cn-reach { display: flex !important; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); }
.cn-reach i { font-style: normal; font-size: 0.8rem; padding: 3px 7px; border: 1px solid var(--joint-2); border-radius: 10px; color: var(--ink-2); }
.duo-cards-flip .flip-face { padding: var(--sp-3); }
.duo-cards-flip { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
@media (max-width: 760px) { .duo-cards-flip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); } .duo-cards-flip .fc-name { font-size: 1rem; } }

/* ── Promesse or Promesse Light ─────────────────────────────────────────────────────────────────────── */
.kickoff.view button { padding: 0 9px; font-size: 0.78rem; letter-spacing: 0.04em; }
/* "Loading the Ground": over the sky while the 14 MB model arrives (the page puts it up, stadium3d.js removes it) */
.ground-loading { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; pointer-events: none;
  background: color-mix(in oklch, var(--ground) 72%, transparent); color: var(--ink); }
.ground-loading b { font: 800 clamp(1.5rem, 3vw, 2.2rem)/1 "Barlow Condensed", sans-serif; letter-spacing: 0.08em; text-transform: uppercase; }
.ground-loading span { font-size: 0.85rem; color: var(--ink-2); }
.ground-loading i { display: block; width: min(260px, 60vw); height: 3px; margin-top: 8px; background: color-mix(in oklch, var(--ink) 18%, transparent); position: relative; overflow: hidden; }
.ground-loading i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 38%; background: var(--crimson); animation: ground-load 1.3s ease-in-out infinite; }
@keyframes ground-load { from { transform: translateX(-100%); } to { transform: translateX(270%); } }
@media (prefers-reduced-motion: reduce) { .ground-loading i::after { animation: none; width: 100%; opacity: 0.6; } }
/* the door: the first visit's one choice */
dialog.door { border: 1.5px solid var(--ink); background: var(--ground); color: var(--ink); padding: clamp(18px, 3vw, 32px); max-width: min(720px, calc(100vw - 32px)); border-radius: 4px; }
dialog.door::backdrop { background: color-mix(in oklch, var(--roof) 70%, transparent); }
dialog.door h2 { margin: 0 0 6px; font: 800 clamp(1.6rem, 3.4vw, 2.3rem)/1 "Barlow Condensed", sans-serif; letter-spacing: 0.04em; text-transform: uppercase; }
.door-lead { margin: 0 0 18px; color: var(--ink-2); max-width: 52ch; }
.door-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .door-ways { grid-template-columns: 1fr; } }
.door-way { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1.5px solid var(--joint-2); border-radius: 3px; }
.door-way b { font: 800 1.5rem/1 "Barlow Condensed", sans-serif; letter-spacing: 0.05em; text-transform: uppercase; }
.door-way span { font-size: 0.9rem; line-height: 1.4; color: var(--ink-2); }
.door-way:hover, .door-way:focus-visible { border-color: var(--ink); background: color-mix(in oklch, var(--ink) 6%, transparent); outline: none; }
.door-way:focus-visible { box-shadow: 0 0 0 3px color-mix(in oklch, var(--crimson) 60%, transparent); }
/* Light's overlay canvas (the ring round the seat under the pointer) must not swallow the pointer: the seats are on the canvas under it */
#bowl-top { pointer-events: none; }
/* on a phone the fascia has no room for the view switch: a phone opens in Light (the 3D ground is for a desktop) */
@media (max-width: 900px) { .kickoff.view { display: none; } }
