/* Vestra — six full-screen statements, each one figure or phrase, one caption and one drawing.
   Shared tokens and the project-page frame live in style.css. */

.vs-note { margin-top: 22px; }

/* ---------- the statements ---------- */

.vs-st {
  position: relative;
  min-height: calc(100svh - var(--bar-h));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(40px, 7vh, 80px) 0;
  border-top: 1px solid var(--rule);
  text-align: center;
  scroll-margin-top: -24px; /* html's scroll-padding leaves 24px; a statement sits flush under the bar */
}

.vs-k {
  margin-bottom: clamp(14px, 2.4vh, 24px);
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.vs-h {
  max-width: 100%;
  font-size: clamp(32px, 9.4vw, 76px); font-weight: 500; line-height: 1.04; letter-spacing: -0.02em;
  text-wrap: balance;
}

/* the net-worth figure: as large as the column allows (8 glyphs at 0.6em, less tracking) */
.vs-num {
  font-size: min(196px, calc((100vw - 2 * var(--gutter) - 24px) / 4.9));
  line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* odometer: each digit is a window one line high over a strip of 0-9-0 */
.odo { display: inline-block; white-space: nowrap; }
.odo-c, .odo-w { display: inline-block; height: 1em; line-height: 1; vertical-align: top; }
.odo-w { width: 0.6em; overflow: hidden; -webkit-user-select: none; user-select: none; }
.odo-w > span { display: block; will-change: transform; }
.odo-w > span > span { display: block; height: 1em; line-height: 1; }

.vs-fig { display: none; position: relative; width: 100%; margin-top: clamp(24px, 4.6vh, 48px); }
.js .vs-fig { display: block; }
.vs-fig canvas { width: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }

.vs-fig-1 { max-width: 780px; }
.vs-fig-1 canvas { height: 380px; }
.vs-fig-2 { max-width: 820px; margin-top: clamp(20px, 4vh, 40px); }
.vs-fig-2 canvas { height: 104px; }
.vs-fig-3 { max-width: 780px; }
.vs-fig-3 canvas { height: 372px; }
.vs-fig-4 { max-width: 780px; }
.vs-fig-4 canvas { height: 340px; }
.vs-fig-5 { max-width: 820px; }
.vs-fig-5 canvas { height: 380px; }
.vs-fig-6 { max-width: 680px; }
.vs-fig-6 canvas { height: 312px; }

.vs-cap {
  margin-top: clamp(18px, 3.2vh, 30px); max-width: 72ch;
  font-size: 13px; line-height: 1.6; color: var(--ink-2);
  text-wrap: balance;
}
.vs-cap span { color: var(--ink); font-weight: 500; }

/* the numbers behind each drawing: plain text without JavaScript, spoken with it */
.vs-data {
  margin: 22px 0 0; padding: 0; list-style: none; max-width: 60ch;
  font-size: 12px; line-height: 1.7; color: var(--ink-2);
}
ul.vs-data { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; }
/* hidden visually but spoken: a 1px box whose children are blocks, so nothing spills into the page's scroll width */
.js .vs-data, .vs-sr { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.js ul.vs-data { display: block; }
.js .vs-data > *, .vs-sr > * { display: block; }

/* money in / time-weighted: one toggle, two labelled halves, the pressed half inverted */
.vs-toggle { display: none; }
.js .vs-toggle {
  display: inline-flex; margin-top: 18px; padding: 0;
  background: var(--paper); border: 1px solid var(--ink); box-shadow: 1px 1px 0 var(--ink);
  font-size: 12px; line-height: 1; cursor: pointer;
}
.vs-toggle span { padding: 8px 12px; white-space: nowrap; }
.vs-toggle .a, .vs-toggle[aria-pressed="true"] .b { background: var(--ink); color: var(--paper); }
.vs-toggle[aria-pressed="true"] .a { background: none; color: var(--ink-3); }
.vs-toggle .b { color: var(--ink-3); border-left: 1px solid var(--ink); }
.vs-toggle:hover .a, .vs-toggle:hover .b { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.vs-toggle:active { box-shadow: none; transform: translate(1px, 1px); }

/* ---------- progress rail: one square per statement, the current one filled ---------- */

.vs-rail { display: none; }
.js .vs-rail {
  position: fixed; right: 4px; top: 50%; z-index: 40;
  display: flex; flex-direction: column; gap: 0;
  transform: translateY(-50%);
  visibility: hidden; clip-path: inset(0 0 100% 0);
  transition: clip-path 0.24s steps(6, end), visibility 0s linear 0.24s;
}
.js .vs-rail.on { visibility: visible; clip-path: inset(0 0 0 0); transition: clip-path 0.24s steps(6, end), visibility 0s; }
/* each link is a 24px tap area; the square inside it is the mark */
.vs-rail a { display: grid; place-items: center; width: 24px; height: 24px; -webkit-tap-highlight-color: transparent; }
.vs-rail a::before { content: ""; width: 9px; height: 9px; border: 1px solid var(--ink); background: var(--paper); }
.vs-rail a[aria-current="true"]::before, .vs-rail a:hover::before { background: var(--ink); }
.vs-rail a:focus-visible { outline-offset: -3px; }

/* ---------- about ---------- */

.vs-about { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 40px; padding: 72px 0 88px; border-top: 1px solid var(--rule); }
.vs-about h2 { font-size: 12px; font-weight: 400; color: var(--ink-3); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .vs-about { grid-template-columns: 1fr; padding: 52px 0 64px; }
  .vs-about h2 { margin-bottom: 20px; }
}

@media (max-width: 620px) {
  .vs-fig-1 canvas { height: 440px; }
  .vs-fig-2 canvas { height: 88px; }
  .vs-fig-3 canvas { height: 340px; }
  .vs-fig-4 canvas { height: 300px; }
  .vs-fig-5 canvas { height: 320px; }
  .vs-fig-6 canvas { height: 300px; }
}

@media (max-width: 380px) {
  .vs-fig-1 canvas { height: 410px; }
}

@media (prefers-reduced-motion: reduce) {
  .odo-w > span { will-change: auto; }
}

/* below 901px the statements run to within a pixel of the edge: no room for the rail beside them; they read fine without it */
@media (max-width: 900px) { .js .vs-rail { display: none; } }
