/* Generated from config.yaml (colours). */
:root{--paper:#F3F5F6;--ink:#141E26;--graphite:#4F5D68;--viewport:#0E1418;--viewport-text:#E3E9EC;--viewport-muted:#93A1AB;--alert:#A3262E;--field-1:#420A68;--field-2:#932667;--field-3:#DD513A;--field-4:#FCA50A;--field-5:#F6D746}
/* NodixLab site styles.
   Colours come from /theme.css (generated from config.yaml); everything else is here.
   Principles: paper for reading, viewports for pictures; colour is a measurement;
   label what's real; one moving thing (the hero). Logical properties throughout so
   right-to-left languages work without changes. */

/* ------------------------------------------------------------------ fonts */

@font-face {
  font-family: "Source Serif 4";
  src: url("/static/fonts/source-serif-4-roman.woff2?v=c86c5b2d3f") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/static/fonts/source-serif-4-italic.woff2?v=89a3a132d7") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo.woff2?v=edbbdb555d") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

/* Arabic: Noto Naskh Arabic for text, Noto Sans Arabic for labels. They follow the Latin
   faces in the stacks and cover only the Arabic block, so pages without Arabic never
   load them and Latin inside Arabic text (C5, mA, DOIs) keeps its own face. */

@font-face {
  font-family: "Noto Naskh Arabic";
  src: url("/static/fonts/noto-naskh-arabic-regular.woff2?v=13bc81c112") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+200C-200F, U+25CC;
}

@font-face {
  font-family: "Noto Naskh Arabic";
  src: url("/static/fonts/noto-naskh-arabic-bold.woff2?v=39dd6e237c") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+200C-200F, U+25CC;
}

@font-face {
  font-family: "Noto Sans Arabic";
  src: url("/static/fonts/noto-sans-arabic-regular.woff2?v=408bfa8c6a") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+200C-200F, U+25CC;
}

@font-face {
  font-family: "Noto Sans Arabic";
  src: url("/static/fonts/noto-sans-arabic-bold.woff2?v=9ca3eb6246") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+200C-200F, U+25CC;
}

/* ----------------------------------------------------------------- tokens */

:root {
  --font-serif: "Source Serif 4", "Noto Naskh Arabic", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Archivo", "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  --sans-width: 88%;

  /* Type scale, ratio about 1.25 from an 18 px body */
  --step--1: 0.875rem;   /* 14: labels, never smaller */
  --step-0: 1.125rem;    /* 18: body */
  --step-1: 1.375rem;    /* 22 */
  --step-2: 1.75rem;     /* 28 */
  --step-3: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);    /* 32 to 44 */
  --step-4: clamp(2.25rem, 1.5rem + 2.6vw, 3.5rem);  /* 36 to 56 */
  --label: 0.9375rem;    /* 15 */

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  --measure: 65ch;
  --wrap: 75rem;
  --gutter: 1rem;
  --section: clamp(3rem, 2rem + 4vw, 5.5rem);

  --rule: color-mix(in srgb, var(--graphite) 28%, var(--paper));
  --rule-strong: color-mix(in srgb, var(--graphite) 60%, var(--paper));
  --field-surface: color-mix(in srgb, var(--paper) 25%, #fff);
  --viewport-frame: color-mix(in srgb, var(--viewport-text) 14%, var(--viewport));
}

@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
}

/* ------------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img, video, canvas, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 560;
  line-height: 1.15;
  text-wrap: balance;
}

p, ul, ol, dl, figure { margin: 0; }

p { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: 2px; }

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

.viewport :focus-visible,
.on-dark :focus-visible {
  outline-color: var(--viewport-text);
}

main:focus { outline: none; }

/* Arabic script: no tracking (it would pull joined letters apart), no slanted motto
   (Arabic has no italic), and taller lines for the Naskh ascenders, descenders and
   vowel marks. Weights snap to the two the Arabic faces have. */
:lang(ar) { letter-spacing: normal !important; font-style: normal !important; }
html:lang(ar) body { line-height: 1.8; }
html:lang(ar) :is(h1, h2, h3, h4) { line-height: 1.45; font-weight: 700; }
/* Email addresses are written left to right; the field keeps the page's alignment. */
html[dir="rtl"] input[type="email"] { direction: ltr; text-align: right; }

::selection { background: var(--ink); color: var(--paper); }

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

.skip-link {
  position: absolute;
  inset-inline-start: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
}

.skip-link:focus { top: var(--space-2); }

/* TODO markers in content: hatched like a section cut, impossible to miss. */
mark.todo {
  color: var(--ink);
  background: repeating-linear-gradient(
    -45deg,
    transparent 0 4px,
    color-mix(in srgb, var(--graphite) 22%, transparent) 4px 5px
  );
  outline: 1px dashed var(--graphite);
  outline-offset: 1px;
  padding-inline: 0.15em;
}

/* ----------------------------------------------------------------- layout */

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section);
  border-top: 1px solid var(--rule);
}

.section--flush {
  border-top: 0;
  padding-top: 0;
}

.section__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5) var(--space-6);
}

.section__head {
  font-size: var(--step-2);
}

.section__body > p,
.section__body > ul:not(.work-list):not(.ledger),
.section__body > ol {
  max-width: var(--measure);
}

.section__body > * + * { margin-top: var(--space-5); }

@media (min-width: 60rem) {
  .section__grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  }
  .section__head { grid-column: 1; grid-row: 1; }
  .section__body { grid-column: 2; grid-row: 1; }
}

/* ------------------------------------------------------------ type pieces */

.lead {
  font-size: var(--step-1);
  line-height: 1.5;
}

.label,
.caption,
.note,
.vat-line {
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
}

.label {
  font-size: var(--label);
  font-weight: 600;
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}

.caption {
  margin-top: var(--space-3);
  font-size: var(--label);
  line-height: 1.5;
  color: var(--graphite);
  max-width: var(--measure);
}

.note,
.vat-line {
  font-size: var(--label);
  color: var(--graphite);
}

.claim {
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-weight: 650;
  font-size: var(--label);
}

.plain-list {
  list-style: none;
  padding: 0;
}

.plain-list > li {
  position: relative;
  padding-inline-start: 1.25rem;
}

.plain-list > li + li { margin-top: var(--space-2); }

/* Short rule as the bullet: a measured tick, not a dot. */
.plain-list > li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.8em;
  width: 0.6rem;
  border-top: 1.5px solid var(--graphite);
}

.plain-list--links > li::before { display: none; }
.plain-list--links > li { padding-inline-start: 0; }

.prose > * + * { margin-top: 1em; }

.prose h2 {
  font-size: var(--step-2);
  margin-top: var(--space-7);
}

.prose h3 {
  font-size: var(--step-1);
  margin-top: var(--space-6);
}

/* Same short-rule marker as .plain-list. */
.prose ul {
  list-style: none;
  padding: 0;
}

.prose ul > li {
  position: relative;
  padding-inline-start: 1.25rem;
}

.prose ul > li + li { margin-top: var(--space-2); }

.prose ul > li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.8em;
  width: 0.6rem;
  border-top: 1.5px solid var(--graphite);
}

.prose > * { max-width: var(--measure); }

/* Sequences (and only sequences) are numbered: nodes joined by an edge. */
.prose ol {
  list-style: none;
  padding: 0;
  counter-reset: node;
}

.prose ol > li {
  counter-increment: node;
  position: relative;
  padding-inline-start: 2.75rem;
  padding-bottom: var(--space-5);
}

.prose ol > li:last-child { padding-bottom: 0; }

.prose ol > li::before {
  content: counter(node);
  position: absolute;
  inset-inline-start: 0;
  top: 0.1em;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--step--1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.prose ol > li:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-start: calc(0.875rem - 0.75px);
  top: 1.95em;
  bottom: 0.1em;
  border-inline-start: 1.5px solid var(--rule-strong);
}

/* ---------------------------------------------------------------- buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7em 1.3em;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-stretch: 94%;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: color-mix(in srgb, var(--ink) 80%, var(--paper));
  border-color: color-mix(in srgb, var(--ink) 80%, var(--paper));
}

/* Secondary action next to a primary one: same shape, no fill. */
.button--quiet {
  background: transparent;
  color: var(--ink);
}

.button--quiet:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.button--small {
  min-height: 2.5rem;
  padding: 0.5em 0.95em;
  font-size: var(--label);
}

/* ----------------------------------------------------------------- header */

.site-header { border-bottom: 1px solid var(--rule); }

.page-home .site-header { border-bottom-color: transparent; }

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  padding-block: var(--space-4);
}

.site-header__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-5);
  margin-inline-end: auto;
  min-width: 0;
}

.brand {
  display: block;
  color: var(--ink);
  text-decoration: none;
  padding-block: var(--space-1);
}

.brand svg {
  height: 1.625rem;
  width: auto;
}

.brand .wm-b { fill: var(--graphite); }
.brand .wm-a,
.brand .wm-node { fill: var(--ink); }

.brand__text {
  font-family: var(--font-sans);
  font-weight: 650;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.brand__b { font-weight: 400; color: var(--graphite); }

.site-header__descriptor {
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--step--1);
  line-height: 1.35;
  color: var(--graphite);
  max-width: 34ch;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a:not(.button),
.lang-switch a {
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
  font-weight: 500;
  text-decoration: none;
  padding-block: var(--space-2);
}

.site-nav a:not(.button):hover,
.lang-switch a:hover,
.site-nav a[aria-current]:not(.button) {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.lang-switch ul {
  display: flex;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-switch a { color: var(--graphite); }

.lang-switch a[aria-current] {
  color: var(--ink);
  font-weight: 650;
}

@media (max-width: 47.99rem) {
  .site-header__inner { row-gap: var(--space-2); }
  .site-header__brand { flex: 1 1 auto; }
  .site-nav { order: 3; flex-basis: 100%; }
  .site-nav__list { column-gap: var(--space-4); }
  .site-nav__cta { margin-inline-start: auto; }
}

@media (max-width: 23rem) {
  .site-nav__list { column-gap: var(--space-3); }
  .site-nav .button--small { padding-inline: 0.7em; }
}

/* --------------------------------------------------------------- page head */

.page-head {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) clamp(2rem, 1.5rem + 2vw, 3rem);
}

.page-head .section__body { grid-column: 1 / -1; }

.page-head__title {
  font-size: var(--step-4);
  font-weight: 520;
  letter-spacing: -0.012em;
  max-width: 24ch;
}

.page-head .lead { max-width: 48ch; }

.page-head__back,
.page-head__meta {
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
  color: var(--graphite);
}

.page-head__back { margin-bottom: var(--space-5); }

/* -------------------------------------------------------------- viewports */

.viewport {
  position: relative;
  background: var(--viewport);
  color: var(--viewport-text);
  box-shadow: inset 0 0 0 1px var(--viewport-frame);
}

.viewport__screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--viewport);
}

.viewport__screen picture { display: contents; }

.viewport__screen img,
.viewport__screen > video,
.viewport__screen > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viewport__screen > video { object-fit: contain; }

/* Corner labels, as on a radiology display. Real text, never decoration. */
.viewport__label {
  position: absolute;
  z-index: 2;
  margin: 0;
  max-width: calc(100% - 2rem);
  padding: var(--space-1) var(--space-2);
  background: color-mix(in srgb, var(--viewport) 78%, transparent);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--step--1);
  line-height: 1.3;
  color: var(--viewport-muted);
  pointer-events: none;
}

.viewport__label--tl { top: var(--space-2); inset-inline-start: var(--space-2); }
.viewport__label--tr { top: var(--space-2); inset-inline-end: var(--space-2); text-align: end; }
.viewport__label--bl { bottom: var(--space-2); inset-inline-start: var(--space-2); }
.viewport__label--br { bottom: var(--space-2); inset-inline-end: var(--space-2); text-align: end; }

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

.hero {
  padding-block: clamp(1rem, 0.5rem + 2vw, 2.5rem) var(--section);
}

.hero__grid {
  display: grid;
  gap: var(--space-6);
}

.hero__title {
  font-size: var(--step-4);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 17ch;
}

.hero__motto {
  margin-top: var(--space-4);
  font-size: var(--step-1);
  font-style: italic;
  color: var(--graphite);
}

.hero__positioning {
  margin-top: var(--space-6);
  max-width: 46ch;
}

.hero__cta { margin-top: var(--space-6); }

.hero__viewport .viewport__screen--tall { aspect-ratio: 4 / 3; }

@media (min-width: 60rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
    gap: var(--space-7);
  }
  .hero__text { padding-top: var(--space-6); }
  .hero__viewport .viewport__screen--tall { aspect-ratio: 5 / 6; }
}

/* What the illustration shows: a real sequence, so numbered nodes on a path. */
.hero-stages {
  list-style: none;
  margin: var(--space-7) 0 0;
  padding: 0;
  counter-reset: stage;
  max-width: 38ch;
}

.hero-stages__item {
  counter-increment: stage;
  position: relative;
  padding-inline-start: 2.75rem;
  padding-bottom: var(--space-5);
  color: var(--graphite);
}

.hero-stages__item:last-child { padding-bottom: 0; }

.hero-stages__item::before {
  content: counter(stage);
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--step--1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.hero-stages__item:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-start: calc(0.875rem - 0.75px);
  top: 1.85rem;
  bottom: 0.1rem;
  border-inline-start: 1.5px solid var(--rule-strong);
}

.hero-stages__title {
  display: block;
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
  font-weight: 650;
  line-height: 1.75rem;
}

.hero-stages__text {
  display: block;
  font-size: 1rem;
  line-height: 1.5;
}

/* The stage the picture is showing (set by hero-scroll.js). */
.hero-stages__item[aria-current="step"] { color: var(--ink); }
.hero-stages__item[aria-current="step"]::before { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Where the frame is wider than the 5:6 poster (phones), keep the cut end with the
   grey matter in view rather than the middle of the cord. */
.hero__screen img { object-position: 50% 8%; }

/* Live scene: canvas (or video) crossfades in over the poster once it has drawn. */
.hero__screen > .hero__canvas {
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s linear;
}

.hero__screen > .hero__canvas.is-ready { opacity: 1; }

.hero__progress {
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  z-index: 2;
  width: calc(var(--hero-progress, 0) * 100%);
  height: 3px;
  background: var(--field-4);
  opacity: 0;
}

.hero__viewport.is-live .hero__progress { opacity: 1; }

/* Atlas-style callouts in the magnified fibre view: a leader line and a name.
   Position (--x, --y) and visibility (--o) come from hero-procedural.js. */
.hero__callout {
  position: absolute;
  z-index: 2;
  left: var(--x, 50%);
  top: var(--y, 50%);
  margin: 0;
  padding: var(--space-1) var(--space-2);
  transform: translate(2.25rem, -50%);
  background: color-mix(in srgb, var(--viewport) 78%, transparent);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--step--1);
  line-height: 1.3;
  color: var(--viewport-text);
  white-space: nowrap;
  opacity: var(--o, 0);
  pointer-events: none;
}

.hero__callout::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  width: 2.25rem;
  border-top: 1px solid var(--viewport-muted);
}
.hero__viewport[data-hero-mode="video"] .hero__progress { display: none; }

/* Desktop with a scroll-linked mode: the viewport stays put while the stage
   captions scroll past it. */
@media (min-width: 60rem) {
  .hero.is-pinned .hero__viewport {
    position: sticky;
    top: 5vh;
  }

  .hero.is-pinned .hero__viewport .viewport__screen--tall {
    aspect-ratio: auto;
    height: 88vh;
  }

  .hero.is-pinned .hero-stages { margin-top: 18vh; }
  .hero.is-pinned .hero-stages__item { padding-bottom: 34vh; }
  /* Room for the last stage to hold before the viewport scrolls away. */
  .hero.is-pinned .hero-stages__item:last-child { padding-bottom: 58vh; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__screen > .hero__canvas { transition: none; }
}

/* ------------------------------------------------------- ledger (home) */

.ledger {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule-strong);
}

.ledger__row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1) var(--space-6);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--rule);
}

.ledger__title {
  font-size: var(--step-1);
  font-weight: 560;
}

.ledger__title a { text-decoration: none; }
.ledger__title a::after { content: ""; position: absolute; inset: 0; }
.ledger__row:hover .ledger__title a { text-decoration: underline; text-decoration-thickness: 2px; }

.ledger__summary {
  color: var(--graphite);
  max-width: 52ch;
}

.ledger__price {
  margin-top: var(--space-2);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
  white-space: nowrap;
}

@media (min-width: 40rem) {
  .ledger__row { grid-template-columns: minmax(0, 1fr) auto; }
  .ledger__title, .ledger__summary { grid-column: 1; }
  .ledger__price {
    grid-column: 2;
    grid-row: 1 / span 2;
    text-align: end;
    margin-top: 0;
    padding-top: 0.3em;
  }
}

.price__amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
}

.price__from,
.price__unit { color: var(--graphite); }

.section__note { color: var(--graphite); }

/* ------------------------------------------------------------- work list */

.work-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-7) var(--space-6);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
}

.work-item { position: relative; }

.work-item__caption { margin-top: var(--space-4); }

.work-item__title {
  font-size: var(--step-1);
  max-width: 30ch;
}

.work-item__title a { text-decoration: none; }
.work-item:hover .work-item__title a { text-decoration: underline; text-decoration-thickness: 2px; }

.stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
}

.work-item__summary {
  margin-top: var(--space-2);
  max-width: 48ch;
}

.work-item__service {
  margin-top: var(--space-3);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--step--1);
  color: var(--graphite);
}

/* Above the card's stretched link, so the service can be opened on its own. */
.work-item__service a {
  position: relative;
  z-index: 4;
  color: inherit;
}

@media (min-width: 48rem) {
  .work-list--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-list--single { grid-template-columns: 1fr; }
  .work-list--single .work-item {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: var(--space-6);
    align-items: end;
  }
  .work-list--single .work-item__caption { margin-top: 0; }
}

/* ---------------------------------------------------- comparison slider */

.compare__stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  aspect-ratio: auto;
  background: var(--viewport-frame);
}

.compare__pane {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--viewport);
}

.compare__pane img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 40rem) {
  .compare__stage { grid-template-columns: repeat(2, 1fr); }
  .compare__stage[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
}

/* Enhanced by compare.js: one frame; the next stage is revealed left of the divider
   (clip paths set per pane by the script). */
.compare.is-enhanced .compare__stage {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--viewport);
}

.compare.is-enhanced .compare__pane {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}

.compare.is-enhanced .compare__pane-label { display: none; }

.compare__live-label { z-index: 5; }
/* These name the stage on each side of the divider, and the pictures are not mirrored in
   right-to-left languages: left stays left. */
.compare__live-label.viewport__label--tl { inset-inline: auto; left: var(--space-2); }
.compare__live-label.viewport__label--tr { inset-inline: auto; right: var(--space-2); }
.compare__live-label[hidden] { display: none; }
.compare__note { z-index: 5; }

/* One button per stage, under the frame: a measured scale, not tabs. */
.compare__ticks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5);
  margin-top: var(--space-3);
}

.compare__tick {
  padding: var(--space-2) 0;
  border: 0;
  background: none;
  color: var(--graphite);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
  font-weight: 500;
  cursor: pointer;
}

.compare__tick:hover,
.compare__tick[aria-pressed="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.compare__range {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
}

.compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  z-index: 3;
  width: 2px;
  margin-left: -1px;
  background: var(--viewport-text);
  pointer-events: none;
}

/* The grip: a node on the divider. */
.compare__handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.75rem;
  height: 2.75rem;
  margin: -1.375rem 0 0 -1.375rem;
  border: 2px solid var(--viewport-text);
  border-radius: 50%;
  background: color-mix(in srgb, var(--viewport) 70%, transparent);
  transform: translateX(var(--grip-shift, 0px)); /* stays inside the frame at the ends */
}

.compare__handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 0.5rem;
  height: 0.5rem;
  margin: -0.25rem 0 0 -0.25rem;
  border-radius: 50%;
  background: var(--viewport-text);
  transform: translateX(var(--grip-shift, 0px));
}

.compare__range:focus-visible + .compare__handle::after {
  outline: 3px solid var(--viewport-text);
  outline-offset: 3px;
}

/* Three or more stages: no grip in the frame (it can't follow the pointer through
   every stage); a slider under it instead, the stage buttons spread along its track. */
.compare--steps .compare__handle::before,
.compare--steps .compare__handle::after { display: none; }

.compare__control { margin-top: var(--space-2); }

.compare--steps .compare__range {
  position: static;
  display: block;
  width: 100%;
  height: 2.75rem; /* touch target */
  opacity: 1;
  cursor: pointer;
  touch-action: auto;
  appearance: none;
  background: transparent;
}

.compare--steps .compare__range::-webkit-slider-runnable-track {
  height: 2px;
  background: color-mix(in srgb, var(--graphite) 45%, transparent);
}

.compare--steps .compare__range::-moz-range-track {
  height: 2px;
  background: color-mix(in srgb, var(--graphite) 45%, transparent);
}

.compare--steps .compare__range::-webkit-slider-thumb {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: calc(1px - 0.625rem);
  border: 0;
  border-radius: 50%;
  background: var(--ink);
}

.compare--steps .compare__range::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
}

.compare--steps .compare__range:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.compare--steps .compare__ticks {
  display: grid;
  grid-template-columns: repeat(var(--count, 3), 1fr);
  margin-top: 0;
}

.compare--steps .compare__tick { justify-self: center; }
.compare--steps .compare__tick:first-child { justify-self: start; }
.compare--steps .compare__tick:last-child { justify-self: end; }

/* --------------------------------------------------------------- variants */

/* Wide components take the full width under their heading. */
@media (min-width: 60rem) {
  .section__grid--stacked .section__body { grid-column: 1 / -1; grid-row: 2; }
}

.variants__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--viewport-frame);
}

@media (min-width: 48rem) {
  .variants__grid[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
  .variants__grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
}

.variants.is-enhanced .variants__item:not(.is-active) { display: none; }

.variants__controls-top {
  padding: var(--space-3);
  border-bottom: 1px solid var(--viewport-frame);
}

@media (min-width: 48rem) {
  .variants__controls-top { display: none; }
}

.segmented {
  display: flex;
  border: 1px solid var(--viewport-muted);
  border-radius: 2px;
}

.segmented__button {
  flex: 1;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-inline-start: 1px solid var(--viewport-muted);
  background: transparent;
  color: var(--viewport-text);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.segmented__button:first-child { border-inline-start: 0; }

.segmented__button[aria-pressed="true"] {
  background: var(--viewport-text);
  color: var(--viewport);
}

/* Shared transport: play/pause, scrubber, time. Progress uses the field ramp. */
.player {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--viewport-frame);
}

.player[hidden] { display: none; }

.player__play {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--viewport-muted);
  border-radius: 50%;
  background: transparent;
  color: var(--viewport-text);
  cursor: pointer;
}

.player__play:hover { border-color: var(--viewport-text); }

.player__icon {
  width: 0;
  height: 0;
  margin-inline-start: 0.2rem;
  border-style: solid;
  border-width: 0.45rem 0 0.45rem 0.75rem;
  border-color: transparent transparent transparent currentColor;
}

.player__play[data-state="playing"] .player__icon {
  width: 0.7rem;
  height: 0.85rem;
  margin: 0;
  border-width: 0 0.22rem;
  border-color: currentColor;
}

.player__scrub {
  --progress: 0%;
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
}

.player__scrub::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(
    to right,
    var(--field-4) 0 var(--progress),
    var(--viewport-frame) var(--progress) 100%
  );
}

.player__scrub::-moz-range-track {
  height: 4px;
  background: var(--viewport-frame);
}

.player__scrub::-moz-range-progress {
  height: 4px;
  background: var(--field-4);
}

.player__scrub::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--viewport-text);
  appearance: none;
}

.player__scrub::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--viewport-text);
}

.player__time {
  flex: none;
  min-width: 6.5ch;
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  color: var(--viewport-muted);
  text-align: end;
}

/* Card loop on hover or focus (work-preview.js). */
.viewport__screen > .work-item__preview {
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s linear;
}

.work-item__preview.is-playing { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .work-item__preview { display: none; }
}

/* -------------------------------------------- method note (title block) */

.titleblock {
  max-width: 46rem;
  border: 1.5px solid var(--ink);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: 1rem;
  line-height: 1.45;
}

.titleblock__claim {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1.5px solid var(--ink);
  font-weight: 650;
}

.titleblock__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-bottom: 1px solid var(--rule-strong);
}

.titleblock__row:last-child { border-bottom: 0; }

.titleblock dt {
  padding: var(--space-3) var(--space-4) 0;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--graphite);
}

.titleblock dd {
  margin: 0;
  padding: var(--space-1) var(--space-4) var(--space-3);
}

.titleblock ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.titleblock li + li { margin-top: var(--space-1); }

@media (min-width: 40rem) {
  .titleblock__row { grid-template-columns: 11.5rem minmax(0, 1fr); }
  .titleblock dt {
    padding: var(--space-3) var(--space-4);
    border-inline-end: 1px solid var(--rule-strong);
  }
  .titleblock dd { padding: var(--space-3) var(--space-4); }
}

.titleblock__row--tools {
  border-top: 1.5px solid var(--ink);
}

.titleblock__row--tools dd { font-variant-numeric: tabular-nums; }

.titleblock__row--credits {
  font-size: var(--step--1);
  color: var(--graphite);
}

/* ---------------------------------------------------------- services page */

.service__title {
  font-size: var(--step-3);
  font-weight: 520;
  letter-spacing: -0.01em;
  max-width: 28ch;
}

.service__main .claim { margin-top: var(--space-3); }

.service__example {
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
}

.spec {
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
  border-top: 1.5px solid var(--ink);
  align-self: start;
}

.spec__row {
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--rule);
}

.spec dt {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--graphite);
}

.spec dd { margin: var(--space-1) 0 0; }

.spec__price {
  display: block;
  font-size: var(--step-1);
  line-height: 1.3;
}

.spec__price .price__from,
.spec__price .price__unit { font-size: var(--label); }

.service__quote { margin-top: var(--space-5); }

/* What a service is not for: a quiet margin rule, not a warning box. */
.scope-note,
.form-note {
  max-width: var(--measure);
  padding-inline-start: var(--space-4);
  border-inline-start: 2px solid var(--rule-strong);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
  line-height: 1.5;
  color: var(--graphite);
}

.form-note { margin-bottom: var(--space-5); }

.faq { margin: 0; }

.faq__item + .faq__item {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--rule);
}

.faq__question {
  font-size: var(--step-1);
  font-weight: 560;
  line-height: 1.3;
}

.faq__answer {
  margin: var(--space-2) 0 0;
  max-width: var(--measure);
}

.spec__extra {
  display: block;
  margin-top: var(--space-2);
  color: var(--graphite);
}

@media (min-width: 60rem) {
  .service .section__grid { align-items: start; }
  .service .spec { margin-top: 0.6rem; }
}

/* --------------------------------------------------------------- CTA band */

.cta-band {
  border-top: 1px solid var(--rule);
  padding-block: var(--space-7);
}

.cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5) var(--space-6);
}

.cta-band__text {
  font-size: var(--step-2);
  line-height: 1.25;
  max-width: 30ch;
  text-wrap: balance;
}

.cta-band__timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
  margin-top: var(--space-3);
  max-width: var(--measure);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
}

.cta-band__timeline dt { font-weight: 600; color: var(--graphite); }
.cta-band__timeline dd { margin: 0; }

.section--note { padding-block: var(--space-6); }

.timeline-note {
  max-width: var(--measure);
  color: var(--graphite);
}

.cta-band__notes > * + * { margin-top: var(--space-2); }
.cta-band__notes { max-width: var(--measure); }

.case-study__hero { margin-bottom: var(--section); }

.stills { display: grid; gap: var(--space-7); }

/* A figure on its own white sheet: shown whole, at a width that keeps its text readable. */
.plate__sheet {
  background: #fff;
  border: 1px solid var(--rule-strong);
  padding: clamp(var(--space-3), 2vw, var(--space-5));
  overflow-x: auto;
}

.plate__sheet:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.plate__sheet picture { display: contents; }

.plate__sheet img {
  display: block;
  width: 100%;
  min-width: 46rem;
  height: auto;
}

.plate__caption {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.plate__caption .caption { margin-top: 0; }

.plate__files {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
}

.plate__hint {
  flex-basis: 100%;
  color: var(--graphite);
}

@media (min-width: 52rem) {
  .plate__hint { display: none; }
}

.next-link {
  padding-block: var(--space-6) var(--space-7);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
}

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

.quote-form { max-width: 40rem; }

.quote-intro {
  max-width: 48ch;
  margin-bottom: var(--space-7);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.step {
  counter-increment: step;
  position: relative;
  padding-inline-start: 2.75rem;
  padding-bottom: var(--space-7);
}

.step:last-child { padding-bottom: 0; }

.step::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 0.15rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--step--1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-start: calc(0.875rem - 0.75px);
  top: 2.1rem;
  bottom: 0.4rem;
  border-inline-start: 1.5px solid var(--rule-strong);
}

.step > fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.step__legend {
  padding: 0;
  margin-bottom: var(--space-5);
  font-size: var(--step-1);
  font-weight: 560;
  line-height: 1.3;
}

.field {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.field > label:not(.choice),
.field > legend {
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
  font-weight: 600;
  padding: 0;
}

.field--choices {
  border: 0;
  padding: 0;
  margin-inline: 0;
  min-width: 0;
}

.field--choices > legend { margin-bottom: var(--space-2); }

.field__optional { font-weight: 400; color: var(--graphite); }

.field__hint {
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--step--1);
  line-height: 1.45;
  color: var(--graphite);
  max-width: 60ch;
}

.field input:not([type="radio"]):not([type="checkbox"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--graphite);
  border-radius: 2px;
  background: var(--field-surface);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.4;
}

.field textarea { resize: vertical; min-height: 10rem; }

.field input[type="date"] { max-width: 16rem; }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}

.field-row {
  display: grid;
  gap: 0 var(--space-5);
}

@media (min-width: 30rem) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding-block: var(--space-1);
  font-size: 1.0625rem;
  line-height: 1.45;
  cursor: pointer;
}

.choice input {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.2rem 0 0;
  accent-color: var(--ink);
}

.field--error input:not([type="radio"]):not([type="checkbox"]),
.field--error select,
.field--error textarea {
  border: 2px solid var(--alert);
}

.field__error {
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
  font-weight: 600;
  color: var(--alert);
}

.error-summary {
  margin-bottom: var(--space-7);
  padding: var(--space-4) var(--space-5);
  border: 2px solid var(--alert);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
}

.error-summary__title { font-weight: 650; color: var(--alert); }
.error-summary__title + .error-summary__title { margin-top: var(--space-3); }

/* Honeypot: off screen (not display:none, which some bots skip). */
.hp {
  position: absolute;
  inset-inline-start: -10000px; /* off the start side: unscrollable in either direction */
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.quote-form button[disabled] { opacity: 0.6; cursor: progress; }

.quote-sent {
  max-width: var(--measure);
  padding-bottom: var(--section);
}

.quote-sent__title {
  font-size: var(--step-3);
  font-weight: 520;
}

.quote-sent__title:focus { outline: none; }

.quote-sent .lead { margin-top: var(--space-4); }
.quote-sent__link { margin-top: var(--space-5); }
.error-summary ul { margin-top: var(--space-2); padding-inline-start: 1.25rem; }

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

.site-footer {
  border-top: 1px solid var(--rule-strong);
  padding-block: var(--space-7) var(--space-6);
  font-family: var(--font-sans);
  font-stretch: var(--sans-width);
  font-size: var(--label);
  line-height: 1.5;
  color: var(--graphite);
}

.site-footer__inner {
  display: grid;
  gap: var(--space-5) var(--space-6);
}

.site-footer__name {
  font-weight: 650;
  color: var(--ink);
}

.site-footer__motto { margin-top: var(--space-2); font-style: italic; font-family: var(--font-serif); }

.site-footer__independence {
  color: var(--ink);
  max-width: 44ch;
}

.site-footer__links ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
}

.site-footer a { color: var(--ink); }

@media (min-width: 60rem) {
  .site-footer__inner { grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 4fr); }
}

/* --------------------------------------------------------------- 404 page */

.page-head--404 { padding-bottom: var(--section); }

/* --------------------------------------------------------- motion & print */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-nav, .lang-switch, .cta-band, .skip-link { display: none; }
  .viewport { box-shadow: none; }
}
