/* Hallmark · shape: one chart, one line, three grounds · genre: atmospheric · theme: custom · job: try · idea: "One chart with one line on it, the opening price; a coin is black while its clock runs, red once the dev has paid, white when the pledge went back." · vibe: "a deep red poster with a live ledger"
 * paper: oklch(41% 0.142 26) · accent: oklch(62% 0.205 31) · display: Clash Grotesk · body: Switzer · hero: a full-bleed sample chart over a poster headline that runs the width of the page; it opens black, turns red when the price falls through the line, and changes side again when the visitor drags the price back · nav: a bar on the field, the wordmark, three anchors, one quiet action · footer: one red band, the wordmark set large, anchors and two facts · imagery: the product, drawn live on canvas from sample data · signature: drag the last price across the line and the page changes side while the pledge flies to whoever is owed it
 * axes: mid/grotesk-heavy/chromatic-red · posture: drenched, three grounds that are the three states of a coin · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P5 H4 E4 S5 R3 V5 · weakest: R, the film and the hero both run the chart; the hero keeps only the ending, the film a second coin with its own numbers and the build-up */
/* Hallmark · hero-review: not run, the render tier had no browser driver on this machine · finish-review: subagent · fix · 8 findings · 7 resolved 1 partial · gap: bone still carries the board and the catch as the page's plain paper */
/* Hallmark · dismissed 58 · the count takes in two ledgers and five coin tiles of sample addresses and amounts, which are data and not copy; the prose itself is under 420 words */
/* Hallmark · waive 23 · red is a declared surface, the ground of every paid coin, never a signal on another ground · the page says a paid coin is red */
@import url("./tokens.css");
@import url("./base.css");

html { background: var(--ink); scrollbar-color: var(--ink-3) var(--ink); }
body { background: var(--ink); color: var(--g-ink); }
[data-ground] { background: var(--g-bg); color: var(--g-ink); }
[data-ground="paid"] ::selection { background: var(--bone); color: var(--red); }
[data-ground="pending"] ::selection { background: var(--bone); color: var(--ink); }
[data-ground="returned"] ::selection { background: var(--ink); color: var(--bone); }

h1, h2, h3 { font-weight: 600; letter-spacing: var(--tracking-display); line-height: 1; }
h2 { font-size: var(--text-section); max-width: 15ch; }
h3 { font-size: var(--text-title); letter-spacing: var(--tracking-title); line-height: 1.08; max-width: 22ch; }
.lead { font-size: var(--text-lead); line-height: 1.4; font-weight: 500; max-width: 34ch; }

.skip { position: absolute; left: var(--space-md); top: calc(-1 * var(--space-3xl)); z-index: var(--z-toast); padding: var(--space-xs) var(--space-md); background: var(--ink); color: var(--bone); }
.skip:focus-visible { top: var(--space-md); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-h); padding: 0 var(--space-lg); border: 1px solid var(--g-ink); border-radius: var(--radius-pill); background: var(--g-ink); color: var(--g-bg); font: 500 var(--text-md)/1 var(--font-body); white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn:hover { background: color-mix(in oklab, var(--g-ink) 84%, var(--g-bg)); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn--quiet { background: transparent; color: var(--g-ink); }
.btn--quiet:hover { background: color-mix(in oklab, var(--g-ink) 12%, transparent); }

.seg { display: inline-flex; flex: none; min-width: 0; margin: 0; padding: var(--space-3xs); border: 1px solid var(--g-ink); border-radius: var(--radius-pill); background: var(--g-bg); transition: background-color var(--dur-long) var(--ease-out), border-color var(--dur-short) var(--ease-out); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-md); border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); }
.seg label:hover { background: color-mix(in oklab, var(--g-ink) 12%, transparent); }
.seg input:checked + label { background: var(--g-ink); color: var(--g-bg); }
.seg input:focus-visible + label { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: var(--space-md); row-gap: var(--space-2xs); min-width: 0; }
.field label { font-weight: 500; }
.field output { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; white-space: nowrap; }
.field .range, .field .input { grid-column: 1 / -1; }

.range { appearance: none; -webkit-appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; color: var(--g-ink); cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 2px; background: currentColor; }
.range::-moz-range-track { height: 2px; background: currentColor; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: calc(-1 * var(--space-sm)); border: 0; border-radius: 50%; background: currentColor; transition: transform var(--dur-micro) var(--ease-out); }
.range::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: currentColor; }
.range:hover::-webkit-slider-thumb { transform: scale(1.12); }
.range:active::-webkit-slider-thumb { transform: scale(0.94); }
.range:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.range:disabled { opacity: 0.55; cursor: not-allowed; }

.input { width: 100%; min-height: var(--control-h); padding: 0 var(--space-md); border: 1px solid var(--g-muted); border-radius: var(--radius-pill); background: transparent; color: var(--g-ink); outline: 2px solid transparent; outline-offset: -3px; }
.input::placeholder { color: var(--g-muted); opacity: 1; }
.input:hover { border-color: var(--g-ink); }
.input:focus-visible { outline-color: var(--color-focus); }
.input:disabled { opacity: 0.55; cursor: not-allowed; }
.input[aria-invalid] { border-color: var(--color-error); }

.fill { padding: 0 0.25em; border: 1px dashed var(--g-ink); border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---------- the ledger: who the pledge went to ---------- */
.ledger { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 0.9375rem; line-height: 1.2; }
.ledger th { padding: 0 0 var(--space-xs); border-bottom: 1px solid var(--g-ink); font-size: var(--text-sm); font-weight: 500; text-align: left; white-space: nowrap; }
.ledger td { height: 32px; padding: 0; border-bottom: 1px solid var(--g-rule); }
.ledger thead th:first-child { width: 42%; }
.ledger .addr, .ledger .num { font-family: var(--font-outlier); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.ledger .num { width: 5rem; text-align: right; }
.ledger tbody tr:last-child td { border-bottom-color: var(--g-ink); }
.ledger tfoot th, .ledger tfoot td { height: 38px; padding: 0; border-bottom: 0; font-size: 0.9375rem; }
.ledger tfoot .num { font-size: var(--text-md); font-weight: 500; }

/* ---------- nav ---------- */
.nav { position: relative; z-index: var(--z-raised); flex: none; display: flex; align-items: center; gap: var(--space-xl); height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--g-ink); font: 600 1.5rem/1 var(--font-display); letter-spacing: -0.03em; text-decoration: none; }
.mark { flex: none; width: 1.05em; height: 1.05em; fill: currentColor; }
.nav-links { display: flex; gap: var(--space-lg); margin-left: auto; }
.nav-links a { padding-block: var(--space-xs); font-size: 0.9375rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav-links a:hover { text-decoration: underline; }
.nav-cta { min-height: 44px; padding: 0 var(--space-md); font-size: 0.9375rem; }

/* ---------- 1. hero ---------- */
.hero { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: clamp(700px, 100svh, 1080px); overflow: clip; background: var(--hero-base, var(--color-field)); color: var(--g-ink); transition: color 480ms linear; }
.flood { position: absolute; inset: 0; z-index: -1; transform: scaleY(0); transform-origin: 50% var(--flood-y, 40%); }

/* The headline runs the width of the page. Its first line is the shorter one, and the lede and actions sit beside it. */
.hero-foot { order: 2; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: start; padding-block: var(--space-sm) var(--space-xl); }
.hero-title { grid-column: 1 / -1; grid-row: 1; display: grid; max-width: none; font-size: var(--text-hero); line-height: 0.92; white-space: nowrap; }
.hl { grid-area: 1 / 1; display: block; transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-long) var(--ease-out); }
.js .hl[data-off] { opacity: 0; transform: translateY(0.08em); pointer-events: none; }
.hero-aside { grid-column: 8 / -1; grid-row: 1; position: relative; display: grid; gap: var(--space-lg); padding-top: var(--space-md); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

.stage { order: 1; flex: 1 1 auto; position: relative; display: grid; min-height: 0; }
.stage > canvas, .film-pin > canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* the coin of the opening is drawn over everything else on the stage, and the stage waits for it */
.stage > .solid { z-index: var(--z-dropdown); }
.stage-grid { position: relative; opacity: var(--frame, 1); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: minmax(300px, 1fr); column-gap: var(--gap-columns); }
.plot { grid-column: 1 / span 8; grid-row: 1; min-width: 0; }
.ledgers { grid-column: 9 / -1; grid-row: 1; display: grid; grid-template-rows: var(--line-px, 42%) minmax(0, 1fr); min-height: 0; }
.ledger--dev { align-self: end; margin-bottom: var(--space-lg); }
.ledger--holders { align-self: start; margin-top: var(--space-lg); }
/* the controls take the one corner of the chart the price never visits: below the line, before the last 12 hours */
.stage-foot { grid-column: 1 / span 6; grid-row: 1; align-self: end; position: relative; z-index: var(--z-raised); display: flex; align-items: center; gap: var(--space-lg); margin: 0 0 var(--space-2xl) var(--space-2xl); }
.stage-note { max-width: 24ch; font-size: var(--text-sm); }

.handle { position: absolute; left: 0; top: 0; z-index: var(--z-raised); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: ns-resize; touch-action: none; }
.handle::before { content: ""; width: 22px; height: 22px; border: 3px solid var(--g-ink); border-radius: 50%; background: var(--g-bg); transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-long) var(--ease-out); }
.handle:hover::before { transform: scale(1.2); }
.handle:active::before { transform: scale(0.92); }
.handle:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 0; }

/* ---------- 2. the 72 hours ---------- */
.film { background: var(--ink); }
.film.is-paid { background: var(--color-field); }
.film-head { padding-block: var(--section-gap) var(--space-xl); }
.film-track { position: relative; }
.film-pin { position: sticky; top: 0; isolation: isolate; height: 100svh; overflow: clip; background: var(--ink); transition: color var(--dur-long) var(--ease-out); }
.film-pin > .flood { background: var(--color-field); transform-origin: 50% var(--flood-y, 46%); transition: transform var(--dur-flood) var(--ease-out); }
.film-pin[data-ground="paid"] > .flood { transform: scaleY(1); }
/* once the red has landed the pin itself is red, so no edge of the black shows under it */
.film-pin[data-ground="paid"] { background: var(--color-field); transition: color var(--dur-long) var(--ease-out), background-color 0s linear var(--dur-flood); }
.film-grid { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); height: 100%; padding-block: var(--space-3xl) var(--space-2xl); }
.film-grid .plot { grid-column: 4 / -1; position: relative; }
.film-grid .ledgers { position: absolute; inset: 0 0 0 auto; width: 320px; transition: opacity var(--dur-long) var(--ease-out); }
.js .film-pin:not(.has-ledger) .ledgers { opacity: 0; }
.film-grid .ledger--holders { grid-row: 2; }
.clock { position: absolute; right: 0; top: 0; width: 320px; display: grid; gap: var(--space-2xs); }
.clock b { font: 600 clamp(4rem, 7vw, 6.5rem)/0.9 var(--font-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.clock span { font-weight: 500; }

.film-steps { position: relative; margin-block: -100svh 0; padding-block: 0; list-style: none; pointer-events: none; }
.film-steps li { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: center; min-height: 100svh; }
.film-steps li > div { grid-column: 1 / span 3; display: grid; gap: var(--space-md); transition: opacity var(--dur-long) var(--ease-out), color var(--dur-long) var(--ease-out); }
.film-steps h3 { font-size: var(--text-2xl); }
.js .film-steps li:not(.is-active) > div { opacity: 0.3; }

/* ---------- 3. the arithmetic ---------- */
/* the film ends on a fraction of a pixel; one pixel of red over the join keeps the two reds one field */
.math { position: relative; padding-block: var(--section-gap-s) var(--section-gap); box-shadow: 0 -1px 0 var(--color-field); }
.math-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: end; }
.math-controls { grid-column: 1 / span 5; display: grid; gap: var(--space-2xl); }
.calc { display: grid; gap: var(--space-md); }
.result { grid-column: 7 / -1; display: grid; gap: var(--space-md); min-width: 0; }
.figure { margin-left: -0.04em; font: 600 var(--text-figure)/0.8 var(--font-display); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.figure-unit { font-size: 0.56em; letter-spacing: 0; }
.result-k { font: 600 var(--text-title)/1.1 var(--font-display); letter-spacing: var(--tracking-title); max-width: 24ch; }
.result-line { max-width: 46ch; }

/* ---------- 4. the three colours ---------- */
.board-sec { padding-block: var(--section-gap) var(--space-3xl); }
.sec-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: end; margin-bottom: var(--space-2xl); }
.sec-head h2 { grid-column: 1 / span 7; }
.sec-head .lead { grid-column: 9 / -1; }
.board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 256px; gap: var(--space-md); }
.tile { grid-column: span 3; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--space-sm); min-width: 0; padding: var(--space-lg); border-radius: var(--radius-card); }
.tile--big { grid-column: span 6; grid-row: span 2; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: var(--space-md); }
.tile[data-ground="returned"] { box-shadow: inset 0 0 0 1px var(--g-ink); }
.tile header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2xs) var(--space-sm); }
.tile h3 { font-size: var(--text-xl); }
.tile--big h3 { font-size: var(--text-3xl); }
.ticker { font: 400 var(--text-sm)/1.2 var(--font-outlier); white-space: nowrap; }
.tile canvas { display: block; width: 100%; height: 100%; min-height: 0; }
.tile dl { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-xl); margin: 0; font-size: var(--text-sm); }
.tile dt { font-weight: 500; }
.tile dd { margin: 0; font-family: var(--font-outlier); font-variant-numeric: tabular-nums; }
.count { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2xs) var(--space-sm); }
.count b { font: 500 var(--text-3xl)/1 var(--font-outlier); font-variant-numeric: tabular-nums; }
.board-note { margin-top: var(--space-md); font-size: var(--text-sm); color: var(--g-muted); }

/* ---------- 5. the catch: four plain rows ---------- */
.catch-sec { padding-block: var(--space-3xl) var(--section-gap); }
.catch-sec h2 { margin-bottom: var(--space-2xl); }
.catch { display: grid; margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--g-ink); }
.catch li { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: baseline; padding-block: var(--space-lg); border-top: 1px solid var(--g-ink); }
.catch h3 { grid-column: 1 / span 7; max-width: none; font-size: clamp(1.625rem, 2.6vw, 2.625rem); }
.catch p { grid-column: 9 / -1; }

/* ---------- 6. the launch ---------- */
.launch { padding-block: var(--section-gap); }
.launch-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: end; }
.launch-main { grid-column: 1 / span 6; display: grid; gap: var(--space-2xl); }
.launch-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg) var(--space-md); }
.launch-form .field { grid-column: 1 / -1; }
.launch-form .field--half { grid-column: span 1; grid-template-columns: minmax(0, 1fr); row-gap: var(--space-xs); }
.form-end { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); }
.form-help { min-height: 1lh; font-size: var(--text-sm); color: var(--g-muted); }
.tile--preview { grid-column: 8 / -1; grid-template-rows: auto minmax(180px, 1fr) auto; gap: var(--space-md); min-height: 400px; background: var(--g-well); }
.tile--preview h3, .tile--preview h2 { font-size: var(--text-2xl); }

/* ---------- footer ---------- */
.foot { padding-block: var(--space-3xl) var(--space-2xl); }
.foot-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-2xl) var(--gap-columns); align-items: start; }
.foot-brand { grid-column: 1 / span 6; display: grid; gap: var(--space-sm); }
.foot-word { display: inline-flex; align-items: center; gap: 0.16em; font: 600 var(--text-section)/1 var(--font-display); letter-spacing: var(--tracking-display); }
.foot-links { grid-column: 7 / span 3; display: grid; gap: var(--space-xs); justify-items: start; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot-facts { grid-column: 10 / -1; display: grid; gap: var(--space-sm); font-size: var(--text-sm); }

/* a short desktop screen: the ledger tightens so the first screen still holds the headline and its action */
@media (min-width: 60rem) and (max-height: 54rem) {
  .ledger td { height: 27px; }
  .ledger tfoot th, .ledger tfoot td { height: 32px; }
  .ledger--dev { margin-bottom: var(--space-md); }
  .ledger--holders { margin-top: var(--space-md); }
}

/* ---------- narrower: the headline keeps eight columns and the lede stands beside its foot ---------- */
@media (max-width: 75rem) {
  .hero-foot { align-items: end; }
  .hero-title { grid-column: 1 / span 8; }
  .hero-aside { grid-column: 9 / -1; align-self: end; padding-block: 0 var(--space-xs); }
  .stage-note { display: none; }
  .film-grid .plot { grid-column: 5 / -1; }
  .film-steps li > div { grid-column: 1 / span 4; }
}
@media (max-width: 60rem) {
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
  .hero { min-height: 0; }
  .hero-foot { order: 0; grid-template-columns: minmax(0, 1fr); row-gap: var(--space-lg); padding-block: var(--space-lg) var(--space-xl); }
  .hero-title, .hero-aside { grid-column: 1 / -1; grid-row: auto; }
  .stage-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: 300px auto auto; }
  .plot { grid-column: 1; }
  .ledgers { grid-column: 1; grid-row: 2; display: block; }
  .ledger--dev { margin-block: var(--space-md) var(--space-lg); }
  .ledger--holders { margin-top: 0; }
  .stage-foot { grid-column: 1; grid-row: 3; flex-direction: column; align-items: flex-start; gap: var(--space-md); margin: 0; padding-block: var(--space-lg) var(--space-xl); }
  .stage-note { display: block; max-width: 46ch; }

  .film-head { padding-bottom: var(--space-lg); }
  .film-pin { z-index: var(--z-raised); height: 62svh; min-height: 460px; }
  .film-grid { grid-template-columns: minmax(0, 1fr); padding-block: var(--space-xl) var(--space-md); }
  .film-grid .plot { grid-column: 1; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
  .film-grid .ledgers { position: static; grid-row: 3; display: block; width: auto; }
  .film-grid .ledger td { height: 24px; }
  .film-grid .ledger tfoot th, .film-grid .ledger tfoot td { height: 28px; }
  .clock { position: static; width: auto; display: flex; align-items: baseline; gap: var(--space-sm); }
  .clock b { font-size: var(--text-3xl); }
  .film-steps { margin-top: 0; }
  .film-steps li { grid-template-columns: minmax(0, 1fr); align-items: start; min-height: 46svh; padding-top: var(--space-xl); }
  .film-steps li > div { grid-column: 1; }

  .math-grid, .launch-grid, .sec-head, .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .math-controls, .result, .sec-head h2, .sec-head .lead, .launch-main, .tile--preview, .foot-brand, .foot-links, .foot-facts { grid-column: 1; }
  .result { margin-top: var(--space-2xl); }
  .sec-head { row-gap: var(--space-lg); }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 220px; }
  .tile { grid-column: span 1; }
  .tile--big { grid-column: span 2; }
  .catch li { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-xs); }
  .catch h3, .catch p { grid-column: 1; }
  .tile--preview { margin-top: var(--space-2xl); min-height: 340px; }
}
@media (max-width: 40rem) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .tile--big { grid-column: span 1; }
  .launch-form .field--half { grid-column: 1 / -1; }
  .actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hero, .film-pin, .film-pin > .flood, .film-grid .ledgers, .hl, .btn, .seg, .seg label, .handle::before, .film-steps li > div, .range::-webkit-slider-thumb { transition: none; }
}
