/* runlaw: the printed annual. Sand paper, one cobalt, Hanken Grotesk. */
:root {
  --bg: #e6dbc7;
  --surface: #ddd0b9;
  --ink: #062b8a;
  --muted: #3a5aa8;
  --deep: #03184f;
  --accent: #062b8a;
  --accent-ink: #e6dbc7;
  --on-deep: #e6dbc7;

  --font: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --code: ui-monospace, /* taste-skill-ignore: literal code only */ "SFMono-Regular", Menlo, Consolas, monospace;

  /* five sizes: small, body, lead, head, display */
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.5rem, 1.2rem + 4.6vw, 6rem);
  --step-display: clamp(5.5rem, 12.5vw, 12rem);

  --m: clamp(16px, 2vw, 28px);      /* the one pair of page margins */
  --gap: 8px;                        /* board gaps */
  --col: 24px;                       /* grid gutter */
  --axis: 42%;                       /* the column line text hangs from */
  --sec: clamp(96px, 14vw, 200px);   /* between sections */

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--step-body)/1.45 var(--font); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
b, strong { font-weight: 500; }
b.k { font-weight: 700; }  /* the words of the subject, bolded now and then */
code, pre { font-family: var(--code); font-size: 0.88em; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
table.sr { width: 1px !important; margin: 0 !important; }  /* chart tables for screen readers; .prose tables would widen them */
.skip { position: absolute; left: var(--m); top: -60px; z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 14px; }
.skip:focus { top: var(--m); }

.link, .page a, .faq a, .prose a, .foot a, .close a, .tile--accent a {
  text-decoration: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.18em;
  transition: text-decoration-color 160ms ease;
}

/* ---------- buttons: square, one fill ---------- */
.button {
  display: inline-flex; align-items: center; min-height: 56px; padding: 0 26px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 0;
  font: 500 var(--step-body)/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform 120ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.button:active { transform: scale(0.97); }
.button--inv { background: var(--bg); color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--deep); }
  .button--inv:hover { background: #fff6e6; }
  .link:hover, .page a:hover, .faq a:hover, .prose a:hover { text-decoration-color: transparent; }
}

/* ---------- the board's top row, used on every page ---------- */
.board-top {
  display: grid; grid-template-columns: 60px 1fr auto; gap: var(--gap);
  padding: var(--m) var(--m) 0; height: calc(60px + var(--m));
}
.tile { background: var(--surface); }
.tile--mark { background: var(--ink); display: grid; place-items: center; }
.mark { width: 26px; height: 26px; background: var(--bg); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0, 38% 18%, 38% 82%, 62% 82%, 62% 18%, 38% 18%); }
.tile--links { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); padding: 0 20px 0 calc(50% - 60px - var(--gap)); }
.tile--links a { text-decoration: none; font-weight: 500; white-space: nowrap; transition: color 160ms ease; }
.tile--links a[aria-current] { text-decoration: underline; text-underline-offset: 0.2em; }
.tile--action {
  background: var(--ink); color: var(--bg); display: flex; align-items: center; padding: 0 26px;
  font-weight: 500; text-decoration: none; transition: background-color 160ms ease, transform 120ms var(--ease-out);
}
.tile--action:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .tile--links a:hover { color: var(--deep); text-decoration: underline; text-underline-offset: 0.2em; }
  .tile--action:hover { background: var(--deep); }
}

/* ---------- hero: two by two ---------- */
.board {
  display: grid; gap: var(--gap); padding: var(--gap) var(--m) 0;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  height: calc(100svh - 60px - var(--m)); min-height: 620px; max-height: 1100px;
}
.tile--name { display: flex; align-items: flex-end; padding: 24px; background: var(--bg); }
.tile--name h1 { font-weight: 500; }
.tile--name .name { display: block; font-size: var(--step-display); line-height: 0.82; letter-spacing: -0.05em; margin-left: -0.04em; }
.tile--name .what { display: block; margin-top: 20px; font-size: var(--step-lead); letter-spacing: -0.01em; line-height: 1.2; }
.tile--pic { overflow: hidden; background: var(--deep); }
.tile--pic img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.tile--pic { object-position: center; }
.board .tile--pic:first-of-type img { object-position: 50% 30%; }
.tile--pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-width: 0; gap: var(--gap); background: none; }
.tile--pair p { padding: 24px; font-size: var(--step-lead); line-height: 1.22; letter-spacing: -0.01em; }
.tile--deep { background: var(--deep); color: var(--on-deep); }
.tile--accent { background: var(--accent); color: var(--accent-ink); }
.tile--accent a { display: inline-block; margin-top: 0.4em; font-weight: 500; }

/* ---------- shared section frame ---------- */
.sec { padding: var(--sec) var(--m) 0; }
.head { font-size: var(--step-head); font-weight: 500; line-height: 0.95; letter-spacing: -0.045em; max-width: 14ch; }
.lead { font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.01em; max-width: 34ch; }

/* ---------- how: stages as one bar ---------- */
.how .head { margin-bottom: 64px; max-width: none; }
.stages { display: flex; gap: 6px; }
.stage { display: flex; flex-direction: column; gap: 18px; min-width: 12%; }
.stage .seg { display: block; height: 22vh; min-height: 150px; padding: 20px; }
.dur { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.clause { max-width: 24ch; font-size: var(--step-body); }
.clause code { font-size: 0.85em; background: var(--surface); padding: 0 0.25em; }
.s1 { flex: 12; } .s1 .seg { background: var(--surface); }
.s2 { flex: 12; } .s2 .seg { background: var(--muted); color: var(--bg); }
.s3 { flex: 40; } .s3 .seg { background: var(--ink); color: var(--bg); }
.s4 { flex: 36; } .s4 .seg { background: var(--deep); color: var(--bg); }

/* ---------- the live ruling: input half, output half ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; margin-top: var(--sec); min-height: 100svh; }
.split__in, .split__out { position: relative; padding: 12vh var(--m) 140px; }
.split__in { background: var(--deep); color: var(--on-deep); padding-left: calc(var(--m) + 4vw); }
.split__out { background: var(--bg); display: flex; justify-content: flex-start; padding-left: clamp(24px, 5vw, 80px); }
/* The editor: a transparent textarea over its own highlighted copy, with identical metrics. */
.editor { position: relative; width: 100%; max-width: 640px; height: min(58vh, 520px); background: #0a2466; transition: background-color 160ms ease; }
.editor:focus-within { outline: 3px solid var(--bg); outline-offset: 0; background: #0c2a75; }
.editor__hl, .policy-src {
  position: absolute; inset: 0; margin: 0; padding: 18px; border: 0; border-radius: 0;
  font: 400 14px/1.6 var(--code); tab-size: 2; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
}
.editor__hl { overflow: hidden; color: #c7d3f5; pointer-events: none; background: none; }
.policy-src { width: 100%; height: 100%; resize: none; overflow: auto; background: transparent; color: transparent; caret-color: #fff; }
.policy-src:focus { outline: none; }
/* no scrollbar: it would narrow the textarea and its wrapping would part from the copy behind */
.policy-src { scrollbar-width: none; }
.policy-src::-webkit-scrollbar { display: none; }
.policy-src::selection { background: rgba(230, 236, 255, 0.28); color: transparent; }
.policy-state { max-width: 640px; margin-top: 14px; font-size: var(--step-small); min-height: 2.9em; }
.policy-state[data-bad] { color: #ffd2b8; }
.split__h { position: absolute; bottom: 32px; font-size: clamp(2.5rem, 5vw, 5rem); font-weight: 500; letter-spacing: -0.045em; line-height: 1; }
.split__h--l { left: calc(var(--m) + 4vw); }
.split__h--r { right: var(--m); }

.ruling { width: min(100%, 540px); background: #efede8; color: #12204a; font-size: 16px; line-height: 1.45; align-self: flex-start; }
.ruling__row { padding: 16px 18px; border-bottom: 1px solid #ddd5c6; } /* taste-skill-ignore: data-ui fragment */
.ruling label, .ruling__k { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: #3a4a78; }
.ruling textarea, .ruling input {
  width: 100%; border: 1px solid #d3c5ac; border-radius: 0; background: #fff; color: #12204a;
  font: 400 16px/1.45 var(--font); padding: 10px 12px; resize: vertical;
  transition: border-color 160ms ease;
}
.ruling input { width: 140px; font-variant-numeric: tabular-nums; }
.ruling textarea:focus, .ruling input:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
.ruling__tool code { font-size: 14px; }
.ruling__verdict { padding: 16px 18px; background: #ebe6dd; border-bottom: 1px solid #ddd5c6; } /* taste-skill-ignore: data-ui fragment */
.ruling__outcome { display: inline-block; padding: 4px 10px; font-size: 16px; font-weight: 500; background: var(--ink); color: #fff; }
.ruling__outcome[data-o="pass"] { background: #d3c5ac; color: #12204a; }
.ruling__outcome[data-o="blocked"] { background: #12204a; }
.ruling__events { margin-top: 12px; display: grid; gap: 10px; }
.ruling__events li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.ruling__events b { font-weight: 500; }
.ruling__events em { font-style: normal; font-size: 14px; font-weight: 500; color: var(--ink); justify-self: end; }
.ruling__events span { grid-column: 1 / -1; color: #3a4a78; font-size: 14px; }
.ruling__fwd { font-size: 16px; white-space: pre-wrap; word-break: break-word; }

/* ---------- connect: a text page on the axis ---------- */
.page { display: grid; grid-template-columns: var(--axis) minmax(0, 1fr); column-gap: var(--col); }
.page__side { padding-top: 12px; padding-right: 6vw; font-size: var(--step-small); align-self: start; position: sticky; top: 24px; }
.page__side p { max-width: 30ch; }
.page__main { min-width: 0; }
.page__main > * + * { margin-top: 28px; }
.page__main p { max-width: 60ch; }
.code { max-width: 760px; min-width: 0; }
.code__k { font-weight: 500; margin: 0 0 10px; }
.code pre { background: var(--deep); color: var(--on-deep); padding: 20px 22px; overflow-x: auto; font-size: 14px; line-height: 1.6; margin: 0 0 28px; }

/* ---------- features: a paragraph with interface words ---------- */
.statement { font-size: clamp(1.5rem, 0.9rem + 2vw, 2.25rem); line-height: 1.3; font-weight: 500; letter-spacing: -0.02em; max-width: 46ch; }
.chip {
  display: inline-block; vertical-align: 0.12em; padding: 0.12em 0.4em 0.16em;
  background: var(--ink); color: var(--bg); font-size: 0.6em; line-height: 1.2; font-weight: 500; letter-spacing: 0;
}
.chip--held { background: var(--muted); }
.chip--blocked { background: var(--deep); }
.chip--rw { background: var(--surface); color: var(--ink); }
.features__more { margin: 72px 0 0 calc((100% - 2 * var(--m)) * 0.5); display: grid; gap: 24px; justify-items: start; max-width: 52ch; }

/* ---------- use cases: pinned index, large picture ---------- */
.work { margin-top: var(--sec); }
.work__stage { height: 100svh; min-height: 640px; max-height: 1000px; display: grid; grid-template-columns: 38% minmax(0, 1fr); }
.work__left { display: flex; flex-direction: column; justify-content: space-between; padding: 40px var(--m) 32px; }
.work__h { font-size: clamp(3rem, 6.2vw, 6rem); font-weight: 500; line-height: 0.95; letter-spacing: -0.045em; max-width: 9ch; }
.work__index li a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; min-height: 48px; text-decoration: none; color: var(--muted); transition: color 200ms ease; }
.work__index li span:first-child { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.015em; }
.work__index .sub { font-size: var(--step-small); text-align: right; }
.work__index li.is-on a { color: var(--ink); }
.work__index li.is-on span:first-child { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.18em; }
.work__index li a:focus-visible { color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .work__index li a:hover { color: var(--ink); } }
.work__pics { position: relative; overflow: hidden; background: var(--deep); margin-right: var(--m); }
.work__pic { position: absolute; inset: 0; clip-path: inset(100% 0 0 0); transition: clip-path 900ms var(--ease-in-out); }
.work__pic.is-on { clip-path: inset(0); z-index: 2; }
.work__pic.is-was { clip-path: inset(0); z-index: 1; }
.work__pic img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.work__pic figcaption {
  position: absolute; left: 0; bottom: 0; max-width: 520px; padding: 22px 24px;
  background: var(--ink); color: var(--bg); font-size: var(--step-lead); line-height: 1.25; letter-spacing: -0.01em;
}

/* ---------- the record: statement, table pushed right ---------- */
.record__h { font-size: clamp(2.5rem, 4.5vw, 4.25rem); font-weight: 500; line-height: 0.98; letter-spacing: -0.04em; text-indent: 3vw; max-width: 16ch; }
.record__body { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--col); margin-top: 96px; }
.record__pic { grid-column: 1 / 5; grid-row: 1 / 3; align-self: end; }
.record__pic .vid { aspect-ratio: 4 / 5; position: relative; overflow: hidden; background: var(--deep); }
.record__pic .vid img, .record__pic .vid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.record__pic figcaption { margin-top: 10px; font-size: var(--step-small); }
.record__name { grid-column: 7 / 8; font-size: var(--step-small); font-weight: 500; padding-top: 2px; }
.record__table { grid-column: 8 / 13; border-collapse: collapse; font-size: 16px; font-variant-numeric: tabular-nums; }
.record__table th, .record__table td { padding: 0 0 26px; text-align: left; vertical-align: top; font-weight: 400; }
.record__table th { color: var(--muted); width: 26%; padding-right: 12px; }
.record__table td:last-child { text-align: right; white-space: nowrap; padding-left: 16px; }
.record__table tr.grp th, .record__table tr.grp td { padding-top: 18px; }

/* ---------- faq: answers as reading text ---------- */
.faq { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--col); }
.faq__h { grid-column: 1 / 4; font-size: clamp(1.75rem, 1.4rem + 1vw, 2rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.faq__text { grid-column: 5 / 13; columns: 2; column-gap: 56px; font-size: 17px; line-height: 1.55; }
.faq__text p { break-inside: avoid; margin-bottom: 20px; }
.faq__text code { font-size: 0.85em; }

/* ---------- the close, inverted ---------- */
.close {
  margin-top: var(--sec); min-height: 92svh; background: var(--ink); color: var(--bg);
  display: flex; flex-direction: column; justify-content: space-between; padding: 12vh var(--m) 40px;
}
.close__h { font-size: clamp(4rem, 10vw, 10rem); font-weight: 500; line-height: 0.9; letter-spacing: -0.05em; max-width: 11ch; }
.close__foot { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--col); align-items: end; margin-top: 80px; }
.close__foot > p { grid-column: 1 / 6; font-size: 20px; max-width: 40ch; }
.close__form { grid-column: 8 / 13; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.close__form label { grid-column: 1 / -1; font-size: var(--step-small); font-weight: 500; }
.close__form input {
  min-height: 56px; border: 0; border-radius: 0; padding: 0 16px; background: #0a3aa8; color: var(--bg);
  font: 400 var(--step-body) var(--font); transition: background-color 160ms ease;
}
.close__form input::placeholder { color: #b6c3e6; }
.close__form input:focus { outline: 3px solid var(--bg); outline-offset: 0; background: #0b3fb6; }
.close__action { grid-column: 10 / 13; justify-self: end; }
.close__note { grid-column: 1 / -1; font-size: var(--step-small); min-height: 1.5em; }

/* ---------- footer: name first ---------- */
.foot { background: var(--deep); color: var(--on-deep); padding: clamp(150px, 14vw, 200px) var(--m) 28px; overflow: hidden; }
.foot__name { font-size: clamp(5rem, 24.5vw, 30rem); font-weight: 500; letter-spacing: -0.06em; line-height: 0.78; padding-top: 0.12em; margin-left: -0.05em; }
.foot__row { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--col); margin-top: 72px; }
.foot__places { grid-column: 1 / 6; display: grid; gap: 6px; }
.foot__places a { font-size: clamp(1.625rem, 1.3rem + 1vw, 2.25rem); letter-spacing: -0.02em; text-decoration: none; }
.foot__cols { grid-column: 7 / 13; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--col); font-size: 15px; }
.foot__cols li + li { margin-top: 8px; }
.foot__cols a { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .foot a:hover { text-decoration: underline; } }
.foot__legal { display: flex; justify-content: space-between; gap: 24px; margin-top: 96px; font-size: 13px; }

/* ---------- subpages ---------- */
.masthead { padding: var(--gap) var(--m) 0; display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.masthead__pic { height: 38svh; min-height: 240px; overflow: hidden; background: var(--deep); }
.masthead__pic img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.masthead__text { display: grid; grid-template-columns: var(--axis) 1fr; column-gap: var(--col); padding: 64px 0 0; }
.masthead__text h1 { grid-column: 2; font-size: var(--step-head); font-weight: 500; line-height: 0.95; letter-spacing: -0.045em; max-width: 13ch; }
.masthead__text .lead { grid-column: 2; margin-top: 32px; max-width: 40ch; }
.doc { display: grid; grid-template-columns: var(--axis) minmax(0, 1fr); column-gap: var(--col); padding: var(--sec) var(--m) 0; }
.doc__toc { position: sticky; top: 24px; align-self: start; display: grid; gap: 8px; font-size: var(--step-small); padding-right: 6vw; }
.doc__toc a { text-decoration: none; color: var(--muted); transition: color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .doc__toc a:hover { color: var(--ink); } }
.prose { min-width: 0; overflow-wrap: anywhere; }
.prose p, .prose ul, .prose ol { max-width: 68ch; }
.prose h2 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; margin: 72px 0 20px; scroll-margin-top: 24px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.01em; margin: 40px 0 12px; scroll-margin-top: 24px; }
.prose p, .prose ul, .prose ol, .prose pre, .prose table, .prose dl { margin-bottom: 18px; }
.prose ul { list-style: square; padding-left: 1.2em; }
.prose ol { list-style: decimal; padding-left: 1.3em; }
.prose li + li { margin-top: 6px; }
.prose code { background: var(--surface); padding: 0.05em 0.3em; }
.prose pre { background: var(--deep); color: var(--on-deep); padding: 20px 22px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid #cbbda2; }
.prose th { font-weight: 500; }
.prose tr:nth-child(even) td { background: transparent; }

/* use cases page: alternating text pages and colour pages */
.case { display: grid; grid-template-columns: var(--axis) minmax(0, 1fr); column-gap: var(--col); padding: var(--sec) var(--m) 0; scroll-margin-top: 0; }
.case__pic { position: sticky; top: var(--m); align-self: start; }
.case__pic img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.case__pic figcaption { margin-top: 10px; font-size: var(--step-small); }
.case__text { min-width: 0; }
.case__text h2 { font-size: clamp(2.25rem, 1.2rem + 3.4vw, 4.5rem); font-weight: 500; line-height: 0.98; letter-spacing: -0.045em; max-width: 13ch; }
.case__text .lead { margin-top: 28px; max-width: 40ch; }
.case__facts { margin-top: 40px; display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 18px 24px; }
.case__facts dt { font-weight: 500; }
.case__facts dd { margin: 0; }
.case__text pre { margin-top: var(--gap); background: var(--deep); color: var(--on-deep); padding: 20px 22px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.case--deep { background: var(--deep); color: var(--on-deep); margin-top: var(--sec); padding-bottom: var(--sec); }
.case--deep pre { background: #0a2466; }

/* a data page: a narrow contents column, so charts and tables get the width */
.doc--wide { grid-template-columns: minmax(160px, 16%) minmax(0, 1fr); }
.doc--wide .prose > p, .doc--wide .prose > ul { max-width: 72ch; }

/* results: large figures, and charts drawn as interface fragments */
.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--col); margin: 0; }
.figs .figs__n { margin-bottom: 14px; font-size: clamp(2.75rem, 1.5rem + 3.4vw, 5rem); font-weight: 500; letter-spacing: -0.045em; line-height: 0.95; }
.figs p { max-width: 34ch; }
.viz-fig { margin: 24px 0 28px; }
.fairmap-wrap { position: relative; }
.fairmap-field { position: absolute; display: block; }
.viz-fig svg.fairmap { position: relative; display: block; width: 100%; height: auto; font-family: var(--font); }
.viz-fig svg.fairmap circle { cursor: help; }
.viz-fig svg.bars { display: block; width: 100%; height: auto; font-family: var(--font); }
.viz-fig figcaption { font-size: var(--step-small); margin-top: 8px; }
.held { font-size: var(--step-small); font-weight: 500; background: var(--surface); padding: 1px 6px; margin-left: 6px; white-space: nowrap; }

/* a gutterless mosaic: pictures butted against one flat colour tile */
.mosaic { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: var(--sec) var(--m) 0; height: clamp(220px, 32vh, 340px); }
.mosaic__pic { overflow: hidden; background: var(--deep); }
.mosaic__pic img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.mosaic__tile { background: var(--ink); color: var(--bg); padding: 22px; font-size: var(--step-lead); line-height: 1.2; letter-spacing: -0.01em; text-decoration: none; transition: background-color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .mosaic__tile:hover { background: var(--deep); } }
.nf { display: grid; gap: 32px; }
.nf__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.button--soft { background: var(--surface); color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .button--soft:hover { background: #d3c4a9; } }

/* ---------- motion: entrances, shutter, never hide content without script ---------- */
/* Phones and tablets show every section's parts at once; the entrances are a desktop layer. */
@media (prefers-reduced-motion: no-preference) and (min-width: 901px) {
  .js .rv { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
  .js .rv.d1 { transition-delay: 80ms; } .js .rv.d2 { transition-delay: 160ms; } .js .rv.d3 { transition-delay: 240ms; }
  .js .rv.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .shutter { clip-path: inset(0 0 100% 0); transition: clip-path 1100ms var(--ease-in-out); }
  .js .shutter img { transform: scale(1.12); transition: transform 1500ms var(--ease-soft); }
  .js .shutter.is-in { clip-path: inset(0); }
  .js .shutter.is-in img { transform: none; }
  .tile--pic2 img { animation: drift 24s var(--ease-in-out) infinite alternate; }
  @keyframes drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.12) translate(-2%, -1.5%); } }
}
@media (prefers-reduced-motion: reduce) { .work__pic { transition: none; } }

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .tile--links { padding-left: 20px; }
  .tile--pair p { font-size: 1.125rem; }
  .faq__text { grid-column: 4 / 13; }
  .record__table { grid-column: 6 / 13; }
  .record__name { grid-column: 5 / 6; }
}
@media (max-width: 900px) {
  .board { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; height: auto; max-height: none; min-height: 0; gap: 6px; }
  .tile--name { min-height: 34svh; }
  .tile--name .name { font-size: 22vw; }
  .tile--pic { aspect-ratio: 4 / 3; }
  .tile--pic2 { display: none; }
  .tile--pair { gap: 6px; }
  .tile--pair p { aspect-ratio: 1; font-size: clamp(1rem, 3.6vw, 1.375rem); padding: 16px; }
  .stages { flex-direction: column; }
  .stage { min-width: 0; flex: none !important; gap: 10px; }
  .stage .seg { height: auto; }
  .s1 .seg, .s2 .seg { min-height: 72px; } .s3 .seg { min-height: 200px; } .s4 .seg { min-height: 180px; }
  .clause { max-width: none; }
  .split { grid-template-columns: 1fr; }
  .split__in, .split__out { padding: 48px var(--m) 110px; }
  .split__h { font-size: 11vw; bottom: 24px; }
  .split__h--l { left: var(--m); }
  .editor { height: 420px; }
  .editor__hl, .policy-src { font-size: 13px; }
  .page, .doc, .doc--wide, .case, .masthead__text { grid-template-columns: minmax(0, 1fr); }
  .page__side { position: static; order: 2; padding: 0; margin-top: 28px; }
  .doc__toc { position: static; padding: 0 0 40px; grid-template-columns: 1fr 1fr; }
  .masthead__text h1, .masthead__text .lead { grid-column: 1; }
  .masthead__text { padding-top: 40px; }
  .case__pic { position: static; margin-bottom: 32px; }
  .case__pic img { aspect-ratio: 4 / 3; }
  .case__facts { grid-template-columns: 1fr; gap: 4px; }
  .lead, .case__text .lead, .masthead__text .lead, .page__main p { max-width: none; }
  .case__facts dd { margin-bottom: 14px; }
  .features__more { margin-left: 0; }
  .work__stage { height: auto; max-height: none; min-height: 0; grid-template-columns: 1fr; }
  .work__left { padding: 40px var(--m) 24px; }
  .work__h { font-size: 14vw; }
  .work__index { display: none; }
  .work__pics { overflow: visible; background: none; display: grid; gap: 6px; padding: 0 var(--m); margin: 0; }
  .work__pic { position: relative; clip-path: none; }
  .work__pic img { aspect-ratio: 4 / 3; height: auto; }
  .work__pic figcaption { position: static; max-width: none; font-size: 1.0625rem; }
  .record__body { grid-template-columns: 1fr; margin-top: 48px; }
  .record__pic, .record__table, .record__name { grid-column: 1; grid-row: auto; }
  .record__name { display: none; }
  .record__pic { width: 60%; justify-self: end; margin-top: 32px; order: 2; }
  .record__h { font-size: 9.5vw; text-indent: 0; }
  .faq { grid-template-columns: 1fr; }
  .faq__h { grid-column: 1; margin-bottom: 24px; font-size: 1.5rem; }
  .faq__text { grid-column: 1; columns: 1; font-size: 16px; }
  .close { min-height: 0; padding-top: 72px; }
  .close__foot { margin-top: 96px; }
  .close__h { font-size: 15vw; }
  .close__foot { grid-template-columns: 1fr; gap: 28px; }
  .close__foot > p, .close__form { grid-column: 1; font-size: 17px; }
  .close__action { justify-self: start; }
  .foot__row { grid-template-columns: 1fr; gap: 40px; }
  .foot__places, .foot__cols { grid-column: 1; }
  .foot__places a { font-size: 1.625rem; }
  .foot__cols { grid-template-columns: 1fr 1fr; }
  .foot__legal { flex-direction: column; gap: 12px; }
  .figs { grid-template-columns: 1fr; gap: 32px; }
  .figs p { max-width: none; }
  .mosaic { grid-template-columns: 1fr 1fr; height: auto; }
  .mosaic__pic { aspect-ratio: 1; }
  .mosaic__tile { aspect-ratio: 1; font-size: 1.125rem; }
}
@media (max-width: 640px) {
  .board-top { grid-template-columns: 52px 1fr auto; height: calc(52px + var(--m)); gap: 6px; }
  .tile--links { gap: 14px; padding: 0 12px; overflow-x: auto; font-size: 15px; }
  .tile--links a:nth-child(-n+2) { display: none; }
  .tile--action { padding: 0 14px; font-size: 15px; }
  .close__form { grid-template-columns: 1fr; }
  .close__form .button { justify-content: center; }
  .record__table { font-size: 15px; }
  .record__table th { width: 30%; }
}

/* monochrome code: shades of blue on the deep ground */
pre code { color: #c7d3f5; }
.tk-k { color: #e6ecff; }
.tk-s { color: #8fa9ee; }
.tk-n { color: #ffffff; }
.tk-c { color: #6b80bf; }
.tk-p { color: #93a3d4; }
