/* VibeFund — private-bank restraint, an exchange's precision. The design spec is redesign/DESIGN.md. */

@font-face { font-family: 'Gloock'; src: url('fonts/gloock.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Mona Sans'; src: url('fonts/mona-sans.woff2') format('woff2'); font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: 'Spline Sans Mono'; src: url('fonts/spline-sans-mono.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
/* Metric-matched fallbacks, so the swap moves nothing. */
@font-face { font-family: 'Gloock fallback'; src: local('Georgia'), local('Times New Roman'), local('DejaVu Serif'); size-adjust: 104%; ascent-override: 94%; descent-override: 26%; }
@font-face { font-family: 'Mona fallback'; src: local('Arial'), local('Helvetica'), local('Liberation Sans'), local('DejaVu Sans'); size-adjust: 101%; ascent-override: 92%; descent-override: 24%; }
@font-face { font-family: 'Spline fallback'; src: local('Courier New'), local('DejaVu Sans Mono'), local('Liberation Mono'); size-adjust: 96%; }

@property --rise { syntax: '<length>'; inherits: false; initial-value: 0px; }

:root {
  color-scheme: light;
  --serif: 'Gloock', 'Gloock fallback', Georgia, serif;
  --sans: 'Mona Sans', 'Mona fallback', 'PingFang SC', 'Noto Sans CJK SC', 'Microsoft YaHei', sans-serif;
  --mono: 'Spline Sans Mono', 'Spline fallback', ui-monospace, monospace;

  /* sRGB first, OKLCH where the browser has it. Contrast measured in redesign/DESIGN.md. */
  --paper: #f4eedd;  --paper: oklch(95.1% 0.027 88);
  --paper-2: #ebe3cc; --paper-2: oklch(91.6% 0.035 87);
  --ink: #102b25;    --ink: oklch(27.4% 0.04 172);
  --ink-2: #3c524b;  --ink-2: oklch(42% 0.03 170);
  --brass: #c5aa75;  --brass: oklch(74.7% 0.073 82);
  --up: #1d6b3c;     --up: oklch(46% 0.11 150);
  --down: #a33a2a;   --down: oklch(48% 0.15 33);
  --you: #7a5a20;    --you: oklch(48% 0.09 75);
  --focus: #a33a2a;
  --bar: #102b25;    --bar-ink: #f4eedd;

  --rule: 1px solid var(--brass);
  --gutter: clamp(16px, 4vw, 56px);
  --fk: 46px;
  font-size: 100%;
}
html[data-theme='night'] {
  color-scheme: dark;
  --paper: #0c1f1b;  --paper: oklch(21% 0.03 172);
  --paper-2: #132a25; --paper-2: oklch(25.5% 0.035 172);
  --ink: #efe7d2;    --ink: oklch(93% 0.03 88);
  --ink-2: #b9b39f;  --ink-2: oklch(77% 0.03 90);
  --up: #7fd39a;     --up: oklch(80% 0.12 150);
  --down: #f2967f;   --down: oklch(76% 0.12 35);
  --you: #e2c385;    --you: oklch(83% 0.09 82);
  --focus: #e2c385;
  --bar: #050f0d;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; scroll-padding-bottom: var(--fk); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.55 var(--sans); font-stretch: 96%;
  padding-bottom: calc(var(--fk) + env(safe-area-inset-bottom));
  font-feature-settings: 'kern', 'liga';
}
h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
img, video, svg { display: block; max-width: 100%; }
.num, input[type='number'], table td.num { font-family: var(--mono); font-variant-numeric: tabular-nums slashed-zero; font-feature-settings: 'tnum', 'zero'; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 14px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--brass); color: #102b25; }

/* The house rule: a scotch rule, thick over thin, in brass. */
.folio::before, .foot::before {
  content: ''; display: block; height: 5px; margin-bottom: 18px;
  border-top: 3px solid var(--brass); border-bottom: 1px solid var(--brass);
}

/* Buttons: a deed (filled, framed twice) and a line (a single ruled edge). Zero radius, no shadow. */
.btn {
  --b: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 46px; padding: 0 22px; border: 0; border-radius: 0; cursor: pointer;
  font: 600 .8125rem/1 var(--sans); font-stretch: 112%; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.btn--deed { background: var(--ink); color: var(--paper); box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 4px var(--brass); }
.btn--deed:hover { box-shadow: inset 0 0 0 5px var(--ink), inset 0 0 0 6px var(--brass); }
.btn--line { background: transparent; color: var(--ink); box-shadow: inset 0 -1px 0 var(--ink), inset 0 1px 0 var(--ink); }
.btn--line:hover { background: var(--paper-2); }
.btn--small { min-height: 36px; padding: 0 14px; font-size: .72rem; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn--small:hover { background: var(--paper-2); }
.btn--on-dark { color: #f4eedd; box-shadow: inset 0 -1px 0 #c5aa75, inset 0 1px 0 #c5aa75; }
.btn--on-dark:hover { background: rgb(244 238 221 / .08); }
.btn:active { translate: 0 1px; }

/* Masthead: the wordmark sits on the plate, the flag in small caps. */
.mast { position: absolute; inset: 0 0 auto 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px var(--gutter); }
.wordmark { width: clamp(132px, 14vw, 196px); height: auto; fill: var(--ink); }
.wordmark__rule { fill: var(--brass); }
.mast__flag { font: 500 .72rem/1.3 var(--sans); font-stretch: 115%; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); background: var(--paper); padding: 8px 12px; border-top: var(--rule); border-bottom: var(--rule); }
.mast__flag span { color: var(--brass); }

/* I · the plate: a full viewport of engraved film, the title set over its foot. */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; isolation: isolate; overflow: clip; }
.hero__film { position: absolute; inset: 0; z-index: -1; }
.film { width: 100%; height: 100%; object-fit: cover; }
.hero__film::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--paper) 0%, var(--paper) 30%, transparent 72%); }
.hero__film .film { filter: saturate(.8) sepia(.12); }
.hero__body { grid-row: 2; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 32px clamp(24px, 4vw, 72px); align-items: end; padding: 0 var(--gutter) clamp(28px, 5vh, 64px); }
.hero__title { font: 400 clamp(3rem, 8.4vw, 9.25rem)/.9 var(--serif); letter-spacing: -.025em; }
html[lang='zh-Hans'] .hero__title { font-size: clamp(2.3rem, 7vw, 6.6rem); line-height: 1.08; letter-spacing: 0; }
.hero__title em { display: block; font-style: normal; color: var(--ink-2); }
.hero__lead { font-size: 1.0625rem; max-width: 40ch; color: var(--ink-2); }
.hero__side { display: grid; gap: 22px; }
.quote { margin: 0; display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); }
.quote > div { padding: 10px 12px 10px 0; display: grid; gap: 2px; }
.quote > div + div { padding-left: 12px; border-left: var(--rule); }
.quote dt { font: 600 .66rem/1.2 var(--sans); font-stretch: 115%; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.quote dd { margin: 0; font-size: 1.25rem; line-height: 1.1; }
.quote__name dt { font: 400 1.5rem/1 var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink); }
.quote__name dd { font-size: .74rem; color: var(--ink-2); }
.acts { display: flex; flex-wrap: wrap; gap: 12px; }
.film-toggle {
  position: absolute; right: var(--gutter); top: 84px; z-index: 2;
  font: 500 .68rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  background: var(--paper); color: var(--ink); border: 0; border-radius: 0; box-shadow: inset 0 0 0 1px var(--ink); padding: 8px 10px; cursor: pointer;
}
.night .film-toggle { top: 20px; background: #0c1f1b; color: #f4eedd; box-shadow: inset 0 0 0 1px #c5aa75; }

/* Section heads: a roman numeral, a kicker, a title, one line. */
.folio { display: grid; grid-template-columns: auto 1fr; column-gap: 20px; align-items: baseline; margin-bottom: clamp(24px, 4vw, 48px); }
.folio::before { grid-column: 1 / -1; }
.folio__no { grid-row: span 3; font: 400 clamp(2.4rem, 5vw, 4.6rem)/.8 var(--serif); color: var(--brass); min-width: 1.6ch; }
.folio__kicker { font: 600 .72rem/1.4 var(--sans); font-stretch: 115%; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.folio__title { font: 400 clamp(2rem, 4.6vw, 4rem)/1 var(--serif); letter-spacing: -.015em; }
.folio__lead { max-width: 58ch; margin-top: 10px; color: var(--ink-2); }
.folio--row { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.1fr) auto; column-gap: 24px; }
.folio--row .folio__no { grid-row: auto; }
.folio--row .folio__lead { margin-top: 0; align-self: end; }
.tag { display: inline-block; vertical-align: middle; font: 600 .66rem/1 var(--sans); font-stretch: 115%; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); padding: 6px 8px; box-shadow: inset 0 0 0 1px var(--brass); translate: 0 -.4em; }
section { padding: clamp(64px, 9vw, 128px) var(--gutter); }
.note { font-size: .82rem; color: var(--ink-2); max-width: 72ch; margin-top: 18px; }
.note::before { content: 'ⓘ '; color: var(--brass); }

/* II · the book: ladder, bid, cap table. */
.book { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 30vw); column-gap: clamp(24px, 4vw, 64px); }
.book > .folio { grid-column: 1; }
.vignette { grid-column: 2; grid-row: 1; margin: 0; align-self: end; padding: 10px; box-shadow: inset 0 0 0 1px var(--brass), inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--brass); }
.vignette img { width: 100%; height: auto; mix-blend-mode: multiply; }
html[data-theme='night'] .vignette img { mix-blend-mode: normal; filter: invert(.88) hue-rotate(180deg) sepia(.2); }
.book__grid { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1.2fr); gap: 0; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); margin-top: 40px; }
.book__grid > * { padding: 22px clamp(14px, 2vw, 28px); }
.book__grid > * + * { border-left: var(--rule); }
.book .note { grid-column: 1 / -1; }
.book h3, .raise h3 { font: 400 1.6rem/1.1 var(--serif); margin-bottom: 16px; }

.ladder { font-family: var(--mono); font-size: .92rem; }
.ladder__head { display: flex; justify-content: space-between; font: 600 .66rem/1 var(--sans); font-stretch: 115%; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.ladder ol { list-style: none; margin: 0; padding: 0; }
.ladder li { --d: 0%; position: relative; display: flex; justify-content: space-between; padding: 5px 6px; font-variant-numeric: tabular-nums; }
.ladder li::before { content: ''; position: absolute; inset: 2px auto 2px 0; width: var(--d); z-index: -1; transition: width .45s cubic-bezier(.2, .7, .2, 1); }
.ladder__asks li::before { background: color-mix(in oklch, var(--down) 13%, transparent); }
.ladder__bids li::before { background: color-mix(in oklch, var(--up) 14%, transparent); }
.ladder__asks .p { color: var(--down); }
.ladder__bids .p { color: var(--up); }
.ladder li.is-yours { box-shadow: inset 0 0 0 1px var(--you); }
.ladder li.is-yours .s::after { content: ' ◆'; color: var(--you); }
.ladder li.is-taken { animation: taken .6s ease-out both; }
@keyframes taken { from { background: color-mix(in oklch, var(--brass) 55%, transparent); } to { background: transparent; } }
.ladder__mid { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0; padding: 8px 6px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.ladder__mid .num { font: 400 1.7rem/1 var(--serif); }
.ladder__mid span + span { font-size: .74rem; color: var(--ink-2); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font: 600 .68rem/1.2 var(--sans); font-stretch: 115%; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
input, select {
  font: inherit; color: var(--ink); background: transparent; border: 0; border-radius: 0; border-bottom: 1px solid var(--ink);
  padding: 8px 2px; min-height: 44px; width: 100%;
}
input[type='number'] { font-size: 1.25rem; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: right 10px top 50%, right 5px top 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 22px; }
.bid .btn { width: 100%; margin-top: 4px; }
.bid__fills-title { font: 600 .68rem/1 var(--sans); font-stretch: 115%; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 22px 0 8px; }
.bid__fills { list-style: none; margin: 0; padding: 0; font: .86rem/1.5 var(--mono); min-height: 3em; max-height: 9.5em; overflow: auto; }
.bid__fills li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted color-mix(in oklch, var(--ink) 35%, transparent); padding: 3px 0; }
.bid__fills li.is-new { animation: tape .5s ease-out both; }
@keyframes tape { from { opacity: 0; translate: -10px 0; } }
.bid__fills .empty { color: var(--ink-2); border: 0; font-family: var(--sans); }
.bid__sum, .ticket__est, .out { margin: 14px 0 0; display: grid; }
.bid__sum > div, .ticket__est > div, .out > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid color-mix(in oklch, var(--ink) 18%, transparent); }
.bid__sum dt, .ticket__est dt, .out dt { color: var(--ink-2); font-size: .88rem; }
.bid__sum dd, .ticket__est dd, .out dd { margin: 0; }

.cap__bar { display: flex; height: 54px; margin-bottom: 18px; box-shadow: inset 0 0 0 1px var(--ink); }
.cap__bar i { --w: 0%; flex: 0 0 var(--w); transition: flex-basis .8s cubic-bezier(.2, .7, .2, 1); border-right: 1px solid var(--paper); }
.cap__bar i:nth-child(1) { background: var(--ink); }
.cap__bar i:nth-child(2) { background: color-mix(in oklch, var(--ink) 70%, var(--paper)); }
.cap__bar i:nth-child(3) { background: color-mix(in oklch, var(--ink) 45%, var(--paper)); }
.cap__bar i:nth-child(4) { background: repeating-linear-gradient(135deg, color-mix(in oklch, var(--ink) 30%, var(--paper)) 0 2px, transparent 2px 6px); }
.cap__bar i:nth-child(5) { background: var(--you); min-width: 0; }
table { width: 100%; border-collapse: collapse; }
th { font: 600 .66rem/1.2 var(--sans); font-stretch: 115%; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--ink); }
td { padding: 9px 8px 9px 0; border-bottom: 1px solid color-mix(in oklch, var(--ink) 16%, transparent); vertical-align: middle; }
th.num, td.num { text-align: right; }
.cap__table .sw { display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: baseline; box-shadow: inset 0 0 0 1px var(--ink); }
.cap__table tr.is-you td { color: var(--you); font-weight: 600; }
.cap__table tr.is-you.is-changed td { animation: ink-in 1.2s ease-out both; }
@keyframes ink-in { from { background: color-mix(in oklch, var(--brass) 40%, transparent); } }

/* The after-hours film: a second full viewport, dark on purpose. */
.night { position: relative; min-height: 92svh; display: grid; align-items: end; color: #f4eedd; isolation: isolate; overflow: clip; padding-top: 0; }
.night__film { position: absolute; inset: 0; z-index: -1; background: #050f0d; }
.night__film::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, rgb(5 15 13 / .88) 0%, rgb(5 15 13 / .55) 45%, transparent 75%); }
.night__body { max-width: 34rem; display: grid; gap: 20px; justify-items: start; }
.night h2 { font: 400 clamp(2.4rem, 6vw, 5.6rem)/.95 var(--serif); letter-spacing: -.02em; }
.night p { color: #d9d1bc; font-size: 1.0625rem; }

/* III · the market: a newspaper stock table, dense. */
.floor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: clamp(20px, 3vw, 48px); align-items: start; }
.controls { display: grid; grid-template-columns: 1fr 200px; gap: 16px; margin-bottom: 8px; }
.table-scroll { overflow-x: auto; }
.quotes tbody tr { cursor: pointer; }
.quotes td.num { white-space: nowrap; }
.quotes tbody tr:hover, .quotes tbody tr[aria-selected='true'] { background: var(--paper-2); }
.quotes tbody tr[aria-selected='true'] td:first-child { box-shadow: inset 3px 0 0 var(--brass); }
.co { display: grid; padding-left: 8px; }
.co b { font: 400 1.15rem/1.15 var(--serif); }
.co span { font-size: .78rem; color: var(--ink-2); }
.up { color: var(--up); }
.down { color: var(--down); }
.up::before { content: '▲ '; font-size: .7em; }
.down::before { content: '▼ '; font-size: .7em; }
td.up::before, td.down::before { vertical-align: 1px; }
.spark { width: 84px; height: 24px; }
.quotes .btn--small { min-height: 32px; }
.ticket { position: sticky; top: 20px; padding: 22px; background: var(--paper-2); box-shadow: inset 0 3px 0 var(--ink), inset 0 -1px 0 var(--ink); }
.ticket h3 { font: 400 1.7rem/1.1 var(--serif); }
.ticket__sym { font: 500 .8rem/1 var(--mono); color: var(--ink-2); vertical-align: middle; }
.ticket__price { font-size: 1.15rem; margin: 6px 0 4px; }
.ticket__hint, .ticket__note { font-size: .8rem; color: var(--ink-2); margin: 6px 0 14px; }
.ticket .row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.ticket__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.empty { color: var(--ink-2); padding: 18px 0; }

/* IV · the statement. */
.statement .folio--row { align-items: end; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 32px; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); }
.totals > div { padding: 18px 18px 18px 0; }
.totals > div + div { padding-left: 18px; border-left: var(--rule); }
.totals dt { font: 600 .68rem/1.2 var(--sans); font-stretch: 115%; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.totals dd { margin: 6px 0 0; font-size: clamp(1.5rem, 3.4vw, 2.6rem); line-height: 1; letter-spacing: -.02em; }
.holdings td { font-family: var(--mono); font-size: .92rem; }
.holdings td:first-child { font-family: var(--sans); }

/* V · the raise. */
.raise { background: var(--paper-2); }
.raise__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(24px, 5vw, 80px); }
.split { display: grid; gap: 12px; margin-bottom: 18px; }
.split__row { display: grid; grid-template-columns: 5.5em 1fr; align-items: center; gap: 12px; font: 600 .68rem/1 var(--sans); font-stretch: 115%; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.split__bar { display: flex; height: 38px; box-shadow: inset 0 0 0 1px var(--ink); }
.split__a, .split__b { --w: 0%; flex: 0 0 var(--w); transition: flex-basis .6s cubic-bezier(.2, .7, .2, 1); }
.split__a { background: var(--ink); }
.split__a--full { --w: 100%; }
.split__b { background: var(--brass); }
.split__key { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: .82rem; color: var(--ink-2); }
.key { width: 12px; height: 12px; display: inline-block; }
.key--a { background: var(--ink); }
.key--b { background: var(--brass); }
.out dd { font-family: var(--mono); font-size: 1.05rem; }

/* VI · how: a composed plate, an image and four movements. */
.how { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 0; min-height: 90svh; }
.how__plate { margin: 0; position: relative; overflow: clip; }
.how__plate img { width: 100%; height: 100%; object-fit: cover; }
.how__body { padding: clamp(48px, 7vw, 112px) var(--gutter); align-self: center; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.steps li { display: grid; grid-template-columns: 7.5em 1fr; column-gap: 20px; padding: 18px 0; border-bottom: 1px solid color-mix(in oklch, var(--ink) 20%, transparent); }
.steps__t { grid-row: span 2; font: 500 .8rem/1.6 var(--mono); color: var(--you); }
.steps h3 { font: 400 1.5rem/1.15 var(--serif); }
.steps p { color: var(--ink-2); font-size: .95rem; }

/* VII · risk: the loudest thing on the page after the title. */
.risk { background: var(--ink); color: var(--paper); }
html[data-theme='night'] .risk { background: #f4eedd; color: #102b25; }
.risk__frame { position: relative; padding: clamp(28px, 5vw, 72px); box-shadow: inset 0 0 0 1px var(--brass), inset 0 0 0 7px var(--ink), inset 0 0 0 8px var(--brass); display: grid; grid-template-columns: auto 1fr; column-gap: 28px; }
html[data-theme='night'] .risk__frame { box-shadow: inset 0 0 0 1px #8c6a2b, inset 0 0 0 7px #f4eedd, inset 0 0 0 8px #8c6a2b; }
.risk .folio__no { grid-row: span 3; }
.risk h2 { font: 400 clamp(2.2rem, 5.4vw, 5rem)/.98 var(--serif); letter-spacing: -.015em; max-width: 16ch; }
.risk__list { margin: 28px 0 0; padding: 0; list-style: none; counter-reset: r; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 0 40px; }
.risk__list li { counter-increment: r; padding: 16px 0 16px 3.2em; position: relative; border-top: 1px solid color-mix(in oklch, currentColor 30%, transparent); font-size: 1.05rem; }
.risk__list li::before { content: counter(r, upper-roman) '.'; position: absolute; left: 0; top: 16px; font-family: var(--serif); color: var(--brass); }
html[data-theme='night'] .risk__list li::before { color: #8c6a2b; }
.risk__review { margin-top: 26px; font: 500 .8rem/1.4 var(--mono); letter-spacing: .04em; color: var(--brass); }
html[data-theme='night'] .risk__review { color: #8c6a2b; }

/* VIII · questions. */
.faq__list { max-width: 64rem; }
details { border-bottom: 1px solid color-mix(in oklch, var(--ink) 22%, transparent); }
summary { cursor: pointer; list-style: none; padding: 18px 2.2em 18px 0; position: relative; font: 400 clamp(1.25rem, 2.2vw, 1.7rem)/1.2 var(--serif); }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; position: absolute; right: 4px; top: 16px; font-family: var(--mono); color: var(--brass); transition: rotate .2s; }
details[open] summary::after { rotate: 45deg; }
details p { padding: 0 0 22px; max-width: 64ch; color: var(--ink-2); }

/* Footer. */
.foot { padding: 56px var(--gutter) 40px; display: grid; gap: 16px; }
.foot::before { margin-bottom: 8px; }
.wordmark--foot { width: min(560px, 80vw); }
.foot__pitch { color: var(--ink-2); }
.foot__links { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: .9rem; }
.foot__base { font-size: .78rem; color: var(--ink-2); }
.lang-links { display: flex; gap: 14px; }

/* The function-key bar: the site's navigation, docked at the foot like a terminal's keys. */
.fkeys {
  position: fixed; inset: auto 0 0 0; z-index: 20; height: calc(var(--fk) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: stretch;
  background: var(--bar); color: var(--bar-ink); border-top: 1px solid #c5aa75;
  font: 500 .74rem/1 var(--sans); font-stretch: 108%;
}
.fkeys__keys { display: flex; overflow-x: auto; scrollbar-width: none; }
.fkeys__keys a { display: flex; align-items: center; gap: 7px; padding: 0 14px; text-decoration: none; white-space: nowrap; border-right: 1px solid rgb(197 170 117 / .35); }
.fkeys__keys a:hover, .fkeys__keys a[aria-current='true'] { background: rgb(244 238 221 / .1); }
.fkeys__keys a[aria-current='true'] kbd { background: #c5aa75; color: #102b25; }
kbd { font: 600 .62rem/1 var(--mono); padding: 3px 4px; box-shadow: inset 0 0 0 1px #c5aa75; color: #c5aa75; }
.fkeys__tape { overflow: hidden; display: flex; align-items: center; mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); }
.fkeys__track { display: flex; gap: 28px; white-space: nowrap; font-family: var(--mono); animation: tape-run 60s linear infinite; padding-left: 20px; }
.fkeys__track .up::before, .fkeys__track .down::before { font-size: .8em; }
.fkeys__track .up { color: #8ee0a8; }
.fkeys__track .down { color: #f2a08b; }
.fkeys__track b { color: #c5aa75; font-weight: 600; }
.ticker__item { display: inline-flex; gap: 10px; }
@keyframes tape-run { to { translate: -50% 0; } }
.fkeys__btn { display: flex; align-items: center; gap: 6px; padding: 0 14px; background: transparent; color: inherit; border: 0; border-left: 1px solid rgb(197 170 117 / .35); border-radius: 0; font: inherit; cursor: pointer; white-space: nowrap; }
.fkeys__btn[aria-pressed='true'] { background: #c5aa75; color: #102b25; }
.fkeys a:focus-visible, .fkeys__btn:focus-visible { outline: 2px solid #c5aa75; outline-offset: -3px; }

/* Language dialog. */
.lang-dialog { border: 0; border-radius: 0; padding: 0; background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--brass), inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--brass); width: min(360px, 92vw); }
.lang-dialog::backdrop { background: rgb(16 43 37 / .55); }
.lang-dialog__box { padding: 26px; }
.lang-dialog__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.lang-dialog h2 { font: 400 1.6rem/1 var(--serif); }
.lang-dialog__close { background: none; border: 0; font: 400 1.6rem/1 var(--sans); color: var(--ink); cursor: pointer; width: 44px; height: 44px; }
.lang-list { list-style: none; margin: 0; padding: 0; }
.lang-list a { display: block; padding: 12px 0; border-bottom: 1px solid color-mix(in oklch, var(--ink) 20%, transparent); text-decoration: none; font-size: 1.05rem; }
.lang-list a[aria-current='true']::after { content: ' ◆'; color: var(--brass); }

.toast { position: fixed; left: 50%; bottom: calc(var(--fk) + 18px); translate: -50% 12px; opacity: 0; z-index: 30; pointer-events: none; background: var(--ink); color: var(--paper); padding: 12px 18px; box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 4px var(--brass); font-size: .9rem; transition: opacity .25s, translate .25s; max-width: 90vw; }
.toast[data-show='true'] { opacity: 1; translate: -50% 0; }

/* Scroll-driven entrances where the browser has them; the page reads complete without. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .folio__title, .folio__no { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .ladder li, .steps li, .risk__list li { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
    .hero__title { animation: lift linear both; animation-timeline: scroll(root); animation-range: 0 100svh; }
    .how__plate img { animation: drift linear both; animation-timeline: view(); }
  }
}
@keyframes settle { from { opacity: 0; translate: 0 18px; } }
@keyframes lift { to { translate: 0 -12vh; opacity: .3; } }
@keyframes drift { from { scale: 1.12; translate: 0 -3%; } to { scale: 1; translate: 0 3%; } }

/* View transitions between the light and the after-hours paper. */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .5s; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .fkeys__track { animation: none; }
}

/* 1100 and down: the book stacks two over one. */
@media (max-width: 1100px) {
  .book { grid-template-columns: 1fr; }
  .vignette { grid-column: 1; grid-row: auto; max-width: 560px; margin-bottom: 8px; }
  .book__grid { grid-template-columns: 1fr 1fr; }
  .cap { grid-column: 1 / -1; border-left: 0 !important; border-top: var(--rule); }
  .folio--row { grid-template-columns: auto 1fr auto; }
  .folio--row .folio__lead { grid-column: 2 / -1; }
  .floor { grid-template-columns: minmax(0, 1fr); }
  .ticket { position: static; }
  .fkeys__tape { display: none; }
  .fkeys { grid-template-columns: minmax(0, 1fr) auto auto; }
}

/* 768 and down: one column; the plate shorter, the title still loud. */
@media (max-width: 768px) {
  .hero__body { grid-template-columns: 1fr; }
  .hero__film::after { background: linear-gradient(to top, var(--paper) 0%, var(--paper) 52%, transparent 85%); }
  .book__grid { grid-template-columns: 1fr; }
  .book__grid > * + * { border-left: 0; border-top: var(--rule); }
  .raise__grid, .how { grid-template-columns: 1fr; }
  .how__plate { aspect-ratio: 16 / 9; }
  .risk__frame { grid-template-columns: 1fr; }
  .risk .folio__no { grid-row: auto; margin-bottom: 8px; }
  .totals { grid-template-columns: 1fr; }
  .totals > div + div { padding-left: 0; border-left: 0; border-top: var(--rule); }
  .hide-sm { display: none; }
  .controls { grid-template-columns: 1fr; }
  .fkeys__btn .label { display: none; }
  .night__film::after { background: linear-gradient(to top, rgb(5 15 13 / .94) 0%, rgb(5 15 13 / .7) 45%, transparent 80%); }
  .fkeys__keys { scroll-snap-type: x mandatory; }
  .fkeys__keys a { scroll-snap-align: start; }
}

/* 390: the thumb's page. */
@media (max-width: 480px) {
  .mast { padding-top: 16px; }
  .mast__flag { font-size: .6rem; letter-spacing: .1em; padding: 6px 8px; }
  .film-toggle { top: 64px; }
  .hero { grid-template-rows: minmax(116px, 1fr) auto; }
  .hero__title { font-size: clamp(2.6rem, 13vw, 3.6rem); }
  .quote { grid-template-columns: repeat(3, 1fr); }
  .quote__name { grid-column: 1 / -1; border-bottom: var(--rule); }
  .quote > div:nth-child(2) { padding-left: 0; border-left: 0; }
  .acts .btn { flex: 1 1 100%; }
  .folio--row { grid-template-columns: auto 1fr; }
  .folio--row > .btn { grid-column: 1 / -1; justify-self: start; margin-top: 14px; }
  .folio--row .folio__lead { grid-column: 1 / -1; margin-top: 10px; }
  .steps li { grid-template-columns: 1fr; }
  .steps__t { grid-row: auto; }
  .fkeys__keys a { padding: 0 11px; }
  .fkeys__keys kbd { display: none; }
  .co span { display: none; }
  .co b { font-size: 1rem; }
  .quotes .btn--small { padding: 0 9px; font-size: .62rem; letter-spacing: .04em; }
}

/* 320: nothing sideways. */
@media (max-width: 340px) {
  .wordmark { width: 118px; }
  .mast__flag { display: none; }
  .fkeys { font-size: .68rem; }
  .fkeys__keys a { padding: 0 9px; }
  .ticket__acts { grid-template-columns: 1fr; }
  .quote dd { font-size: 1.05rem; }
  .quotes th, .quotes td { padding-right: 5px; }
  .co { padding-left: 4px; }
}

@media print {
  .fkeys, .film, .film-toggle, .toast { display: none; }
  body { padding: 0; }
}
