:root {
  color-scheme: light;
  /* Interface colours */
  --page: oklch(0.985 0.008 85);
  --surface: oklch(1 0 0);
  --surface-muted: oklch(0.95 0.012 85);
  --text: oklch(0.25 0.02 300);
  --muted: oklch(0.47 0.015 300);
  --border: oklch(0.86 0.012 85);
  --border-strong: oklch(0.58 0.015 300);
  --accent: oklch(0.42 0.11 300);
  --on-accent: oklch(0.985 0.008 85);
  --focus: oklch(0.52 0.17 300);
  /* Demo data colours: one sequential ramp, dark to light */
  --viz-low: oklch(0.26 0.07 285);
  --viz-high: oklch(0.93 0.14 100);
  --radius: 4px;
  --serif: Georgia, "Times New Roman", serif;
  color: var(--text);
  background: var(--page);
  font: 100%/1.6 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
button, select { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.shell { width: min(1080px, calc(100% - 3rem)); margin-inline: auto; }

.masthead, nav, .footer { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.masthead { justify-content: space-between; padding-block: 1.25rem; border-bottom: 1px solid var(--border); }
.masthead a { text-decoration: none; }
.masthead a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.wordmark { font-weight: 650; }
nav { font-size: .95rem; }

h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(3rem, 7vw, 5.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
p { margin: 0 0 1rem; }
figure { margin: 0; }
img { max-width: 100%; }

.hero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2rem, 6vw, 5rem); padding-block: clamp(3rem, 8vw, 6rem); }
.intro { font-size: clamp(1.1rem, 2vw, 1.25rem); max-width: 30rem; margin-top: 1.5rem; }
.hero-photo img { width: 100%; height: auto; display: block; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.hero-photo figcaption { padding-top: .5rem; font-size: .85rem; color: var(--muted); }

.section { padding-block: clamp(3rem, 7vw, 5.5rem); border-top: 1px solid var(--border); }
.split { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(1.5rem, 6vw, 5rem); }
.measure { max-width: 40rem; margin-top: 1rem; }

.results { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 2rem 0 0; }
.results > div { display: flex; flex-direction: column-reverse; border-top: 1px solid var(--border); padding-top: .75rem; }
.results dt { font-size: .95rem; color: var(--muted); }
.results dd { margin: 0; font: 400 clamp(2rem, 4vw, 2.75rem)/1.15 var(--serif); }

.lab-controls, .choices, .direction { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.lab-controls { justify-content: space-between; gap: 1rem; margin: 2rem 0 1rem; }
.direction { gap: .75rem; }
button, select { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); min-height: 44px; padding: .5rem 1rem; }
button[aria-pressed="false"]:hover { background: var(--surface-muted); }
button[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.panels figure { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panels img, canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--viz-low); }
canvas { image-rendering: pixelated; }
.panels figcaption { display: grid; align-content: start; gap: .25rem; padding: .85rem; font-size: .95rem; }
.panels figcaption span { color: var(--muted); }
.readout { margin-top: 1rem; font-family: ui-monospace, monospace; font-size: .875rem; color: var(--muted); }

.about-links { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; margin-top: 1.5rem; }

.footer { align-items: start; justify-content: space-between; padding-block: 1.5rem; border-top: 1px solid var(--border); font-size: .9rem; color: var(--muted); }
.footer details { max-width: 36rem; }
.footer p { margin: .5rem 0 0; }

@media (max-width: 680px) {
  .shell { width: calc(100% - 2rem); }
  .hero, .split { grid-template-columns: 1fr; }
  .hero { padding-block: 2.5rem; gap: 2rem; }
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panels figure:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .footer { flex-direction: column; gap: .75rem; }
}
