/* IBM Plex, self-hosted. Latin subset only, which is all this site sets.
   Same origin as everything else: no third party learns who reads the
   page, and no second connection has to open before a heading can
   paint. IBM Plex is OFL, so redistributing it here is fine. */

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-500.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-sans-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-sans-400.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-sans-condensed-600.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  /* The accents are the Chrome DevTools box-model overlay: blue is content,
     green is padding, tan is margin. Here they keep meaning: blue is anything
     you can touch, green is what holds, tan is what to watch out for. */
  --content: #6fa8dc;
  --padding: #93c47d;
  --margin: #f6b26b;

  --ink: #0b0e14;
  --surface: #131822;
  --raised: #1a212d;
  --paper: #e6eaf2;
  --muted: #8a94a8;
  --line: #232c3a;
  --code: #c7d2e2;
  --shimmer: #26303f;
  color-scheme: dark;

  --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --display: 'IBM Plex Sans Condensed', var(--sans);
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --gutter: clamp(20px, 4vw, 56px);
}

/* The light theme is the same nine tokens swapped, which is the payoff for
   never having painted a colour outside them. The accents darken because on
   paper they are ink, not light. */
:root[data-theme="light"] {
  --content: #27619b;
  --padding: #3f6a33;
  --margin: #8b530f;

  /* warm paper, and nothing on the page is pure white: the brightest
     surface is bone, which is what keeps a light theme off the eyes */
  --ink: #e4e1d8;
  --surface: #eceae2;
  --raised: #f3f1e9;
  --paper: #23221c;
  --muted: #5f5d52;
  --line: #cfccc0;
  --code: #454a52;
  --shimmer: #dedbd1;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--content); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: blur(8px);
}
.masthead .wrap {
  display: flex;
  /* baseline alignment lines the text up but leaves the whole group hugging
     the top of the bar, which reads as a mistake. Centre the row instead. */
  align-items: center;
  gap: 28px;
  height: 64px;
}
.wordmark {
  font: 600 19px/1 var(--display);
  letter-spacing: 0.01em;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark b { color: var(--content); font-weight: 600; }
.masthead nav { margin-left: auto; display: flex; gap: 22px; }
.masthead nav a {
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
}
.masthead nav a:hover { color: var(--paper); }
.theme {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
}
.theme::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(135deg, currentColor 50%, transparent 50%);
}
.theme:hover { color: var(--paper); border-color: var(--content); }
.theme:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }

/* ---------- hero ---------- */

.hero { padding: clamp(36px, 5.5vw, 68px) 0 clamp(40px, 6vw, 72px); }
.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px clamp(24px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.hero-copy .eyebrow { grid-column: 1 / -1; margin: 0; }
.hero h1 {
  font: 600 clamp(46px, 8.4vw, 112px)/.9 var(--display);
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  color: var(--content);
}
.hero-copy > p:last-child {
  margin: 0 0 .5em;
  color: var(--muted);
  max-width: 44ch;
  font-size: 17px;
}
@media (max-width: 760px) {
  .hero-copy { grid-template-columns: 1fr; }
  .hero-copy > p:last-child { margin: 0; }
}

.eyebrow {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--padding);
  margin: 0 0 18px;
}

/* ---------- the specimen: a floating blob you can tune ---------- */

.specimen {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card, 12px);
  overflow: hidden;
}

.blob-panel { position: relative; min-height: 290px; overflow: hidden; }
.mitosis {
  /* Absolute, so the canvas never feeds its own intrinsic ratio back into
     the panel's height. In flow, `height: 100%` against a parent with only
     a min-height resolves to auto — the canvas then sizes from its bitmap,
     the ResizeObserver sets that bitmap from the panel, and the panel's
     height ends up a function of resize history instead of the 290 here. */
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.blob-controls {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
/* The knobs belong to the toy, not to the panel: sand has nothing to say
   about a bird's size and the flock has no mode to order. Which set is on
   screen is read straight off the panel's own data-toy through :has(), so
   there is no script keeping two lists in step — this site documents that
   selector, it may as well use it. Everything but sand takes the first set,
   so a toy added later gets sensible knobs without being named here. */
.knobs { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
/* .blob-panel and not just [data-toy]: the picker's own buttons carry that
   attribute too, so matching it loosely is true on every page state. */
.specimen:has(.blob-panel[data-toy="sand"]) .knobs--motion,
.specimen:not(:has(.blob-panel[data-toy="sand"])) .knobs--sand { display: none; }

.range-field { display: flex; align-items: center; gap: 10px; font: 400 11px/1 var(--mono); color: var(--muted); }
.range-field input {
  width: 96px;
  appearance: none;
  background: transparent;
}
.range-field input::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: var(--line); }
.range-field input::-moz-range-track { height: 4px; border-radius: 999px; background: var(--line); }
.range-field input::-webkit-slider-thumb { appearance: none; margin-top: -6px; width: 15px; height: 15px; border-radius: 50%; background: var(--content); border: 0; }
.range-field input::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--content); border: 0; }
.range-field input:focus-visible { outline: 2px solid var(--content); outline-offset: 5px; border-radius: 999px; }

/* the two toys share the canvas and both sliders; this picks which runs */
/* Same segmented control as the :has() + translate card, four columns wide:
   equal tracks, an indicator one track wide, shifted by whole multiples of
   itself. Four labels of different lengths still get equal columns, which is
   the whole reason this is a grid and not four pills in a row. */
.toy-picker {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  margin-left: auto;
  padding: 3px;
  border-radius: 999px;
  background: var(--ink);
  border: 1px solid var(--line);
}
.toy-picker button {
  position: relative;
  z-index: 1;
  font: 500 11px/1 var(--mono);
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: color .2s;
}
.toy-picker button:hover { color: var(--paper); }
/* the label waits for the pill instead of flipping under it */
.toy-picker button[aria-pressed="true"] { color: var(--ink); transition-delay: .14s; }
.toy-picker button:focus-visible { outline: 2px solid var(--content); outline-offset: 3px; }
.toy-picker::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 4);
  border-radius: 999px;
  background: var(--content);
  transition: translate .42s cubic-bezier(.32, .94, .28, 1);
}
/* A block that only slides reads as a block. Squashing it along the travel
   axis mid-flight — wider and thinner at the halfway point, back to its own
   shape on arrival — is what makes the same 42ms of movement read as one
   thing flowing between the labels rather than jumping between them. The
   animation restarts on every pick, so the JS has to retrigger it. */
.toy-picker[data-slide]::after { animation: toy-pill-flow .42s cubic-bezier(.32, .94, .28, 1); }
@keyframes toy-pill-flow {
  40% { scale: 1.12 .86; }
  70% { scale: 1.04 .96; }
}
.toy-picker:has(button:nth-of-type(2)[aria-pressed="true"])::after { translate: 100% 0; }
.toy-picker:has(button:nth-of-type(3)[aria-pressed="true"])::after { translate: 200% 0; }
.toy-picker:has(button:nth-of-type(4)[aria-pressed="true"])::after { translate: 300% 0; }
@media (prefers-reduced-motion: reduce) {
  .toy-picker::after { transition: none; }
  .toy-picker[data-slide]::after { animation: none; }
  .toy-picker button[aria-pressed="true"] { transition-delay: 0s; }
}

/* ---------- feed ---------- */

.feed { padding-bottom: 96px; }
.feed-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 26px 0 18px;
  border-top: 1px solid var(--line);
}
.feed-head h2 {
  font: 600 20px/1 var(--display);
  margin: 0;
}
.feed-head span {
  font: 400 12px/1 var(--mono);
  color: var(--muted);
  margin-left: auto;
}

.card {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  overflow: hidden;
}
/* An off-screen demo is not rendered at all, and its infinite animations do
   not run — which is what lets this feed grow a card a day without the page
   getting heavier to scroll. On the stage and not the card: content-visibility
   auto always remembers the last height it drew, even with no auto keyword
   written, and a whole card's height belongs to one view. After a switch the
   cards at the edge of the screen opened at the other view's height for two
   frames — 750px tiles, 330px rows — before they snapped. A stage's height
   comes from the layout around it instead: aspect-ratio in the grid, the
   text column beside it in a row. */
.feed .stage {
  content-visibility: auto;
  contain-intrinsic-size: auto 210px;
}
.card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font: 400 12px/1 var(--mono);
  color: var(--muted);
}
.card-top .prop { color: var(--content); }
.card-top time { margin-left: auto; }
/* Four things now share this line — property, tag, chip, date — and at grid
   width they do not fit. Let the line wrap, but never a label: a property
   broken across two lines reads as two properties, and "21 Aug 2026" split
   after the day reads as a mistake. */
.card-top { flex-wrap: wrap; row-gap: 7px; }
.card-top > * { white-space: nowrap; }

.card-body {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
}
.stage {
  min-width: 0;
  padding: 30px 26px;
  display: grid;
  /* an auto track sizes to its content, so any demo wider than the panel
     would widen the track and spill over the divider instead of staying in */
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  border-right: 1px solid var(--line);
  min-height: 210px;
  /* paper is the text colour, which already flips per theme — tinting the
     stripe with it means one rule reads as a faint light hatch on dark and a
     faint dark hatch on paper, instead of a white stripe that vanishes the
     moment the surface under it goes light. */
  background:
    repeating-linear-gradient(45deg, transparent 0 8px,
      color-mix(in srgb, var(--paper) 4%, transparent) 8px 16px);
}

.detail { padding: 22px 24px 24px; min-width: 0; }
.detail h3 {
  font: 600 21px/1.18 var(--display);
  margin: 0 0 14px;
}

/* The two structural devices. Both say something always true about a
   snippet: where it bites, and what happens where it is not supported. */
.note {
  border-left: 2px solid var(--margin);
  padding: 2px 0 2px 14px;
  margin: 0 0 12px;
  font-size: 15px;
}
.note b {
  display: block;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--margin);
  margin-bottom: 7px;
}
.note--fallback { border-left-color: var(--padding); }
.note--fallback b { color: var(--padding); }

.source { margin-top: 18px; }
.source-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 400 11px/1 var(--mono);
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.copy {
  margin-left: auto;
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 9px;
  cursor: pointer;
}
.copy:hover { color: var(--paper); border-color: var(--content); }
.copy[data-done="1"] { color: var(--padding); border-color: var(--padding); }

pre {
  margin: 0;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 14px 16px;
  overflow-x: auto;
  font: 400 12.5px/1.7 var(--mono);
  color: var(--code);
}
pre .t { color: var(--content); }
pre .k { color: var(--padding); }
pre .c { color: var(--muted); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 60px;
  font: 400 12px/1.7 var(--mono);
  color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer .wrap { display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer p { margin: 0; }
.site-footer nav { margin-left: auto; display: flex; gap: 20px; }

/* ---------- demos, each namespaced so nothing leaks ---------- */

.d-sticky { width: 100%; max-width: 320px; height: 150px; overflow: auto; border: 1px solid var(--line); border-radius: 3px; }
.d-sticky table { width: 100%; border-collapse: collapse; font: 400 13px/1 var(--mono); }
.d-sticky th { position: sticky; top: 0; background: var(--raised); color: var(--content); text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.d-sticky td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }

.d-clamp { max-width: 320px; color: var(--muted); font-size: 14px; }
.d-clamp p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }

.d-grow { width: 100%; max-width: 320px; }
.d-grow textarea {
  field-sizing: content;
  width: 100%;
  min-height: 3lh;
  max-height: 9lh;
  resize: none;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px 12px;
  font: 400 13px/1.6 var(--mono);
}
.d-grow textarea:focus-visible { outline: 2px solid var(--content); outline-offset: 1px; }

.d-acc { width: 100%; max-width: 320px; }
.d-acc details { border: 1px solid var(--line); border-radius: 3px; margin-bottom: 6px; background: var(--raised); }
.d-acc summary { list-style: none; cursor: pointer; padding: 10px 13px; font: 500 13px/1 var(--mono); color: var(--paper); }
.d-acc summary::-webkit-details-marker { display: none; }
.d-acc summary::before { content: "+"; color: var(--content); margin-right: 9px; }
.d-acc details[open] summary::before { content: "\2212"; }
.d-acc p { margin: 0; padding: 0 13px 12px; font-size: 13px; color: var(--muted); }

.d-focus { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.d-focus button {
  font: 500 13px/1 var(--mono);
  padding: 11px 16px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--paper);
  cursor: pointer;
}
.d-focus button:focus { outline: none; }
.d-focus button:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }
.d-focus .hint { flex-basis: 100%; text-align: center; font: 400 11px/1.5 var(--mono); color: var(--muted); margin-top: 4px; }

/* ---------- responsive + reduced motion ---------- */

@media (max-width: 880px) {
  .card-body { grid-template-columns: 1fr; }
  .stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .masthead nav a { display: none; }
}

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


/* ---------- gradient border ---------- */

.d-grad {
  border-radius: 14px;
  padding: 1px;                 /* this is the border thickness */
  background: linear-gradient(135deg, var(--content), var(--padding) 55%, var(--margin));
  max-width: 250px;
}
.d-grad-inner {
  border-radius: 13px;          /* outer minus the padding, or corners go wrong */
  background: var(--surface);
  padding: 20px 22px;
}
.d-grad h4 { font: 600 17px/1.2 var(--display); margin: 0 0 6px; }
.d-grad p { margin: 0; font-size: 13px; color: var(--muted); }
.d-grad .price { font: 500 13px/1 var(--mono); color: var(--padding); display: block; margin-top: 14px; }

/* ---------- cursor spotlight ---------- */

.d-spot {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 26px 24px;
  max-width: 250px;
  overflow: hidden;
  isolation: isolate;
}
.d-spot h4 { font: 600 17px/1.2 var(--display); margin: 0 0 6px; position: relative; }
.d-spot p { margin: 0; font-size: 13px; color: var(--muted); position: relative; }
.d-spot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity .25s ease;
  background: radial-gradient(220px circle at var(--x, 50%) var(--y, 50%),
              color-mix(in srgb, var(--content) 26%, transparent), transparent 70%);
}
/* Only where a real cursor exists. On touch the highlight would latch on
   after a tap and stay lit with nothing hovering it. */
@media (hover: hover) and (pointer: fine) {
  .d-spot:hover::before { opacity: 1; }
}

/* ---------- scroll-linked progress ---------- */

.d-scroll {
  width: 100%;
  max-width: 250px;
  height: 165px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.d-scroll .track {
  display: none;                /* see the @supports below */
  position: sticky;
  top: 0;
  height: 3px;
  background: var(--line);
}
.d-scroll .bar {
  height: 100%;
  background: var(--content);
  transform-origin: 0 50%;
  animation: fill linear both;
  animation-timeline: scroll(nearest);
}
.d-scroll p { margin: 0; padding: 14px 16px; font-size: 13px; color: var(--muted); }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@supports (animation-timeline: scroll()) {
  .d-scroll .track { display: block; }
}

/* ---------- horizontal table: frozen first column ---------- */

.d-hscroll { width: 100%; max-width: 260px; height: 150px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.d-hscroll table { border-collapse: separate; border-spacing: 0; font: 400 12px/1 var(--mono); white-space: nowrap; }
.d-hscroll th, .d-hscroll td { padding: 9px 14px; border-bottom: 1px solid var(--line); }
.d-hscroll thead th { position: sticky; top: 0; z-index: 2; background: var(--raised); color: var(--content); text-align: left; }
.d-hscroll .pin { position: sticky; left: 0; z-index: 1; background: var(--surface); }
/* the corner is sticky in both axes, so it has to outrank both */
.d-hscroll thead .pin { z-index: 3; background: var(--raised); }
.d-hscroll td { color: var(--muted); }

/* ---------- scroll shadows ---------- */

.d-shadow {
  width: 100%; max-width: 260px; overflow: auto; border-radius: 6px;
  font: 400 12px/2.6 var(--mono); color: var(--muted); white-space: nowrap; padding: 4px 0;
  background:
    linear-gradient(90deg, var(--surface) 30%, transparent) left / 42px 100% no-repeat local,
    linear-gradient(270deg, var(--surface) 30%, transparent) right / 42px 100% no-repeat local,
    radial-gradient(farthest-side at 0, rgba(0,0,0,.55), transparent) left / 18px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100%, rgba(0,0,0,.55), transparent) right / 18px 100% no-repeat scroll,
    var(--surface);
}
.d-shadow span { padding: 0 14px; }

/* ---------- segmented control ---------- */

/* Equal columns, an indicator exactly one column wide, and a shift of 100% of
   itself. Pixel widths would need re-measuring every time a label changes. */
.d-seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 999px; background: var(--ink); border: 1px solid var(--line); }
.d-seg label { position: relative; z-index: 1; padding: 8px 16px; text-align: center; border-radius: 999px; font: 500 12px/1 var(--mono); color: var(--muted); cursor: pointer; transition: color .2s; }
.d-seg input { position: absolute; opacity: 0; pointer-events: none; }
.d-seg input:checked + label { color: var(--ink); }
.d-seg input:focus-visible + label { outline: 2px solid var(--content); outline-offset: 2px; }
.d-seg::after {
  content: ""; position: absolute; z-index: 0;
  top: 4px; bottom: 4px; left: 4px;
  width: calc((100% - 8px) / 3);
  border-radius: 999px; background: var(--content);
  transition: translate .28s cubic-bezier(.4, 1.3, .5, 1);
}
.d-seg:has(input:nth-of-type(2):checked)::after { translate: 100% 0; }
.d-seg:has(input:nth-of-type(3):checked)::after { translate: 200% 0; }

/* ---------- skeleton ---------- */

.d-skel { width: 100%; max-width: 250px; }
.d-skel i, .d-skel b { display: block; border-radius: 4px; background:
  linear-gradient(90deg, var(--raised) 25%, var(--shimmer) 50%, var(--raised) 75%) 0 0 / 300% 100%;
  animation: sweep 1.4s linear infinite; }
.d-skel b { height: 13px; margin-bottom: 9px; width: 62%; }
.d-skel i { height: 10px; margin-bottom: 7px; }
.d-skel i:last-child { width: 45%; }
@keyframes sweep { to { background-position: -300% 0; } }
@media (prefers-reduced-motion: reduce) { .d-skel i, .d-skel b { animation: none; background: var(--raised); } }

/* ---------- menu button ---------- */

.d-burger button { width: 46px; height: 46px; display: grid; place-content: center; gap: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.d-burger span { display: block; width: 20px; height: 2px; background: var(--paper); transition: translate .22s, rotate .22s, opacity .15s; }
.d-burger [aria-expanded="true"] span:nth-child(1) { translate: 0 8px; rotate: 45deg; }
.d-burger [aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.d-burger [aria-expanded="true"] span:nth-child(3) { translate: 0 -8px; rotate: -45deg; }
.d-burger button:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }

/* ---------- switch ---------- */

.d-switch label { display: inline-flex; align-items: center; gap: 11px; font: 400 13px/1 var(--mono); color: var(--muted); cursor: pointer; }
.d-switch input { appearance: none; margin: 0; width: 44px; height: 25px; border-radius: 999px; background: var(--ink); border: 1px solid var(--line); position: relative; cursor: pointer; transition: background .2s; }
.d-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); transition: translate .2s, background .2s; }
.d-switch input:checked { background: color-mix(in srgb, var(--padding) 30%, var(--ink)); border-color: var(--padding); }
.d-switch input:checked::after { translate: 19px 0; background: var(--padding); }
.d-switch input:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }

/* ---------- marquee ---------- */

.d-marquee { width: 100%; max-width: 260px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.d-marquee div { display: flex; width: max-content; animation: slide 14s linear infinite; }
.d-marquee span { padding: 0 16px; font: 500 12px/1 var(--mono); color: var(--muted); white-space: nowrap; }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .d-marquee div { animation: none; } }

/* ---------- glass ---------- */

.d-glass { position: relative; width: 100%; max-width: 250px; height: 160px; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: conic-gradient(from 210deg, #6fa8dc, #93c47d, #f6b26b, #6fa8dc); }
.d-glass div { backdrop-filter: blur(11px); background: rgba(11,14,20,.42); border: 1px solid rgba(255,255,255,.16); border-radius: 9px; padding: 14px 20px; font: 500 13px/1 var(--mono); color: #fff; }

/* ---------- gradient text ---------- */

.d-gtext { font: 600 40px/1.1 var(--display); text-align: center; max-width: 260px;
  background: linear-gradient(100deg, var(--content), var(--padding) 45%, var(--margin));
  -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- range ---------- */

.d-range { width: 100%; max-width: 250px; }
.d-range input { width: 100%; appearance: none; background: transparent; }
.d-range input::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; background: var(--line); }
.d-range input::-moz-range-track { height: 5px; border-radius: 999px; background: var(--line); }
.d-range input::-webkit-slider-thumb { appearance: none; margin-top: -7px; width: 19px; height: 19px; border-radius: 50%; background: var(--content); border: 0; }
.d-range input::-moz-range-thumb { width: 19px; height: 19px; border-radius: 50%; background: var(--content); border: 0; }
.d-range input:focus-visible { outline: 2px solid var(--content); outline-offset: 6px; border-radius: 999px; }

/* ---------- tilt ---------- */

.d-tilt { perspective: 700px; }
.d-tilt div { width: 190px; padding: 26px 22px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); font: 500 13px/1.5 var(--mono); color: var(--paper); transition: rotate .3s ease, box-shadow .3s ease; }
@media (hover: hover) and (pointer: fine) { .d-tilt:hover div { rotate: x 9deg; box-shadow: 0 18px 30px rgba(0,0,0,.45); } }

/* ---------- animated gradient angle ---------- */

@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.d-spin { width: 180px; height: 180px; border-radius: 50%; padding: 2px;
  background: conic-gradient(from var(--spin), var(--content), var(--padding), var(--margin), var(--content));
  animation: spin 5s linear infinite; display: grid; place-items: center; }
.d-spin div { width: 100%; height: 100%; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font: 500 12px/1 var(--mono); color: var(--muted); }
@keyframes spin { to { --spin: 360deg; } }
@media (prefers-reduced-motion: reduce) { .d-spin { animation: none; } }

/* ---------- search and tag filter ---------- */

html:not(.js) .feed .filters { display: none; }   /* no JS, no controls that do nothing */
.filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 0 0 22px; }
.filters input {
  flex: 0 1 260px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  color: var(--paper);
  font: 400 13px/1 var(--mono);
}
.filters input::placeholder { color: var(--muted); }
.filters input:focus-visible { outline: 2px solid var(--content); outline-offset: 1px; }
.tags { display: flex; gap: 7px; flex-wrap: wrap; }
.tags button {
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.tags button:hover { color: var(--paper); border-color: var(--content); }
.tags button[aria-pressed="true"] { color: var(--ink); background: var(--content); border-color: var(--content); }
.tags button:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }
.no-hits { color: var(--muted); font-size: 15px; padding: 8px 0 40px; }
.filters .hits { font: 400 11px/1 var(--mono); color: var(--muted); }
/* .catalogue li sets display: grid, which beats the hidden attribute's own
   display: none — without this the filter hides nothing at all */
.catalogue li[hidden] { display: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- container query, draggable ---------- */

/* resize hands the width to the reader, so it needs both ends bounded:
   below 130px the card has nothing left to reflow, above 300px it just
   pushes out of the panel without demonstrating anything further. */
.d-cq, .d-cqi { container-type: inline-size; resize: horizontal; overflow: auto; width: 220px; min-width: 130px; max-width: min(100%, 300px); padding: 12px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface); }
.d-cq .row { display: grid; gap: 10px; }
.d-cq .thumb { height: 46px; border-radius: 6px; background: linear-gradient(135deg, var(--content), var(--padding)); }
.d-cq h5 { font: 600 14px/1.2 var(--display); margin: 0 0 3px; color: var(--paper); }
.d-cq p { margin: 0; font-size: 12px; color: var(--muted); }
@container (min-width: 210px) { .d-cq .row { grid-template-columns: 62px 1fr; align-items: center; } }
.d-cqi p { margin: 0; font-family: var(--display); font-weight: 600; line-height: 1.15; font-size: clamp(14px, 9cqi, 30px); color: var(--paper); }
/* resize writes an inline width and keeps writing past max-width: the box
   still paints clamped, but the wrapper measures the stored value, so a
   caption centred in the wrapper drifts off the box. Give both a column of
   their own to centre in. */
/* the track must be capped too: an auto grid column sizes to its content,
   so a resized child widens the column past the container and then the
   child's own max-width: 100% resolves against that wider column and
   stops clamping anything. */
.d-resize { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; width: min(100%, 300px); }
.d-hint { font: 400 10px/1 var(--mono); color: var(--muted); margin-top: 8px; text-align: center; }

/* ---------- aspect ratio ---------- */

.d-ar { display: flex; gap: 10px; align-items: flex-start; }
.d-ar div { width: 62px; aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; font: 500 11px/1 var(--mono); color: var(--ink); background: var(--content); }
.d-ar div:nth-child(2) { aspect-ratio: 3 / 4; background: var(--padding); }
.d-ar div:nth-child(3) { aspect-ratio: 16 / 9; width: 96px; background: var(--margin); }

/* ---------- text setting ---------- */

.d-balance { max-width: 250px; display: grid; gap: 16px; }
.d-balance h5 { margin: 0; font: 600 18px/1.25 var(--display); color: var(--paper); }
.d-balance .on { text-wrap: balance; }
.d-balance small { display: block; font: 400 10px/1 var(--mono); color: var(--muted); margin-bottom: 5px; letter-spacing: .08em; }

.d-pretty { max-width: 250px; font-size: 13px; color: var(--muted); }
.d-pretty p { margin: 0; text-wrap: pretty; }

.d-hyph { max-width: 148px; font-size: 13px; color: var(--muted); text-align: justify; }
.d-hyph p { margin: 0; hyphens: auto; }

/* ---------- form state ---------- */

.d-invalid { width: 100%; max-width: 240px; }
.d-invalid input { width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 10px 13px; color: var(--paper); font: 400 13px/1 var(--mono); }
.d-invalid input:user-invalid { border-color: #e06c6c; }
.d-invalid input:user-valid { border-color: var(--padding); }
.d-invalid input:focus-visible { outline: 2px solid var(--content); outline-offset: 1px; }
.d-invalid small { display: block; margin-top: 7px; font: 400 11px/1.4 var(--mono); color: var(--muted); }

.d-accent { display: grid; gap: 12px; accent-color: var(--padding); font: 400 13px/1 var(--mono); color: var(--muted); }
.d-accent label { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.d-accent input[type="range"] { accent-color: var(--content); width: 150px; }

.d-float { width: 100%; max-width: 240px; position: relative; }
.d-float input { width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 18px 13px 8px; color: var(--paper); font: 400 13px/1 var(--mono); }
.d-float label { position: absolute; left: 14px; top: 13px; font: 400 12px/1 var(--mono); color: var(--muted); pointer-events: none; transition: translate .15s, font-size .15s; }
.d-float input:not(:placeholder-shown) + label,
.d-float input:focus + label { translate: 0 -8px; font-size: 10px; color: var(--content); }
.d-float input:focus-visible { outline: 2px solid var(--content); outline-offset: 1px; }

/* ---------- scroll behaviour ---------- */

.d-snap { display: flex; gap: 10px; width: 100%; max-width: 250px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 0 0 0; padding-bottom: 8px; }
.d-snap div { flex: 0 0 82%; scroll-snap-align: start; height: 108px; border-radius: 10px; display: grid; place-items: center; font: 500 13px/1 var(--mono); color: var(--ink); background: var(--content); }
.d-snap div:nth-child(2) { background: var(--padding); }
.d-snap div:nth-child(3) { background: var(--margin); }

.d-chain { width: 100%; max-width: 250px; height: 120px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.d-chain p { margin: 0; padding: 12px 14px; font-size: 13px; color: var(--muted); }

.d-anchor { width: 100%; max-width: 250px; height: 150px; overflow: auto; scroll-padding-top: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.d-anchor .bar { position: sticky; top: 0; display: flex; gap: 10px; padding: 9px 12px; background: var(--raised); border-bottom: 1px solid var(--line); font: 400 11px/1 var(--mono); }
.d-anchor .bar a { color: var(--content); text-decoration: none; }
.d-anchor h6 { margin: 0; padding: 12px 14px 4px; font: 600 13px/1 var(--display); color: var(--paper); }
.d-anchor p { margin: 0; padding: 0 14px 26px; font-size: 12px; color: var(--muted); }

/* ---------- :has() ---------- */

.d-field { width: 100%; max-width: 240px; }
.d-field .field { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--ink); transition: border-color .2s, background .2s; }
.d-field .field:has(input:user-invalid) { border-color: #e06c6c; background: rgba(224,108,108,.07); }
.d-field .field:has(input:user-valid) { border-color: var(--padding); }
.d-field label { display: block; font: 400 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.d-field input { width: 100%; background: none; border: 0; color: var(--paper); font: 400 13px/1 var(--mono); padding: 0; }
.d-field input:focus { outline: none; }
.d-field .field:has(input:focus-visible) { outline: 2px solid var(--content); outline-offset: 2px; }

.d-dim { display: grid; gap: 7px; width: 100%; max-width: 230px; }
.d-dim a { padding: 9px 12px; border-radius: 6px; background: var(--raised); border: 1px solid var(--line); font: 400 12px/1 var(--mono); color: var(--paper); text-decoration: none; transition: opacity .18s; }
@media (hover: hover) and (pointer: fine) {
  .d-dim:has(a:hover) a:not(:hover) { opacity: .35; }
}

.d-count { width: 100%; max-width: 240px; }
.d-count ul { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.d-count li { padding: 8px 11px; border-radius: 6px; background: var(--raised); border: 1px solid var(--line); font: 400 12px/1 var(--mono); color: var(--muted); }
.d-count ul:has(li:nth-child(4)) { grid-template-columns: 1fr 1fr; }
.d-count button { font: 400 11px/1 var(--mono); color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.d-count button:hover { color: var(--paper); border-color: var(--content); }
.d-count button:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }

/* ---------- top layer ---------- */

.d-open { font: 500 12px/1 var(--mono); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--paper); cursor: pointer; }
.d-open:hover { border-color: var(--content); }
.d-open:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }

dialog.d-modal { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--paper); padding: 24px; max-width: 300px; }
dialog.d-modal::backdrop { background: rgba(5, 7, 11, .72); backdrop-filter: blur(2px); }
dialog.d-modal h5 { font: 600 17px/1.2 var(--display); margin: 0 0 8px; }
dialog.d-modal p { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
dialog.d-modal form { margin: 0; }

/* No position override here on purpose. The user agent puts an open popover
   in the top layer and centres it; forcing position: absolute drags it back
   into normal flow, which is exactly the behaviour this card is about. */
.d-pop { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--paper); padding: 18px 20px; font: 400 12px/1.6 var(--mono); max-width: 300px; }
.d-pop::backdrop { background: rgba(5, 7, 11, .6); }

.d-inert { display: grid; gap: 10px; width: 100%; max-width: 230px; font: 400 12px/1 var(--mono); color: var(--muted); }
.d-inert fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0; display: grid; gap: 9px; transition: opacity .2s; }
.d-inert fieldset[inert] { opacity: .35; }
.d-inert legend { padding: 0 6px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.d-inert button { font: 400 12px/1 var(--mono); padding: 8px 11px; border-radius: 6px; border: 1px solid var(--line); background: var(--ink); color: var(--paper); cursor: pointer; }
.d-inert button:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }

/* ---------- entry and exit ---------- */

.d-enter { display: grid; gap: 12px; justify-items: center; }
.d-enter .panel {
  display: none; opacity: 0; translate: 0 -8px;
  transition: opacity .3s, translate .3s, display .3s allow-discrete;
  padding: 14px 18px; border-radius: 10px; background: var(--raised);
  border: 1px solid var(--content); font: 400 12px/1 var(--mono); color: var(--paper);
}
.d-enter:has(input:checked) .panel { display: block; opacity: 1; translate: 0 0; }
@starting-style { .d-enter:has(input:checked) .panel { opacity: 0; translate: 0 -8px; } }
.d-enter label { font: 400 12px/1 var(--mono); color: var(--muted); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.d-enter input { accent-color: var(--content); }

.d-exit { display: grid; gap: 12px; justify-items: center; }
.d-exit .panel {
  opacity: 1; scale: 1;
  transition: opacity .35s, scale .35s;
  padding: 14px 18px; border-radius: 10px; background: var(--raised);
  border: 1px solid var(--padding); font: 400 12px/1 var(--mono); color: var(--paper);
}
.d-exit:not(:has(input:checked)) .panel { opacity: 0; scale: .9; }
.d-exit label { font: 400 12px/1 var(--mono); color: var(--muted); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.d-exit input { accent-color: var(--padding); }

/* ---------- view transition ---------- */

.d-vt { display: grid; gap: 10px; width: 100%; max-width: 230px; }
.d-vt ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
/* Names go on the elements, not on nth-child positions: tied to a position
   they would stay put while the content moved through them, and the move
   animation is the whole point. */
#vt-build { view-transition-name: vt-build; }
#vt-test { view-transition-name: vt-test; }
#vt-deploy { view-transition-name: vt-deploy; }
.d-vt li { padding: 9px 12px; border-radius: 6px; background: var(--raised); border: 1px solid var(--line); font: 400 12px/1 var(--mono); color: var(--paper); }
.d-vt button { justify-self: start; font: 400 11px/1 var(--mono); color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.d-vt button:hover { color: var(--paper); border-color: var(--content); }
.d-vt button:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }

/* ---------- resize vs max-width ---------- */

.d-rz { display: grid; gap: 18px; }
.d-rz small { display: block; font: 400 10px/1 var(--mono); letter-spacing: .1em; color: var(--muted); margin-bottom: 7px; }
.d-rz .box { resize: horizontal; overflow: auto; width: 130px; min-width: 70px; max-width: 210px; height: 42px; border: 1px dashed var(--line); border-radius: 6px; background: var(--surface); }
.d-rz p { margin: 7px 0 0; text-align: center; font: 400 10px/1 var(--mono); }
/* fit-content asks the element how wide it wants to be, and resize answers
   with the value it stored, not the one that painted */
.d-rz .drifts { display: grid; justify-items: center; width: fit-content; }
.d-rz .drifts p { color: var(--margin); }
.d-rz .holds { display: grid; justify-items: center; width: 210px; }
.d-rz .holds p { color: var(--padding); }

/* ---------- element page ---------- */

.article.element { max-width: 760px; }
.element-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 240px;
  padding: 36px 28px;
  margin: 24px 0 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface)
    repeating-linear-gradient(45deg, transparent 0 8px,
      color-mix(in srgb, var(--paper) 4%, transparent) 8px 16px);
}
.article.element .note { font-size: 16px; }
.stamp { margin: 26px 0 0; font: 400 11px/1 var(--mono); color: var(--muted); }

.related { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 22px; }
.related h2 { font: 600 15px/1 var(--display); margin: 0 0 14px; color: var(--muted); }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.related li { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.related a { color: var(--paper); text-decoration: none; font-size: 15px; }
.related a:hover { color: var(--content); }
.related span { font: 400 11px/1 var(--mono); color: var(--content); }

/* ---------- questions (half the element pages carry these, see EXPERIMENT.md) ---------- */

/* An exclusive accordion on <details name> — the element this site documents
   at /elements/accordion-with-no-javascript/ — with the panel height animated
   through ::details-content. interpolate-size is what makes a height of auto
   animatable at all; it is scoped here rather than put on :root because it
   changes how every keyword-sized box in its subtree transitions.
   CAVEAT: an open panel is closed by opening another, so a visitor cannot put
   two answers side by side. That is the trade for one question at a time
   being readable at a glance, and it is why the first one ships open.
   FALLBACK: where ::details-content or interpolate-size is missing the panel
   opens instantly instead of sliding. Nothing is hidden and nothing is lost
   but the animation, which is the right way round for this to fail. */

.faq { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 20px; interpolate-size: allow-keywords; }
.faq-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.faq-head h2 { font: 600 15px/1 var(--display); margin: 0; color: var(--muted); }
.faq-head p { margin: 0; font: 400 11px/1 var(--mono); color: var(--muted); }
.faq-head a { color: var(--content); text-decoration: none; }
.faq-head a:hover { text-decoration: underline; }

.faq-q { border-bottom: 1px solid var(--line); }
.faq-q summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 15px 0;
}
.faq-q summary::-webkit-details-marker { display: none; }
.faq-q summary h3 { font: 600 16px/1.4 var(--display); margin: 0; flex: 1; }
.faq-q summary:hover h3 { color: var(--content); }
.faq-q summary:focus-visible { outline: 2px solid var(--content); outline-offset: 4px; }

/* one glyph for both states: a plus that turns into a cross */
.faq-q summary::after {
  content: "+";
  font: 400 17px/1 var(--mono);
  color: var(--content);
  transition: rotate 0.3s ease;
}
.faq-q[open] summary::after { rotate: 45deg; }

.faq-q::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.32s ease, content-visibility 0.32s allow-discrete;
}
.faq-q[open]::details-content { block-size: auto; }
.faq-a p { margin: 0 0 17px; font-size: 15px; color: var(--paper); max-width: 64ch; }
.faq-q code { font: 400 13px/1 var(--mono); color: var(--content); }

/* ---------- the small-screen menu ---------- */

/* Three of this site's own elements doing the work of a hamburger script: the
   panel is a popover, so light dismiss, Escape and the button wiring are the
   browser's job; @starting-style gives it a first frame to animate from; and
   :has() on the body is what lets the button read the panel's state and change
   its own word. There is no JavaScript here at all.
   CAVEAT: an open popover sits in the top layer, above everything, so the
   masthead's own z-index has no say in what covers what — which is fine here
   and a trap the moment anything else on the page is promoted too.
   FALLBACK: where the Popover API is missing the panel is ordinary content, so
   it is shown as a plain list under the header and the button that would do
   nothing is hidden instead. Navigation survives; the animation does not. */

.menu-btn {
  display: none;
  align-items: center;
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
}
.menu-btn:hover { color: var(--paper); border-color: var(--content); }
.menu-shut { display: none; }
body:has(#menu:popover-open) .menu-open { display: none; }
body:has(#menu:popover-open) .menu-shut { display: inline; }

#menu {
  position: fixed;
  inset: 64px 0 auto 0;
  inline-size: 100%;
  max-inline-size: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-block-end: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  backdrop-filter: blur(10px);
  opacity: 0;
  translate: 0 -10px;
  transition:
    opacity .24s ease,
    translate .24s ease,
    overlay .24s allow-discrete,
    display .24s allow-discrete;
}
#menu:popover-open { display: grid; opacity: 1; translate: 0 0; }
@starting-style {
  #menu:popover-open { opacity: 0; translate: 0 -10px; }
}
#menu::backdrop { background: rgb(0 0 0 / 0.4); }

#menu a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 22px;
  border-block-start: 1px solid var(--line);
  font: 600 27px/1 var(--display);
  color: var(--paper);
  text-decoration: none;
  opacity: 0;
  translate: 0 -8px;
  transition: opacity .32s ease, translate .32s ease;
}
#menu a span { font: 400 11px/1 var(--mono); color: var(--content); }
#menu a:active { color: var(--content); }
/* the rows arrive one after another rather than all at once — four delays is
   cheaper than any other way of saying "this opened" */
#menu:popover-open a { opacity: 1; translate: 0 0; }
#menu:popover-open a:nth-child(2) { transition-delay: .05s; }
#menu:popover-open a:nth-child(3) { transition-delay: .1s; }
#menu:popover-open a:nth-child(4) { transition-delay: .15s; }

@media (max-width: 880px) {
  /* the pair of rules that swap the nav for the button live in two different
     places in this file; keep this one next to the .menu-btn base rule above,
     because source order is what decides which display wins */
  .menu-btn { display: inline-flex; }
}

@supports not selector(:popover-open) {
  #menu { position: static; display: grid; opacity: 1; translate: none; backdrop-filter: none; }
  #menu a { opacity: 1; translate: none; }
  .menu-btn { display: none !important; }
}

/* ---------- palette ---------- */

/* Two rules paint every swatch on the page: the same colour seen from a
   different angle, either a hue rotation or a new lightness with the chroma
   pulled back. Neither knows what --base is, which is why one line of script
   recolours all twenty-one. The per-swatch numbers arrive from
   assets/palette.css, generated by build.py — see the note at the top of it
   for why they cannot be style attributes. */

.palette { --c1: #a7c7e7; --c2: #b5e0c9; --c3: #f6c9a8; }

/* Rotating the hue and holding lightness is what every colour wheel does, and
   it is why their triads come out muddy: sRGB has far less room for a
   yellow-green at lightness 0.62 than for a blue, so the browser gamut-maps
   the difference away and you get khaki. The cos() term is the correction —
   how much headroom the hue we landed on has, minus how much the hue we
   started from had, peaking at yellow-green around 100°. Nought when the two
   agree, which is why the first swatch of a row is exactly the colour picked.

   Written once per chosen colour rather than once, because every harmony is
   drawn for all of them: a second picker that left these rows alone was a
   button that appeared to do nothing. */
.sw[data-of="1"][data-dh] {
  background: oklch(
    from var(--c1)
    clamp(0.2,
      calc(l + 0.14 * (max(0, cos((h + var(--dh) - 100) * 1deg))
                     - max(0, cos((h - 100) * 1deg)))),
      0.93)
    c calc(h + var(--dh)));
}
.sw[data-of="2"][data-dh] {
  background: oklch(
    from var(--c2)
    clamp(0.2,
      calc(l + 0.14 * (max(0, cos((h + var(--dh) - 100) * 1deg))
                     - max(0, cos((h - 100) * 1deg)))),
      0.93)
    c calc(h + var(--dh)));
}
.sw[data-of="3"][data-dh] {
  background: oklch(
    from var(--c3)
    clamp(0.2,
      calc(l + 0.14 * (max(0, cos((h + var(--dh) - 100) * 1deg))
                     - max(0, cos((h - 100) * 1deg)))),
      0.93)
    c calc(h + var(--dh)));
}
.sw[data-of="1"][data-tone] { background: oklch(from var(--c1) var(--l) calc(c * var(--cm)) h); }
.sw[data-of="2"][data-tone] { background: oklch(from var(--c2) var(--l) calc(c * var(--cm)) h); }
.sw[data-of="3"][data-tone] { background: oklch(from var(--c3) var(--l) calc(c * var(--cm)) h); }

/* one line per colour inside a row, each marked with the picker it came from */
.sw-group { display: flex; flex-wrap: wrap; flex: 1 1 100%; position: relative; }
.sw-group[hidden] { display: none; }
.sw-group + .sw-group { border-block-start: 1px solid var(--line); }
.sw-group[data-of]::before {
  content: attr(data-of);
  position: absolute;
  inset-block-start: 6px;
  inset-inline-end: 8px;
  z-index: 1;
  font: 500 10px/1 var(--mono);
  color: var(--muted);
}
.sw-group[data-of="1"]::before { content: none; }

.pal-stage {
  margin: 28px 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card, 12px);
  background: var(--surface);
  overflow: hidden;
}

.pal-pick {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.pal-input {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 500 10px/1 var(--mono);
  color: var(--margin);
}
.pal-input label { cursor: pointer; }
.pal-drop {
  border: 0 !important;
  background: none;
  color: var(--muted);
  font: 400 14px/1 var(--mono);
  padding: 2px 2px 4px;
  cursor: pointer;
}
.pal-drop:hover { color: var(--paper); }
/* display: inline-flex above beats the hidden attribute's own display: none,
   so a picker that is not in use would stay on screen — the same trap the
   catalogue rows have a line for further down */
.pal-input[hidden] { display: none; }
.pal-add { color: var(--content) !important; border-color: var(--content) !important; }
.pal-add:hover { background: var(--content); color: var(--surface) !important; }
.pal-pick input[type="color"] {
  inline-size: 46px;
  block-size: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: none;
  cursor: pointer;
}
.pal-pick button {
  font: 400 11px/1 var(--mono);
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.pal-pick button:hover { color: var(--paper); border-color: var(--content); }
.pal-said { font: 400 11px/1 var(--mono); color: var(--content); margin-inline-start: auto; }

.pal-bar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.pal-row + .pal-row .pal-bar { border-top: 1px solid var(--line); }
.pal-bar b {
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--margin);
}
.pal-bar span { font-size: 13px; color: var(--muted); }

/* flush tiles, the way a palette is actually printed — the hairline between
   them is an inset shadow rather than a border so the row keeps its width */
.sw-row { display: flex; flex-wrap: wrap; }
.sw-group .sw:first-child { box-shadow: none; }
.sw {
  flex: 1 1 108px;
  min-block-size: 98px;
  border: 0;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 9px;
  text-align: start;
  cursor: pointer;
  color: var(--ink, #0a0a0c);
  box-shadow: inset 1px 0 0 rgb(0 0 0 / 0.14);
}
.sw:first-child { box-shadow: none; }
.sw:hover { box-shadow: inset 0 0 0 2px var(--ink, #0a0a0c); }
.sw:focus-visible { outline: 2px solid var(--content); outline-offset: -4px; }
.sw-hex { font: 500 13px/1 var(--mono); }
.sw-note { font: 400 10px/1.35 var(--mono); opacity: 0.82; white-space: pre-line; }
/* a swatch nothing legible can sit on says so on itself, rather than leaving
   it to be discovered in an audit three weeks later */
.sw[data-grade="none"] .sw-note { text-decoration: underline; text-underline-offset: 3px; }

/* the set: what you kept, and what it does to itself */

.pal-set {
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card, 12px);
  background: var(--surface);
  overflow: hidden;
}
.pal-set .pal-bar { border-block-end: 1px solid var(--line); }
.set-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  padding: 8px 9px 8px 14px;
  font: 500 12px/1 var(--mono);
  color: var(--ink, #0a0a0c);
  cursor: pointer;
}
.chip b { font: 400 14px/1 var(--mono); opacity: 0.65; padding: 0 4px; }
.chip:hover b { opacity: 1; }

.set-read { padding: 0 14px 4px; display: grid; gap: 9px; }
.set-read p {
  margin: 0;
  font-size: 14px;
  color: var(--paper);
  border-inline-start: 2px solid var(--margin);
  padding-inline-start: 12px;
}
.set-read:empty { padding: 0; }

.set-grid { padding: 12px 14px 16px; overflow-x: auto; }
.set-grid table { border-collapse: collapse; font: 400 11px/1 var(--mono); }
.set-grid td { padding: 7px 10px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.set-grid tr:first-child td, .set-grid td:first-child { color: var(--paper); }
/* the grade is the point of the table, so it is the only thing with colour */
.set-grid td.aa { color: var(--content); }
.set-grid td.large { color: var(--margin); }
.set-grid td.none { color: var(--paper); text-decoration: line-through; text-decoration-thickness: 1px; }
.set-grid td.same { color: var(--line); }
/* the WCAG ratio leads and the APCA figure sits under it, because one is what
   an audit asks for and the other is what your eye reports */
.set-grid td i { display: block; font-style: normal; opacity: 0.62; margin-block-start: 3px; }

.pal-legend { font-size: 14px; color: var(--muted); margin: 0 0 22px; max-width: 74ch; }
.pal-legend b { color: var(--paper); font-weight: 500; }

.pal-nope { display: none; }
@supports not (background: oklch(from red l c h)) {
  .pal-nope { display: block; color: var(--muted); font-size: 15px; margin: 0 0 22px; }
}

/* ---------- catalogue ---------- */

.catalogue { list-style: none; margin: 26px 0 0; padding: 0; counter-reset: n; }
.catalogue li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px 16px;
  align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.catalogue a { color: var(--paper); text-decoration: none; font-size: 16px; }
.catalogue a:hover { color: var(--content); }
.catalogue .prop { font: 400 11px/1 var(--mono); color: var(--content); }
.catalogue .tag { font: 400 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) {
  .catalogue li { grid-template-columns: 1fr; }
}

/* headings in the feed become links once the element pages exist */
.detail h3 a { color: inherit; text-decoration: none; }
.detail h3 a:hover { color: var(--content); }

/* ---------- density ---------- */

.cards { display: grid; gap: 22px; }

/* Two named buttons, not one that toggles. A single button has to be
   labelled either for the state you are in or for the one it takes you to,
   and whichever you pick, aria-pressed contradicts it: "Grid", filled in,
   while you are looking at rows reads as Grid already being on, so pressing
   it looks like nothing happened. The picker under the hero already had this
   right — one button per choice, the current one lit. */
/* The site's own segmented control, borrowed from the :has() + translate
   card: equal columns, an indicator one column wide, moved by 100% of
   itself. Two buttons here rather than three, so the width divides by two
   and the second position is a single 100% shift. The buttons carry
   aria-pressed already, so the indicator follows state that is real. */
.view-picker {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  margin-left: auto;
  padding: 3px;
  border-radius: 999px;
  background: var(--ink);
  border: 1px solid var(--line);
}
.view-picker button {
  position: relative;
  z-index: 1;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
  transition: color .12s;
}
.view-picker button:hover { color: var(--paper); }
.view-picker button[aria-pressed="true"] { color: var(--ink); }
.view-picker button:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }
.view-picker::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 2);
  border-radius: 999px;
  background: var(--content);
  /* short and with no overshoot: the cards swap in one frame, and a pill
     still bouncing after them read as the switch lagging */
  transition: translate .14s ease-out;
}
.view-picker:has(button:nth-of-type(2)[aria-pressed="true"])::after { translate: 100% 0; }
@media (prefers-reduced-motion: reduce) { .view-picker::after { transition: none; } }

/* Two views, and both of them are dense — the wide airy card the feed opened
   with is gone. The grid is for scanning: a card is demo, title and caveat,
   because that is what you read to decide whether this is your problem. The
   row is for the moment after that, so it keeps the fallback and the source
   and puts the demo alongside them rather than above.

   Everything that is about density rather than direction is written once,
   for both. */
.compact .cards, .rows .cards { gap: 18px; }
.compact .card-top, .rows .card-top { padding: 10px 16px; }
.compact .detail, .rows .detail { padding: 16px 16px 18px; }
.compact .note, .rows .note { font-size: 14px; }
.compact .stage, .rows .stage { padding: 22px 16px; }

/* 288 and not a round 320: the wrap is 1160px, so 320 only fits three columns
   from 1280px up and drops to two on a narrower window. 288 holds three from
   1000px, which is where this actually gets read. Four would need the track
   under 242px and the demos do not survive that. */
.compact .cards { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }
.compact .card-body { grid-template-columns: minmax(0, 1fr); }
/* One horizontal gutter for the whole stack, top bar through demo through
   text — property label, stage content and heading all start at the same
   16px, so the left edges line up reading down the card instead of
   stepping in and out between sections. */
.compact .stage { border-right: 0; border-bottom: 1px solid var(--line); min-height: 168px; }
.compact .detail h3 {
  font-size: 17px;
  margin-bottom: 10px;
  /* Reserves the same two lines whether a title takes one or two, so
     CAVEAT starts on the same row across a whole grid row instead of
     stepping down under the longer titles. */
  min-height: calc(17px * 1.2 * 2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
/* The grid card is a decision, not the argument: demo, title, and enough of
   the caveat to know whether this is your bug. One card ran to fifteen lines
   and left the column beside it half empty. The rest is behind the title,
   which link_feed has already made a link to the element page. */
.compact .note {
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
  overflow: hidden;
}
/* At grid width the header cannot hold four things on one line — a property
   like animation-delay: -43200s wraps on its own, chip or no chip, on 28 of
   48 cards. So stop fighting it and give the date its own line: every header
   is two lines by construction, which is what keeps the demos in a row
   starting at the same height. Right-aligned, so it still reads as a stamp
   rather than a fourth label. */
.compact .card-top time { flex-basis: 100%; text-align: right; }
/* and the chip sits flat in that line rather than standing 8px taller than
   the text beside it, which was enough on its own to stagger a grid row */
.compact .card-top .code-tag { font-size: 9px; padding: 1px 7px; }
.compact .note--fallback, .compact .source { display: none; }

/* The row: one card per line, demo held to a third of it. The stage keeps a
   width of its own instead of a fraction that collapses on a narrow window,
   and the text column gets whatever is left. */
.rows .cards { grid-template-columns: minmax(0, 1fr); }
.rows .card-body { grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr); }
.rows .stage { min-height: 200px; }
.rows .detail h3 { font-size: 19px; margin-bottom: 10px; }
.rows .note { margin-bottom: 10px; }
.rows .source { margin-top: 14px; }
.rows .source pre { max-height: 240px; overflow: auto; }

/* Under a phone there is no room for two columns of anything, so the row
   folds into one — and then the two views are the same width and the same
   markup, and the only thing telling them apart is a fallback and a source
   you have to scroll past a full-height demo to reach. Which is no way to
   tell them apart.

   So on a phone the grid earns its name a different way: a shorter stage and
   a caveat cut to four lines, because the job here is fitting more than one
   card on a screen. The row keeps the tall demo and the whole text. The full
   caveat is one tap away on the element page either way. */
@media (max-width: 620px) {
  .rows .card-body { grid-template-columns: minmax(0, 1fr); }
  .rows .stage { border-right: 0; border-bottom: 1px solid var(--line); }

  .compact .stage { min-height: 124px; padding: 16px 14px; }
  .compact .detail { padding: 13px 14px 15px; }
  .compact .detail h3 { font-size: 16px; min-height: 0; }
  /* :not() and not a bare .note — the fallback carries that class too, and
     this rule sits below the one hiding it, so a bare .note would hand it a
     display and put it back on screen. */
  .compact .note:not(.note--fallback) {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
  }
}

/* ---------- long-form pages: element, catalogue, about ---------- */

.page {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 34px var(--gutter) 96px;
}

.breadcrumb {
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 26px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--content); }

.article { max-width: 760px; }
.article h1 {
  font: 600 clamp(30px, 4.4vw, 46px)/1.08 var(--display);
  letter-spacing: -0.01em;
  color: var(--white, var(--paper));
  margin: 0 0 18px;
  text-wrap: balance;
}
/* On its own page the heading is not a link to itself. */
.article h1 a { color: inherit; text-decoration: none; pointer-events: none; }
.article h2 {
  font: 600 22px/1.25 var(--display);
  color: var(--color-ice, var(--paper));
  margin: 40px 0 14px;
}
.article p { font-size: 16px; line-height: 1.7; margin: 0 0 16px; }
.article .dek { font-size: 18px; color: var(--color-fog, var(--muted)); margin-bottom: 26px; }
.article ul { margin: 0 0 18px; padding-left: 20px; }
.article li { margin: 0 0 9px; line-height: 1.65; }
.article a { color: var(--content); }
.article strong { color: var(--paper); font-weight: 500; }

/* inline code, as opposed to the block kind */
.article :not(pre) > code,
.detail :not(pre) > code {
  font: 400 0.88em/1 var(--mono);
  background: var(--fill, rgba(186,214,247,.07));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
  white-space: nowrap;
}
.article .note :not(pre) > code { background: none; border: 0; padding: 0; }
.detail .note :not(pre) > code { background: none; border: 0; padding: 0; }

/* swatches and demo labels, out of style attributes so the page can carry a
   content security policy without allowing inline styles */
.demo-label { margin-bottom: 8px; display: block; }

/* ---------- the bouncing logo ---------- */

.d-dvd {
  container-type: size;              /* so cqw and cqh mean this box */
  position: relative;
  width: 100%;
  max-width: 250px;
  height: 158px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 6px);
  background: var(--ink);
}
/* One element per axis. Both animations want the translate property, and the
   later one would win outright rather than the two combining. */
.d-dvd .drift {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-block;
  animation: dvd-x 7.3s linear infinite alternate;
}
.d-dvd .logo {
  display: grid;
  justify-items: center;
  gap: 2px;
  animation: dvd-y 4.7s linear infinite alternate;
}
/* the silhouette is the point: a skewed ellipse with a bar under it */
.d-dvd .disc {
  width: 58px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: skewX(-14deg);
  background: var(--content);
  animation: dvd-tint 22s steps(1, end) infinite;
}
.d-dvd .disc b {
  transform: skewX(14deg);   /* stand the letters back up */
  font: 700 13px/1 var(--display);
  letter-spacing: 0.02em;
  color: var(--ink);
}
.d-dvd .tag {
  font: 500 6px/1 var(--mono);
  letter-spacing: 0.24em;
  padding: 2px 5px 1px;
  border-radius: 2px;
  color: var(--ink);
  background: var(--content);
  animation: dvd-tint 22s steps(1, end) infinite;
}
/* 100% is the element's own size, so the travel is the box minus the logo */
@keyframes dvd-x { to { translate: calc(100cqw - 100%) 0; } }
@keyframes dvd-y { to { translate: 0 calc(100cqh - 100%); } }
@keyframes dvd-tint {
  0%   { background: var(--content); }
  33%  { background: var(--padding); }
  66%  { background: var(--margin); }
}
@media (prefers-reduced-motion: reduce) {
  .d-dvd .drift, .d-dvd .logo, .d-dvd .disc, .d-dvd .tag { animation: none; }
  .d-dvd .logo { translate: 0 calc(50cqh - 50%); }
  .d-dvd .drift { translate: calc(50cqw - 50%) 0; }
}

/* ---------- tag hubs ---------- */

.tag-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }
.tag-nav a {
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
}
.tag-nav a:hover { color: var(--paper); border-color: var(--content); }
.card-top a { color: inherit; text-decoration: none; }
.card-top a:hover { color: var(--paper); }

/* ---------- the clock ---------- */

.d-clock {
  position: relative;
  width: 172px;
  height: 172px;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--line);
}
/* the dial is laid out by trigonometry, not by twelve hand-tuned offsets */
.d-clock i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: var(--muted);
  translate: calc(cos(var(--i) * 30deg) * 70px)
             calc(sin(var(--i) * 30deg) * 70px);
}
/* the quarters get the accent, purely to orient the eye */
.d-clock i:nth-child(3n+1) { background: var(--content); width: 5px; height: 5px; }
.d-clock i:nth-child(1)  { --i: 0; }
.d-clock i:nth-child(2)  { --i: 1; }
.d-clock i:nth-child(3)  { --i: 2; }
.d-clock i:nth-child(4)  { --i: 3; }
.d-clock i:nth-child(5)  { --i: 4; }
.d-clock i:nth-child(6)  { --i: 5; }
.d-clock i:nth-child(7)  { --i: 6; }
.d-clock i:nth-child(8)  { --i: 7; }
.d-clock i:nth-child(9)  { --i: 8; }
.d-clock i:nth-child(10) { --i: 9; }
.d-clock i:nth-child(11) { --i: 10; }
.d-clock i:nth-child(12) { --i: 11; }

/* Three hands, one keyframe. Duration decides which hand it is; the shared
   negative delay is what sets the time. */
.d-clock .hand {
  position: absolute;
  left: calc(50% - var(--w) / 2);
  bottom: 50%;
  width: var(--w);
  height: var(--l);
  border-radius: 999px;
  background: var(--paper);
  transform-origin: 50% 100%;
  animation: clock-turn var(--t) linear infinite;
  animation-delay: calc(var(--now, 0) * -1s);
}
.d-clock .hour   { --w: 5px; --l: 40px; --t: 43200s; }
.d-clock .minute { --w: 3px; --l: 58px; --t: 3600s; }
.d-clock .second { --w: 1px; --l: 64px; --t: 60s; background: var(--margin); }
.d-clock .pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--content);
}
@keyframes clock-turn { to { rotate: 360deg; } }

/* A paused animation still honours its negative delay, so the hands freeze
   at the right time instead of springing back to twelve. */
@media (prefers-reduced-motion: reduce) {
  .d-clock .hand { animation-play-state: paused; }
}

/* ---------- sliding underline ---------- */

.d-under { display: grid; gap: 16px; justify-items: start; }
.d-under a {
  color: var(--paper);
  text-decoration: none;
  font: 500 15px/1.4 var(--sans);
  padding-bottom: 3px;
  background: linear-gradient(currentColor, currentColor)
    no-repeat left 100% / 0% 2px;
  transition: background-size .25s ease;
}
.d-under a:hover,
.d-under a:focus-visible { background-size: 100% 2px; outline: none; }

/* ---------- object-fit avatars ---------- */

.d-fit { display: flex; gap: 22px; }
.d-fit figure { margin: 0; display: grid; gap: 8px; justify-items: center; }
.d-fit img { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); }
.d-fit .cover img { object-fit: cover; }
.d-fit figcaption { font: 400 10px/1 var(--mono); color: var(--muted); letter-spacing: .06em; }

/* ---------- focus-within menu ---------- */

.d-fw { position: relative; display: inline-block; }
.d-fw .trigger {
  font: 500 13px/1 var(--mono);
  padding: 10px 16px;
  border-radius: var(--r-sm, 6px);
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--paper);
  cursor: pointer;
}
.d-fw .trigger:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }
/* the bridge: padding, never margin, or the hover path has a hole in it */
.d-fw ul {
  position: absolute;
  top: 100%;
  left: 0;
  margin: 0;
  padding: 8px 0 0;
  list-style: none;
  visibility: hidden;
}
.d-fw li { background: var(--raised); border: 1px solid var(--line); margin-top: -1px; }
.d-fw li a {
  display: block;
  padding: 10px 16px;
  font: 400 12px/1 var(--mono);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.d-fw li a:hover, .d-fw li a:focus-visible { color: var(--paper); outline: none; background: var(--ink); }
.d-fw:hover ul, .d-fw:focus-within ul { visibility: visible; }

/* ---------- overflow: clip vs hidden ---------- */

.d-clip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 290px; }
.d-clip figure { margin: 0; display: grid; gap: 6px; min-width: 0; }
.d-clip figcaption { font: 400 10px/1 var(--mono); color: var(--muted); text-align: center; }
.d-clip-pane {
  height: 148px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 6px);
  background: var(--ink);
}
/* the only difference between the two panes is this one word. hidden is not
   allowed to stay on one axis: the used value of overflow-y becomes auto, the
   wrapper turns into a scroll container, and the sticky heading inside starts
   resolving against a box that never scrolls */
.d-clip-wrap--hidden { overflow-x: hidden; }
.d-clip-wrap--clip { overflow-x: clip; }
.d-clip h4 {
  position: sticky;
  top: 0;
  margin: 0;
  padding: 7px 9px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
  font: 500 10px/1 var(--mono);
  color: var(--paper);
}
.d-clip p {
  margin: 0;
  padding: 6px 9px;
  font: 400 10px/1.5 var(--mono);
  color: var(--muted);
  /* wider than the pane on purpose, so there is something to clip */
  white-space: nowrap;
}

/* ---------- the html + css chip ---------- */

/* Two of these exist and they are one control: the one in the filter row and
   the one on every card that carries markup. Pressing either presses both,
   which is why the state is written to all of them at once. */
.code-tag {
  font: 400 10px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
  background: none;
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}
.code-tag:hover { color: var(--paper); border-color: var(--content); }
.code-tag[aria-pressed="true"] {
  color: var(--ink);
  background: var(--content);
  border-style: solid;
  border-color: var(--content);
}
.code-tag:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }
.card-top .code-tag { padding: 4px 9px; }

/* the property label is a link to the card's own page now, and says so only
   on hover — an underline on every card would turn the feed into a list of
   links with demos attached */
.card-top .prop a { color: inherit; text-decoration: none; }
.card-top .prop a:hover { text-decoration: underline; }
.card-top .prop a:focus-visible { outline: 2px solid var(--content); outline-offset: 3px; }

/* ---------- view() reveal ---------- */

.d-viewt {
  width: 100%;
  max-width: 250px;
  height: 170px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 6px);
  background: var(--ink);
}
.d-viewt p { margin: 0; padding: 12px 14px 2px; font: 400 11px/1.5 var(--mono); color: var(--muted); }
.d-viewt ul { list-style: none; margin: 0; padding: 10px 14px 14px; display: grid; gap: 8px; }
.d-viewt li {
  padding: 12px 14px;
  border-radius: var(--r-sm, 6px);
  background: var(--raised);
  border: 1px solid var(--line);
  font: 400 12px/1 var(--mono);
  color: var(--paper);
  /* the hidden state lives in the keyframe's from, never on the element:
     without view() support the zero-duration animation ends instantly and
     the content is simply there */
  animation: d-rise linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 85%;
}
@keyframes d-rise {
  from { opacity: 0; translate: 0 16px; scale: .96; }
}
@media (prefers-reduced-motion: reduce) {
  .d-viewt li { animation: none; }
}

/* ---------- shape-outside: a float that is not a rectangle ---------- */

.d-shape {
  width: 100%;
  max-width: 272px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 6px);
  background: var(--raised);
}
.d-shape .orb {
  float: left;
  width: 94px;
  height: 94px;
  /* border-radius paints the circle; shape-outside is what the text obeys.
     Two separate declarations describing the same circle, by hand */
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%,
      color-mix(in srgb, var(--content) 52%, transparent),
      color-mix(in srgb, var(--content) 30%, transparent) 72%);
  /* the reference box is pinned to border-box, so the optical overhang
     below moves the paint and leaves the wrap where it was drawn */
  shape-outside: circle(50%) border-box;
  shape-margin: 9px;
  margin-left: -5px;
}
.d-shape p {
  margin: 0;
  font: 400 12.5px/1.7 var(--sans);
  color: var(--paper);
  hyphens: auto;
}

/* ---------- linear(): a spring in the easing function ---------- */

.d-spring { width: 200px; max-width: 100%; display: grid; gap: 15px; }
.d-spring .run {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 400 12px/1 var(--mono);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.d-spring .run input { accent-color: var(--content); margin: 0; }
.d-spring .track { display: grid; gap: 7px; }
.d-spring .lane {
  position: relative;
  width: 200px;
  max-width: 100%;
  height: 1px;
  background: var(--line);
}
/* the target the spring passes and comes back to */
.d-spring .lane::after {
  content: "";
  position: absolute;
  right: 0;
  top: -5px;
  width: 1px;
  height: 11px;
  background: color-mix(in srgb, var(--muted) 65%, transparent);
}
.d-spring .knob {
  position: absolute;
  top: -7px;
  left: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--content);
}
.d-spring .knob--ease { transition: translate .55s cubic-bezier(.22, .61, .36, 1); }
/* a spring equation sampled into stops — generated, never hand-written */
.d-spring .knob--spring {
  transition: translate .55s linear(
    0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%,
    1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%,
    1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%,
    0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
}
.d-spring:has(input:checked) .knob { translate: 185px; }
.d-spring figcaption { font: 400 10px/1 var(--mono); color: var(--muted); }

/* ---------- animating to height auto ---------- */

.d-isize {
  /* the opt-in inherits, so it is scoped here and not on :root */
  interpolate-size: allow-keywords;
  width: 100%;
  max-width: 250px;
}
.d-isize .head {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 400 13px/1 var(--mono);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.d-isize .head input { accent-color: var(--content); margin: 0; }
.d-isize .panel {
  height: 0;
  overflow: clip;
  transition: height .35s ease;
}
.d-isize:has(input:checked) .panel { height: auto; }
.d-isize .panel p {
  margin: 10px 0 0;
  padding: 14px 16px;
  border-radius: var(--r-sm, 6px);
  border: 1px solid var(--line);
  background: var(--raised);
  font: 400 12px/1.6 var(--mono);
  color: var(--paper);
}

/* ---------- styles that stop at a boundary ---------- */

.d-scope {
  width: 100%;
  max-width: 250px;
  font: 400 12px/1.5 var(--mono);
}
.d-scope .outer,
.d-scope .inner {
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 6px);
  padding: 12px 14px;
  background: var(--raised);
}
.d-scope .inner { margin-top: 10px; background: var(--surface); }
.d-scope p { margin: 0; color: var(--muted); }

@scope (.d-scope .outer) to (.inner) {
  p {
    color: var(--content);
    border-left: 2px solid var(--content);
    padding-left: 9px;
  }
}

/* ---------- a tooltip pinned to its anchor ---------- */

.d-anchor {
  display: grid;
  place-items: center;
  min-height: 156px;
  width: 100%;
}
.d-anchor .pin {
  anchor-name: --pin;
  font: 400 13px/1 var(--mono);
  color: var(--paper);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 6px);
  padding: 10px 16px;
  cursor: pointer;
}
.d-anchor .tip {
  position: absolute;
  position-anchor: --pin;
  position-area: block-start;
  position-try-fallbacks: flip-block;
  margin-block: 8px;
  max-width: 176px;
  font: 400 12px/1.5 var(--mono);
  color: var(--ink);
  background: var(--content);
  border-radius: var(--r-sm, 6px);
  padding: 8px 11px;
  opacity: 0;
  transition: opacity .18s ease;
}
.d-anchor .pin:hover + .tip,
.d-anchor .pin:focus-visible + .tip { opacity: 1; }

/* ---------- carousel dots the browser draws ---------- */

.d-marker {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-marker-group: after;
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
  width: 100%;
  max-width: 260px;
  scrollbar-width: none;
}
.d-marker::-webkit-scrollbar { display: none; }
.d-marker > li {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: grid;
  place-items: center;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 6px);
  background: var(--raised);
  font: 400 13px/1 var(--mono);
  color: var(--muted);
}
.d-marker::scroll-marker-group {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 12px;
}
.d-marker > li::scroll-marker {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
}
.d-marker > li::scroll-marker:target-current {
  background: var(--content);
  border-color: var(--content);
}

/* ---------- one declaration, both themes ---------- */

.d-ld {
  /* light-dark() reads the computed color-scheme, which :root already
     sets to match data-theme — overriding it here with `light dark`
     would follow the OS instead of the site's own toggle */
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 250px;
}
.d-ld .swatch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--r-sm, 6px);
  font: 400 12px/1 var(--mono);
  border: 1px solid light-dark(#d6d3c8, #2a3342);
  background: light-dark(#f6f4ec, #171d28);
  color: light-dark(#23221c, #e6eaf2);
}
.d-ld .swatch b { font-weight: 400; color: var(--content); }
.d-ld .broken {
  color-scheme: normal;
  opacity: .75;
}

/* ---------- stripes that survive a filter ---------- */

.d-nthof {
  width: 100%;
  max-width: 250px;
  font: 400 12px/1 var(--mono);
  color: var(--paper);
}
.d-nthof .toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
}
.d-nthof .toggle input { accent-color: var(--content); margin: 0; }
.d-nthof ul { list-style: none; margin: 0; padding: 0; }
.d-nthof li {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-top: 0;
  color: var(--muted);
}
.d-nthof li:first-child { border-top: 1px solid var(--line); }
.d-nthof li.gone { display: none; }
.d-nthof:has(input:checked) li.gone { display: block; }

/* numbered within the kept rows, not filtered after numbering */
.d-nthof li:nth-child(odd of :not(.gone)) {
  background: var(--raised);
  color: var(--paper);
}

/* ---------- a drop cap that sits in the text ---------- */

.d-cap {
  width: 100%;
  max-width: 252px;
  font: 400 12px/1.65 var(--sans);
  color: var(--muted);
}
.d-cap p { margin: 0; }
.d-cap p::first-letter {
  /* three lines tall, sunk two: the browser does the maths */
  initial-letter: 3 2;
  font-family: var(--display);
  font-weight: 600;
  color: var(--content);
  /* the sinking is vertical only — the gutter is still yours */
  margin-right: 8px;
}

/* ---------- an outline that stays outside the letters ---------- */

.d-stroke {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}
.d-stroke b {
  font: 600 44px/1.15 var(--display);
  color: var(--paper);
  /* centred on the outline, so half of it grows inward */
  -webkit-text-stroke: 5px var(--content);
}
/* the fill paints last and covers the half that grew in */
.d-stroke .after { paint-order: stroke fill; }
.d-stroke span {
  font: 400 10px/1 var(--mono);
  color: var(--muted);
  margin-bottom: 10px;
}
.d-stroke span:last-child { margin-bottom: 0; }

/* ---------- type that inverts against its backdrop ---------- */

.d-diff {
  /* stop the blend here, or it reaches past the demo and
     picks up the card and the page behind it */
  isolation: isolate;
  width: 100%;
  max-width: 252px;
  padding: 30px 12px;
  border-radius: 4px;
  background: linear-gradient(90deg,
              var(--paper) 0 50%, var(--ink) 50%);
}
.d-diff p {
  margin: 0;
  font: 600 30px/1.1 var(--display);
  text-align: center;
  color: #fff;
  /* white minus the backdrop is the backdrop inverted */
  mix-blend-mode: difference;
}

/* ---------- a heading trimmed to its own cap height ---------- */

.d-trim {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 252px;
}
.d-trim b {
  display: block;
  background: var(--raised);
  border-radius: 3px;
  font: 600 26px/1.6 var(--display);
  color: var(--paper);
}
/* trim the block box down to the cap line and the baseline */
.d-trim .after { text-box: trim-both cap alphabetic; }
.d-trim span {
  font: 400 10px/1 var(--mono);
  color: var(--muted);
  margin-top: -8px;
}

/* ---------- a label that takes real space on its side ---------- */

.d-spine {
  display: flex;
  gap: 12px;
  align-items: stretch;
  width: 100%;
  max-width: 252px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--raised);
}
.d-spine b {
  writing-mode: vertical-rl;
  /* the block axis is horizontal now, so the logical names
     are the ones that still point where they say */
  padding-inline: 10px;
  padding-block: 6px;
  border-radius: 3px;
  background: var(--content);
  color: var(--ink);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.d-spine p {
  margin: 0;
  font: 400 12px/1.6 var(--sans);
  color: var(--muted);
}

/* ---------- an edge that fades instead of cutting ---------- */

.d-fade {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 252px;
  padding-bottom: 8px;
  overflow-x: auto;
  /* one gradient per edge, and intersect to keep both:
     the default add unions them, and the union is no mask */
  mask-image:
    linear-gradient(90deg, #0000, #000 26px),
    linear-gradient(-90deg, #0000, #000 26px);
  mask-composite: intersect;
}
.d-fade span {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--raised);
  font: 400 11px/1 var(--mono);
  color: var(--code);
}

/* ---------- centring in a plain block box ---------- */

.d-acen {
  width: 100%;
  max-width: 252px;
  height: 132px;
  padding: 0 16px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  /* no flex, no grid, no wrapper: block layout learned
     to distribute its own free space */
  align-content: center;
}
.d-acen b {
  display: block;
  font: 600 16px/1.3 var(--display);
  color: var(--paper);
}
.d-acen p {
  margin: 4px 0 0;
  font: 400 12px/1.5 var(--sans);
  color: var(--muted);
}

/* ---------- auto-fit collapses, auto-fill holds ---------- */

.d-fitfill {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 252px;
}
.d-fitfill div {
  display: grid;
  gap: 8px;
  /* empty tracks stay, so two items keep their own size */
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
}
/* empty tracks collapse, so two items share the whole row */
.d-fitfill .fit {
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
}
.d-fitfill i {
  height: 30px;
  border-radius: 3px;
  background: var(--content);
}
.d-fitfill span {
  font: 400 10px/1 var(--mono);
  color: var(--muted);
  margin-bottom: -6px;
}

/* ---------- the same mix, in two colour spaces ---------- */

.d-mix {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 252px;
}
.d-mix p {
  margin: 0;
  font: 400 10px/1 var(--mono);
  color: var(--muted);
}
.d-mix div {
  display: grid;
  grid-auto-flow: column;
  gap: 3px;
}
.d-mix i {
  height: 30px;
  border-radius: 3px;
}
.d-mix i:first-child { background: var(--content); }
.d-mix i:last-child { background: var(--margin); }
/* straight through sRGB, which runs the midpoint via grey */
.d-mix .srgb i:nth-child(2) { background: color-mix(in srgb, var(--content) 75%, var(--margin)); }
.d-mix .srgb i:nth-child(3) { background: color-mix(in srgb, var(--content) 50%, var(--margin)); }
.d-mix .srgb i:nth-child(4) { background: color-mix(in srgb, var(--content) 25%, var(--margin)); }
/* the same three steps in OKLCH, which keeps the chroma up */
.d-mix .oklch i:nth-child(2) { background: color-mix(in oklch, var(--content) 75%, var(--margin)); }
.d-mix .oklch i:nth-child(3) { background: color-mix(in oklch, var(--content) 50%, var(--margin)); }
.d-mix .oklch i:nth-child(4) { background: color-mix(in oklch, var(--content) 25%, var(--margin)); }

/* ---------- skip link ---------- */

.d-skip { position: relative; width: 100%; max-width: 250px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); overflow: hidden; }
.d-skip header { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.d-skip header i { width: 38px; height: 8px; border-radius: 4px; background: var(--raised); }
.d-skip p { margin: 0; padding: 12px 12px 14px; font: 400 11px/1.5 var(--mono); color: var(--muted); }
.d-skip a { position: absolute; top: 5px; left: 5px; padding: 7px 12px; border-radius: 6px; background: var(--content); color: var(--ink); font: 600 11px/1 var(--mono); text-decoration: none; translate: 0 -44px; transition: translate .18s; }
.d-skip a:focus { translate: 0 0; outline: 2px solid var(--paper); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .d-skip a { transition: none; } }

/* ---------- visually hidden ---------- */

.d-vh { display: grid; grid-auto-flow: column; gap: 30px; }
.d-vh figure { margin: 0; position: relative; display: grid; justify-items: center; gap: 10px; }
.d-vh button { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--paper); font: 600 15px/1 var(--mono); display: grid; place-items: center; cursor: pointer; }
.d-vh button:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }
.d-vh .kept { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.d-vh .gone { display: none; }
.d-vh figcaption { font: 400 10px/1.5 var(--mono); color: var(--muted); text-align: center; }
.d-vh figcaption b { display: block; font-weight: 600; color: var(--paper); }

/* ---------- relative colours ---------- */

.d-from { display: grid; gap: 10px; width: 100%; max-width: 252px; }
.d-from p { margin: 0; font: 400 10px/1 var(--mono); color: var(--muted); }
.d-from div { display: grid; grid-auto-flow: column; gap: 3px; }
.d-from i { height: 30px; border-radius: 3px; background: var(--content); }
.d-from .tint { background: oklch(from var(--content) calc(l + .17) c h); }
.d-from .shade { background: oklch(from var(--content) calc(l - .17) c h); }
.d-from .mute { background: oklch(from var(--content) l calc(c / 4) h); }
.d-from .flip { background: oklch(from var(--content) l c calc(h + 180)); }

/* ---------- layered shadow ---------- */

.d-shade { display: grid; grid-auto-flow: column; gap: 20px; padding: 24px 20px 18px; border-radius: 12px; background: #dfe3ec; }
.d-shade figure { margin: 0; display: grid; gap: 12px; justify-items: center; }
.d-shade i { width: 76px; height: 54px; border-radius: 8px; background: #fff; }
.d-shade .one i { box-shadow: 0 12px 24px rgb(9 14 24 / .45); }
.d-shade .four i { box-shadow: 0 1px 1px rgb(9 14 24 / .07), 0 2px 3px rgb(9 14 24 / .07), 0 5px 8px rgb(9 14 24 / .07), 0 12px 20px rgb(9 14 24 / .07); }
.d-shade figcaption { font: 400 10px/1.3 var(--mono); color: #4d5566; text-align: center; }

/* ---------- template areas ---------- */

.d-areas { width: 100%; max-width: 250px; display: grid; gap: 5px; grid-template-columns: 62px minmax(0, 1fr); grid-template-rows: 32px 66px 32px; grid-template-areas: "head head" "side main" "foot foot"; }
.d-areas i { display: grid; place-items: center; border-radius: 5px; font: 500 10px/1 var(--mono); font-style: normal; color: var(--ink); }
.d-areas .hd { grid-area: head; background: var(--content); }
.d-areas .sd { grid-area: side; background: var(--margin); }
.d-areas .mn { grid-area: main; background: var(--padding); }
.d-areas .ft { grid-area: foot; background: var(--muted); }

/* ---------- reduced motion ---------- */

.d-motion { display: grid; place-items: center; gap: 16px; }
.d-motion .orb { width: 72px; height: 72px; border-radius: 50%; border: 1px dashed var(--line); position: relative; animation: d-orbit 3.2s linear infinite; }
.d-motion .orb::after { content: ""; position: absolute; top: -7px; left: calc(50% - 7px); width: 14px; height: 14px; border-radius: 50%; background: var(--content); }
@keyframes d-orbit { to { rotate: 360deg; } }
@keyframes d-breathe { 50% { opacity: .35; } }
.d-motion p { margin: 0; font: 400 10px/1.5 var(--mono); color: var(--muted); text-align: center; max-width: 200px; }
.d-motion .still { display: none; }
@media (prefers-reduced-motion: reduce) {
  .d-motion .orb { animation: d-breathe 3.2s ease-in-out infinite; }
  .d-motion .spin { display: none; }
  .d-motion .still { display: block; }
}

/* ---------- ellipsis ---------- */

.d-ellip { display: grid; gap: 14px; width: 100%; max-width: 236px; }
.d-ellip figure { margin: 0; display: grid; gap: 6px; }
.d-ellip figcaption { font: 400 10px/1 var(--mono); color: var(--muted); }
.d-ellip div { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--raised); padding: 9px 11px; font: 500 12px/1.2 var(--mono); color: var(--paper); }
.d-ellip i { flex: none; width: 14px; height: 14px; border-radius: 4px; background: var(--content); }
.d-ellip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-ellip .trap span { overflow: visible; }

/* ---------- overflow wrap ---------- */

.d-wrap { display: grid; gap: 14px; width: 100%; max-width: 236px; }
.d-wrap figure { margin: 0; display: grid; gap: 6px; min-width: 0; }
.d-wrap figcaption { font: 400 10px/1 var(--mono); color: var(--muted); }
.d-wrap p { margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--raised); padding: 9px 11px; font: 400 12px/1.5 var(--mono); color: var(--paper); }
.d-wrap .fix p { overflow-wrap: anywhere; }

/* ---------- drop shadow ---------- */

.d-drop { display: grid; grid-auto-flow: column; gap: 26px; padding: 20px 18px 14px; border-radius: 12px; background: #dfe3ec; }
.d-drop figure { margin: 0; display: grid; gap: 10px; justify-items: center; }
.d-drop i { display: block; width: 64px; height: 64px; background: #fff; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.d-drop .self i { filter: drop-shadow(0 7px 6px rgb(9 14 24 / .55)); }
.d-drop .parent span { display: block; filter: drop-shadow(0 7px 6px rgb(9 14 24 / .55)); }
.d-drop figcaption { font: 400 10px/1.3 var(--mono); color: #4d5566; text-align: center; }

/* ---------- fixed under transform ---------- */

.d-fixed { position: relative; width: 100%; max-width: 250px; height: 150px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); transform: translate(0); overflow: hidden; }
.d-fixed p { margin: 0; padding: 12px; font: 400 11px/1.5 var(--mono); color: var(--muted); }
.d-fixed b { position: fixed; right: 10px; bottom: 10px; padding: 7px 11px; border-radius: 999px; background: var(--margin); color: var(--ink); font: 600 10px/1 var(--mono); }

/* ---------- fluid type ---------- */

.d-fluid { width: min(100%, 260px); display: grid; gap: 8px; }
.d-fluid .frame { resize: horizontal; overflow: hidden; min-width: 130px; max-width: 100%; border: 1px dashed var(--line); border-radius: 8px; container-type: inline-size; }
.d-fluid .frame p { margin: 0; padding: 14px 14px 18px; font: 600 clamp(13px, 9cqi, 30px)/1.15 var(--display); color: var(--paper); }
.d-fluid .hint { font: 400 10px/1 var(--mono); color: var(--muted); text-align: right; }

/* ---------- underline tuning ---------- */

.d-deco { display: grid; gap: 16px; font: 500 17px/1.2 var(--sans); color: var(--paper); }
.d-deco figure { margin: 0; display: grid; gap: 5px; }
.d-deco figcaption { font: 400 10px/1 var(--mono); color: var(--muted); }
.d-deco span { text-decoration: underline; width: max-content; }
.d-deco .tuned span { text-decoration-thickness: .09em; text-underline-offset: .24em; text-decoration-color: color-mix(in srgb, var(--content) 65%, transparent); }
.d-deco .solid span { text-decoration-skip-ink: none; }

/* ---------- counters ---------- */

.d-toc { font: 400 12.5px/1.7 var(--mono); color: var(--paper); }
.d-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: sec; }
.d-toc ol ol { padding-left: 22px; }
.d-toc li::before { counter-increment: sec; content: counters(sec, ".") "  "; color: var(--content); font-weight: 600; }

/* ---------- range fill ---------- */

.d-trackfill { width: 100%; max-width: 250px; }
.d-trackfill input { display: block; width: 100%; height: 14px; margin: 0; appearance: none; background: var(--line); border-radius: 999px; overflow: hidden; }
.d-trackfill input::-webkit-slider-runnable-track { height: 14px; background: transparent; }
.d-trackfill input::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); box-shadow: calc(-100vw - 7px) 0 0 100vw var(--content); }
.d-trackfill input::-moz-range-track { height: 14px; background: transparent; }
.d-trackfill input::-moz-range-progress { height: 14px; background: var(--content); }
.d-trackfill input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--paper); }
.d-trackfill input:focus-visible { outline: 2px solid var(--content); outline-offset: 4px; }

/* ---------- hover gate ---------- */

.d-hovergate { display: grid; gap: 14px; justify-items: center; text-align: center; }
.d-hovergate button { font: 600 14px/1 var(--sans); color: var(--paper); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; cursor: pointer; transition: translate .2s, border-color .2s; }
.d-hovergate button:focus-visible { outline: 2px solid var(--content); outline-offset: 3px; translate: 0 -3px; }
.d-hovergate p { margin: 0; font: 400 12px/1.5 var(--mono); color: var(--muted); }
.d-hovergate p::after { content: "this pointer cannot hover, so nothing lifts"; }
@media (hover: hover) and (pointer: fine) {
  .d-hovergate button:hover { translate: 0 -3px; border-color: var(--content); }
  .d-hovergate p::after { content: "this pointer can hover"; }
}

/* ---------- sticky header that knows it is stuck ---------- */

.d-stuck { width: 100%; max-width: 260px; }
.d-stuck .scroller { height: 168px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.d-stuck .head { position: sticky; top: 0; container-type: scroll-state; background: var(--surface); }
.d-stuck .head span { display: block; padding: 9px 12px; font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s, background-color .2s; }
.d-stuck p { margin: 0; padding: 9px 12px; font: 400 11px/1.5 var(--mono); color: var(--muted); border-bottom: 1px solid var(--line); }
.d-stuck p:last-child { border-bottom: 0; }
@container scroll-state(stuck: top) {
  .d-stuck .head span { color: var(--content); border-bottom-color: var(--line); background: var(--raised); }
}

/* ---------- card rows that line up across cards ---------- */

.d-subgrid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: auto 1fr auto; gap: 8px; width: 100%; max-width: 268px; }
.d-subgrid .tier { grid-row: span 3; display: grid; grid-template-rows: subgrid; gap: 6px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.d-subgrid h4 { margin: 0; font: 500 11px/1.25 var(--sans); color: var(--paper); }
.d-subgrid p { margin: 0; font: 400 10px/1.4 var(--mono); color: var(--muted); }
.d-subgrid b { align-self: end; font: 500 10px/1 var(--mono); color: var(--content); border-top: 1px solid var(--line); padding-top: 6px; }

/* ---------- a stagger that survives a new item ---------- */

.d-stagger { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; width: 100%; max-width: 216px; }
.d-stagger li { font: 400 11px/1 var(--mono); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--content); border-radius: 7px; padding: 9px 11px; animation: d-stagger-in 2.4s calc(sibling-index() * 140ms) infinite; }
@keyframes d-stagger-in {
  0%, 55%, 100% { opacity: .3; translate: -10px 0; }
  14%, 41% { opacity: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .d-stagger li { animation: none; opacity: 1; translate: none; }
}

/* ---------- a bar sized by its own data attribute ---------- */

.d-attrbars { display: grid; gap: 8px; width: 100%; max-width: 232px; }
.d-attrbars div { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 9px; font: 400 10px/1 var(--mono); color: var(--muted); }
.d-attrbars i { font-style: normal; }
.d-attrbars span { display: block; height: 13px; border-radius: 4px; background: color-mix(in srgb, var(--content) 30%, transparent); border: 1px solid var(--content); width: attr(data-pct type(<percentage>), 4%); transition: width .3s; }

/* ---------- a select you can finally style ---------- */

.d-baseselect { appearance: base-select; font: 400 12px/1 var(--mono); color: var(--paper); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; min-width: 176px; }
.d-baseselect::picker-icon { color: var(--content); transition: rotate .2s; }
.d-baseselect:open::picker-icon { rotate: 180deg; }
.d-baseselect::picker(select) { appearance: base-select; border: 1px solid var(--line); border-radius: 9px; background: var(--raised); padding: 5px; margin-top: 5px; }
.d-baseselect option { font: 400 12px/1 var(--mono); color: var(--muted); padding: 8px 10px; border-radius: 6px; }
.d-baseselect option:hover, .d-baseselect option:focus { background: var(--surface); color: var(--paper); }
.d-baseselect option:checked { color: var(--content); }
.d-baseselect option::checkmark { content: "\2022"; margin-right: 7px; }

/* ---------- a dialog opened with no script at all ---------- */

.d-command { display: grid; gap: 11px; justify-items: center; text-align: center; }
.d-command > button { font: 500 12px/1 var(--mono); color: var(--paper); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 11px 16px; cursor: pointer; transition: border-color .2s; }
.d-command > button:hover, .d-command > button:focus-visible { border-color: var(--content); }
.d-command p { margin: 0; font: 400 10px/1.5 var(--mono); color: var(--muted); }
.d-command dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--raised); color: var(--paper); padding: 20px; max-width: 280px; font: 400 12px/1.5 var(--mono); }
.d-command dialog::backdrop { background: color-mix(in srgb, var(--ink) 72%, transparent); }
.d-command dialog button { margin-top: 14px; font: 500 11px/1 var(--mono); color: var(--content); background: none; border: 1px solid var(--line); border-radius: 7px; padding: 8px 13px; cursor: pointer; }

/* ---------- text the find bar can still reach ---------- */

.d-untilfound { width: 100%; max-width: 250px; display: grid; gap: 9px; font: 400 11px/1.55 var(--mono); color: var(--muted); }
.d-untilfound p { margin: 0; }
.d-untilfound kbd { font: 500 10px/1 var(--mono); color: var(--paper); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; margin-right: 3px; }
/* styled only once the browser has removed the attribute: a
   content-visibility: hidden box still paints its own border */
.d-untilfound .panel:not([hidden]) { border: 1px solid var(--line); border-left: 2px solid var(--padding); border-radius: 8px; background: var(--surface); padding: 10px 12px; color: var(--paper); animation: d-uf-in .35s both; }
@keyframes d-uf-in { from { opacity: 0; translate: 0 -6px; } }

/* ---------- the full height a phone actually gives you ---------- */

.d-dvh { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; width: 100%; max-width: 224px; }
.d-dvh div { display: grid; gap: 6px; justify-items: center; }
.d-dvh span { display: block; width: 100%; border-radius: 6px 6px 0 0; background: color-mix(in srgb, var(--content) 26%, transparent); border: 1px solid var(--content); border-bottom: 0; }
.d-dvh .s span { height: calc(100svh / 12); }
.d-dvh .d span { height: calc(100dvh / 12); }
.d-dvh .l span { height: calc(100lvh / 12); }
.d-dvh b { font: 500 10px/1 var(--mono); color: var(--muted); border-top: 1px solid var(--line); padding-top: 7px; width: 100%; text-align: center; }

/* ---------- the jump when a scrollbar arrives ---------- */

.d-gutter { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; width: 100%; max-width: 262px; }
.d-gutter b { display: block; font: 500 9px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.d-gutter .pane { height: 124px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
/* styling the scrollbar opts this demo out of overlay scrollbars, which
   is the only way the reserved gutter is visible on a Mac at all */
.d-gutter .pane::-webkit-scrollbar { width: 9px; }
.d-gutter .pane::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; }
.d-gutter .stable { scrollbar-gutter: stable; }
.d-gutter p { margin: 0; padding: 10px; font: 400 10px/1.5 var(--mono); color: var(--muted); text-align: center; animation: d-gutter-grow 5s steps(1, end) infinite; }
@keyframes d-gutter-grow {
  0%, 50% { padding-bottom: 10px; }
  50.01%, 100% { padding-bottom: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  .d-gutter p { animation: none; padding-bottom: 130px; }
}

/* ---------- the 099 grammar ----------
   An experiment borrowed whole from 099.supply: one monospace voice for
   everything, no colour but grey, framed buttons over a header that is not
   there, and the feed as a wall of tiles — the demo in a frame, a caption
   bar under it, the caption swapping to where it goes on hover. Everything
   below overrides what came before it, so deleting this block is the undo. */

:root, :root[data-theme="dark"] {
  --content: #ffffff;
  --padding: #b9b9b9;
  --margin: #e0e0e0;
  --ink: #101010;
  --surface: #161616;
  --raised: #1c1c1c;
  --paper: #ffffff;
  --muted: #888888;
  --line: #555555;
  --line-hover: #999999;
  --code: #cccccc;
  --shimmer: #222222;
  --sans: var(--mono);
  --display: var(--mono);
  --gutter: clamp(16px, 3vw, 40px);
}
:root[data-theme="light"] {
  --content: #101010;
  --padding: #555555;
  --margin: #222222;
  --ink: #ffffff;
  --surface: #f6f6f6;
  --raised: #fafafa;
  --paper: #101010;
  --muted: #696969;
  --line: #e0e0e0;
  --line-hover: #999999;
  --code: #333333;
  --shimmer: #eeeeee;
}

/* Two demos are about colour itself: one token taken apart into tint, shade,
   muted and complement, and two colours mixed through sRGB and OKLCH. Fed the
   grey tokens above they show white and grey and prove nothing, since a
   colour with no chroma has no hue to turn and no grey dip to avoid. They
   keep the site's old blue and tan, the same #6fa8dc the code under the demo
   declares. */
.d-from, .d-mix { --content: #6fa8dc; --margin: #f6b26b; }
:root[data-theme="light"] :is(.d-from, .d-mix) { --content: #27619b; --margin: #8b530f; }

body { font-size: 15px; font-synthesis: none; }
h1, h2, h3, h4, h5, .detail h3, .article h1 { font-weight: 500 !important; letter-spacing: -0.01em; }
.wrap { max-width: none; }
::selection { background: var(--paper); color: var(--ink); }

/* ---------- header: three columns, no bar ---------- */

.masthead {
  border-bottom: 0;
  background: none;
  backdrop-filter: none;
}
.masthead .wrap { height: 76px; gap: 8px; position: relative; }
.masthead nav { display: contents; }
.masthead nav a, .menu-btn, .theme {
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px 11px;
  transition: border-color .12s ease-out;
}
.masthead nav a:hover, .menu-btn:hover, .theme:hover { color: var(--paper); border-color: var(--line-hover); }
.masthead nav a[href="/about/"] { margin-left: auto; }
.theme { width: 36px; height: 34px; padding: 0; order: 9; }
.menu-btn { order: 10; }
/* the wordmark sits dead centre whatever is either side of it */
.wordmark {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  font: 400 13px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  padding: 6px 8px;
  border-radius: 6px;
}
.wordmark b { color: inherit; font-weight: 400; }
@media (max-width: 880px) {
  .wordmark { position: static; translate: none; margin-right: auto; }
  .menu-btn { border-radius: 6px; }
}

/* ---------- hero, quieter ---------- */

.hero { padding: 24px 0 56px; }
.hero h1 {
  font: 500 clamp(30px, 4.6vw, 64px)/1 var(--mono);
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.hero h1 em { color: var(--muted); }
.hero-copy > p:last-child { font-size: 13px; line-height: 1.6; }
.eyebrow { font: 400 12px/1 var(--mono) !important; letter-spacing: 0.08em !important; color: var(--muted) !important; }

/* ---------- labels, chips, inputs ---------- */

.feed-head { border-top: 0; padding: 8px 0 14px; }
.feed-head h2, .feed-head span {
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.filters input, .tags button, .view-picker, .view-picker button, .code-tag, .copy, .tag-nav a {
  border-radius: 6px;
}
.view-picker::after { border-radius: 4px; }
.tags button, .code-tag, .view-picker button {
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 11px 10px;
  border-style: solid;
  transition: color .12s ease-out, border-color .12s ease-out, background .12s ease-out;
}
.tags button:hover, .code-tag:hover, .tag-nav a:hover { color: var(--paper); border-color: var(--line-hover); }
/* a pressed chip is filled with --content, which is --paper in both themes:
   the hover colour above would turn its label the colour of its fill */
.tags button[aria-pressed="true"]:hover, .code-tag[aria-pressed="true"]:hover { color: var(--ink); border-color: var(--content); }
.filters input { font-size: 12px; padding: 10px 12px 11px; background: var(--ink); }

/* the counter rolls like an odometer: each digit is a column of 0–9 moved
   up by its own value, so a filter that drops 90 to 12 spins to it */
.odo {
  display: inline-block;
  height: 1em;
  line-height: 1;
  overflow: hidden;
  vertical-align: -0.12em;
}
.odo > span {
  display: block;
  width: 1ch;
  word-break: break-all;
  transition: translate .6s cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-reduced-motion: reduce) { .odo > span { transition: none; } }

/* ---------- the feed as a wall of tiles ---------- */

/* 250 holds five tiles from 1400px; the demos were drawn for 242 and up */
.compact .cards { gap: 40px 40px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
@media (max-width: 1200px) { .compact .cards { gap: 24px; } }
/* .compact .card below sets display: flex at the same specificity, and the
   later rule wins, so a filtered-out tile stayed on screen. One class more. */
.cards .card[hidden] { display: none; }
.compact .card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border-color: var(--line);
  background: var(--ink);
  transition: border-color .12s ease-out;
}
.compact .card:hover { border-color: var(--line-hover); }
.compact .card-body { flex: 1; }
.compact .stage {
  aspect-ratio: 1;
  min-height: 0;
  border: 0;
  background: var(--surface);
}
/* the tile is the demo; title, caveat and source are one click away, and
   all of them are still in the row view */
.compact .detail { display: none; }

.compact .card-top {
  order: 2;
  position: relative;
  flex-wrap: nowrap;
  gap: 12px;
  padding: 10px 12px 11px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  overflow: hidden;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.compact .card-top::before { content: "E\00a0" attr(data-no); color: var(--paper); white-space: nowrap; }
.compact .card-top > :not(.name) { display: none; }
.card-top .name { display: none; }

/* the right half of the caption: the title, and on hover the word Preview
   rising into its place. Both are one link to the element page. */
.compact .card-top .name {
  display: grid;
  margin-left: auto;
  min-width: 0;
  height: 1em;
  line-height: 1;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  text-align: right;
}
.compact .card-top .name span {
  grid-area: 1 / 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: translate .18s ease-out;
}
.compact .card-top .name span + span { translate: 0 110%; color: var(--paper); }
.compact .card:hover .name span:first-child, .compact .name:focus-visible span:first-child { translate: 0 -110%; }
.compact .card:hover .name span + span, .compact .name:focus-visible span + span { translate: 0 0; }
@media (prefers-reduced-motion: reduce) { .compact .card-top .name span { transition: none; } }

/* ---------- the row view and element pages, in the same voice ---------- */

.rows .card { border-radius: 8px; background: var(--ink); }
.rows .stage { background: var(--surface); }
.note b { letter-spacing: 0.08em; }
.source pre, .detail pre, pre { border-radius: 8px; }
.site-footer { font-size: 12px; letter-spacing: 0.04em; }

/* The catalogue is the demonstration; the introduction stays still. */
.home .hero--catalog { padding: clamp(40px, 6vw, 88px) 0 clamp(36px, 5vw, 64px); }
.home .hero-copy { margin-bottom: 0; align-items: end; }
.home .hero h1 {
  font: 600 clamp(46px, 6.5vw, 88px)/.98 var(--display);
  letter-spacing: -.04em;
  text-transform: none;
  text-wrap: initial;
}
.hero-intro { max-width: 36ch; }
.hero-intro p { margin: 0 0 24px; font: 400 18px/1.55 var(--sans); color: var(--paper); }
.hero-intro > a { display: inline-flex; align-items: center; gap: 24px; color: var(--paper); text-underline-offset: 5px; }
.hero-intro > a:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; }
@media (max-width: 760px) {
  .home .hero-copy { gap: 24px; }
  .hero-intro { max-width: 40ch; }
  .hero-intro p { font-size: 16px; margin-bottom: 20px; }
}

/* Pause previews only on the home feed, including animated pseudo-elements. */
.home .card .stage,
.home .card .stage *,
.home .card .stage::before,
.home .card .stage::after,
.home .card .stage *::before,
.home .card .stage *::after { animation-play-state: var(--preview-play, paused) !important; }
.home .card:focus-within { --preview-play: running; }
@media (hover: hover) {
  .home .card:hover { --preview-play: running; }
}

/* ---------- palette, as a specimen sheet ----------
   Only presentation: palette.js and the generated palette.css still do all
   the colour work. Each swatch becomes a chip in a specimen sheet: the colour
   on top carries a live "Aa" in the ink palette.js picked for it (--ink), so
   legibility is seen rather than read, with the grade it computed
   (data-grade) as a tag; the hex and the numbers sit on a neutral strip
   underneath. Harmonies are numbered sections. The chrome stays grey; the
   only colour on the page is the colour being judged. */

.article.palette { max-width: none; }
.article.palette > :not(.pal-stage):not(.pal-set) { max-width: 760px; }
.pal-stage, .pal-set { max-width: 940px; margin-inline: auto; }

.pal-stage {
  border: 0;
  background: none;
  overflow: visible;
  display: grid;
  gap: 0;
  counter-reset: harmony;
}
.pal-pick {
  position: sticky;
  top: 70px;
  z-index: 5;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 18px 40px -28px rgb(0 0 0 / .55);
}
.pal-pick input[type="color"] {
  inline-size: 40px;
  block-size: 40px;
  border-radius: 50%;
  border: 2px solid var(--line);
  overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.pal-pick input[type="color"]:hover { transform: scale(1.06); border-color: var(--line-hover); }
.pal-pick input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.pal-pick input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.pal-pick input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }

/* each harmony: a numbered section, its name and line on the left, chips on
   the right; one column on narrow screens */
.pal-row {
  counter-increment: harmony;
  display: grid;
  grid-template-columns: minmax(160px, 200px) minmax(0, 1fr);
  gap: 14px 26px;
  padding: 22px 0;
  align-items: start;
  border-top: 1px solid var(--line);
}
/* display: grid above would beat the hidden attribute on rows not in use */
.pal-row[hidden] { display: none; }
.pal-row .pal-bar {
  display: block;
  padding: 0;
  border: 0 !important;
}
.pal-bar b {
  display: block;
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.14em;
  color: var(--paper);
  margin-bottom: 10px;
}
.pal-row .pal-bar b::before {
  content: counter(harmony, decimal-leading-zero);
  display: block;
  margin-bottom: 14px;
  font: 400 clamp(22px, 2.2vw, 30px)/1 var(--mono);
  letter-spacing: -0.04em;
  color: var(--muted);
}
.pal-bar span { display: block; font-size: 13px; line-height: 1.55; color: var(--muted); }
.pal-row > :not(.pal-bar) { min-width: 0; }

.sw-row, .sw-group { gap: 8px; }
.sw-group + .sw-group { border-block-start: 0; margin-block-start: 10px; }
.sw-group[data-of]::before { content: none; }
.sw-group[data-of]:not([data-of="1"]) { padding-top: 22px; }
.sw-group[data-of]:not([data-of="1"])::after {
  content: "colour " attr(data-of);
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  font: 400 10px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* the chip */
.sw {
  position: relative;
  flex: 1 1 96px;
  min-block-size: 0;
  padding: 0;
  display: grid;
  grid-template-rows: minmax(66px, 1fr) auto auto;
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line) !important;
  color: var(--ink, #0a0a0c);
  transition: background-color .5s ease, transform .25s cubic-bezier(.2,.75,.2,1), box-shadow .25s;
}
.sw::before {
  content: "Aa";
  align-self: end;
  padding: 0 11px 8px;
  font: 400 clamp(22px, 2.2vw, 30px)/1 var(--mono);
  letter-spacing: -0.04em;
}
.sw::after {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 8px;
  padding: 3px 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font: 500 9.5px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
}
.sw[data-grade="aa"]::after { content: "AA"; }
.sw[data-grade="large"]::after { content: "AA large"; }
.sw[data-grade="none"]::after { content: "no text"; opacity: .7; }
.sw[data-grade="none"]::before { text-decoration: line-through; text-decoration-thickness: 1px; opacity: .55; }
.sw-hex, .sw-note {
  display: block;
  width: 100%;
  justify-self: stretch;
  text-align: start;
  background: var(--raised);
  color: var(--paper);
  padding-inline: 10px;
}
.sw-hex {
  padding-block: 9px 3px;
  font: 500 12px/1 var(--mono);
  letter-spacing: .02em;
  border-top: 1px solid var(--line);
}
.sw-note {
  padding-block: 0 9px;
  font: 400 9.5px/1.4 var(--mono);
  color: var(--muted);
  opacity: 1;
  text-decoration: none !important;
}
.sw:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px var(--line-hover), 0 18px 34px -20px rgb(0 0 0 / .75) !important;
  z-index: 1;
}
.sw:active { transform: translateY(-1px) scale(.985); }
.sw:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
.sw[data-label="base"] { box-shadow: 0 0 0 1px var(--paper) !important; }

.pal-set { border-radius: 12px; margin-top: 28px; }
.set-row { gap: 10px; padding: 16px; }
.chip { padding: 10px 10px 10px 16px; transition: transform .2s; }
.chip:hover { transform: translateY(-2px); }
.set-grid td { border-color: color-mix(in srgb, var(--line) 70%, transparent); padding: 9px 12px; }

@media (max-width: 760px) {
  .pal-row { grid-template-columns: 1fr; padding: 22px 0; }
  .pal-row .pal-bar b::before { display: inline; margin: 0 12px 0 0; font-size: 22px; }
  .pal-pick { top: 62px; padding: 10px 12px; }
  .sw { flex-basis: 88px; grid-template-rows: minmax(60px, 1fr) auto auto; }
}
@media (prefers-reduced-motion: reduce) {
  .sw, .chip, .pal-pick input[type="color"] { transition: none; }
  .sw:hover, .chip:hover { transform: none; }
}

/* ---------- a dial laid out by ray() ----------
   Every tick, number and the needle sit on the dial with offset-path: ray(),
   an angle and a distance from the centre, instead of rotate-translate-rotate
   chains or trig. --v is the value (0 to 100), registered so it animates;
   --vi is the same value as an integer, so a counter can print it while it
   is still moving. */
@property --v { syntax: "<number>"; inherits: true; initial-value: 42; }
@property --vi { syntax: "<integer>"; inherits: true; initial-value: 42; }

.d-ray {
  --v: 42;
  --vi: var(--v);
  position: relative;
  width: 184px;
  aspect-ratio: 1;
  border-radius: 50%;
  touch-action: none;
  cursor: grab;
  user-select: none;
  transition: --v .35s cubic-bezier(.2, .75, .2, 1);
  background:
    radial-gradient(circle, color-mix(in srgb, var(--paper) 6%, transparent) 0 34%, transparent 35%),
    radial-gradient(circle, transparent 0 58%, color-mix(in srgb, var(--paper) 9%, transparent) 58.5% 59%, transparent 59.5%);
}
.d-ray.is-dragging { cursor: grabbing; transition: none; }
.d-ray:has(input:focus-visible) { outline: 1px solid var(--line-hover); outline-offset: 6px; }

/* the shared trick: start the ray at the centre of the dial, then let
   offset-path point it. left/top 50% as well, because older engines start a
   ray from the element's own position rather than from offset-position */
.d-ray .tick, .d-ray .num, .d-ray .needle, .d-ray .knob {
  position: absolute;
  left: 50%;
  top: 50%;
  offset-position: 50% 50%;
}

/* 41 ticks over 270 degrees, 6.75 apart, lit up to the value */
.d-ray .tick {
  --a: calc(-135deg + var(--i) * 6.75deg);
  --lit: clamp(0, (var(--v) * 0.4 - var(--i) + 1) * 4, 1);
  width: 9px;
  height: 1.5px;
  offset-path: ray(var(--a) closest-side);
  offset-distance: 94%;
  offset-rotate: auto;
  background: var(--paper);
  opacity: calc(.14 + .86 * var(--lit));
  border-radius: 1px;
}
.d-ray .tick:nth-child(10n + 1) { width: 14px; height: 2px; }

/* numbers ride rays too, but stay upright: offset-rotate: 0deg */
.d-ray .num {
  offset-path: ray(var(--a) closest-side);
  offset-distance: 59%;
  offset-rotate: 0deg;
  font: 400 9px/1 var(--mono);
  letter-spacing: .04em;
  color: var(--muted);
}
.d-ray .num:nth-of-type(1) { --a: -135deg; }
.d-ray .num:nth-of-type(2) { --a: -67.5deg; }
.d-ray .num:nth-of-type(3) { --a: 0deg; }
.d-ray .num:nth-of-type(4) { --a: 67.5deg; }
.d-ray .num:nth-of-type(5) { --a: 135deg; }

/* the needle: a line anchored at its left end, pointed along the ray */
.d-ray .needle {
  width: 40%;
  height: 1.5px;
  offset-path: ray(calc(-135deg + var(--v) * 2.7deg) closest-side);
  offset-distance: 0%;
  offset-anchor: 0 50%;
  offset-rotate: auto;
  background: linear-gradient(90deg, transparent 0 22%, var(--paper));
}
.d-ray .knob {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  offset-path: ray(calc(-135deg + var(--v) * 2.7deg) closest-side);
  offset-distance: 80%;
  background: var(--paper);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--paper) 12%, transparent), 0 0 14px color-mix(in srgb, var(--paper) 35%, transparent);
}

/* the readout: an integer custom property printed by a counter, so it
   counts through every number while --v is still easing */
.d-ray::after {
  content: counter(v);
  counter-reset: v var(--vi);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 500 30px/1 var(--mono);
  letter-spacing: -0.04em;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.d-ray input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

/* no offset-path, no dial: the plain slider it is built on comes back */
@supports not (offset-path: ray(0deg)) {
  .d-ray { width: auto; aspect-ratio: auto; background: none; cursor: auto; }
  .d-ray > i, .d-ray > span, .d-ray::after { display: none; }
  .d-ray input { position: static; opacity: 1; pointer-events: auto; width: 180px; }
}
.d-ray .tick:nth-child(1) { --i: 0; }
.d-ray .tick:nth-child(2) { --i: 1; }
.d-ray .tick:nth-child(3) { --i: 2; }
.d-ray .tick:nth-child(4) { --i: 3; }
.d-ray .tick:nth-child(5) { --i: 4; }
.d-ray .tick:nth-child(6) { --i: 5; }
.d-ray .tick:nth-child(7) { --i: 6; }
.d-ray .tick:nth-child(8) { --i: 7; }
.d-ray .tick:nth-child(9) { --i: 8; }
.d-ray .tick:nth-child(10) { --i: 9; }
.d-ray .tick:nth-child(11) { --i: 10; }
.d-ray .tick:nth-child(12) { --i: 11; }
.d-ray .tick:nth-child(13) { --i: 12; }
.d-ray .tick:nth-child(14) { --i: 13; }
.d-ray .tick:nth-child(15) { --i: 14; }
.d-ray .tick:nth-child(16) { --i: 15; }
.d-ray .tick:nth-child(17) { --i: 16; }
.d-ray .tick:nth-child(18) { --i: 17; }
.d-ray .tick:nth-child(19) { --i: 18; }
.d-ray .tick:nth-child(20) { --i: 19; }
.d-ray .tick:nth-child(21) { --i: 20; }
.d-ray .tick:nth-child(22) { --i: 21; }
.d-ray .tick:nth-child(23) { --i: 22; }
.d-ray .tick:nth-child(24) { --i: 23; }
.d-ray .tick:nth-child(25) { --i: 24; }
.d-ray .tick:nth-child(26) { --i: 25; }
.d-ray .tick:nth-child(27) { --i: 26; }
.d-ray .tick:nth-child(28) { --i: 27; }
.d-ray .tick:nth-child(29) { --i: 28; }
.d-ray .tick:nth-child(30) { --i: 29; }
.d-ray .tick:nth-child(31) { --i: 30; }
.d-ray .tick:nth-child(32) { --i: 31; }
.d-ray .tick:nth-child(33) { --i: 32; }
.d-ray .tick:nth-child(34) { --i: 33; }
.d-ray .tick:nth-child(35) { --i: 34; }
.d-ray .tick:nth-child(36) { --i: 35; }
.d-ray .tick:nth-child(37) { --i: 36; }
.d-ray .tick:nth-child(38) { --i: 37; }
.d-ray .tick:nth-child(39) { --i: 38; }
.d-ray .tick:nth-child(40) { --i: 39; }
.d-ray .tick:nth-child(41) { --i: 40; }

/* ---------- notes ----------
   The archive is a plain list in the spirit of a newsletter index: number,
   title, one line under it, the date, and a lot of air. The post is one
   narrow reading column; code and demos are allowed to be a little wider. */
.notes .dek { max-width: 52ch; }
.notes-list { list-style: none; margin: 46px 0 0; padding: 0; border-top: 1px solid var(--line); }
.notes-list a {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  column-gap: 20px;
  row-gap: 8px;
  padding: 30px 0 32px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.notes-list .n-num, .notes-list time {
  font: 400 12px/1.9 var(--mono);
  color: var(--muted);
}
.notes-list .n-num { grid-row: 1 / 3; }
.notes-list .n-title {
  font: 600 clamp(22px, 2.6vw, 28px)/1.15 var(--display);
  color: var(--paper);
  text-wrap: balance;
  transition: color .2s;
}
.notes-list .n-dek { grid-column: 2; font-size: 15px; line-height: 1.55; color: var(--muted); max-width: 56ch; }
.notes-list time { grid-column: 3; grid-row: 1; white-space: nowrap; }
.notes-list a:hover .n-title, .notes-list a:focus-visible .n-title { color: var(--content); }
@media (max-width: 640px) {
  .notes-list a { grid-template-columns: 1fr; }
  .notes-list .n-num, .notes-list .n-dek, .notes-list time { grid-column: 1; grid-row: auto; }
  .notes-list .n-num { order: -1; }
}

.note-post { max-width: 680px; }
.note-post .eyebrow time { color: inherit; }
.note-body p, .note-body li { font-size: 17px; line-height: 1.75; }
.note-body h2 { margin-top: 48px; }
.note-body pre { margin: 6px 0 24px; }
.note-body em { font-style: italic; color: var(--paper); }
.note-table { overflow-x: auto; margin: 6px 0 24px; }
.note-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.note-table th {
  text-align: left;
  font: 400 11px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 14px 12px 0;
  border-bottom: 1px solid var(--line);
}
.note-table td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.note-table td:first-child { color: var(--muted); white-space: nowrap; }
.note-table code { white-space: nowrap; }
.note-demo {
  margin: 6px 0 24px;
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

/* note 01: the same declarations twice, once through a shared selector list
   that every engine drops, once through a rule per engine */
.n-range { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 560px) { .n-range { grid-template-columns: 1fr; } }
.n-range label {
  display: grid;
  gap: 14px;
  font: 400 11px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.n-range input { width: 100%; margin: 0; appearance: none; background: transparent; }
.n-range input:focus-visible { outline: 2px solid var(--content); outline-offset: 8px; border-radius: 999px; }
.n-range .n-one::-webkit-slider-runnable-track,
.n-range .n-one::-moz-range-track { height: 4px; border-radius: 999px; background: var(--line); }
.n-range .n-one::-webkit-slider-thumb,
.n-range .n-one::-moz-range-thumb { appearance: none; box-sizing: border-box; width: 22px; height: 22px; margin-top: -9px; border: 1px solid transparent; border-radius: 50%; background: var(--paper); }
.n-range .n-two::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: var(--line); }
.n-range .n-two::-moz-range-track { height: 4px; border-radius: 999px; background: var(--line); }
.n-range .n-two::-webkit-slider-thumb { appearance: none; box-sizing: border-box; width: 22px; height: 22px; margin-top: -9px; border: 1px solid transparent; border-radius: 50%; background: var(--paper); }
.n-range .n-two::-moz-range-thumb { box-sizing: border-box; width: 22px; height: 22px; border: 1px solid transparent; border-radius: 50%; background: var(--paper); }
.n-range .n-two::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--paper); }
.note-post h1 .nb { white-space: nowrap; }
.stamp + .stamp { margin-top: 10px; }
.stamp a { color: var(--content); }

/* note 02: six hues 60 degrees apart, held level in HSL and in OKLCH */
.n-hue { --h: 25; display: grid; gap: 14px; }
.n-hue-row { display: grid; grid-template-columns: 130px repeat(6, 1fr); gap: 6px; align-items: center; transition: filter .3s; }
.n-hue-row span, .n-hue-controls label {
  font: 400 11px/1.3 var(--mono);
  letter-spacing: .04em;
  color: var(--muted);
}
.n-hue-row i { height: 56px; border-radius: 4px; }
.n-hue-row i:nth-of-type(2) { --i: 1; }
.n-hue-row i:nth-of-type(3) { --i: 2; }
.n-hue-row i:nth-of-type(4) { --i: 3; }
.n-hue-row i:nth-of-type(5) { --i: 4; }
.n-hue-row i:nth-of-type(6) { --i: 5; }
.n-hue-hsl i { background: hsl(calc(var(--h) + var(--i, 0) * 60) 85% 55%); }
.n-hue-oklch i { background: oklch(0.72 0.13 calc(var(--h) + var(--i, 0) * 60)); }
.n-hue:has(input[type="checkbox"]:checked) .n-hue-row { filter: grayscale(1); }
.n-hue-controls { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; margin-top: 8px; }
.n-hue-controls label { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; }
.n-hue-controls input[type="range"] { width: 200px; accent-color: var(--paper); }
.n-hue-controls input[type="checkbox"] { accent-color: var(--paper); margin: 0; }
@media (max-width: 560px) {
  .n-hue-row { grid-template-columns: repeat(6, 1fr); }
  .n-hue-row span { grid-column: 1 / -1; }
  .n-hue-row i { height: 44px; }
}

/* ---------- rows the browser refuses to lay out ---------- */

.d-cvis { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; width: 100%; max-width: 264px; }
.d-cvis b { display: block; font: 500 9px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.d-cvis .pane { height: 128px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.d-cvis .pane::-webkit-scrollbar { width: 9px; }
.d-cvis .pane::-webkit-scrollbar-thumb { background: var(--content); border-radius: 9px; }
.d-cvis ul { list-style: none; margin: 0; padding: 0; }
.d-cvis li { content-visibility: auto; font: 400 10px/1 var(--mono); color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.d-cvis .sized li { contain-intrinsic-size: auto 27px; }

/* Section headings on element pages. They are there for structure (a page that
   is one H1 and a run of paragraphs tells a crawler nothing about its parts), so
   they read as quiet labels rather than as a second set of headlines. */
.article h2.part { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 34px 0 12px; }

/* The grid of demos rests in greyscale and takes its colour back on hover, so a
   wall of ninety demos reads as one surface and the one under the cursor stands
   out. A saturation-blend layer rather than filter: grayscale(), because a filter
   makes the stage a containing block and would change the very demos about
   position: fixed and backdrop-filter. Mouse only: a touchscreen has no hover to
   bring the colour back, so there the demos stay in colour. */
@media (hover: hover) {
  .card .stage { position: relative; isolation: isolate; }
  .card .stage::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #808080;
    mix-blend-mode: saturation;
    pointer-events: none;
    z-index: 2147483647;
    transition: opacity .3s ease;
  }
  .card:hover .stage::after, .card:focus-within .stage::after { opacity: 0; }
}
@media (hover: hover) and (prefers-reduced-motion: reduce) { .card .stage::after { transition: none; } }

/* ---------- cards that stack as you scroll ---------- */

.d-stack-wrap { width: 100%; max-width: 300px; }
.d-stack {
  width: 100%;
  max-width: 300px;
  height: 236px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 0 12px;
  border-radius: 16px;
  timeline-scope: --st2, --st3, --st4;
  mask-image: linear-gradient(180deg, #000 82%, transparent);
}
.d-stack::-webkit-scrollbar { display: none; }
.d-stack-card {
  position: sticky;
  height: 150px;
  margin: 0 0 22px;
  padding: 16px 18px;
  border-radius: 14px;
  display: grid;
  align-content: space-between;
  color: #fff;
  transform-origin: 50% 0;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .25) inset, 0 18px 30px -18px rgba(0, 0, 0, .7);
}
.d-stack-card:nth-child(1) { top: 10px; background: linear-gradient(135deg, #6d5dfc, #3b2fb8); }
.d-stack-card:nth-child(2) { top: 20px; background: linear-gradient(135deg, #12b3a8, #0b6b78); view-timeline: --st2 block; }
.d-stack-card:nth-child(3) { top: 30px; background: linear-gradient(135deg, #ff8a4c, #d6345f); view-timeline: --st3 block; }
.d-stack-card:nth-child(4) { top: 40px; background: linear-gradient(135deg, #2e3445, #12151d); view-timeline: --st4 block; }
.d-stack-card b { font: 600 22px/1.1 var(--display, sans-serif); letter-spacing: -0.02em; }
.d-stack-card span { font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.d-stack-card i { font: 400 11px/1.4 var(--mono); font-style: normal; opacity: .85; }
.d-stack-tail { height: 120px; }
.d-stack-hint { margin: 14px 0 0; text-align: center; font: 400 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Without scroll timelines the animation would run as a plain 0s animation and
   park every card in its end state, so the recession lives behind @supports. */
@supports (animation-timeline: view()) {
  .d-stack-card { animation: d-stack-recede linear both; animation-range: entry 0% entry 100%; }
  .d-stack-card:nth-child(1) { animation-timeline: --st2; }
  .d-stack-card:nth-child(2) { animation-timeline: --st3; }
  .d-stack-card:nth-child(3) { animation-timeline: --st4; }
  .d-stack-card:nth-child(4) { animation: none; }
}
@keyframes d-stack-recede { to { scale: .9; filter: brightness(.55) saturate(.8); } }
@media (prefers-reduced-motion: reduce) { .d-stack-card { animation: none; } }

/* the slogan leads the hero paragraph: set like the headline, one size down */
.hero-copy > p:last-child strong {
  display: block;
  margin-bottom: 10px;
  font: 600 clamp(17px, 1.9vw, 22px)/1.15 var(--display);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--paper);
}
.hero-copy > p:last-child strong span { display: block; color: var(--muted); }

/* ---------- palette: colour bands ----------
   Each harmony is one strip of full-height bands, read like a printer's
   colour guide. The hex sits at the foot of its band in the ink palette.js
   picked for it, so legibility shows in the label itself, and the grade
   rides on top as a tag. The fill stays on .sw: palette.js reads the
   painted colour back off that element, so the shape changes and the
   measuring does not. */
.palette { --page: var(--ink); }
.pal-stage, .pal-set { max-width: 940px; }
.pal-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 18px 0 20px; }
.pal-row .pal-bar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 22px; align-items: baseline; }
.pal-row .pal-bar b { margin: 0; white-space: nowrap; }
.pal-row .pal-bar b::before { display: inline; margin: 0 12px 0 0; font-size: 16px; }
.pal-row .pal-bar span { max-width: 64ch; }

.sw-row, .sw-group { gap: 0; }
.sw-group, .sw-row:not(:has(.sw-group)) { flex-wrap: nowrap; justify-content: stretch; background: none; padding-bottom: 0; }
.sw-group + .sw-group { margin-block-start: 10px; }
.sw {
  flex: 1 1 0;
  inline-size: auto;
  block-size: 112px;
  aspect-ratio: auto;
  margin: 0;
  padding: 0 8px 11px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  box-shadow: none !important;
  transition: background-color .5s ease, flex-grow .35s cubic-bezier(.2,.75,.2,1);
}
.sw:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
.sw:last-child { border-start-end-radius: 10px; border-end-end-radius: 10px; }
/* overlap by a pixel so fractional widths leave no seam between bands */
.sw + .sw { margin-inline-start: -1px; }
.sw::before { content: none; }
.sw[data-label="base"]::before {
  content: "base";
  align-self: center;
  padding: 0;
  font: 500 8.5px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .75;
}
.sw::after {
  inset-block-start: 9px;
  inset-inline: 50% auto;
  translate: -50% 0;
  inline-size: auto;
  block-size: auto;
  padding: 3px 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: none;
  font: 500 8.5px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: .8;
}
.sw[data-grade="large"]::after, .sw[data-grade="none"]::after { background: none; }
.sw[data-grade="none"]::after { opacity: .55; }
.sw-hex, .sw-note {
  position: static;
  inline-size: auto;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: center;
}
.sw-hex { font: 600 13px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.sw-note { font: 400 9px/1.4 var(--mono); color: inherit; opacity: .72; white-space: pre-line; }
.sw-note::first-line { color: inherit; }
.sw:hover { flex-grow: 1.35; transform: none; box-shadow: none !important; z-index: 0; }
.sw:active { transform: none; }
.sw[data-label="base"] { box-shadow: none !important; }
.sw:focus-visible { outline: 2px solid currentColor; outline-offset: -8px; }

/* the colour picker sits in a ring of every hue it could be */
.pal-pick input[type="color"] {
  border: 0;
  padding: 3px;
  background: conic-gradient(from 0deg, oklch(.72 .17 0), oklch(.8 .16 90), oklch(.75 .17 150), oklch(.7 .15 220), oklch(.62 .2 290), oklch(.72 .17 360));
}

@media (max-width: 760px) {
  .pal-row .pal-bar { grid-template-columns: minmax(0, 1fr); }
  .sw { block-size: 92px; padding: 0 3px 10px; }
  .sw-hex { font-size: 11px; letter-spacing: 0; }
  .sw-note { display: none; }
  .sw::after { inset-block-start: 10px; padding: 3px 5px; font-size: 8px; letter-spacing: .04em; }
}
@media (hover: none) { .sw:hover { flex-grow: 1; } }
@media (prefers-reduced-motion: reduce) { .sw { transition: none; } }

/* ---------- content above that stops pushing you down ---------- */

.d-anchorscroll { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; width: 100%; max-width: 264px; }
.d-anchorscroll b { display: block; font: 500 9px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.d-anchorscroll .pane { height: 124px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.d-anchorscroll .off { overflow-anchor: none; }
.d-anchorscroll .grow { background: color-mix(in srgb, var(--margin) 22%, transparent); border-bottom: 1px solid var(--margin); animation: d-anchor-grow 4s steps(1, end) infinite; }
.d-anchorscroll p { margin: 0; padding: 8px 10px; font: 400 10px/1.5 var(--mono); color: var(--muted); border-bottom: 1px solid var(--line); }
.d-anchorscroll p.mark { color: var(--content); }
@keyframes d-anchor-grow { 0%, 50% { height: 26px; } 50.01%, 100% { height: 104px; } }
@media (prefers-reduced-motion: reduce) {
  .d-anchorscroll .grow { animation: none; height: 104px; }
}

/* ---------- tab order that follows what you see ---------- */

.d-readflow { display: flex; flex-wrap: wrap; gap: 9px; reading-flow: flex-visual; width: 100%; max-width: 232px; }
.d-readflow button { flex: 1 1 96px; font: 500 11px/1 var(--mono); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 0; cursor: pointer; }
.d-readflow button:focus-visible { outline: 2px solid var(--content); outline-offset: 3px; color: var(--paper); }
.d-readflow .a { order: 3; }
.d-readflow .b { order: 1; }
.d-readflow .c { order: 4; }
.d-readflow .d { order: 2; }

/* ---------- corners that are not arcs ---------- */

.d-squircle { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; max-width: 208px; }
.d-squircle div { aspect-ratio: 1 / 1; display: grid; place-items: center; border-radius: 26px; background: color-mix(in srgb, var(--content) 20%, transparent); border: 1px solid var(--content); font: 500 10px/1 var(--mono); color: var(--paper); }
.d-squircle .r { corner-shape: round; }
.d-squircle .s { corner-shape: squircle; }
.d-squircle .b { corner-shape: bevel; }
.d-squircle .n { corner-shape: notch; }

/* ---------- a clip path that can be animated ---------- */

.d-shapeclip { width: 100%; max-width: 224px; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--content), var(--padding)); clip-path: shape(from 0 0, line to 100% 0, line to 100% 62%, curve to 0 62% with 50% 104%, close); animation: d-shapeclip-roll 5s ease-in-out infinite alternate; }
@keyframes d-shapeclip-roll {
  to { clip-path: shape(from 0 0, line to 100% 0, line to 100% 88%, curve to 0 88% with 50% 32%, close); }
}
@media (prefers-reduced-motion: reduce) {
  .d-shapeclip { animation: none; }
}

/* ---------- a component that reads its own token ---------- */

.d-stylequery { display: grid; gap: 9px; width: 100%; max-width: 214px; }
.d-stylequery div { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 10px 12px; }
.d-stylequery [data-tone="ok"] { --tone: ok; }
.d-stylequery [data-tone="warn"] { --tone: warn; }
.d-stylequery [data-tone="stale"] { --tone: stale; }
.d-stylequery span { font: 500 11px/1 var(--mono); color: var(--muted); }
.d-stylequery span::before { content: "\25CF"; margin-right: 8px; }
@container style(--tone: ok) { .d-stylequery span { color: var(--padding); } }
@container style(--tone: warn) { .d-stylequery span { color: var(--margin); } }
@container style(--tone: stale) { .d-stylequery span { color: var(--muted); opacity: .6; } }

/* ---------- type snapped to a baseline grid ---------- */

.d-baseline { --step: 9px; display: grid; gap: 10px; width: 100%; max-width: 244px; }
.d-baseline p { margin: 0; padding: 0 9px; font: 400 11px var(--mono); color: var(--muted); background: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--paper) 13%, transparent) 0 1px, transparent 1px var(--step)); }
.d-baseline .loose { line-height: 1.48em; }
.d-baseline .snapped { line-height: round(up, 1.48em, var(--step)); color: var(--paper); }

/* ---------- a menu exactly as wide as its button ---------- */

.d-anchorsize { display: flex; gap: 12px; align-items: start; width: 100%; max-width: 252px; }
.d-anchorsize button { font: 500 11px/1 var(--mono); color: var(--paper); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; cursor: pointer; }
.d-anchorsize button:hover { border-color: var(--content); }
.d-anchorsize .a { anchor-name: --d-size-a; }
.d-anchorsize .b { anchor-name: --d-size-b; }
.d-anchorsize [popover] { margin: 0; inset: auto; position: absolute; position-area: block-end span-inline-end; position-try-fallbacks: flip-block; margin-top: 6px; width: anchor-size(width); min-width: 88px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--muted); padding: 8px; font: 400 10px/1.6 var(--mono); }
.d-anchorsize #d-size-pa { position-anchor: --d-size-a; }
.d-anchorsize #d-size-pb { position-anchor: --d-size-b; }

/* ---------- a fallback font that does not move the page ---------- */

@font-face {
  /* the same file the mono face already loads, declared a second time
     with its metrics scaled down onto the sans it stands in for. 76.4%
     is measured, not guessed: it is what makes this sentence measure the same in both */
  font-family: d-sizeadjust-matched;
  src: url(/assets/fonts/ibm-plex-mono-400.woff2) format('woff2');
  size-adjust: 76.4%;
  ascent-override: 137%;
  descent-override: 44%;
  line-gap-override: 0%;
}
.d-sizeadjust { display: grid; gap: 8px; width: 100%; max-width: 258px; }
.d-sizeadjust p { margin: 0; width: max-content; max-width: 100%; white-space: nowrap; font-size: 12px; line-height: 1.3; color: var(--muted); border: 1px dashed var(--line); border-right: 2px solid var(--content); border-radius: 5px; padding: 5px 7px; }
.d-sizeadjust b { display: block; font: 500 9px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--content); margin-bottom: 4px; }
.d-sizeadjust .web { font-family: var(--sans); }
.d-sizeadjust .raw { font-family: var(--mono); }
.d-sizeadjust .fix { font-family: d-sizeadjust-matched, var(--mono); }

/* Mobile navigation stays within thumb reach; the header must not create a fixed containing block. */
@media (max-width: 760px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .masthead { background: var(--ink); backdrop-filter: none; }
  .masthead .wrap { height: 56px; }
  .masthead nav {
    position: fixed; inset: auto 0 0; margin: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
    padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .masthead nav > a, .masthead nav .menu-btn {
    display: flex; align-items: center; justify-content: center;
    min-height: 48px; padding: 8px 2px; border: 0; border-radius: 8px;
    font: 500 12px/1 var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted);
  }
  .masthead nav > a[href="/about/"] { display: none; }
  .masthead nav > a[aria-current], .masthead nav > a:active,
  .masthead nav .menu-btn:active, body:has(#menu:popover-open) .menu-btn {
    color: var(--content); background: var(--raised);
  }
  .masthead nav > a:focus-visible, .menu-btn:focus-visible { outline: 2px solid var(--content); outline-offset: -2px; }
  .masthead .theme { position: fixed; top: 6px; right: var(--gutter); width: 44px; height: 44px; }
  #menu {
    inset: auto 0 calc(72px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - 140px - env(safe-area-inset-bottom)); overflow-y: auto;
    background: var(--surface); backdrop-filter: none; border-radius: 16px 16px 0 0;
    border-block: 1px solid var(--line); translate: 0 12px;
  }
  #menu:popover-open { translate: 0 0; }
  #menu a { min-height: 56px; padding: 18px 24px; font-size: 24px; }
  #menu a span { display: none; }
  .home .hero--catalog { padding: 28px 0; }
  .home .hero h1 { font-size: clamp(40px, 11vw, 60px); }
  .home .hero-copy { gap: 16px; }
  .hero-intro p { margin-bottom: 0; }
  .filters { gap: 12px; }
  .filters input { width: 100%; min-width: 0; min-height: 48px; font-size: 16px; }
  .filters .tags { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding: 3px 0 8px; }
  .tags button { flex-shrink: 0; min-height: 44px; padding-inline: 14px; }
  .view-picker button, .copy { min-height: 44px; }
  .compact .cards { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .compact .card-top { min-height: 64px; align-items: center; }
  .compact .card-top .name { height: auto; line-height: 1.4; font-size: 13px; text-transform: none; letter-spacing: 0; }
  .compact .card-top .name span:first-child { white-space: normal; translate: none; }
  .compact .card-top .name span + span { display: none; }
  .detail { min-width: 0; }
  .detail pre, .source pre { max-width: 100%; overflow-x: auto; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  #menu, #menu a { transition: none; }
}
@supports not selector(:popover-open) {
  @media (max-width: 760px) {
    .masthead nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .masthead nav > a[href="/about/"] { display: flex; }
    #menu { display: none; }
  }
}

/* ---------- marking text without touching the DOM ---------- */

.d-hilite { display: grid; gap: 10px; width: 100%; max-width: 246px; }
.d-hilite input { font: 400 11px/1 var(--mono); color: var(--paper); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; }
.d-hilite input:focus-visible { outline: 2px solid var(--content); outline-offset: 2px; }
.d-hilite p { margin: 0; font: 400 11px/1.65 var(--mono); color: var(--muted); }
::highlight(d-hilite) { background-color: color-mix(in srgb, var(--content) 42%, transparent); color: var(--paper); }

/* ---------- a list marker you define yourself ---------- */

@counter-style d-padded {
  system: numeric;
  symbols: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
  pad: 2 "0";
  suffix: "  ";
}
@counter-style d-arrow {
  system: cyclic;
  symbols: "\2192";
  suffix: "  ";
}
.d-counterstyle { display: grid; gap: 14px; width: 100%; max-width: 224px; font: 400 11px/1.5 var(--mono); color: var(--muted); }
.d-counterstyle ol, .d-counterstyle ul { margin: 0; padding-left: 30px; display: grid; gap: 5px; }
.d-counterstyle ol { list-style: d-padded; }
.d-counterstyle ul { list-style: d-arrow; }
.d-counterstyle li::marker { color: var(--content); font-weight: 500; }

.d-plans {
  border: 0; padding: 0; margin: 0;
  width: 100%; max-width: 22rem;
  color: var(--paper, #e6eaf1);
}
.d-plans legend { margin-bottom: .8rem; }
.d-plans label {
  display: flex; align-items: center; gap: .8rem;
  padding: 1rem; margin-top: .6rem;
  border: 2px solid #64748b;
  border-radius: .6rem; cursor: pointer;
}
.d-plans input { accent-color: #6fa8dc; }
.d-plans span { flex: 1; min-width: 0; }
.d-plans strong, .d-plans span small {
  display: block;
}
.d-plans small { font-size: .75rem; }
.d-plans label:has(:checked) {
  border-color: #6fa8dc;
  background: rgb(111 168 220 / .14);
}
.d-plans label:has(:focus-visible) {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.d-rating {
  border: 0; padding: 0; margin: 0;
  max-width: 100%;
  color: var(--paper, #e6eaf1);
}
.d-rating legend { margin-bottom: 1rem; }
.d-rating > div { display: flex; gap: .35rem; }
.d-rating label {
  display: grid; justify-items: center;
  cursor: pointer; min-width: 2rem;
}
.d-rating input { accent-color: #d99b28; }
.d-rating span {
  font-size: 2rem; line-height: 1.3;
  color: #64748b;
}
.d-rating label:has(:checked) span,
.d-rating label:has(~ label :checked) span {
  color: #d99b28;
}
.d-rating label:has(:focus-visible) {
  outline: 2px solid currentColor;
  outline-offset: 2px; border-radius: .2rem;
}

.d-fluidgrid {
  width: 100%; max-width: 30rem;
  min-width: min(10rem, 100%);
  resize: horizontal; overflow: auto;
  color: var(--paper, #e6eaf1);
  border: 1px solid #64748b;
  padding: .75rem;
}
.d-fluidgrid p {
  margin: 0 0 .75rem; font-size: .8rem;
}
.d-fluidgrid ul {
  display: grid; gap: .5rem;
  grid-template-columns:
    repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  list-style: none; margin: 0; padding: 0;
}
.d-fluidgrid li {
  min-width: 0; overflow-wrap: anywhere;
  border: 1px solid #64748b;
  padding: .8rem;
  background: rgb(111 168 220 / .12);
}
.d-fluidgrid b {
  display: block; color: #6fa8dc;
  font-size: 1.5rem; margin-bottom: .5rem;
}

.d-searchdrawer {
  width: 100%; max-width: 24rem;
  color: var(--paper, #e6eaf1);
  border: 1px solid #64748b;
}
.d-searchdrawer-bar {
  display: flex; flex-wrap: wrap; gap: .5rem;
  justify-content: space-between; padding: 1rem;
}
.d-searchdrawer-bar span { font-size: .75rem; }
.d-searchdrawer summary {
  cursor: pointer; padding: .8rem 1rem;
  border-top: 1px solid #64748b;
}
.d-searchdrawer details[open] summary {
  color: #6fa8dc;
}
.d-searchdrawer summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}
.d-searchdrawer details > div { padding: 1rem; }
.d-searchdrawer label { display: block; }
.d-searchdrawer input {
  width: 100%; min-width: 0; margin-top: .5rem;
  padding: .7rem; font: inherit;
}
.d-searchdrawer p {
  font-size: .75rem; margin: .75rem 0 0;
}

.d-compare {
  --cut: 50%; border: 0; padding: 0; margin: 0;
  width: 100%; max-width: 26rem;
  color: var(--paper, #e6eaf1);
}
.d-compare legend { margin-bottom: .75rem; }
.d-compare-controls {
  display: flex; flex-wrap: wrap; gap: .8rem;
  margin-bottom: .75rem; font-size: .75rem;
}
.d-compare input { accent-color: #6fa8dc; }
.d-compare:has([value="25"]:checked) {
  --cut: 75%;
}
.d-compare:has([value="75"]:checked) {
  --cut: 25%;
}
.d-compare-frame { display: grid; }
.d-compare img {
  grid-area: 1 / 1; width: 100%; height: auto;
  aspect-ratio: 5 / 3; object-fit: cover;
}
.d-compare img + img {
  clip-path: inset(0 var(--cut) 0 0);
}
.d-compare-frame::after {
  content: ""; grid-area: 1 / 1;
  z-index: 1; pointer-events: none;
  width: 2px; background: white;
  margin-left: calc(100% - var(--cut));
}
.d-compare label:has(:focus-visible) {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
