/* Annotated: a working sheet that annotates itself.
   Drafting paper, ink, one red for markers and their leader lines, one quiet tint. */

@font-face {
  font-family: "Young Serif";
  src: url("fonts/YoungSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Crimson Pro";
  src: url("fonts/CrimsonPro-Italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  /* drafting paper: a cool white with a pale blue grid. The coffee ring is the only warm thing on it. */
  --paper: #eef1ef;
  --sheet: #fbfcfb;
  --ink: #191b1c;
  --soft: #3d4345;
  --pen: #2a4dc4;     /* blue pen: markers, leaders, the name label. 6.2:1 on the paper, white on it 6.9:1 */
  --tint: #cfdbde;
  --shade: #d6dcdc;
  --pencil: #656c6e;
  --coffee: #a8936c;
  --rule: rgba(25, 27, 28, 0.24);
  --grid: rgba(54, 98, 128, 0.075);
  --grid-major: rgba(54, 98, 128, 0.11);
  --on-pen: #fff;                          /* text on a marker */
  --label: #2a4dc4;                        /* the name label: his royal blue, the same by day and by night */
  --shadow: var(--shadow); --shadow-strong: rgba(25, 27, 28, 0.2);
  --btn-hover: #34393b; --tint-hover: #b8ccd2;
  --pen-wash: rgba(42, 77, 196, 0.06); --scrim: rgba(25, 27, 28, 0.36);

  --serif: "Young Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --hand: "Crimson Pro", "Iowan Old Style", Georgia, serif;

  --margin: 208px;
  --gap: 48px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);            /* entering, feedback */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);   /* moving on screen */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);    /* the sheet sliding up */
}

/* Night: the sheet becomes a blueprint. Deep navy paper, pale lines, the pen brightened so it still reads.
   Follows the system; the title block's switch (data-theme on <html>) overrides it either way. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1626; --sheet: #16213a; --ink: #e9edf3; --soft: #b8c2d0;
    --pen: #8fa8ff; --on-pen: #0e1626; --tint: #2a3d63; --shade: #070c16; --pencil: #8b98ad; --coffee: #b79f73;
    --rule: rgba(233, 237, 243, 0.22); --grid: rgba(143, 168, 255, 0.055); --grid-major: rgba(143, 168, 255, 0.10);
    --shadow: rgba(0, 0, 0, 0.5); --shadow-strong: rgba(0, 0, 0, 0.6); --btn-hover: #ffffff; --tint-hover: #38527f;
    --pen-wash: rgba(143, 168, 255, 0.10); --scrim: rgba(3, 6, 12, 0.6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --paper: #0e1626; --sheet: #16213a; --ink: #e9edf3; --soft: #b8c2d0;
    --pen: #8fa8ff; --on-pen: #0e1626; --tint: #2a3d63; --shade: #070c16; --pencil: #8b98ad; --coffee: #b79f73;
    --rule: rgba(233, 237, 243, 0.22); --grid: rgba(143, 168, 255, 0.055); --grid-major: rgba(143, 168, 255, 0.10);
    --shadow: rgba(0, 0, 0, 0.5); --shadow-strong: rgba(0, 0, 0, 0.6); --btn-hover: #ffffff; --tint-hover: #38527f;
    --pen-wash: rgba(143, 168, 255, 0.10); --scrim: rgba(3, 6, 12, 0.6); color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
html:has(.lab-dialog[open]) { overflow: hidden; }

body, .gridded {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: 50% -1px;
}
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }

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

.defs { position: absolute; }
[hidden] { display: none !important; }

.wrap {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4.4vw, 44px);
}

.skip {
  position: absolute; left: 12px; top: -60px;
  background: var(--ink); color: var(--paper);
  padding: 8px 14px; z-index: 10; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- drawing vocabulary ---------- */

svg { display: block; overflow: visible; }

.ink, .pencil {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ink { stroke: var(--ink); stroke-width: 1.6px; }
.pencil { stroke: var(--pencil); stroke-width: 1.2px; }
.ink *, .pencil * { vector-effect: non-scaling-stroke; }
.ink .heavy { stroke-width: 2.2px; }
.ink .thin { stroke-width: 1px; }
.ink .paper, .ink.paper { fill: var(--sheet); }
.ink .tint { fill: var(--tint); }
.ink .solid { fill: var(--ink); }
.shade { fill: var(--shade); }
.paper-fill { fill: var(--sheet); }
.ink .track { stroke: var(--rule); stroke-width: 4px; }
.ink .track-on { stroke-width: 4px; }
.dot { fill: var(--pen); }
.dot-line { fill: none; stroke: var(--pen); stroke-width: 1.1; stroke-linecap: round; }

.ring { fill: none; stroke: var(--coffee); color: var(--coffee); transform-box: fill-box; transform-origin: center; }

.t-serif { font-family: var(--serif); fill: var(--ink); }
.t-sans { font-family: var(--sans); fill: var(--ink); }
.t-soft { fill: var(--soft); }
.t-inv { fill: var(--sheet); }
.t-note { font-family: var(--hand); font-style: italic; fill: var(--soft); }
.t-pencil { fill: var(--pencil); }
.t-dot { font: 700 14px var(--sans); fill: var(--on-pen); text-anchor: middle; dominant-baseline: central; }

/* ---------- the marker ---------- */

.mk {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--pen); color: var(--on-pen);
  font: 700 0.75rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
button.mk {
  position: relative;
  appearance: none; border: 0; padding: 0; cursor: pointer;
  transition: transform 140ms var(--ease);
}
button.mk::before { content: ""; position: absolute; inset: -11px; border-radius: 50%; } /* 44 px target */
button.mk:active { transform: scale(0.88); }
button.mk:focus-visible { outline-offset: 2px; border-radius: 50%; }

svg .mk circle { fill: var(--pen); }
svg .mk text {
  fill: var(--on-pen); font: 700 12.5px var(--sans);
  text-anchor: middle; dominant-baseline: central;
}
svg .mk {
  cursor: pointer; transform-box: fill-box; transform-origin: center;
  transition: transform 180ms var(--ease), opacity 160ms var(--ease);
}
svg .mk:focus { outline: none; }
svg .mk:focus-visible circle { stroke: var(--ink); stroke-width: 2.5px; }
svg .mk:active { transform: scale(0.9); }

.leader { height: 1px; background: var(--pen); transform-origin: 0 50%; }

.note {
  position: relative;
  display: block;
  font-family: var(--hand);
  font-style: italic;
  font-size: 1.1875rem;
  line-height: 1.3;
  color: var(--soft);
}
/* a plain aside: no number, no leader. Markers are for figures. */
.aside {
  display: block;
  font-family: var(--hand); font-style: italic;
  font-size: 1.125rem; line-height: 1.3;
  color: var(--soft);
}
.note-n {
  font-family: var(--sans); font-style: normal; font-weight: 700;
  font-size: 0.8125rem; color: var(--pen);
  margin-right: 0.45em;
  font-variant-numeric: tabular-nums;
}
.note-n::after { content: "."; }
/* the pencil underline a note gets when its marker is pointed at */
.note::after {
  content: ""; position: absolute; left: 0; bottom: -5px;
  width: min(100%, 6.4em); height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='6' preserveAspectRatio='none' viewBox='0 0 120 6'%3E%3Cpath d='M1 3.6C16 1.6 30 4.8 46 3 62 1.4 78 4.6 96 2.8c9-.8 16 .2 23 1' fill='none' stroke='%236f7678' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 140ms var(--ease);
}

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

.top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px 24px; flex-wrap: wrap;
  padding-block: 22px 18px;
}
.name {
  font-family: var(--serif); font-size: 1.1875rem; line-height: 1; text-decoration: none;
  display: inline-block; padding: 7px 10px 6px; border-radius: 2px;
  background: var(--label); color: #fff;
  transform: rotate(-1.2deg);
  transition: transform 180ms var(--ease);
}
.top ul { display: flex; gap: clamp(14px, 2.6vw, 34px); }
.top nav a { font-size: 0.9375rem; text-decoration: none; padding-block: 6px; }
.top nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
@media (hover: hover) and (pointer: fine) { .name:hover { transform: rotate(0deg); } }

/* ---------- view as agent ----------
   The switch flips the page to sheet 2: AGENTS.md as an agent reads it, raw Markdown in a monospace face,
   on plain paper. One motion each way: the drawn page lets go (140 ms), the text streams in once. */
:root { --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; }
.top nav { margin-left: auto; }
.agent-toggle {
  order: 3; display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 2px 0 4px;
  font: 500 0.8125rem/1 var(--mono); color: var(--soft); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.agent-toggle:hover { color: var(--ink); }
.at-track {
  position: relative; width: 28px; height: 16px; border-radius: 8px;
  border: 1.5px solid currentColor; transition: background-color 180ms ease, border-color 180ms ease;
}
.at-knob {
  position: absolute; top: 2px; left: 2px; width: 9px; height: 9px; border-radius: 50%;
  background: currentColor; transition: transform 220ms var(--ease), background-color 180ms ease;
}
.agent-toggle[aria-checked="true"] { color: var(--pen); }
.agent-toggle[aria-checked="true"] .at-track { background: var(--pen); border-color: var(--pen); }
.agent-toggle[aria-checked="true"] .at-knob { transform: translateX(12px); background: var(--on-pen); }
.agent-toggle:active .at-knob { transform: scale(0.85); }
.agent-toggle[aria-checked="true"]:active .at-knob { transform: translateX(12px) scale(0.85); }

.agent-sheet { display: none; }
.agent-mode body { background-image: none; background-color: var(--sheet); }
.agent-mode main, .agent-mode .foot, .agent-mode .margin-rail, .agent-mode .m-leader, .agent-mode .note-slip { display: none !important; }
.agent-mode .agent-sheet { display: block; }
.agent-mode .top nav { visibility: hidden; }
.agent-sheet { padding-block: 18px 72px; }
.agent-sheet .as-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px;
  padding-bottom: 10px; margin-bottom: 22px; border-bottom: 1px solid var(--rule);
  font: 0.8125rem/1.4 var(--mono); color: var(--soft);
}
.agent-sheet .as-bar a { color: inherit; }
.agent-sheet pre {
  margin: 0; max-width: 78ch;
  font: 0.9375rem/1.6 var(--mono); color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
}
.agent-sheet pre .md-h { color: var(--pen); font-weight: 700; }
.agent-sheet pre .md-m { color: var(--pencil); }
.agent-sheet .as-caret { display: inline-block; width: 0.6em; height: 1.1em; vertical-align: -0.2em; background: var(--pen); animation: as-blink 1s steps(1) infinite; }
@keyframes as-blink { 50% { opacity: 0; } }
@media (max-width: 699px) {
  .agent-toggle { order: 0; margin-left: auto; }
  .top nav { margin-left: 0; flex-basis: 100%; }
  .agent-mode .top nav { display: none; }
  .agent-sheet pre { font-size: 0.875rem; }
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  padding-block: clamp(20px, 3vw, 44px) 8px;
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 1.02rem + 3vw, 3.5rem);
  line-height: 1.07;
  letter-spacing: -0.012em;
  text-wrap: balance;
  max-width: 13.5em;
}
.lead {
  margin-top: 1.3rem;
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  line-height: 1.5;
  max-width: 34rem;
  text-wrap: pretty;
}
.actions {
  margin-top: 1.9rem;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px 26px;
}
.btn {
  display: inline-flex; align-items: center;
  min-height: 48px; padding: 0 24px;
  background: var(--ink); color: var(--paper);
  border-radius: 4px;
  font-weight: 600; font-size: 1.0625rem;
  text-decoration: none;
  transition: background-color 160ms ease, transform 140ms var(--ease);
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(0.97); }
.more { font-weight: 600; padding-block: 10px; display: inline-block; transition: transform 140ms var(--ease); }
.more:active { transform: scale(0.97); }
.actions .aside { flex-basis: 100%; margin-top: -2px; }
/* the credentials belong to the lead: body colour, one step down */
.creds {
  margin-top: 0.7rem;
  font-size: clamp(1rem, 0.94rem + 0.25vw, 1.0625rem); line-height: 1.5;
  max-width: 34rem; text-wrap: pretty;
}

.hero-art svg { width: 100%; height: auto; }
.fig-compact { display: none; }
.hero-art figcaption { margin-top: 6px; }
.fig-cap {
  display: block; text-align: right;
  font-family: var(--hand); font-style: italic; font-size: 1.125rem; color: var(--soft);
}

.hl { fill: var(--tint); opacity: 0; pointer-events: all; cursor: pointer; transition: opacity 160ms ease; }
.hl.is-on { opacity: 0.85; }
.ld {
  fill: none; stroke: var(--pen); stroke-width: 1.3; stroke-linecap: round;
  transition: stroke-width 160ms ease, opacity 160ms ease;
}
.ld.is-on { stroke-width: 2.4; }
svg .mk.is-on { transform: scale(1.22); }
svg .mk.is-on:active { transform: scale(1.1); }
.has-on .ld:not(.is-on), .has-on svg .mk:not(.is-on) { opacity: 0.3; }
.ul { fill: none; stroke: var(--pencil); stroke-width: 1.5; stroke-linecap: round; opacity: 0; transition: opacity 120ms ease; }
.ul.is-on { opacity: 1; }

/* The opening sequence is started by main.js. Until it takes over, the parts it will draw are held back.
   Without JS, or with reduced motion, the class is never set and the drawing is simply there. */
.pre .hero-art .pop,
.pre .hero-art .ld { opacity: 0; }

/* ---------- sections ---------- */

.sec { padding-top: clamp(52px, 5.6vw, 76px); scroll-margin-top: 8px; }
.main {
  border-top: 1.5px solid var(--ink);
  padding-top: 22px;
}
/* only the blocks that have a note beside them keep the margin free */
.mgn { margin-right: calc(var(--margin) + var(--gap)); }

h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.6rem, 1.25rem + 1.1vw, 2.125rem);
  line-height: 1.12; letter-spacing: -0.008em;
  text-wrap: balance;
}
h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; }


/* one quiet arrival per section; main.js adds .seen */
.rv .sec [data-rv] {
  transition: opacity 600ms var(--ease), transform 700ms var(--ease);
  transition-delay: calc(var(--d, 0) * 1ms);
}
.rv .sec:not(.seen) [data-rv] { opacity: 0; transform: translateY(14px); }
.rv .sec:not(.seen) [data-rv="lead"] { transform: translateY(22px); }

/* a figure's note writes in when its marker scrolls into view; main.js adds .in */
.rv .anno-g button.mk { transition: transform 180ms var(--ease), opacity 140ms linear; }
.rv .anno-g .note { transition: opacity 200ms linear 160ms, clip-path 420ms var(--ease) 160ms; clip-path: inset(-4px -4px -10px 0); }

.rv .anno-g:not(.in) .note { opacity: 0; clip-path: inset(-4px 100% -10px 0); }

/* the signature moment: point at a marker and its note gets a pencil underline */
.anno-g:has(.mk:focus-visible) .note::after { clip-path: inset(0); transition: clip-path 260ms var(--ease) 60ms; }
@media (hover: hover) and (pointer: fine) {
  .anno-g:has(.mk:hover) .note::after { clip-path: inset(0); transition: clip-path 260ms var(--ease) 60ms; }
  button.mk:hover { transform: scale(1.14); }
  button.mk:active { transform: scale(0.88); }
}

/* a marker placed on a drawing: --x and --y are its centre, in percent of the drawing */
.spot-fig { position: relative; display: block; }
.spot-fig > .mk { position: absolute; left: var(--x); top: var(--y); margin: -11px 0 0 -11px; box-shadow: 0 0 0 2px var(--sheet); }

/* ---------- what I do ---------- */

.ways {
  margin-top: 26px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(6, auto);
}
.way {
  display: grid; grid-row: span 6; grid-template-rows: subgrid;
  padding: 4px 32px 0 32px; border-left: 1px solid var(--rule);
}
.way:first-child { padding-left: 0; border-left: 0; }
.way:last-child { padding-right: 0; }
.spot-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; max-width: 340px; }
.spot { width: 100%; height: auto; }
.spot-row .note { font-size: 1.125rem; }
.way h3 { font-size: 1.5rem; }
.dur { margin-top: 8px; font-weight: 600; font-size: 0.9375rem; }
.way > p:not(.dur) { margin-top: 12px; font-size: 1rem; text-wrap: pretty; max-width: 38rem; }
.way .end { color: var(--soft); font-size: 1rem; padding-top: 12px; border-top: 1px dashed var(--rule); }
.end b { color: var(--ink); font-weight: 600; }
/* each offer ends with something to tap: a mail that already names the offer */
.way > p.ask { margin-top: 4px; }
/* inline, so a label that wraps keeps its arrow after the last word */
.way > p.ask { padding-block: 10px; }
.ask a {
  display: inline; padding-block: 10px;
  font-weight: 600; font-size: 1rem; color: var(--ink);
  text-decoration-color: var(--rule);
  transition: text-decoration-color 160ms ease, transform 140ms var(--ease);
}
.ask a:hover { text-decoration-color: var(--ink); text-decoration-thickness: 1px; }
.ask a:active { transform: scale(0.97); }
.ask svg, .lab-open svg { width: 26px; height: 12px; flex: none; transition: transform 180ms var(--ease); }
.ask svg { display: inline-block; vertical-align: -0.05em; margin-left: 8px; }
.ask .ink, .lab-open .ink { stroke-width: 1.7px; }
.ask a:focus-visible svg { transform: translateX(5px); }
@media (hover: hover) and (pointer: fine) {
  .ask a:hover svg { transform: translateX(5px); }
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Hovering an offer or a client: its drawing lifts a hair and its pale fills deepen. A state, not a one-off:
   it holds while the pointer is there and settles back when it leaves. Mouse only. */
.spot, .motif { transition: transform 260ms var(--ease); }
.spot .tint, .motif .tint { transition: fill 220ms ease; }
@media (hover: hover) and (pointer: fine) {
  .way:hover .spot, .work > li:hover .motif { transform: translateY(-2px) rotate(-0.5deg); }
  .way:hover .spot .ink .tint, .work > li:hover .motif .ink .tint { fill: var(--tint-hover); }
}

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

.work {
  margin-top: 24px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px 30px;
}
.work li { position: relative; }
.motif { width: 140px; height: 90px; margin-bottom: 14px; }
.work h3 { font-size: 1.3125rem; display: inline; }
.sector {
  display: inline; margin-left: 0.4em;
  font-family: var(--hand); font-style: italic; font-size: 1.1875rem; color: var(--soft);
}
.work li > p:not(.sector) { margin-top: 6px; font-size: 1rem; line-height: 1.5; color: var(--soft); text-wrap: pretty; }
.work .tile-mark { position: absolute; top: 2px; left: 112px; box-shadow: 0 0 0 2px var(--paper); }
.work .note { margin-top: 8px; font-size: 1.125rem; }
.also { margin-top: 26px; font-size: 1rem; color: var(--soft); text-wrap: pretty; }

/* ---------- labs: numbered figures on the sheet ---------- */

.labs-intro { margin-top: 12px; max-width: 40rem; font-size: 1.125rem; text-wrap: pretty; }
.labs {
  margin-top: 30px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px 30px;
}
.labs > li { display: flex; }
.lab {
  display: block; text-decoration: none; border-radius: 3px;
  position: relative; width: 100%; padding-bottom: 44px;   /* "Open" sits on one line across the row */
  -webkit-tap-highlight-color: transparent;
}
.lab:focus-visible { outline-offset: 6px; }
.lab-fig-wrap { position: relative; display: block; margin-bottom: 14px; }
.lab-fig-wrap::before {
  content: ""; position: absolute; inset: 5% -1.5% -3.5% 3%;
  background: var(--shade); transform: rotate(var(--r, 0deg));
}
.lab-still {
  position: relative; width: 100%; height: auto;
  transform: rotate(var(--r, 0deg));
  transition: transform 180ms var(--ease);
}
.labs li:nth-child(1) { --r: -0.9deg; }
.labs li:nth-child(2) { --r: 0.7deg; }
.labs li:nth-child(3) { --r: -0.4deg; }
.labs li:nth-child(4) { --r: 1.1deg; }
.lab:active .lab-still { transform: rotate(var(--r, 0deg)) scale(0.985); }
@media (hover: hover) and (pointer: fine) {
  .lab:hover .lab-still { transform: translate(-2px, -4px) rotate(0deg); }
  .lab:hover:active .lab-still { transform: translate(0, -1px) rotate(0deg) scale(0.99); }
  .lab:hover .lab-name { text-decoration-color: var(--ink); }
}
.lab-figno {
  display: block;
  font-family: var(--hand); font-style: italic; font-size: 1.125rem; color: var(--soft); line-height: 1.3;
}
.lab-title { display: block; }
.lab h3 { display: inline; font-size: 1.25rem; }
.lab-name { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--rule); text-underline-offset: 0.2em; transition: text-decoration-color 160ms ease; }
.lab-kind {
  margin-left: 0.4em;
  font-family: var(--hand); font-style: italic; font-size: 1.1875rem; color: var(--soft);
}
.lab-line { display: block; margin-top: 6px; font-size: 1rem; line-height: 1.5; color: var(--soft); text-wrap: pretty; }
/* every figure says that it opens */
.lab-open {
  position: absolute; left: 0; bottom: 0;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 28px;
  font-weight: 600; font-size: 1rem; color: var(--ink);
}
.lab:active .lab-open svg { transform: translateX(2px); }
@media (hover: hover) and (pointer: fine) {
  .lab:hover .lab-open svg { transform: translateX(5px); }
}
.lab:focus-visible .lab-open svg { transform: translateX(5px); }

/* the lab opens as a sheet of paper sliding up over the desk */
.lab-dialog {
  position: fixed; inset: 0; margin: auto;
  width: min(980px, calc(100vw - 32px));
  height: min(var(--lab-h, 760px), calc(100dvh - 40px));
  max-width: none; max-height: none;
  padding: 0; border: 0; background: transparent; color: var(--ink);
  overflow: visible;
  opacity: 0; transform: translateY(44px) scale(0.93);
  transition: transform 170ms var(--ease), opacity 130ms linear;   /* leaving: quicker */
}
.lab-dialog.is-open {
  opacity: 1; transform: none;
  transition: transform 290ms var(--ease-drawer), opacity 150ms linear;
}
.lab-dialog::backdrop { background: var(--scrim); opacity: 0; transition: opacity 170ms linear; }
.lab-dialog.is-open::backdrop { opacity: 1; transition: opacity 240ms linear; }
.lab-dialog:focus { outline: none; }
.lab-paper {
  position: relative; height: 100%;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  box-shadow: 7px 9px 0 var(--shadow-strong);
}
.lab-paper::before {   /* the sheet underneath */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--sheet); border: 1.5px solid var(--ink);
  transform: rotate(0.9deg);
}
.lab-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 8px 8px 20px;
  border-bottom: 1px solid var(--rule);
}
.lab-bar-fig { font-family: var(--hand); font-style: italic; font-size: 1.125rem; color: var(--soft); }
.lab-bar-tools { display: flex; align-items: center; gap: 14px; }
.lab-bar a { font-size: 0.875rem; color: var(--soft); }
.lab-close {
  appearance: none; border: 0; background: transparent; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 12px; border-radius: 4px;
  font: 600 0.9375rem/1 var(--sans);
  transition: background-color 160ms ease, transform 140ms var(--ease);
}
.lab-close svg { width: 14px; height: 14px; }
.lab-close:hover { background: var(--tint); }
.lab-close:active { transform: scale(0.96); }
.lab-hold { min-height: 0; }
.lab-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--sheet); }

/* ---------- about ---------- */

.about {
  margin-top: 22px;
  /* the roles get the room: each one on a line or two at desktop */
  display: grid; grid-template-columns: minmax(0, 33rem) minmax(22rem, 1fr) 168px;
  gap: 44px; align-items: start;
}
.about-text > p { font-size: 1.125rem; line-height: 1.55; text-wrap: pretty; }
.about-text > p + p { margin-top: 1em; }
.roles { margin-top: 4px; font-size: 1rem; }
.roles div { display: grid; grid-template-columns: 6.8em 1fr; gap: 14px; padding-block: 8px; border-top: 1px solid var(--rule); }
.roles dt { white-space: nowrap; }
.roles div:last-child { border-bottom: 1px solid var(--rule); }
.roles dt { color: var(--soft); font-variant-numeric: tabular-nums; }
/* the portrait is a placeholder, so it stays small and comes last */
.portrait { position: relative; margin-top: 2px; }
.portrait svg { width: 100%; height: auto; }
.portrait .note { margin-top: 10px; font-size: 1.0625rem; }
/* Fig. 6: the pencil drawing on top, the photo under it. Pointing at it puts a loupe on the drawing that
   shows the photo underneath, magnified a little, and follows the pointer with a short lag.
   Click (or tap) opens both photos on a sheet, the way the labs open. */
.ph-open { display: block; color: inherit; text-decoration: none; border-radius: 2px; -webkit-tap-highlight-color: transparent; }
.ph-open:focus-visible { outline-offset: 6px; }
.ph-frame {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 4 / 5; background: var(--sheet);
  outline: 1.5px solid var(--ink); outline-offset: -1px;
  box-shadow: 5px 6px 0 var(--shadow);
  transform: rotate(1.2deg);
  transition: transform 220ms var(--ease);
  cursor: zoom-in;
}
.ph-photo, .ph-sketch, .ph-sketch-cv { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.ph-sketch-cv { pointer-events: none; }
.ph-frame.can-erase .ph-sketch { visibility: hidden; }   /* the canvas copy takes over */
/* the head poses: one on show, the one it replaces held underneath until the new one has faded in */
.ph-poses, .ph-pose { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.ph-pose { object-fit: cover; opacity: 0; transition: opacity 140ms linear; }
.ph-pose.is-on { opacity: 1; z-index: 2; }
.ph-pose.was { opacity: 1; z-index: 1; transition: none; }
.ph-frame.has-poses .ph-sketch, .ph-frame.can-erase .ph-poses { visibility: hidden; }
/* the pointer is an eraser while it is over the sketch */
@media (hover: hover) and (pointer: fine) {
  .ph-frame.can-erase, .ph-frame:hover {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cg transform='rotate(-35 17 17)'%3E%3Crect x='9' y='6' width='14' height='24' rx='2.5' fill='%23fbfcfb' stroke='%23191b1c' stroke-width='1.6'/%3E%3Crect x='9' y='6' width='14' height='9' rx='2.5' fill='%23e9a7a0' stroke='%23191b1c' stroke-width='1.6'/%3E%3C/g%3E%3C/svg%3E") 8 26, zoom-in;
  }
}
.ph-open:active .ph-frame { transform: rotate(1.2deg) scale(0.985); }
@media (hover: hover) and (pointer: fine) {
  .ph-open:hover .ph-frame { transform: rotate(0deg); }
}
.ph-figno { display: block; margin-top: 10px; font-family: var(--hand); font-style: italic; font-size: 1.0625rem; color: var(--soft); }

/* the photos, on a sheet */
.photo-dialog { --lab-h: 690px; }
.ph-sheet { overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px 26px; }
.ph-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ph-pair figure { margin: 0; }
.ph-pair img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; outline: 1.5px solid var(--ink); outline-offset: -1px; background: var(--paper); }
.ph-pair figure:nth-child(1) img { transform: rotate(-0.6deg); }
.ph-pair figure:nth-child(2) img { transform: rotate(0.5deg); }
.ph-pair figcaption { margin-top: 10px; font-family: var(--hand); font-style: italic; font-size: 1.125rem; color: var(--soft); }
@media (max-width: 699px) {
  .ph-pair { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .ph-sheet { padding: 16px 16px 22px; }
}

/* ---------- contact ---------- */

#contact h2 { font-size: clamp(1.9rem, 1.2rem + 2.2vw, 2.9rem); }
.contact-line { margin-top: 14px; max-width: 36rem; font-size: 1.125rem; text-wrap: pretty; }
.email-row { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.email-row .aside { flex-basis: 100%; }
.email {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 0.9rem + 2.5vw, 2.6rem);
  line-height: 1.15;
  text-decoration-thickness: 1.5px; text-underline-offset: 0.16em;
}
.email:hover { text-decoration-thickness: 3px; }
.copy {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px 0 11px;
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 4px;
  font: 600 0.9375rem/1 var(--sans);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 140ms var(--ease);
}
.copy svg { width: 18px; height: 18px; }
.copy .ink { stroke: currentColor; stroke-width: 1.5px; }
.copy:hover, .copy.is-done { background: var(--ink); color: var(--paper); }
.copy:active { transform: scale(0.97); }
.copy-label { min-width: 2.9em; text-align: left; }
.sr-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.details {
  margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 6px 36px;
  font-size: 1rem;
}

/* the title block every drawing sheet ends with */
.foot { padding-block: 56px 36px; }
.title-block {
  /* a drawn table: the 1 px gaps and the 1 px padding show the rule colour, so every cell has a stroke on
     all four sides and rows line up however the block wraps */
  display: grid; gap: 1px; padding: 1px;
  grid-template-columns: minmax(0, 1fr); grid-auto-flow: column; grid-auto-columns: max-content;
  background: var(--rule);
  font-size: 0.9375rem; color: var(--soft);
}
.title-block p { padding: 9px 14px; background: var(--paper); min-width: 0; }
.title-block p:first-child { color: var(--ink); }
.title-block p:has(> [hidden]) { display: none; }
@media (max-width: 899px) {
  /* three columns: the name across the top, then two full rows */
  .title-block { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row; font-size: 0.875rem; }
  .title-block p { padding: 9px 12px; }
  .title-block p:first-child { grid-column: 1 / -1; }
  .title-block p:nth-child(5) { grid-column: span 2; }
  .title-block:has([data-theme-toggle][hidden]) p:nth-child(5) { grid-column: 1 / -1; }
}

/* ---------- the margin: every note in one floating column ----------
   Without JS the notes stay in the content, under their drawings. With JS (.has-margin) they move out:
   on a wide screen into a panel in the sheet's right margin, which arrives once the hero has gone;
   on a narrow one into a slip at the bottom edge that shows the note of the marker in view.
   Both are copies for the eye; screen readers get each note from its marker's aria-describedby. */

.has-margin .note[data-n] { display: none; }

button.mk.mk-inline { width: 20px; height: 20px; font-size: 0.6875rem; vertical-align: 0.12em; margin-left: 2px; }
button.mk.is-lit { transform: scale(1.18); }

.margin-rail { position: fixed; inset: 0 0 auto; z-index: 6; pointer-events: none; }
.margin-rail .wrap { display: flex; justify-content: flex-end; }
.margin {
  width: var(--margin);
  margin-top: max(28px, env(safe-area-inset-top, 0px));
  max-height: calc(100dvh - 56px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 14px 16px 16px;
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  box-shadow: 5px 6px 0 var(--shadow);
  /* resting state is away: a short step out to the right */
  opacity: 0; transform: translateX(14px); visibility: hidden;
  transition: opacity 160ms linear, transform 180ms var(--ease), visibility 0s linear 180ms;
}
.margin.is-shown {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: opacity 200ms linear, transform 340ms var(--ease), visibility 0s;
}
.m-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--ink);
  font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.m-head span + span { font-family: var(--hand); font-style: italic; font-weight: 400; font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--soft); }
.m-group { padding-top: 10px; transition: opacity 220ms linear; }
.m-group + .m-group { margin-top: 2px; border-top: 1px dashed var(--rule); }
.m-group:not(.is-cur) { opacity: 0.46; }
.m-label { font-size: 0.8125rem; font-weight: 600; color: var(--soft); margin-bottom: 2px; }
.m-row {
  position: relative;
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 9px; align-items: start;
  padding: 5px 0 7px; cursor: pointer;
  font-family: var(--hand); font-style: italic; font-size: 1.0625rem; line-height: 1.28; color: var(--soft);
  transition: color 160ms ease;
}
.m-row.m-fig { grid-template-columns: minmax(0, 1fr); font-size: 1rem; }
.m-n {
  width: 20px; height: 20px; border-radius: 50%; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 0.6875rem/1 var(--sans); font-style: normal; font-variant-numeric: tabular-nums;
  color: var(--pen); box-shadow: inset 0 0 0 1.5px var(--pen);
  transition: background-color 160ms ease, color 160ms ease, transform 180ms var(--ease);
}
.m-t { position: relative; }
/* the pencil underline, drawn when the note is the one in play */
.m-t::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: min(100%, 6.4em); height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='6' preserveAspectRatio='none' viewBox='0 0 120 6'%3E%3Cpath d='M1 3.6C16 1.6 30 4.8 46 3 62 1.4 78 4.6 96 2.8c9-.8 16 .2 23 1' fill='none' stroke='%236f7678' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 120ms var(--ease);
}
.m-row.is-on { color: var(--ink); }
.m-row.is-on .m-n { background: var(--pen); color: var(--on-pen); }
.m-row.is-on .m-t::after { clip-path: inset(0); transition: clip-path 300ms var(--ease) 60ms; }
.m-row.is-lit .m-n { transform: scale(1.14); }
@media (hover: hover) and (pointer: fine) {
  .m-row:hover { color: var(--ink); }
}

/* 'all' (default): one quiet list, no section labels or rules; 'section': only the section in view */
.m-all .m-group { padding-top: 2px; }
.m-all .m-group + .m-group { margin-top: 0; border-top: 0; }
.m-all .m-head { margin-bottom: 8px; }
.m-section .m-group:not(.is-cur) { display: none; }
.m-section .m-group + .m-group { margin-top: 0; border-top: 0; }

.m-index { display: inline-flex; gap: 6px; font: 700 0.75rem/1 var(--sans); letter-spacing: 0; color: var(--pen); text-transform: none; }
.m-index span { color: var(--soft); opacity: 0.35; transition: opacity 200ms linear, color 200ms linear; }
.m-index span.is-here { color: var(--pen); opacity: 1; }


/* the leader from a note in the margin to its marker, drawn while either is pointed at */
.m-leader { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; overflow: visible; }
.m-leader path { fill: none; stroke: var(--pen); stroke-width: 1.3; stroke-linecap: round; opacity: 0; transition: opacity 120ms linear; }
.m-leader path.is-on { opacity: 1; transition: none; }
.m-leader circle { fill: var(--pen); opacity: 0; transition: opacity 120ms linear; }
.m-leader circle.is-on { opacity: 1; transition: opacity 120ms linear 200ms; }

/* the slip at the bottom edge, on narrower screens */
.note-slip {
  position: fixed; z-index: 6;
  left: max(16px, env(safe-area-inset-left, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  max-width: min(400px, calc(100vw - 32px));
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 10px 16px 11px 12px;
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  box-shadow: 4px 5px 0 var(--shadow);
  font-family: var(--hand); font-style: italic; font-size: 1.125rem; line-height: 1.28; color: var(--ink);
  pointer-events: none;
  opacity: 0; transform: translateY(10px);
  transition: opacity 140ms linear, transform 160ms var(--ease);
}
.note-slip.is-shown { opacity: 1; transform: none; transition: opacity 180ms linear, transform 300ms var(--ease); }
.note-slip .m-n { width: 22px; height: 22px; background: var(--pen); color: var(--on-pen); box-shadow: none; font-size: 0.75rem; }

/* ---------- narrower ---------- */

@media (max-width: 1099px) {
  .mgn { margin-right: 0; }
  .work { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 40px; }
  .work li { display: grid; grid-template-columns: 128px minmax(0, 1fr); column-gap: 20px; align-content: start; }
  .work li > * { grid-column: 2; }
  .work .motif { grid-column: 1; grid-row: 1 / span 2; width: 128px; height: 82px; margin: 2px 0 0; }
  .work li > p:not(.sector), .work .note { grid-column: 1 / -1; margin-top: 10px; }
  .work h3 { align-self: end; }
  .work .tile-mark { grid-area: 1 / 1; left: 112px; top: -6px; }
  .work h3 { display: block; }
  .sector { display: block; margin-left: 0; }
  .about { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 48px; }
  .about-text { grid-column: 1 / -1; max-width: 38rem; }
  .portrait { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 20px; align-items: end; margin-top: 0; }
  .portrait .note { margin: 0 0 6px; }
  .labs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 30px; }
  .lab-fig-wrap { max-width: 340px; }
}

@media (max-width: 979px) {
  .ways { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .way, .way:first-child, .way:last-child { display: block; padding: 24px 0 26px; border-left: 0; border-top: 1px solid var(--rule); }
  .way:first-child { border-top: 0; padding-top: 0; }
  .way:last-child { padding-bottom: 0; }
  .way > p:not(.dur) { max-width: 36rem; }
  .spot-row { margin-bottom: 14px; }
}

@media (max-width: 959px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hero-art { max-width: 560px; width: 100%; }
}

@media (max-width: 699px) {
  /* on a phone the grid stays out from under the text: it is kept behind the figures */
  body { background-image: none; }
  .hero-art, .spot-row .spot-fig, .spot-row > .spot { position: relative; }
  .hero-art::before, .spot-row::before {
    content: ""; position: absolute; z-index: -1; pointer-events: none;
    background-color: var(--paper);
    background-image:
      linear-gradient(var(--grid-major) 1px, transparent 1px),
      linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
      linear-gradient(var(--grid) 1px, transparent 1px),
      linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
    -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
            mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
  }
  .hero-art { isolation: isolate; }
  .hero-art::before { inset: -22px -20px -10px; }
  .spot-row { position: relative; isolation: isolate; }
  .spot-row::before { inset: -14px -20px auto; height: calc(100% + 4px); }
  .spot-row:has(.note)::before { height: calc(100% - 1.6em); }

  .top { padding-block: 16px 10px; }
  .top nav a { font-size: 0.875rem; }
  .hero { padding-top: 10px; gap: 22px; }
  .lead { margin-top: 1rem; }
  .actions { margin-top: 1.3rem; gap: 10px 22px; }
  .creds { margin-top: 0.6rem; }
  .fig-full { display: none; }
  .fig-compact { display: block; }
  .hero-art figcaption { position: relative; background: var(--paper); margin-top: 4px; }
  .fig-cap { text-align: left; }

  .sec { padding-top: 30px; }
  .main { padding-top: 18px; }
  .ways { margin-top: 20px; }
  .spot-row { max-width: 304px; }
  .labs-intro { font-size: 1.0625rem; }
  .way, .way:first-child, .way:last-child { padding-block: 16px 10px; }
  .way > p:not(.dur) { margin-top: 10px; }
  .way > p.ask { margin-top: 0; }
  .way .end { padding-top: 10px; }
  .way:first-child { padding-top: 0; }

  /* a compact list: small drawing, name and sector on one line, the line at full measure under them */
  .work { margin-top: 18px; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .work li { grid-template-columns: 62px auto minmax(0, 1fr); column-gap: 12px; align-items: center; }
  .work li > * { grid-column: auto; }
  .work .motif { grid-row: 1; grid-column: 1; width: 62px; height: 40px; margin: 0; }
  .work h3 { grid-column: 2; align-self: center; font-size: 1.25rem; }
  .sector { grid-column: 3; align-self: center; margin-left: 0; padding-top: 2px; }
  .work li > p:not(.sector), .work .note { grid-column: 1 / -1; margin-top: 4px; }
  .work .note { margin-top: 6px; }
  .work .tile-mark { grid-area: 1 / 1; left: 48px; top: -9px; }
  .also { margin-top: 20px; }

  /* labs as rows: name, kind and Open on the first line; the still at 160 px with its figure number under it,
     the line beside it. At 160 px the stills' digits are 17 units, 11.3 px. */
  .labs { margin-top: 16px; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .lab-still .t-dot { font-size: 17px; }
  .lab {
    display: grid; grid-template-columns: 160px minmax(0, 1fr); column-gap: 14px;
    grid-template-rows: auto auto auto; padding-bottom: 0;
  }
  .lab-title { grid-area: 1 / 1 / 2 / 3; justify-self: start; align-self: center; padding-right: 86px; line-height: 1.2; }
  .lab-open { position: static; grid-area: 1 / 1 / 2 / 3; justify-self: end; align-self: center; min-height: 32px; }
  .lab-fig-wrap { grid-area: 2 / 1 / 3 / 2; max-width: none; margin: 6px 0 0; align-self: start; }
  .lab-figno { grid-area: 3 / 1 / 4 / 2; margin-top: 2px; }
  .lab-line { grid-area: 2 / 2 / 4 / 3; margin-top: 6px; align-self: start; }

  .about { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .portrait { grid-template-columns: 128px minmax(0, 1fr); gap: 16px; }
  .roles div { grid-template-columns: 6.6em 1fr; gap: 10px; padding-block: 7px; }
  .roles dt { white-space: nowrap; }
  .details { flex-direction: column; margin-top: 26px; }
  .email-row { margin-top: 22px; }
  .foot { padding-block: 40px 28px; }
  .lab-dialog { width: calc(100vw - 16px); height: min(var(--lab-h, 100dvh), calc(100dvh - 20px)); }
  .lab-bar { padding-left: 14px; }
  .lab-bar a { display: none; }
}

/* wide: the sheet keeps its right margin free for the notes column */
@media (min-width: 1200px) {
  .has-margin .sec .main { padding-right: calc(var(--margin) + 32px); }
  .has-margin .ways .way { padding-inline: 26px; }
  .has-margin .ways .way:first-child { padding-left: 0; }
  .has-margin .ways .way:last-child { padding-right: 0; }
  .has-margin .work, .has-margin .labs { gap: 30px 24px; }
  .has-margin .about { grid-template-columns: minmax(0, 1fr) 288px; column-gap: 56px; }
  .has-margin .about-text, .has-margin .roles { grid-column: 1; }
  .has-margin .portrait { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 1199px) {
  .margin-rail, .m-leader { display: none; }
}
@media (max-width: 1099px) {
  /* the note has moved out, so the photo gets the room it had */
  .has-margin .portrait { grid-template-columns: minmax(0, 280px); }
}
@media (min-width: 1200px) {
  .note-slip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; animation: none !important; }
}

/* the title block's "of 2": sheet 2 is /AGENTS.md, for agents */
.sheet2 { color: inherit; text-decoration-color: var(--rule); }
.sheet2:hover { color: var(--pen); text-decoration-color: currentColor; }

/* ---------- a-person: the person leads ----------
   Fig. 1 is Niels, drawn; the method drawing is Fig. 2 at the top of What I do; the margin column carries
   his face, whose mood follows the section in view. */
.hero-me { width: min(100%, 400px); justify-self: center; align-self: center; }
.hero-me .ph-frame { transform: rotate(-1deg); }
.hero-me figcaption { margin-top: 12px; }
.hero-me .fig-cap { text-align: left; }

.method-fig { max-width: 600px; margin: 22px 0 6px; }
.method-fig figcaption { margin-top: 6px; }
.method-fig .fig-cap { text-align: left; }

.about-photo { margin: 2px 0 0; }
.ph-thumb { display: block; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.ph-thumb img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  outline: 1.5px solid var(--ink); outline-offset: -1px; background: var(--sheet);
  box-shadow: 5px 6px 0 var(--shadow); transform: rotate(1deg);
  transition: transform 220ms var(--ease);
}
@media (hover: hover) and (pointer: fine) { .ph-thumb:hover img { transform: rotate(0deg) translateY(-2px); } }
.ph-thumb:active img { transform: rotate(1deg) scale(0.985); }
.about-photo figcaption { margin-top: 10px; }
@media (min-width: 1200px) {
  .has-margin .about-photo { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 1099px) { .about-photo { max-width: 240px; } }

/* his face in the margin, above the notes */
.m-me { position: relative; margin: -14px -16px 12px; aspect-ratio: 5 / 4; overflow: hidden; border-bottom: 1px solid var(--ink); background: var(--sheet); }
.m-me img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 6%; opacity: 0; transition: opacity 260ms linear; }
.m-me img.is-on { opacity: 1; z-index: 2; }
.m-me img.was { opacity: 1; z-index: 1; transition: none; }
.note-slip .slip-me { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; border: 1.5px solid var(--ink); background: var(--sheet); }
.note-slip.has-me { grid-template-columns: 34px 22px minmax(0, 1fr); align-items: center; width: min(400px, calc(100vw - 32px)); }
.note-slip.has-me:has(.m-n[hidden]) { grid-template-columns: 34px minmax(0, 1fr); }
@media (max-width: 699px) {
  /* on a phone the person comes first: a small drawing above the headline */
  .hero-me { order: -1; width: 46%; max-width: 190px; justify-self: start; margin-bottom: -4px; }
  .hero-me figcaption { display: none; }
}
.m-say { font-family: var(--hand); font-style: italic; font-size: 1.0625rem; line-height: 1.3; color: var(--ink); margin-top: 8px; }
.m-say:empty { display: none; }
.margin.no-notes .m-head { display: none; }
/* the thank-you drawing, over the head poses while the pointer is on Write to me */
.ph-thanks { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; z-index: 3; pointer-events: none; transition: opacity 160ms linear; }
.ph-frame.is-thanking .ph-thanks { opacity: 1; transition-duration: 200ms; }

/* ---------- client drawings: one meaningful motion each, on hover, mouse only ----------
   AP Pension: the projection draws out from today. SDC: the counter bell rings. Matas: the pump presses.
   Amass: the molecule draws itself (main.js). Novozymes: bubbles rise. Maersk: the ship rides the waves.
   Grundfos: the impeller spins up. LEGO: the top brick clicks on. Nothing moves at rest. */
.motif g[class^="mv-"] { transform-box: fill-box; }
.mv-bell { transform-origin: 50% 100%; }
.mv-fan { transform-origin: 50% 50%; }
.mv-ship { transform-origin: 50% 100%; }
.work > li svg.motif:has(.mv-waves) { overflow: hidden; }
@keyframes mv-reveal { from { clip-path: inset(-10% 100% -10% -10%); } to { clip-path: inset(-10% -10% -10% -10%); } }
@keyframes mv-ring { 0% { transform: rotate(0); } 18% { transform: rotate(-7deg); } 36% { transform: rotate(6deg); } 54% { transform: rotate(-4deg); } 72% { transform: rotate(2deg); } 100% { transform: rotate(0); } }
@keyframes mv-press { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(3.5px); } }
@keyframes mv-rise { 0% { transform: translateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
@keyframes mv-bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-2px) rotate(1.2deg); } }
@keyframes mv-sea { from { transform: translateX(0); } to { transform: translateX(-24px); } }
@keyframes mv-spin { from { transform: rotate(0); } to { transform: rotate(540deg); } }
@keyframes mv-drop { 0% { transform: translateY(-18px); opacity: 0; } 20% { opacity: 1; } 70% { transform: translateY(0); } 84% { transform: translateY(-2.5px); } 100% { transform: translateY(0); } }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .work > li:hover .mv-proj { animation: mv-reveal 620ms cubic-bezier(0.65, 0, 0.35, 1); }
  .work > li:hover .mv-bell { animation: mv-ring 640ms ease-out; }
  .work > li:hover .mv-pump { animation: mv-press 420ms cubic-bezier(0.34, 1.4, 0.64, 1); }
  .work > li:hover .mv-bubbles > * { animation: mv-rise 1400ms ease-in infinite; transform-box: fill-box; }
  .work > li:hover .mv-bubbles > :nth-child(2) { animation-delay: 300ms; }
  .work > li:hover .mv-bubbles > :nth-child(3) { animation-delay: 650ms; }
  .work > li:hover .mv-bubbles > :nth-child(4) { animation-delay: 900ms; }
  .work > li:hover .mv-ship { animation: mv-bob 1800ms ease-in-out infinite; }
  .work > li:hover .mv-waves { animation: mv-sea 1600ms linear infinite; }
  .work > li:hover .mv-fan { animation: mv-spin 1300ms cubic-bezier(0.22, 1, 0.36, 1); }
  .work > li:hover .mv-brick { animation: mv-drop 560ms cubic-bezier(0.22, 1, 0.36, 1); }
}

/* ---------- ask: a letter with blanks, filled in blue pen ----------
   Each "Ask about" opens a short letter in the lab sheet. The blanks are inputs drawn as lines on the paper;
   what you type appears in the pen. The result goes into an email, or onto the clipboard. */
.ask-dialog { --lab-h: 560px; width: min(720px, calc(100vw - 32px)); }
.ask-sheet { overflow-y: auto; overscroll-behavior: contain; padding: 26px 30px 26px; }
.ask-letter {
  font-family: var(--serif); font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem); line-height: 2.05;
  color: var(--ink); max-width: 36em; text-wrap: pretty;
}
.ask-letter p + p { margin-top: 0.5em; }
.blank {
  display: inline-block; vertical-align: baseline;
  min-width: 6ch; max-width: 100%; width: var(--w, 9ch);
  padding: 0 4px 1px; margin: 0 2px;
  border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--pen);
  font: italic 1.08em/1.3 var(--hand);
  transition: border-color 160ms ease, background-color 160ms ease;
}
.blank::placeholder { color: var(--pencil); opacity: 0.75; font-size: 0.86em; }
.blank:focus { outline: none; border-bottom-color: var(--pen); background: var(--pen-wash); }
.blank:focus-visible { outline: none; }
.ask-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--rule); }
.ask-acts .btn { min-height: 44px; font-size: 1rem; cursor: pointer; border: 0; }
.ask-acts .copy { min-height: 44px; }
.ask-note { flex-basis: 100%; font-family: var(--hand); font-style: italic; font-size: 1.0625rem; color: var(--soft); }
@media (max-width: 699px) {
  .ask-sheet { padding: 18px 18px 20px; }
  .ask-letter { line-height: 1.95; }
}
.ask-dialog .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ask-acts .ask-mail { text-decoration: none; }
.ask-letter.is-sent .blank { border-bottom-color: transparent; }
.ask-acts .btn[disabled] { opacity: 0.7; cursor: progress; }
/* the free line: ruled like writing paper, filled in the blue pen */
.blank-area {
  display: block; width: 100%; min-height: 4.2em; resize: none; overflow: hidden;
  margin: 2px 0 6px; padding: 0 2px;
  border: 0; background: transparent;
  background-image: linear-gradient(transparent calc(2.05em - 1.5px), var(--ink) calc(2.05em - 1.5px), var(--ink) 2.05em, transparent 2.05em);
  background-size: 100% 2.05em; background-attachment: local;
  color: var(--pen); font: italic 1.08em/2.05em var(--hand);
}
.blank-area::placeholder { color: var(--pencil); opacity: 0.8; font-size: 0.9em; }
.blank-area:focus { outline: none; background-color: var(--pen-wash); }

/* the switch in the title block */
.theme-toggle { appearance: none; border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.22em; }
.theme-toggle:hover { color: var(--pen); text-decoration-color: currentColor; }
/* the booking widget is Google's and stays light; give it a light bed in the blueprint */
.book-frame { background: #fff; }
