/* Shared styles for every page. The design system is described in DESIGN.md. */

/* Shared components for every page. Load tokens.css first, then this file, then a page's
   own page.css. Naming: .block, .block__part, .block--variant; state classes are .is-*;
   group colour comes from one .tone-* class. Do not add page-specific rules here. */

/* =========================================================================
   1. Reset and base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + var(--space-l));
}
html:focus-within { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, h4, p, ol, ul, dl, dd, figure, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-weight: var(--weight-medium); line-height: var(--leading-snug); }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
b, strong { font-weight: var(--weight-medium); }
[hidden] { display: none !important; }

:focus-visible {
  outline: var(--focus-w) solid var(--ink);
  outline-offset: var(--focus-offset);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--space-s); top: -100px; z-index: 50;
  background: var(--ink); color: var(--on-ink); padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius-pill); font-size: var(--text-s); text-decoration: none;
}
.skip-link:focus { top: var(--space-xs); }

/* =========================================================================
   2. Layout
   ========================================================================= */
.wrap { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }

/* A page section with generous air. --tight for less. */
.section { padding: var(--space-4xl) 0; }
.section--tight { padding: var(--space-3xl) 0; }
.section-title {
  font-size: var(--text-section); font-weight: var(--weight-medium);
  letter-spacing: -0.03em; line-height: 1.1;
}
.section-title--center { text-align: center; }
.section-intro {
  color: var(--ink-2); font-size: var(--text-m); line-height: 1.4;
  margin-top: var(--space-s); max-width: 30ch;
}
.section-head { margin-bottom: var(--space-2xl); }

@media (max-width: 600px) {
  .section { padding: var(--space-3xl) 0; }
  .section--tight { padding: var(--space-2xl) 0; }
  .section-head { margin-bottom: var(--space-xl); }
}

/* Group colour. Put one on a stage, a swatch, or any ancestor (even <main>). */
.tone-reports { --stage: var(--stage-reports); }
.tone-numbers { --stage: var(--stage-numbers); }
.tone-finding { --stage: var(--stage-finding); }
.tone-pricing { --stage: var(--stage-pricing); }
.tone-team    { --stage: var(--stage-team); }
.tone-offers  { --stage: var(--stage-offers); }
.tone-apps    { --stage: var(--stage-apps); }

/* =========================================================================
   3. Buttons and links
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs);
  min-height: var(--tap); padding: 0 var(--space-m);
  border: 0; border-radius: var(--radius-pill);
  font-family: var(--sans); font-size: var(--text-s); font-weight: var(--weight-medium); line-height: 1.15;
  text-decoration: none; text-align: center; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease);
}
.btn--ink { background: var(--ink); color: var(--on-ink); }
.btn--ink:hover { background: var(--ink-hover); }
.btn--pale { background: var(--pale); color: var(--ink); }
.btn--pale:hover { background: var(--pale-hover); }
.btn--lg { min-height: 60px; padding: var(--space-xs) var(--space-l); font-size: 20px; white-space: normal; max-width: 100%; }
.btn--block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }

/* Underlined text link, for <a> or <button>. */
.textlink {
  display: inline-flex; align-items: center; gap: 0.35em; min-height: var(--tap);
  padding: 0; border: 0; background: none;
  font-size: var(--text-s); font-weight: var(--weight-medium); color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px;
}
.textlink:hover { text-decoration-thickness: 2px; }

/* "Start again": a quiet reset inside a demo. Always a <button>. */
.start-again {
  display: inline-flex; align-items: center; min-height: var(--tap);
  padding: 0; border: 0; background: none;
  font-size: var(--text-s); font-weight: var(--weight-medium); color: var(--ink);
  text-decoration: underline; text-underline-offset: 5px;
}

/* Small grey link line: hero kicker, "‹ All tools" back link. */
.link-line {
  display: inline-block; padding: 10px 0; line-height: 1.4;
  color: var(--ink-2); font-size: var(--text-s); text-decoration: none;
}
.link-line:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }

/* =========================================================================
   4. Top bar and phone menu
   ========================================================================= */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--white);
  border-bottom: var(--rule-w) solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.topbar.is-scrolled, .topbar.is-open { border-bottom-color: var(--rule); }
.topbar__inner {
  height: var(--bar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-m);
}
.topbar__mark {
  justify-self: start;
  font-family: var(--serif); font-size: 26px; letter-spacing: -0.02em; line-height: 1;
  text-decoration: none; font-variation-settings: "opsz" 36; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap);
}
/* The logo: a calendar page with a tick, the same picture as the favicon. */
.topbar__logo { flex: none; width: 30px; height: 30px; }
.topbar__nav { display: flex; gap: var(--space-l); }
.topbar__nav a {
  display: inline-flex; align-items: center; min-height: var(--tap);
  font-size: var(--text-s); color: var(--ink-2); text-decoration: none;
}
.topbar__nav a:hover, .topbar__nav a[aria-current="page"] { color: var(--ink); }
.topbar__nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.topbar__actions { display: flex; gap: var(--space-xs); justify-self: end; align-items: center; }
.topbar__menu-btn { display: none; }

.menu {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--white); border-bottom: var(--rule-w) solid var(--rule);
}
.menu__list { padding: var(--space-2xs) 0 var(--space-m); }
.menu__list a {
  display: flex; align-items: center; min-height: 60px;
  border-bottom: var(--rule-w) solid var(--rule);
  font-size: var(--text-m); font-weight: var(--weight-medium); text-decoration: none;
}
.menu__list a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.menu__actions { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-top: var(--space-m); }

@media (max-width: 900px) {
  .topbar__inner { grid-template-columns: 1fr auto; }
  .topbar__nav { display: none; }
  .topbar__menu-btn { display: inline-flex; }
}
@media (min-width: 901px) { .menu { display: none !important; } }
/* The pale "How it works" button repeats a menu link, so it goes first when space is short. */
@media (min-width: 901px) and (max-width: 1099px) {
  .topbar__actions .btn--pale { display: none; }
}
@media (max-width: 600px) {
  .topbar__inner { gap: 10px; }
  .topbar__mark { font-size: clamp(18px, 5.2vw, 22px); gap: 8px; }
  .topbar__logo { width: 24px; height: 24px; }
  .topbar__actions { gap: 6px; }
  .topbar__actions .btn--pale:not(.topbar__menu-btn) { display: none; }
  .topbar__actions .btn { padding: 0 12px; }
}
/* The smallest phones: the hero's own button asks people to get in touch. */
@media (max-width: 369px) {
  .topbar__actions .btn--ink { display: none; }
}

/* =========================================================================
   5. Page header (inner pages)
   ========================================================================= */
.page-head { padding: var(--space-2xl) 0 var(--space-3xl); }
.page-head__back { margin-bottom: var(--space-xl); }
.page-head__title {
  font-family: var(--serif); font-weight: var(--weight-regular); font-variation-settings: "opsz" 72;
  font-size: var(--text-title); line-height: var(--leading-tight); letter-spacing: var(--track-display);
  max-width: 16ch; margin-left: -0.03em;
}
.page-head__lede {
  margin-top: var(--space-l); max-width: var(--measure);
  color: var(--ink-2); font-size: var(--text-lede); line-height: 1.4; letter-spacing: -0.01em;
}
.page-head__meta { margin-top: var(--space-m); display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
@media (max-width: 600px) {
  .page-head { padding: var(--space-m) 0 var(--space-2xl); }
  .page-head__back { margin-bottom: var(--space-l); }
  .page-head__lede { margin-top: var(--space-m); }
}

/* =========================================================================
   6. Pill switch (tabs) and segmented choice
   ========================================================================= */
/* Sticky holder keeps a page-level switch in view under the top bar. */
.switch-holder {
  position: sticky; top: calc(var(--bar-h) + var(--space-xs)); z-index: 10;
  display: flex; justify-content: center; margin: var(--space-xl) 0 var(--space-3xl);
  pointer-events: none;
}
.switch {
  pointer-events: auto;
  display: inline-flex; gap: 2px; padding: 5px;
  background: var(--pale); border-radius: var(--radius-pill);
  box-shadow: 0 0 0 1px var(--white);
}
.switch__tab {
  min-height: 48px; padding: 0 var(--space-m);
  border: 0; border-radius: var(--radius-pill); background: transparent;
  font-size: var(--text-s); font-weight: var(--weight-medium); line-height: 1.2; color: var(--ink-2);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.switch__tab:hover { color: var(--ink); }
.switch__tab[aria-selected="true"] { background: var(--white); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); }
.switch__tab:focus-visible { outline-offset: 1px; }
@media (max-width: 600px) {
  .switch--fill { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; width: 100%; border-radius: 30px; }
  .switch--fill .switch__tab { min-height: 56px; padding: 6px 8px; font-size: var(--text-xs); border-radius: 26px; }
  .switch-holder { margin: var(--space-l) 0 var(--space-2xl); }
}

/* Segmented choice: a small radio group inside a demo ("This week / Next week"). */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--pale); border-radius: var(--radius-pill); }
.segmented__option { position: relative; display: inline-flex; }
.segmented__option input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented__option span {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-m);
  border-radius: var(--radius-pill); font-size: var(--text-s); font-weight: var(--weight-medium); color: var(--ink-2);
}
.segmented__option input:checked + span { background: var(--white); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); }
.segmented__option input:focus-visible + span { outline: var(--focus-w) solid var(--ink); outline-offset: 1px; }
.segmented__option:hover span { color: var(--ink); }

/* =========================================================================
   7. Stage: flat group colour holding a white panel
   ========================================================================= */
.stage { display: block; }
.stage + .stage { margin-top: var(--space-5xl); }
.stage__field {
  background: var(--stage);
  padding: var(--space-3xl) var(--space-2xl);
  min-height: 540px;
  display: flex; align-items: center; justify-content: center;
}
.stage__panel {
  width: 100%; max-width: var(--panel-moment);
  background: var(--white); border-radius: var(--radius-panel);
  padding: var(--space-xl);
}
.tone-apps .stage__panel { box-shadow: 0 0 0 1px var(--rule); }
.stage--bench .stage__field { padding: var(--space-2xl) var(--space-xl); }
.stage--bench .stage__panel { max-width: var(--panel-bench); }
.stage__note { margin-top: var(--space-l); color: var(--ink-2); font-size: var(--text-xs); }
.stage__panel > :first-child { margin-top: 0; }

/* Panel used outside a stage (e.g. the home split opening). */
.panel { background: var(--white); border-radius: var(--radius-panel); }

@media (max-width: 900px) {
  .stage--bench .stage__field { padding: var(--space-xl) var(--space-m); }
  .stage--bench .stage__panel { padding: var(--space-l); }
}
@media (max-width: 600px) {
  .stage + .stage { margin-top: var(--space-4xl); }
  /* On phones the colour runs edge to edge so the panel gets the width. */
  .stage__field, .stage--bench .stage__field {
    margin-inline: calc(-1 * var(--gutter));
    padding: var(--space-xl) var(--space-s); min-height: 0;
  }
  .stage__panel, .stage--bench .stage__panel { padding: var(--space-m); }
}

/* =========================================================================
   8. Caption, Before / Now, statement
   ========================================================================= */
.caption {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl);
  padding: var(--space-xl) var(--space-2xl) 0;
}
.caption__title { font-size: var(--text-xl); letter-spacing: var(--track-heading); line-height: 1.15; }
.caption__text { color: var(--ink-2); font-size: 20px; line-height: var(--leading-body); }
.caption__link { margin-top: var(--space-xs); }
@media (max-width: 900px) { .caption { padding: var(--space-l) 0 0; } }
@media (max-width: 600px) {
  .caption { grid-template-columns: 1fr; gap: var(--space-s); }
  .caption__text { font-size: 18px; }
}

.before-now { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
.before-now__item { border-top: var(--rule-w) solid var(--rule); padding-top: var(--space-m); }
.before-now__text { font-size: var(--text-l); line-height: 1.35; letter-spacing: -0.015em; font-weight: var(--weight-medium); }
.before-now__item--before .before-now__text { color: var(--ink-2); }
.before-now__item--now { border-top-color: var(--ink); }
@media (max-width: 600px) { .before-now { grid-template-columns: 1fr; gap: var(--space-l); } }

.statement { display: block; }
.statement__label { display: block; color: var(--ink-2); font-size: var(--text-m); font-weight: var(--weight-medium); margin-bottom: var(--space-m); }
.statement__text {
  font-family: var(--serif); font-weight: var(--weight-regular); font-variation-settings: "opsz" 60;
  font-size: var(--text-statement); line-height: 1.12; letter-spacing: -0.025em;
  max-width: 22ch;
}

/* =========================================================================
   9. Ruled rows (label left; giant numeral or plain statement right)
   ========================================================================= */
.rows { border-top: var(--rule-w) solid var(--rule); }
.row {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl);
  padding: var(--space-xl) 0 var(--space-2xl);
  border-bottom: var(--rule-w) solid var(--rule);
}
.row__label { color: var(--ink-2); font-size: var(--text-m); font-weight: var(--weight-regular); line-height: 1.35; padding-top: var(--space-s); }
.row__num {
  font-family: var(--serif); font-weight: var(--weight-regular); font-variation-settings: "opsz" 72;
  font-size: var(--text-numeral); line-height: 1; letter-spacing: var(--track-display);
  font-variant-numeric: lining-nums tabular-nums;
}
.row__text { font-size: var(--text-l); line-height: 1.35; letter-spacing: -0.015em; }
.row__text p + p { margin-top: var(--space-xs); }
.row__text .row__sub { display: block; margin-top: var(--space-xs); color: var(--ink-2); font-size: var(--text-body); letter-spacing: 0; line-height: var(--leading-body); }
.rows--statements .row { padding: var(--space-l) 0 var(--space-xl); }
.rows--statements .row__label { padding-top: 0.2em; color: var(--ink); font-weight: var(--weight-medium); font-size: var(--text-l); letter-spacing: -0.015em; }
.rows--statements .row__text { color: var(--ink-2); font-size: 20px; letter-spacing: 0; line-height: var(--leading-body); }
@media (max-width: 600px) {
  .row { grid-template-columns: 1fr; gap: var(--space-2xs); padding: var(--space-m) 0 var(--space-l); }
  .row__label { padding-top: 0; }
  .rows--statements .row { gap: var(--space-xs); padding: var(--space-m) 0 var(--space-l); }
  .rows--statements .row__text { font-size: 18px; }
}

/* Numbered steps ("How it works"). */
.how-steps { border-top: var(--rule-w) solid var(--rule); }
.how-steps__item {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl);
  padding: var(--space-l) 0 var(--space-xl); border-bottom: var(--rule-w) solid var(--rule);
}
.how-steps__title { font-size: var(--text-l); letter-spacing: -0.02em; display: flex; gap: var(--space-m); }
.how-steps__n { color: var(--ink-2); min-width: 1ch; font-variant-numeric: tabular-nums; }
.how-steps__text { color: var(--ink-2); font-size: 20px; }
@media (max-width: 600px) {
  .how-steps__item { grid-template-columns: 1fr; gap: var(--space-2xs); padding: var(--space-m) 0 var(--space-l); }
  .how-steps__title { gap: var(--space-s); }
  .how-steps__text { padding-left: calc(1ch + var(--space-s) + 0.3em); font-size: 18px; }
}

/* "Next tool" link row. */
.next-tool {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); align-items: center;
  padding: var(--space-xl) 0; border-top: var(--rule-w) solid var(--rule); border-bottom: var(--rule-w) solid var(--rule);
  text-decoration: none;
}
.next-tool__label { color: var(--ink-2); font-size: var(--text-m); }
.next-tool__name { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-m); font-size: var(--text-xl); font-weight: var(--weight-medium); letter-spacing: var(--track-heading); line-height: 1.15; }
.next-tool__arrow { transition: transform var(--dur-fast) var(--ease); }
.next-tool:hover .next-tool__name { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.next-tool:hover .next-tool__arrow { transform: translateX(4px); }
@media (max-width: 600px) { .next-tool { grid-template-columns: 1fr; gap: var(--space-2xs); padding: var(--space-m) 0; } }

/* =========================================================================
   10. Catalogue (tools page)
   ========================================================================= */
.catalogue__group + .catalogue__group { margin-top: var(--space-3xl); }
.catalogue__head { display: flex; align-items: center; gap: var(--space-s); margin-bottom: var(--space-m); }
.catalogue__title { font-size: var(--text-xl); letter-spacing: var(--track-heading); line-height: 1.15; }
.catalogue__about { color: var(--ink-2); font-size: var(--text-body); margin: calc(-1 * var(--space-xs)) 0 var(--space-m); max-width: 46ch; }
.swatch { flex: none; width: 22px; height: 22px; background: var(--stage); }
.tone-apps .swatch, .swatch.tone-apps { box-shadow: inset 0 0 0 1px var(--line); }
.catalogue__list { border-top: var(--rule-w) solid var(--ink); }
.tool-row { border-bottom: var(--rule-w) solid var(--rule); }
.tool-row__inner {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr) 132px; gap: var(--space-l); align-items: baseline;
  padding: var(--space-m) 0; text-decoration: none; color: inherit;
}
.tool-row__name { font-size: var(--text-m); font-weight: var(--weight-medium); letter-spacing: -0.01em; line-height: 1.3; }
.tool-row__line { color: var(--ink-2); font-size: var(--text-body); line-height: 1.45; }
.tool-row__end { justify-self: end; display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-s); font-weight: var(--weight-medium); white-space: nowrap; }
.tool-row__arrow { font-size: 22px; line-height: 1; transition: transform var(--dur-fast) var(--ease); }
a.tool-row__inner:hover .tool-row__name { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
a.tool-row__inner:hover .tool-row__arrow { transform: translateX(4px); }
a.tool-row__inner:focus-visible { outline-offset: 0; }
@media (max-width: 900px) {
  .tool-row__inner { grid-template-columns: 1fr auto; gap: var(--space-2xs) var(--space-m); }
  .tool-row__line { grid-column: 1; grid-row: 2; }
  .tool-row__end { grid-column: 2; grid-row: 1; }
}

/* Status label: "In testing", "Early version", "Retired". */
.status {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 var(--space-xs);
  border: var(--rule-w) solid var(--line); border-radius: var(--radius-pill);
  color: var(--ink-2); font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: 1; white-space: nowrap;
}

/* =========================================================================
   11. Form pieces (inside demos; big and friendly)
   ========================================================================= */
.field { display: block; }
.field + .field { margin-top: var(--space-m); }
.field__label { display: block; font-size: var(--text-s); font-weight: var(--weight-medium); margin-bottom: var(--space-2xs); }
.field__hint { display: block; color: var(--ink-2); font-size: var(--text-xs); margin-top: var(--space-2xs); }

.input, .textarea, .select {
  display: block; width: 100%;
  min-height: var(--control-h); padding: 0 var(--space-s);
  border: var(--line-w) solid var(--line); border-radius: var(--radius-s); background: var(--white);
  font-size: 20px; line-height: 1.4;
}
.textarea { padding: var(--space-s); min-height: 112px; resize: vertical; line-height: 1.45; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: var(--space-2xl);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23161614' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 22px;
}
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline-offset: 2px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-2); opacity: 1; }

/* Number stepper: [−] [ 12 ] [+]. site.js wires any [data-stepper]. */
.stepper__ctl { display: flex; align-items: center; gap: var(--space-2xs); }
.stepper__btn {
  flex: none; width: var(--control-h); height: var(--control-h); border: 0; border-radius: 50%;
  background: var(--pale); font-size: 28px; line-height: 1; display: grid; place-items: center;
  transition: background-color var(--dur-fast) var(--ease);
}
.stepper__btn:hover { background: var(--pale-hover); }
.stepper__box { position: relative; flex: 1; min-width: 0; max-width: 180px; }
.stepper__prefix { position: absolute; left: var(--space-s); top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--ink-2); pointer-events: none; }
.stepper__input {
  width: 100%; height: var(--control-h); padding: 0 var(--space-s);
  border: var(--line-w) solid var(--line); border-radius: var(--radius-s); background: var(--white);
  font-size: 22px; font-weight: var(--weight-medium); text-align: center; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.stepper__input::-webkit-outer-spin-button, .stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__input:focus-visible { outline-offset: 2px; }
.steppers { display: grid; gap: var(--space-m); }

/* Slider. Show the value beside the label in .slider__value. */
.slider__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-s); margin-bottom: var(--space-2xs); }
.slider__value { font-size: var(--text-m); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.slider {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: var(--tap);
  background: transparent; margin: 0; cursor: pointer;
}
.slider::-webkit-slider-runnable-track { height: 8px; background: var(--pale-hover); border-radius: var(--radius-pill); }
.slider::-moz-range-track { height: 8px; background: var(--pale-hover); border-radius: var(--radius-pill); }
.slider::-moz-range-progress { height: 8px; background: var(--ink); border-radius: var(--radius-pill); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 32px; height: 32px; margin-top: -12px; border-radius: 50%;
  background: var(--ink); border: 4px solid var(--white); box-shadow: 0 0 0 1px var(--ink);
}
.slider::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); border: 4px solid var(--white); box-shadow: 0 0 0 1px var(--ink); }
.slider:focus-visible { outline-offset: 2px; }
.slider__ends { display: flex; justify-content: space-between; color: var(--ink-2); font-size: var(--text-xs); }

/* Checkbox and radio rows. Use .choices--radio for round marks. */
.choices { border-top: var(--rule-w) solid var(--rule); }
.choice {
  display: flex; align-items: center; gap: var(--space-s); min-height: var(--control-h);
  padding: var(--space-2xs) 0; border-bottom: var(--rule-w) solid var(--rule);
  font-size: var(--text-body); cursor: pointer;
}
.choice__input {
  flex: none; appearance: none; -webkit-appearance: none; margin: 0;
  width: 28px; height: 28px; border: var(--line-w) solid var(--line); border-radius: var(--radius-s); background: var(--white);
  display: grid; place-items: center; cursor: pointer;
}
.choice__input[type="radio"] { border-radius: 50%; }
.choice__input:checked { background: var(--ink); border-color: var(--ink); }
.choice__input[type="checkbox"]:checked {
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/22px no-repeat;
}
.choice__input[type="radio"]:checked { box-shadow: inset 0 0 0 6px var(--white); }
.choice__input:focus-visible { outline-offset: 2px; }
.choice__text { flex: 1; }
.choice__aside { color: var(--ink-2); font-size: var(--text-s); }

/* =========================================================================
   12. Data pieces
   ========================================================================= */
/* Big figures, e.g. a report's three numbers. */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--space-m); }
.figures__value { display: block; font-size: 32px; font-weight: var(--weight-medium); letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figures__label { display: block; color: var(--ink-2); font-size: var(--text-xs); margin-top: 2px; }
.figure-big { font-size: var(--text-figure); font-weight: var(--weight-medium); letter-spacing: -0.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figure-sub { color: var(--ink-2); font-size: 18px; margin-top: var(--space-2xs); }

/* Tags. */
.tag {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 var(--space-xs);
  background: var(--pale); border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: 1; white-space: nowrap;
}
.tag--dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.tag--ink { background: var(--ink); color: var(--on-ink); }
.tag--stage { background: var(--stage); }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }

/* "Saved" confirmation. Toggle with Site.flash(el). */
.saved {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 var(--space-xs);
  background: var(--pale); border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: 1;
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.saved::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 12.5l3.2 3L17 9' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}
.saved.is-on { opacity: 1; }

/* Progress step list ("pretend work"). Drive with Site.runSteps(list). */
.steps { display: grid; gap: var(--space-s); }
.steps__item { display: flex; align-items: center; gap: var(--space-s); font-size: var(--text-body); color: var(--ink-2); transition: color var(--dur) var(--ease); }
.steps__item::before {
  content: ""; flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: var(--line-w) solid var(--rule);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.steps__item.is-active { color: var(--ink); }
.steps__item.is-active::before { border-color: var(--ink); }
.steps__item.is-done { color: var(--ink); }
.steps__item.is-done::before {
  border-color: var(--ink);
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 12.5l3.2 3L17 9' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}
.steps--inline { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-m); }
.steps--inline .steps__item { font-size: var(--text-s); }

/* A result appearing. Add .reveal to anything a demo shows after work finishes. */
.reveal { animation: site-rise var(--dur-slow) var(--ease-out) both; }
@keyframes site-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Result cards. */
.results { display: grid; gap: var(--space-xs); }
.result {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-2xs) var(--space-s); align-items: start;
  padding: var(--space-m); border: var(--rule-w) solid var(--rule); border-radius: var(--radius-s); background: var(--white);
}
.result__rank {
  width: 36px; height: 36px; border-radius: 50%; background: var(--pale);
  display: grid; place-items: center; font-size: var(--text-s); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums;
}
.result__body { min-width: 0; }
.result__title { font-size: 20px; font-weight: var(--weight-medium); letter-spacing: -0.01em; line-height: 1.3; }
.result__meta { color: var(--ink-2); font-size: var(--text-s); margin-top: 2px; }
.result__note { font-size: var(--text-s); margin-top: var(--space-2xs); }
.result__end { justify-self: end; text-align: right; }
.result--top { border-color: var(--ink); }
.result--top .result__rank { background: var(--stage); }
.result.is-muted { opacity: 0.55; }
@media (max-width: 600px) {
  .result { grid-template-columns: auto 1fr; padding: var(--space-s); }
  .result__end { grid-column: 2; justify-self: start; text-align: left; }
}

/* Plain table; add .table--stack to turn rows into stacked blocks on phones.
   Give each <td> a data-label so the stacked view can name it. */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-s); font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--ink-2); padding: var(--space-xs) var(--space-s) var(--space-xs) 0; border-bottom: var(--rule-w) solid var(--ink); }
.table td { padding: var(--space-s) var(--space-s) var(--space-s) 0; border-bottom: var(--rule-w) solid var(--rule); vertical-align: top; }
.table .table__num { text-align: right; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table tr.is-highlight td { background: color-mix(in oklch, var(--stage) 32%, var(--white)); }
.table tr.is-highlight td:first-child { padding-left: var(--space-s); }
@media (max-width: 600px) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: var(--space-s) 0; border-bottom: var(--rule-w) solid var(--rule); }
  .table--stack tr:first-child { border-top: var(--rule-w) solid var(--ink); }
  .table--stack td { display: flex; justify-content: space-between; gap: var(--space-s); padding: 4px 0; border: 0; text-align: right; }
  .table--stack td::before { content: attr(data-label); color: var(--ink-2); text-align: left; }
  .table--stack td:first-child { font-size: 18px; font-weight: var(--weight-medium); text-align: left; }
  .table--stack td:first-child::before { content: none; }
  .table--stack .table__num { text-align: right; }
  .table--stack tr.is-highlight { background: color-mix(in oklch, var(--stage) 32%, var(--white)); padding-inline: var(--space-s); }
  .table--stack tr.is-highlight td { background: none; }
  .table--stack tr.is-highlight td:first-child { padding-left: 0; }
}

/* Bars (CSS only). Set --value (0 to 100) on each .bars__bar. Near-black, one .is-highlight in the stage colour. */
.bars { display: grid; gap: var(--space-xs); align-content: start; }
.bars__row { display: grid; grid-template-columns: minmax(80px, 9em) 1fr auto; gap: var(--space-s); align-items: center; font-size: var(--text-s); }
.bars__label { color: var(--ink-2); }
.bars__track { height: 24px; background: var(--pale-2); }
.bars__bar { display: block; height: 100%; width: calc(var(--value, 0) * 1%); background: var(--ink); transition: width var(--dur-slow) var(--ease-out); }
.bars__value { font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.bars__row.is-highlight .bars__bar { background: var(--stage); box-shadow: inset 0 0 0 1.5px var(--ink); }
.bars__row.is-highlight .bars__label { color: var(--ink); font-weight: var(--weight-medium); }
/* Column variant: .bars.bars--columns, rows become upright columns. */
.bars--columns { grid-auto-flow: column; grid-auto-columns: 1fr; grid-template-rows: 240px; gap: var(--space-xs); }
.bars--columns .bars__row { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; align-items: stretch; gap: var(--space-2xs); text-align: center; }
.bars--columns .bars__value { order: -1; text-align: center; }
.bars--columns .bars__track { position: relative; height: auto; background: none; border-bottom: var(--rule-w) solid var(--ink); }
.bars--columns .bars__bar { position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: calc(var(--value, 0) * 1%); transition-property: height; }
.bars--columns .bars__label { order: 2; font-size: var(--text-xs); }

/* Abstract map: pale field, faint grid, round pins. Position pins with --x and --y (percent). */
.map {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background-color: var(--pale-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M48 0H0V48' fill='none' stroke='%23e3e3df' stroke-width='1'/%3E%3C/svg%3E");
  border: var(--rule-w) solid var(--rule); border-radius: var(--radius-s);
}
.map--wide { aspect-ratio: 16 / 9; }
.map__pin {
  position: absolute; left: calc(var(--x, 50) * 1%); top: calc(var(--y, 50) * 1%);
  transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%; padding: 0;
  display: grid; place-items: center;
  background: var(--white); border: 2px solid var(--ink); color: var(--ink);
  font-size: var(--text-xs); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; line-height: 1;
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
button.map__pin::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; }
.map__pin--active, .map__pin[aria-pressed="true"] { background: var(--stage); transform: translate(-50%, -50%) scale(1.15); z-index: 2; }
.map__pin--ink { background: var(--ink); color: var(--on-ink); }
.map__pin.is-muted { opacity: 0.4; }
.map__label {
  position: absolute; left: calc(var(--x, 50) * 1%); top: calc(var(--y, 50) * 1%);
  transform: translate(-50%, 26px); white-space: nowrap;
  background: var(--white); padding: 2px 8px; border-radius: var(--radius-s); font-size: var(--text-xs); font-weight: var(--weight-medium);
}

/* Week strip / rota: names down the side, days across. --cols is the number of days. */
.rota { display: grid; grid-template-columns: 64px repeat(var(--cols, 5), 1fr); row-gap: 6px; column-gap: 4px; }
.rota__day { font-size: var(--text-xs); color: var(--ink-2); text-align: center; padding-bottom: 4px; }
.rota__name { font-size: var(--text-s); font-weight: var(--weight-medium); display: flex; align-items: center; min-height: 40px; }
.rota__cell { background: var(--pale-2); border-radius: 4px; min-height: 40px; }
.rota__block {
  z-index: 1; display: flex; align-items: center; justify-content: center; min-height: 40px;
  background: var(--ink); color: var(--on-ink); border-radius: 4px;
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  animation: site-fade var(--dur) var(--ease) both;
}
.rota__block--stage { background: var(--stage); color: var(--ink); }
@keyframes site-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 600px) { .rota { grid-template-columns: 52px repeat(var(--cols, 5), 1fr); column-gap: 3px; } }

/* Click-to-edit words (contenteditable). Wire with Site.editable(el, onSave). */
.editable { border-radius: 3px; outline: 1px dashed transparent; outline-offset: 3px; cursor: text; transition: background-color var(--dur-fast) var(--ease); }
.editable:hover { outline-color: var(--line); }
.editable:focus { outline: 2px solid var(--ink); outline-offset: 3px; background: var(--pale-2); }

/* Divider inside a panel. */
.panel-rule { height: 0; border: 0; border-top: var(--rule-w) solid var(--rule); margin: var(--space-m) 0; }

/* =========================================================================
   13. Closing band and footer
   ========================================================================= */
.closing { padding: var(--space-4xl) 0 var(--space-3xl); }
.closing__title {
  font-family: var(--serif); font-weight: var(--weight-regular); font-variation-settings: "opsz" 72;
  font-size: var(--text-title); line-height: var(--leading-tight); letter-spacing: var(--track-display);
  max-width: 17ch; margin-left: -0.03em;
}
.closing__text { color: var(--ink-2); font-size: var(--text-m); margin: var(--space-l) 0; max-width: var(--measure); }
@media (max-width: 600px) { .closing { padding: var(--space-3xl) 0 var(--space-2xl); } }

.footer { border-top: var(--rule-w) solid var(--rule); }
.footer__inner {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-s) var(--space-l);
  padding-top: var(--space-l); padding-bottom: var(--space-l);
  color: var(--ink-2); font-size: var(--text-s);
}
.footer__mark { font-family: var(--serif); color: var(--ink); font-size: 20px; letter-spacing: -0.01em; }
.footer__links { display: flex; flex-wrap: wrap; gap: 0 var(--space-m); }
.footer__links a { display: inline-flex; align-items: center; min-height: var(--tap); text-decoration: none; }
.footer__links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }

/* =========================================================================
   14. Motion: hero entrance, reveal on view, pinned scenes, ink fill, page
   continuity. The inline <head> script adds .motion to <html> only when the
   visitor has not asked for reduced motion, and .vt-in when the page arrived
   through a view transition. Every hidden-at-start state lives under html.motion,
   so with no script, or under reduced motion, everything shows finished.
   ========================================================================= */

/* Hero entrance (CSS only). .enter on each part, --i 0 to 3 in reading order.
   Skipped when the page arrives through a view transition: the morph is the entrance. */
html.motion:not(.vt-in) .enter { animation: site-enter var(--dur-enter) var(--ease-out) calc(var(--i, 0) * var(--stagger)) backwards; }
span.enter { display: inline-block; }
@keyframes site-enter { from { opacity: 0; translate: 0 24px; } }

/* Reveal once on view (site.js adds .is-in). [data-reveal] for one block;
   [data-reveal-list] staggers its children, total delay capped at 400ms. */
html.motion [data-reveal]:not(.is-in),
html.motion [data-reveal-list]:not(.is-in) > * { opacity: 0; }
html.motion [data-reveal].is-in,
html.motion [data-reveal-list].is-in > * { animation: site-reveal var(--dur-enter) var(--ease-out) var(--reveal-delay, 0ms) backwards; }
html.motion [data-reveal].is-instant,
html.motion [data-reveal-list].is-instant > * { animation: none; }
@keyframes site-reveal { from { opacity: 0; translate: 0 var(--rise); } }

/* Pinned scene: a tall section whose inner box holds the screen while --p runs
   0 to 1 (site.js). The page sets the length with --scene-len and reads var(--p)
   for transforms and opacity, or [data-step] when it has data-steps="n".
   Without motion the section is its natural height and --p is 1. */
.scene { --p: 1; }
html.motion .scene { --p: 0; height: var(--scene-len, 250svh); }
html.motion .scene__pin {
  position: sticky; top: var(--bar-h);
  height: calc(100svh - var(--bar-h)); overflow-x: clip;
}
@media (max-height: 520px) {
  html.motion .scene { height: auto; }
  html.motion .scene__pin { position: static; height: auto; }
}

/* Ink fill: words go from light to full ink as the paragraph rises to mid-screen.
   site.js wraps the words (plain text only); screen readers get one normal sentence. */
.ink {
  font-family: var(--serif); font-weight: var(--weight-regular); font-variation-settings: "opsz" 60;
  font-size: var(--text-statement); line-height: 1.16; letter-spacing: -0.025em;
  max-width: 26ch; margin-left: -0.02em;
}
html.motion .ink__word { opacity: calc(var(--ink-from) + (1 - var(--ink-from)) * clamp(0, (var(--p, 1) * 1.2 - var(--w, 0)) * 5, 1)); }

/* Page continuity: cross-page view transitions where the browser supports them.
   A quick cross-fade for the page; the top bar holds still; a tool card's frame
   (data-vt-name="tool-<folder>", named by site.js as its link is followed) grows
   into the tool page's .stage__field (style="view-transition-name: tool-<folder>").
   A name may appear only once on a page. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .topbar { view-transition-name: topbar; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur); }
::view-transition-group(topbar) { animation: none; }
::view-transition-old(topbar) { display: none; }
::view-transition-new(topbar) { animation: none; }
.tool-card__frame, .stage__field { view-transition-class: tool; }
::view-transition-group(*.tool) { animation-duration: var(--dur-slow); animation-timing-function: var(--ease-out); }
::view-transition-old(*.tool), ::view-transition-new(*.tool) { height: 100%; object-fit: cover; object-position: top; }
/* A stage with no partner on the other page fades with the page, not slower. */
::view-transition-old(*.tool):only-child, ::view-transition-new(*.tool):only-child { animation-duration: var(--dur); }

/* =========================================================================
   15. Tool hero: page header and demo together. Text left, stage right on wide
   screens; text, then demo, when stacked. --wide: text and the Before / Now
   pair in the top row, the full-width workbench stage under them.
   ========================================================================= */
.tool-hero { padding: var(--space-xl) 0 0; }
.tool-hero__inner { display: grid; gap: var(--space-xl); }
.tool-hero__text { min-width: 0; }
.tool-hero__stage { min-width: 0; }
.tool-hero__text .page-head__title { max-width: 15ch; }

/* The default hero is followed by the Before / Now .section; the wide one holds the
   pair itself, so it brings its own space before the next block. */
.tool-hero--wide { padding-bottom: var(--space-4xl); }
.tool-hero--wide .tool-hero__inner { grid-template-areas: "text" "stage" "pair"; }
.tool-hero--wide .tool-hero__text { grid-area: text; }
.tool-hero--wide .tool-hero__pair { grid-area: pair; }
.tool-hero--wide .tool-hero__stage { grid-area: stage; }
.tool-hero__pair .before-now__text { font-size: var(--text-m); line-height: 1.4; letter-spacing: -0.01em; }

/* Side by side from 1200px: below that a real demo gets under ~390px of panel while
   its own layout still thinks it is on a desktop. Workbench demos (about 1100px) use --wide. */
@media (min-width: 1200px) {
  .tool-hero__inner { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: var(--space-2xl); align-items: start; }
  .tool-hero__text { padding-top: var(--space-xs); }
  .tool-hero .page-head__title { font-size: clamp(48px, 4.6vw, 72px); }
  .tool-hero:not(.tool-hero--wide) .stage__field { padding: var(--space-xl); }

  .tool-hero--wide .tool-hero__inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-areas: "text pair" "stage stage";
    row-gap: var(--space-2xl);
  }
  .tool-hero--wide .tool-hero__text { padding-top: 0; }
  .tool-hero--wide .page-head__title { font-size: clamp(48px, 5.2vw, 80px); max-width: 14ch; }
  .tool-hero--wide .tool-hero__pair { align-self: end; grid-template-columns: 1fr; gap: var(--space-l); }
}
@media (max-width: 1199px) {
  .tool-hero--wide .tool-hero__pair { margin-top: var(--space-l); }
}
@media (max-width: 600px) {
  .tool-hero { padding-top: var(--space-m); }
  .tool-hero--wide { padding-bottom: var(--space-3xl); }
  .tool-hero__inner { gap: var(--space-l); }
}

/* =========================================================================
   16. Tiles: small live demos in a grid, each on its group colour with a
   caption under it. Panels in a row share their height.
   ========================================================================= */
.tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3xl) var(--space-xl); }
.tile { display: grid; grid-template-rows: subgrid; grid-row: span 2; row-gap: 0; min-width: 0; }
.tile__field { display: flex; background: var(--stage); padding: var(--space-xl); }
.tile__panel {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
  background: var(--white); border-radius: var(--radius-panel); padding: var(--space-l);
}
.tile__panel > .stage__note { margin-top: auto; padding-top: var(--space-m); }
.tile__caption { padding-top: var(--space-m); }
.tile__title { font-size: var(--text-l); letter-spacing: var(--track-heading); line-height: 1.2; }
.tile__text { margin-top: var(--space-2xs); color: var(--ink-2); max-width: 44ch; }
.tile__link { margin-top: var(--space-3xs); }
@media (min-width: 1000px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) and (max-width: 1199px) {
  .tile__field { padding: var(--space-l); }
  .tile__panel { padding: var(--space-m); }
}
@media (max-width: 600px) {
  .tiles { gap: var(--space-2xl); }
  .tile__field { margin-inline: calc(-1 * var(--gutter)); padding: var(--space-m) var(--space-s); }
  .tile__panel { padding: var(--space-m); }
}

/* =========================================================================
   17. Tool cards: a picture of each tool's demo on its colour, then name,
   one line and "Try it". Tools without a demo use the catalogue rows.
   ========================================================================= */
.tool-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2xl) var(--space-l); }
.tool-cards > li { display: flex; min-width: 0; }
.tool-card { display: flex; flex-direction: column; width: 100%; color: inherit; text-decoration: none; }
/* The frame shows first even when the name comes first in the markup (so a screen reader
   hears the name before the picture). The picture keeps its full width and runs off the
   bottom of the colour. */
.tool-card__frame { order: -1; position: relative; display: block; aspect-ratio: 960 / 660; overflow: hidden; background: var(--stage); }
.tool-card__img {
  position: absolute; top: 10%; left: 8%; width: 84%; height: auto;
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  transform-origin: 50% 0; transition: transform var(--dur-slow) var(--ease-out);
}
.tool-card__name { margin-top: var(--space-m); font-size: var(--text-l); font-weight: var(--weight-medium); letter-spacing: var(--track-heading); line-height: 1.2; }
.tool-card__line { margin-top: var(--space-2xs); color: var(--ink-2); line-height: 1.45; }
.tool-card__go {
  margin-top: auto; padding-top: var(--space-xs); min-height: var(--tap);
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  font-size: var(--text-s); font-weight: var(--weight-medium);
}
.tool-card__arrow { font-size: 22px; line-height: 1; transition: transform var(--dur-fast) var(--ease); }
.tool-card:hover .tool-card__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.tool-card:hover .tool-card__arrow { transform: translateX(4px); }
.tool-card:focus-visible { outline-offset: 6px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tool-card:hover .tool-card__img { transform: scale(1.03); }
}
@media (max-width: 1099px) { .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .tool-cards { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); } }

/* =========================================================================
   18. Reduced motion and print
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  html.motion [data-reveal], html.motion [data-reveal-list] > *, html.motion .ink__word { opacity: 1 !important; animation: none !important; }
}
