:root {
  color-scheme: dark;
  --ground: #16130f;
  --ink: #ebe9e5;
  --soft: #b8ae9f;
  --field: #221d17;
  --seal: #c2312a;
  --seal-ink: #ffffff;
  --seal-text: #e0574d; /* vermilion for text on the dark ground, 4.97:1 */
  --ok: #7fb37a;
  --font: "Schibsted Grotesk", system-ui, sans-serif;
  --deva: "Tiro Devanagari Marathi", serif;
  --line: #2e2721;
  --line-strong: #4a4036;
  --seal-hover: #a92a24;
  --mono: /* taste-skill-ignore: code blocks only */ ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  --edge: clamp(16px, 4vw, 48px);
  /* five sizes: display, heading, lead, body, small. Each scales down to a phone. */
  --s-display: clamp(44px, 9.5vw, 160px);
  --s-heading: clamp(30px, 4.4vw, 64px);
  --s-lead: clamp(18px, 1.5vw, 22px);
  --s-body: clamp(16px, 15px + 0.25vw, 18px);
  --s-small: 14px;
  --gap: clamp(88px, 11vw, 168px); /* between sections */
  --radius: 6px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 var(--s-body)/1.55 var(--font); }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--edge); top: 8px; background: var(--ink); color: var(--ground); padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--seal); outline-offset: 3px; }

/* Header: the same on every page. Under 900px the links fold into a menu. */
.bar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  height: 64px; padding: 0 var(--edge); background: var(--ground); }
.wordmark { flex-shrink: 0; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.wordmark img { width: 28px; height: 28px; }
.bar nav { display: flex; align-items: center; gap: 4px; font-size: 15px; }
.bar nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--soft); padding: 8px 12px; border-radius: var(--radius); transition: color .15s ease, background .15s ease; }
.bar nav a:hover { color: var(--ink); background: var(--field); }
.bar nav a[aria-current="page"] { color: var(--ink); }
.bar nav a.action { margin-left: 12px; color: var(--seal-ink); background: var(--seal); font-weight: 500; padding: 8px 16px; }
.bar nav a.action:hover { background: var(--seal-hover); }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  background: var(--field); border-radius: var(--radius); font-size: 15px; font-weight: 500; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
.menu[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.menu nav { position: absolute; right: 0; top: calc(100% + 10px); width: min(280px, calc(100vw - 2 * var(--edge))); display: grid; gap: 2px; padding: 8px;
  background: #1d1914; border-radius: 10px; box-shadow: 0 24px 48px rgb(0 0 0 / 0.45); /* taste-skill-ignore: the open menu floats over the page */ }
.menu nav a { padding: 12px 14px; font-size: 16px; }
.menu nav a.action { margin: 6px 0 0; text-align: center; }
@media (max-width: 900px) { .bar > nav { display: none; } .menu { display: block; } }

section { padding: 0 var(--edge); margin: 0 0 var(--gap); }
h1 { font-weight: 800; font-size: var(--s-display); line-height: 0.92; letter-spacing: -0.045em; margin: 0 0 clamp(20px, 3vw, 32px); }
h1, h2 { text-wrap: balance; }
h2 { font-weight: 800; font-size: var(--s-heading); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 clamp(18px, 2.4vw, 28px); max-width: 16ch; }
.lede { font-size: var(--s-lead); line-height: 1.5; color: #d9d4cc; max-width: 40ch; margin: 0 0 clamp(28px, 4vw, 40px); }
.note { color: var(--ink); max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* Buttons: one primary per view, secondaries a filled step darker. 48px tall, so they are easy to hit on a phone. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  background: var(--seal); color: var(--seal-ink); border: 0; border-radius: var(--radius);
  font: 500 16px/1.2 var(--font); letter-spacing: -0.005em; text-decoration: none; max-width: 100%; padding-block: 12px; text-align: center; cursor: pointer;
  touch-action: manipulation;
  transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover { background: var(--seal-hover); }
.button:active { transform: translateY(1px); }
.button .arrow { transition: transform .15s ease; }
.button:hover .arrow { transform: translateX(3px); }
.button.quiet { background: var(--tile-2, #2a231b); color: var(--ink); }
.button.quiet:hover { background: #3a3026; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 16px 48px; align-items: center; padding-top: 4vh; min-height: calc(92vh - 64px); }
.seal3d { height: min(76vh, 720px); display: grid; place-items: center; }
.seal3d.live img { display: none; }
.seal3d canvas { width: 100%; height: 100%; display: block; cursor: pointer;
  -webkit-mask-image: radial-gradient( /* taste-skill-ignore: edge fade on the rendered picture */ellipse 58% 62% at 50% 42%, #000 45%, transparent 72%);
  mask-image: radial-gradient( /* taste-skill-ignore */ellipse 58% 62% at 50% 42%, #000 45%, transparent 72%); }
.hint { grid-column: 2; color: var(--soft); font-size: var(--s-small); margin: 0; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 40px; } .hint { grid-column: 1; } .seal3d { height: min(88vw, 420px); } }

.try { background: var(--field); padding-top: clamp(64px, 9vw, 112px); padding-bottom: clamp(64px, 9vw, 112px); }
.sim { display: grid; gap: 32px; margin-top: 40px; }
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  display: grid; place-items: center; font-weight: 800; font-size: var(--s-small); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }


.seal-story { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }
.seal-copy p { max-width: 46ch; }
.plate { margin: 0; }
.plate img { width: 100%; }
.plate.wide { grid-column: 1 / -1; max-width: 760px; justify-self: end; }
figcaption { color: var(--soft); font-size: var(--s-small); margin-top: 10px; }
@media (max-width: 900px) { .seal-story { grid-template-columns: 1fr; } }

.band { margin: 0 0 var(--gap); }
.band img { width: 100%; height: min(78vh, 760px, 110vw); object-fit: cover; }
.band figcaption { padding: 0 var(--edge); }
.plate img.top { aspect-ratio: 4 / 3; object-fit: cover; object-position: top; margin-top: 32px; }

.close { background: #0c0a08; padding: clamp(64px, 9vw, 112px) var(--edge) 48px; }
.close a { color: var(--soft); }
.close a:hover { color: var(--ink); }
.close .big { font-family: var(--deva); font-size: var(--s-display); line-height: 1.1; margin: 0 0 16px; color: var(--seal); }
.close .credits { color: var(--soft); font-size: var(--s-small); max-width: 64ch; }

/* Content is never far from visible: a short rise from 40% opacity, so a fast scroll or a screenshot never lands on an empty section. */
.js .reveal > * { opacity: 0.4; transform: translateY(12px); transition: opacity .45s ease, transform .45s ease; }
.js .reveal.in > * { opacity: 1; transform: none; }
.js .reveal.in > *:nth-child(2) { transition-delay: .08s; }
.js .reveal.in > *:nth-child(3) { transition-delay: .16s; }
.js .reveal.in > *:nth-child(4) { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal > * { opacity: 1; transform: none; }
}

/* Documentation pages generated from docs/*.md */
.doc .doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; padding: clamp(32px, 5vw, 56px) var(--edge) clamp(72px, 10vw, 120px); }
.toc { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow: auto; align-self: start; display: grid; gap: 10px; font-size: var(--s-small); }
.toc a { color: var(--soft); text-decoration: none; }
.toc a:hover { color: var(--ink); }
@media (max-width: 900px) {
  .doc .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 20px; }
  /* On a phone the contents list is one row of chips that scrolls sideways. */
  .toc { position: static; max-height: none; display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--edge)); padding: 0 var(--edge) 6px; scrollbar-width: none; }
  .toc a { flex: none; white-space: nowrap; padding: 8px 14px; background: var(--field); border-radius: 999px; }
}
.prose { max-width: 76ch; min-width: 0; }
.prose h1 { font-size: var(--s-heading); margin-top: 0; }
.prose h2 { font-size: clamp(26px, 3vw, 40px); margin: clamp(48px, 7vw, 72px) 0 16px; scroll-margin-top: 88px; }
.prose h3 { scroll-margin-top: 88px; }
.prose h3 { font-size: var(--s-lead); margin: 40px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.prose a { color: var(--seal-text); }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--field); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.prose pre { background: #0c0a08; border-radius: 8px; padding: 20px; overflow-x: auto; line-height: 1.45; }
.prose pre code { overflow-wrap: normal; }
.prose pre code { background: none; padding: 0; font-size: var(--s-small); }
.prose table { border-collapse: collapse; width: 100%; margin: 24px 0; font-size: var(--s-small); display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #2d261e; vertical-align: top; }
.prose th { color: var(--soft); font-weight: 500; }
.prose blockquote { margin: 24px 0; padding-left: 20px; border-left: 4px solid var(--seal); color: var(--soft); }
.doc .close { padding-top: 48px; }

.hero-name { padding-top: clamp(40px, 8vh, 96px); margin-bottom: clamp(48px, 8vw, 96px); }
.page-meta { color: var(--soft); font-size: var(--s-small); margin-top: 64px; padding: 16px 20px; background: var(--field); border-radius: 4px; }
.page-meta a { color: var(--soft); }

/* ---- The board: sections below the hero are filled tiles fitted with narrow gaps. ---- */
:root { --tile: #1f1a15; --tile-2: #2a231b; --brass: #6e5426; --gap-tile: 8px; }

/* Numbers: a terminal fragment and two figure tiles, touching. */
.mosaic { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; min-height: min(52vw, 640px); margin: 0 calc(-1 * var(--edge)) 32px; }
/* Terminal fragments: the product's own output stands in for pictures. */
.mosaic-term { grid-row: 1 / 3; background: #0c0a08; padding: clamp(20px, 3vw, 44px); display: flex; align-items: center; overflow: hidden; }
.mosaic-term pre, .field-term pre { margin: 0; font: 400 clamp(13px, 1.15vw, 17px)/1.7 var(--mono); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.mosaic-term .dim, .field-term .dim { color: var(--soft); }
.mosaic-term .ok { color: var(--ok); }
.mosaic-term .seal, .field-term .seal { color: var(--seal-text); }
.fig-tile { padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.fig-tile.ink { background: var(--tile-2); }
.fig-tile.seal { background: var(--seal); color: var(--seal-ink); }
.fig-tile .fig { font-weight: 800; font-size: clamp(56px, 6vw, 104px); line-height: 0.9; letter-spacing: -0.04em; margin: 0; }
.fig-tile p { margin: 0; max-width: 30ch; }
.fig-tile a { color: inherit; opacity: 0.85; }
@media (max-width: 760px) {
  .mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .mosaic-term { grid-column: 1 / -1; grid-row: auto; }
  .fig-tile { padding: 18px; }
  .fig-tile .fig { font-size: 13vw; }
}

/* Simulator: capability tiles and the receipt log set as a departure board. */
.try-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; }
@media (max-width: 900px) { .try-head { grid-template-columns: 1fr; } }
.caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--gap-tile); }
.cap { background: var(--ground); padding: 24px; border-radius: 4px; }
.cap p { margin: 0; }
.cap .name { font-weight: 800; font-size: var(--s-lead); }
.cap .level { color: var(--ok); font-size: clamp(28px, 2.6vw, 40px); font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 0; }
.cap .meter { height: 10px; background: var(--tile-2); margin: 18px 0 12px; border-radius: 2px; overflow: hidden; }
.cap .meter span { display: block; height: 100%; background: var(--ok); transition: width .4s ease; }
.cap.demoted .level { color: var(--seal-text); }
.cap.demoted .meter span { background: var(--seal); }
.cap .why { color: var(--soft); font-size: var(--s-small); }
.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.receipts { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; max-height: 420px; overflow: auto; }
.receipts li { background: var(--ground); border-radius: 2px; min-height: 64px; padding: 10px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 16px; align-items: center; animation: rise .35s ease both; }
.receipts li strong { font-weight: 500; font-size: clamp(16px, 1.4vw, 20px); }
.receipts .stamp { grid-row: span 2; width: 44px; height: 44px; background: var(--seal); color: var(--seal-ink);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  display: grid; place-items: center; font-weight: 800; font-size: var(--s-small); }
.receipts .stamp.ok { background: #3f6b3c; }
.receipts code { grid-column: 2; font-size: 13px; color: var(--soft); word-break: break-all; }

/* How it works: the four steps as one bar, widths following how long each really takes. */
.stages { display: flex; gap: 6px; height: clamp(120px, 20vh, 200px); margin-top: 48px; }
.stage { flex-basis: 0; min-width: 14%; border-radius: 4px; padding: clamp(12px, 1.5vw, 20px); overflow-wrap: break-word; }
.stage .dur { margin: 0; font-weight: 800; font-size: clamp(15px, 1.7vw, 28px); letter-spacing: -0.01em; line-height: 1.1; }
/* Widths follow how long each step really takes. */
.g1 { flex-grow: 1; } .g5 { flex-grow: 5; } .g2 { flex-grow: 2.2; }
.s-record { background: var(--tile-2); }
.s-verify { background: #24361f; }
.s-score { background: var(--brass); }
.s-decide { background: var(--seal); color: var(--seal-ink); }
.stage-notes { display: flex; gap: 6px; margin: 16px 0 0; }
.stage-notes > div { flex-basis: 0; min-width: 14%; }
.stage-notes dt { font-weight: 800; }
.stage-notes dd { margin: 4px 0 0; max-width: 34ch; color: var(--soft); font-size: var(--s-small); }
@media (max-width: 760px) {
  .stages, .stage-notes { display: none; }
  .how .stage-notes { display: grid; gap: 6px; }
  .how .stage-notes > div { padding: 20px; border-radius: 4px; background: var(--tile-2); }
  .how .stage-notes > div:nth-child(2) { background: #24361f; }
  .how .stage-notes > div:nth-child(3) { background: var(--brass); }
  .how .stage-notes > div:nth-child(4) { background: var(--seal); }
  .how .stage-notes > div:nth-child(4) dd { color: var(--seal-ink); }
  .how .stage-notes dd { color: var(--ink); }
}

/* Receipt: the JSON as one tall tile beside a board of field tiles. */
.receipt-board { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(150px, auto); gap: var(--gap-tile); margin-top: 40px; }
/* Full-length example hashes, cut to fit by the browser so the markup holds the real value. */
.hash { display: inline-block; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.receipt-json { grid-row: span 4; margin: 0; background: #0c0a08; border-radius: 4px; padding: clamp(18px, 2.4vw, 32px); overflow-x: auto; font: 400 13px/1.6 var(--mono); }
.field-tile { background: var(--tile); border-radius: 4px; padding: 22px; }
.field-tile .key { font-weight: 800; font-size: var(--s-lead); color: var(--seal-text); margin: 0 0 8px; }
.field-tile p { margin: 0; }
.field-tile.seal { background: var(--seal); color: var(--seal-ink); grid-column: span 2; }
.field-tile.seal .key { color: var(--seal-ink); }
.field-tile code { font-size: 0.9em; }
.field-term { grid-column: span 2; background: #0c0a08; border-radius: 4px; padding: 22px; display: grid; gap: 14px; align-content: start; }
.field-term p { margin: 0; }
@media (max-width: 900px) {
  .receipt-board { grid-template-columns: 1fr 1fr; }
  .receipt-json { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 560px) { .receipt-board { grid-template-columns: 1fr; } .field-tile.seal, .field-term { grid-column: auto; } }

/* Trust levels: three fields of colour, the level name the largest thing in each. */
.level-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-tile); margin-top: 40px; }
.level-tile { border-radius: 4px; padding: 28px; min-height: 320px; display: flex; flex-direction: column; gap: 10px; }
.level-tile p { margin: 0; max-width: 32ch; }
.level-tile .lname { font-weight: 800; font-size: clamp(36px, 3.6vw, 56px); letter-spacing: -0.03em; line-height: 1; margin-bottom: 8px; }
.level-tile .gets { margin-top: auto; color: inherit; opacity: 0.8; font-size: var(--s-small); }
.l-ask { background: var(--tile-2); }
.l-sup { background: #4a3a1c; }
.l-trust { background: #24361f; }
@media (max-width: 900px) { .level-board { grid-template-columns: 1fr; } .level-tile { min-height: 0; } }

/* Integrations: a wall of name tiles led by the heading tile. */
.fit-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap-tile); }
.fit-head { grid-column: span 2; grid-row: span 2; background: var(--seal); color: var(--seal-ink); border-radius: 4px; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.fit-head h2 { margin: 0; }
.fit-head p { margin: 0; max-width: 40ch; }
.fit-head a { color: inherit; }
.fit-tile { overflow-wrap: break-word; hyphens: auto; margin: 0; background: var(--tile); border-radius: 4px; padding: 22px; min-height: 140px; font-weight: 800; font-size: clamp(20px, 1.8vw, 28px); letter-spacing: -0.01em; line-height: 1.15; }
@media (max-width: 900px) { .fit-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fit-tile { min-height: 96px; } }

/* Closing row: the accent tile flanked by a photograph and a field, cropped by the page edges. */
.cta { padding: 0; }
.cta-row { display: grid; grid-template-columns: 1fr 4fr 1fr; gap: var(--gap-tile); min-height: 420px; }
.cta-flank { margin: 0; border-radius: 4px; overflow: hidden; }
.cta-flank.field { background: var(--brass); }
.cta-flank.ink { background: var(--tile-2); }
.cta-main { background: var(--seal); color: var(--seal-ink); border-radius: 4px; padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.cta-main h2 { margin: 0; max-width: 18ch; }
.cta-main p { margin: 0; max-width: 56ch; }
.cta-main pre { margin: 0; background: #7d1e19; border-radius: 4px; padding: 16px 18px; overflow-x: auto; font: 400 13px/1.5 var(--mono); }
.button.light { background: var(--seal-ink); color: #3b0e0b; }
.button.light:hover { background: #f2e9e1; }
.button.quiet.on-seal { color: var(--seal-ink); background: #a92a24; }
.button.quiet.on-seal:hover { background: #8f231e; }
@media (max-width: 900px) {
  .cta-row { grid-template-columns: 1fr 1fr; }
  .cta-main { grid-column: 1 / -1; order: -1; }
  .cta-flank { height: 140px; }
}

/* Footer: the name built from blocks of different heights, then plain link columns. */
.close .blocks { display: flex; gap: 4px; align-items: flex-end; height: clamp(140px, 30svh, 300px); margin: 0 0 56px; }
.close .blocks span { flex: 1; display: grid; place-items: center; font-weight: 800; font-size: clamp(56px, 11vw, 200px); line-height: 1; color: #0c0a08; border-radius: 4px; }
.close .blocks span:nth-child(1) { height: 100%; background: var(--seal); }
.close .blocks span:nth-child(2) { height: 72%; background: var(--brass); }
.close .blocks span:nth-child(3) { height: 88%; background: var(--ink); }
.close .blocks span:nth-child(4) { height: 64%; background: #3f6b3c; }
.close .blocks span:nth-child(5) { height: 94%; background: var(--seal-text); }
.foot-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 40px; }
.foot-cols nav { display: grid; gap: 8px; align-content: start; font-size: 15px; }
.foot-cols a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.foot-cols nav { gap: 0; }
@media (max-width: 760px) { .foot-cols { grid-template-columns: 1fr 1fr; } .close .blocks { height: 22svh; } }
