/* Shared fonts, tokens, base type, layout, header, footer and components. One stylesheet per page sits on top.
 *
 * ONE VIEW. A page is shapes, photographs and words on open paper. No line runs longer than --rule-w (120px).
 * THE SUBTLETY RULE. Hovers change colour, underline or border only, over --hover-t: no fills, no movement over
 * 1px, never red, nothing at all on photographs. Every :hover sits inside @media (hover: hover). Focus rings stay loud.
 * TYPE. Jost capitals: name, page titles, section heads, labels, at most one quote per page. Archivo 300: every
 * sentence, paper titles in sentence case, legends, captions. Space Mono 400: numbers, units, readouts, code only.
 * Thin type only (never above 400), square corners (only dots round), no gradients, no shadows, no blur.
 */

/* Fonts: self-hosted (OFL, assets/fonts/LICENSES.txt). Jost and Archivo roman are variable files. */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 200 300; font-display: swap; src: url("../assets/fonts/jost-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 200 300; font-display: swap; src: url("../assets/fonts/jost-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-style: italic; font-weight: 300; font-display: swap; src: url("../assets/fonts/archivo-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; font-style: italic; font-weight: 300; font-display: swap; src: url("../assets/fonts/archivo-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 300 400; font-display: swap; src: url("../assets/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 300 400; font-display: swap; src: url("../assets/fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/space-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/space-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* STIX Two Text sets the maths. Google's subsets hold no maths operators (√ ∂ ∇ ≈ ≤ ≥ → ∞) and no U+202F: those come from the next face in --font-math. */
@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/stix-two-text-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/stix-two-text-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/stix-two-text-greek.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "STIX Two Text"; font-style: italic; font-weight: 400; font-display: swap; src: url("../assets/fonts/stix-two-text-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "STIX Two Text"; font-style: italic; font-weight: 400; font-display: swap; src: url("../assets/fonts/stix-two-text-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "STIX Two Text"; font-style: italic; font-weight: 400; font-display: swap; src: url("../assets/fonts/stix-two-text-italic-greek.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }

:root {
  /* Colour: paper + ink, Miró primaries in small solid patches */
  --paper: #f3f3f3;
  --paper-raised: #ffffff;
  --line: #d6d6d6;
  --ink: #141414;
  --ink-muted: #5c5c5c;
  --miro-blue: #1d3fa8;      /* link text and focus. It lightens in charcoal, so never fill a shape with it */
  --miro-yellow: #f3c018;
  --miro-green: #1f7a4a;
  --field-red: #d22a1f;      /* colour patches: the stop */
  --field-blue: #1d3fa8;     /* colour patches: shards, slabs, primary buttons */
  --miro-red: var(--field-red); /* red is never text, so the two are the same colour in both themes */
  --on-colour: #ffffff;      /* text on --miro-blue */
  --on-field: #ffffff;       /* text on --field-red or --field-blue */
  --on-yellow: #141414;

  /* Type */
  --font-display: "Jost", "Helvetica Neue", Arial, sans-serif;
  --font-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Space Mono", ui-monospace, Menlo, monospace;
  /* maths: STIX Two Text self-hosted above; operators fall to STIX Two Math (macOS) or Cambria Math (Windows) */
  --font-math: "STIX Two Text", "STIX Two Math", "Cambria Math", "Cambria", "Times New Roman", serif;
  --w-display: 200;          /* Jost at display sizes, 30px and up */
  --w-display-small: 300;    /* Jost below that, where 200 goes faint */

  /* Space: close or far, rarely in between */
  --space-1: 4px; --space-2: 8px; --space-4: 16px; --space-6: 24px; --space-10: 40px; --space-16: 64px;

  /* Column: 1120px, centred up to a 1600px window, then sitting left of centre as the paper widens.
   * --col-left is the column's left margin, for anything placed against the viewport. */
  --col: 1120px;
  --col-left: max(0px, min(50vw - var(--col) / 2, 240px + (100vw - 1600px) / 4));

  /* Shape */
  --radius-dot: 9999px;
  --stroke-hair: 1px;
  --rule-w: 120px;           /* the one rule width, and the longest line allowed */
  --stop: .14em;             /* the full stop, in the em of whatever it ends */
  --focus-ring: 0 0 0 2px var(--paper), 0 0 0 5px var(--miro-blue);
  --hover-t: .2s ease;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141414; --paper-raised: #1e1e1e; --line: #3a3a3a;
    --ink: #ececec; --ink-muted: #a8a8a8;
    --miro-blue: #7d98f2; --miro-green: #4cc285;
    --field-red: #e0382a; --field-blue: #3f63d6;
    --on-colour: #141414;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141414; --paper-raised: #1e1e1e; --line: #3a3a3a;
  --ink: #ececec; --ink-muted: #a8a8a8;
  --miro-blue: #7d98f2; --miro-green: #4cc285;
  --field-red: #e0382a; --field-blue: #3f63d6;
  --on-colour: #141414;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* Base */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
/* no cyan tap flash on touch screens (inherited by everything; focus rings are unaffected) */
html { -webkit-tap-highlight-color: transparent; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 27px;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  min-width: 0;
}
b, strong { font-weight: 400; }
[hidden] { display: none !important; }
i, em { font-style: italic; }
img, video { max-width: 100%; display: block; }
canvas { display: block; }
a { color: var(--miro-blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (hover: hover) { a:hover { color: var(--ink); } }
a, .btn, .textbtn, .chip, .theme-switch, details.working > summary {
  transition: color var(--hover-t), border-color var(--hover-t), background-color var(--hover-t), text-decoration-color var(--hover-t);
}
/* theme switch: everything changes colour at once, not link by link (tb.js sets this for two frames) */
html.tb-swap *, html.tb-swap *::before, html.tb-swap *::after { transition: none !important; }
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus-ring); } /* the outline shows only in forced colours */
::selection { background: var(--miro-yellow); color: var(--on-yellow); }
button { font: inherit; color: inherit; }
p { margin: 0; max-width: 64ch; }
/* no word alone on a last line; headings and leads keep their own balance */
p, li, .rn-dek, .figure-cap { text-wrap: pretty; }
.meta a, .result-role a, .pub-m a { white-space: nowrap; }
ul, ol { margin: 0; }
figure { margin: 0; }

/* Type */
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--w-display); text-transform: uppercase; letter-spacing: .03em; margin: 0; text-wrap: balance; }
h1 { font-size: 44px; line-height: 1.05; }
h2 { font-size: clamp(30px, 4.6vw, 40px); line-height: 1.1; }
h3 { font-size: 24px; line-height: 1.2; font-weight: var(--w-display-small); letter-spacing: .05em; }
/* small capitals: nav, buttons, section tags. Words only; a number with a unit is .readout */
.label {
  font-family: var(--font-display); font-weight: var(--w-display-small); font-size: 13px; line-height: 16px;
  letter-spacing: .1em; text-transform: uppercase;
}
.mono { font-family: var(--font-mono); font-weight: 400; }
/* journal typesetting: a unit symbol keeps its case inside capitals (4,896 km, never KM); maths sets in the maths face,
 * variables in <i>, numbers, units and constants upright */
.unit { text-transform: none; }
.math { font-family: var(--font-math); font-weight: 400; font-size: 1.08em; letter-spacing: 0; text-transform: none; }
.math i, .math .math, .puzzle-q .math i { font-size: 1em; }
.muted { color: var(--ink-muted); }
.lead { font-size: 20px; line-height: 30px; }
.nowrap { white-space: nowrap; }
.readout {
  font-family: var(--font-mono); font-weight: 400; font-size: 12px; line-height: 18px;
  letter-spacing: .06em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.quote { font-family: var(--font-display); font-weight: var(--w-display-small); font-size: clamp(19px, 1.9vw, 23px); line-height: 1.4; text-transform: uppercase; letter-spacing: .05em; }
.note-text { font-size: 15px; line-height: 24px; color: var(--ink-muted); max-width: 60ch; }
.figure-cap { font-family: var(--font-sans); font-size: 14px; line-height: 20px; color: var(--ink-muted); margin-top: var(--space-2); max-width: 64ch; }

/* The name, page titles and the full stop */
/* One signature: thin capitals ended by a disc sized in em, red on every page. In the title of more than one word,
 * wrap the last word and the stop in .nowrap. */
.name, .page-title { font-family: var(--font-display); font-weight: var(--w-display); text-transform: uppercase; margin: 0; }
.name { font-size: clamp(64px, 11vw, 132px); line-height: .92; letter-spacing: .02em; }
.page-title { font-size: clamp(min(46px, 12.4vw), 7.4vw, 88px); line-height: 1; letter-spacing: .03em; }
.stop {
  display: inline-block; width: var(--stop); height: var(--stop); margin-left: .06em; vertical-align: baseline;
  border-radius: var(--radius-dot); background: var(--field-red);
}
/* the stop as a control (Home): the disc holds still; the invisible ::after only widens the target */
button.stop { position: relative; padding: 0; border: 0; cursor: pointer; }
button.stop::after { content: ""; position: absolute; inset: -14px; border-radius: var(--radius-dot); }
/* lettering: an SVG in place of a title's words, the words kept for screen readers and the stop after it:
 *   <h1 class="page-title"><span class="sr-only">RESEARCH</span><svg class="lettering" viewBox="…" aria-hidden="true">…</svg><span class="stop"></span></h1> */
.lettering { display: inline-block; height: .72em; width: auto; fill: currentColor; vertical-align: baseline; overflow: visible; }

.page-head { position: relative; padding-block: var(--space-10); display: grid; gap: var(--space-4); justify-items: start; }

/* Layout */
.wrap { max-width: var(--col); margin-left: var(--col-left); margin-right: auto; padding-inline: clamp(16px, 5vw, 64px); }
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-10); align-items: start; }
/* the one rule: 120px of hairline at the text edge, wherever the column sits. Section spacing comes with it;
 * .sec.open drops the rule and keeps the space. */
.rule { display: block; width: var(--rule-w); height: 1px; margin: 0; border: 0; background: var(--ink-muted); }
section.sec { padding-block: 0 var(--space-16); }
section.sec::before { content: ""; display: block; width: var(--rule-w); height: 1px; margin-bottom: var(--space-16); background: var(--ink-muted); }
section.sec.open::before { background: none; }
.sec-head { display: grid; gap: var(--space-4); margin-bottom: var(--space-10); }
.stack > * + * { margin-top: var(--space-4); }
@media (max-width: 760px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}

/* Skip link, screen reader */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 12px; color: var(--paper); }

/* Header: name and nav. All plain text. */
.top {
  display: flex; align-items: baseline; gap: 0 var(--space-6);
  padding-block: var(--space-4); position: relative; z-index: 5;
}
.top .brand { color: var(--ink); text-decoration: none; margin-right: auto; padding-block: 8px; white-space: nowrap; }
.top .nav { display: flex; flex-wrap: wrap; gap: 0 var(--space-6); }
/* the current page (or the section a sub-page belongs to, notes → RESEARCH) is ink; the rest are muted */
.top .nav a { color: var(--ink-muted); text-decoration: none; padding-block: 8px; }
.top .nav a[aria-current] { color: var(--ink); }
@media (hover: hover) { .top .brand:hover, .top .nav a:hover { color: var(--miro-blue); } }
.theme-switch { background: none; border: 0; padding: 8px 0; margin: 0; cursor: pointer; white-space: nowrap; }

/* Narrower than one row: the name on row 1, the nav on row 2 */
@media (max-width: 1000px) {
  .top { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .top .brand { grid-column: 1; grid-row: 1; margin-right: 0; }
  .top .nav { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 600px) {
  .top { padding-block: var(--space-1) 0; }
  .top .nav { gap: 0 var(--space-4); }
  .top .brand, .top .nav a { position: relative; padding-block: 6px; }
  /* 40px tap targets without 40px rows */
  .top .brand::after, .top .nav a::after { content: ""; position: absolute; inset: -6px 0; }
}

/* Shapes: one small solid mark, placed by hand */
/* Set on the svg (see README): --s size (longest side, 30 to 40px), --x or --xr distance from the left or right of the
 * positioned parent, --y from the top; --x-sm, --xr-sm, --y-sm replace them at 600px and below. Never over letters,
 * never red (red is the stop), no motion. */
.shape {
  position: absolute; display: block; width: auto; height: var(--s, 36px); overflow: visible; pointer-events: none;
  left: var(--x, auto); right: var(--xr, auto); top: var(--y, 0); fill: var(--ink);
}
.shape.blue { fill: var(--field-blue); }
.shape.yellow { fill: var(--miro-yellow); }
@media (max-width: 600px) {
  .shape { left: var(--x-sm, var(--x, auto)); right: var(--xr-sm, var(--xr, auto)); top: var(--y-sm, var(--y, 0)); }
}

/* Buttons: one style. Blue underlined capitals, ink when pressed or open. */
.btn, .textbtn, .chip, details.working > summary {
  font-family: var(--font-display); font-weight: var(--w-display-small); font-size: 13px; line-height: 16px;
  letter-spacing: .1em; text-transform: uppercase;
}
.btn, .textbtn, .chip {
  background: none; border: 0; padding: 12px 0; color: var(--miro-blue); cursor: pointer; display: inline-block;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}
.btns { display: flex; flex-wrap: wrap; gap: 0 var(--space-6); align-items: center; }
.btn[disabled] { opacity: .45; cursor: default; }
[aria-pressed="true"].btn, [aria-pressed="true"].chip { color: var(--ink); }
@media (hover: hover) { .btn:not([disabled]):hover, .textbtn:hover, .chip:hover { color: var(--ink); } }

/* Plate: a 1px keyline, no mat */
/* Photographs and figures sit straight in it, with no hover and no CSS filter. The caption goes outside it. */
.plate { display: block; padding: 0; border: var(--stroke-hair) solid var(--line); background: none; }
.plate img, .plate video { display: block; width: 100%; height: auto; }

/* My photographs, wherever they sit: the month and year appear under the frame when asked (hover, or a tap on a
 * touch screen), never on it, and take no room until they show. The figcaption is always there for screen readers. */
.ph { position: relative; margin: 0; }
.ph-date {
  position: absolute; left: 0; top: 100%; padding-top: var(--space-1); white-space: nowrap; pointer-events: none;
  font-size: 13px; line-height: 20px; color: var(--ink-muted); opacity: 0; transition: opacity var(--hover-t);
}
.ph-date.r { left: auto; right: 0; }
@media (hover: hover) { .ph:hover .ph-date { opacity: 1; } }
.ph.is-open .ph-date { opacity: 1; }

/* Range input */
/* A track is a line, so it stops at --rule-w */
input[type=range].slider { -webkit-appearance: none; appearance: none; background: transparent; width: 100%; height: 28px; margin: 0; cursor: pointer; }
input[type=range].slider { max-width: var(--rule-w); }
input[type=range].slider::-webkit-slider-runnable-track { height: 1px; background: var(--ink); border: 0; }
input[type=range].slider::-moz-range-track { height: 1px; background: var(--ink); border: 0; }
input[type=range].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 22px; background: var(--ink); border: 0; border-radius: 0; margin-top: -10.5px; }
input[type=range].slider::-moz-range-thumb { width: 12px; height: 22px; background: var(--ink); border: 0; border-radius: 0; }
input[type=range].slider:focus-visible { box-shadow: none; }
input[type=range].slider:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus-ring); }
input[type=range].slider:focus-visible::-moz-range-thumb { box-shadow: var(--focus-ring); }
/* forced colours (Windows contrast themes) drop backgrounds and shadows: draw the slider and its focus in system
 * colours, and keep the stop red. Each engine drops a rule that names the other's pseudo-elements, so they stay apart. */
@media (forced-colors: active) {
  input[type=range].slider::-webkit-slider-runnable-track, input[type=range].slider::-webkit-slider-thumb { background: CanvasText; }
  input[type=range].slider::-moz-range-track, input[type=range].slider::-moz-range-thumb { background: CanvasText; }
  input[type=range].slider:focus-visible::-webkit-slider-thumb { outline: 2px solid Highlight; }
  input[type=range].slider:focus-visible::-moz-range-thumb { outline: 2px solid Highlight; }
  .stop { forced-color-adjust: none; }
}

/* details.working, code */
details.working > summary {
  list-style: none; display: inline-block; cursor: pointer; padding: 12px 0; color: var(--miro-blue);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}
details.working > summary::-webkit-details-marker { display: none; }
@media (hover: hover) { details.working > summary:hover { color: var(--ink); } }
details.working[open] > summary { color: var(--ink); }
details.working > :not(summary) { margin-top: var(--space-4); }
pre.code {
  font-family: var(--font-mono); font-size: 12px; line-height: 18px; background: var(--paper-raised);
  border: var(--stroke-hair) solid var(--line); padding: var(--space-4); overflow-x: auto; max-width: 100%;
  margin: var(--space-4) 0; white-space: pre; tab-size: 2;
}
code { font-family: var(--font-mono); font-size: .88em; }

[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after {
  transition: none !important; animation: none !important; scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Footer: the puzzle sentence and a button. The square appears only once it is solved. */
.site-foot { padding-block: 0 var(--space-6); }
.site-foot .rule { margin-bottom: var(--space-10); }
.foot-main { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: var(--space-6) var(--space-10); }
.puzzle { flex: 1 1 340px; min-width: 0; max-width: 64ch; }
.puzzle-q i { font-family: var(--font-math); font-size: 1.12em; font-weight: 400; }
.email-slot { white-space: nowrap; }
/* the x of the address is the input: type a value, press return */
.puzzle-in {
  width: 3ch; min-width: 2ch; max-width: 12ch; field-sizing: content;
  font-family: var(--font-mono); font-size: 16px; line-height: 24px; text-align: center;
  padding: 2px 3px; margin-block: -3px; background: transparent; color: var(--ink);
  border: 0; border-radius: 0; border-bottom: var(--stroke-hair) solid var(--ink);
  transition: border-color var(--hover-t);
}
.puzzle-in::placeholder { font-family: var(--font-math); font-style: italic; font-size: 19px; color: var(--ink); opacity: 1; }
.puzzle-in:focus::placeholder { color: transparent; }
@media (hover: hover) { .puzzle-in:hover { border-bottom-color: var(--miro-blue); } }
.puzzle-reply { color: var(--ink-muted); margin-top: var(--space-2); }
.puzzle-reply:empty { display: none; }
.puzzle-reply.ok { color: var(--ink); }
.puzzle-show { display: block; margin-top: var(--space-2); }
/* the solved address, on its own line at reading size */
.puzzle-solved { margin-top: var(--space-4); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-6); }
.email-link { font-size: 20px; line-height: 30px; white-space: nowrap; margin-right: auto; flex-basis: 100%; }
.puzzle-solved .textbtn { padding-block: 8px; }

.cut-wrap { flex: 0 0 auto; width: 262px; max-width: 100%; }
.cut-svg { display: block; width: 100%; height: auto; overflow: visible; user-select: none; -webkit-user-select: none; }
.cut-svg .sq { fill: none; }
.cut-svg .strip-top { fill: var(--line); }
.cut-svg .strip-one { fill: var(--ink-muted); }
.cut-svg .slip { fill: var(--miro-yellow); }
.cut-svg text { font-family: var(--font-sans); font-size: 12px; fill: var(--ink-muted); }
.cut-svg .one polygon { fill: var(--on-yellow); }
.cut-svg .phi { font-family: var(--font-math); font-style: italic; font-size: 20px; fill: var(--ink); }
.cut-svg .mv { transition: transform .8s cubic-bezier(.45,0,.25,1), opacity .8s ease; }
.cut-svg .fade { transition: opacity .6s ease; }

.foot-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 var(--space-6); margin-top: var(--space-6); }
.foot-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0 var(--space-6); }
.foot-links a { display: inline-block; padding-block: 8px; color: var(--ink-muted); text-decoration: none; }
@media (hover: hover) { .foot-links a:hover { color: var(--miro-blue); } }
/* the theme switch: both words, the current one in ink */
.theme-switch { color: var(--ink-muted); }
.theme-switch[data-on="light"] .t-light, .theme-switch[data-on="dark"] .t-dark { color: var(--ink); }
@media (hover: hover) { .theme-switch:hover { color: var(--miro-blue); } }
@media (max-width: 600px) {
  .site-foot .rule { margin-bottom: var(--space-6); }
  .cut-wrap { width: 194px; }
  .foot-bar { margin-top: var(--space-4); }
  .foot-links { gap: 0 var(--space-4); }
  .foot-links a, .theme-switch { padding-block: 12px; } /* 40px tap targets */
}

/* Print */
@page { size: A4; margin: 16mm; }
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --paper: #ffffff; --paper-raised: #ffffff; --line: #d6d6d6;
    --ink: #141414; --ink-muted: #5c5c5c;
    --miro-blue: #1d3fa8; --miro-green: #1f7a4a;
    --field-red: #d22a1f; --field-blue: #1d3fa8;
    --on-colour: #ffffff; color-scheme: light;
  }
  body { font-size: 11pt; line-height: 1.45; background: #fff; }
  .top .nav, .skip, .site-foot, .shape, .no-print { display: none !important; }
  a { color: var(--ink); text-decoration-thickness: 1px; }
  .wrap { max-width: none; margin: 0; padding-inline: 0; }
  section.sec { padding-block: 0 8mm; break-inside: auto; }
  section.sec::before { margin-bottom: 8mm; }
  .plate { break-inside: avoid; }
}
