/*
 * Frolic — one stylesheet, in page order:
 * tokens and base · header · hero · sections · 01 intelligence · 02 invention · 03 complexity
 * · 04 real world · 05 physics · 06 foundations · closing · breakpoints
 */

/* ---------- tokens and base ---------- */
@font-face { font-family: "Berkeley Mono"; src: url("../fonts/BerkeleyMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Berkeley Mono"; src: url("../fonts/BerkeleyMono-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "mononoki"; src: url("../fonts/Mononoki-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }   /* SIL OFL, see fonts/Mononoki-LICENSE.txt */
@font-face { font-family: "mononoki"; src: url("../fonts/Mononoki-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* colour: paper, two text tones and one accent */
  --bg: #f5f4f0;        /* warm drafting paper */
  --plate: #fbfbf9;     /* panels */
  --line: #e0e2e6;      /* hairlines */
  --edge: #d3d6dc;      /* window borders */
  --ink: #26375c;       /* headings and emphasis */
  --text: #3d4a66;      /* body copy */
  --dim: #66728c;       /* secondary text, labels */
  --heat: #3a8ee6;      /* sky blue, the one accent */
  --shadow: 0 18px 40px -24px rgba(38, 55, 92, 0.28), 0 1px 3px rgba(38, 55, 92, 0.08);
  --mono: "Berkeley Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;   /* headings, labels, figures, code */
  --body: "mononoki", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;   /* running text: a second, rounder mono, so the page stays a console but the headings keep their own voice */
  /* type: one scale, regular weight for everything large */
  --fs-display: min(calc((100vw - 2 * var(--gutter)) / 13.5), 3rem);   /* 21 characters still fit a phone */
  --fs-h2: clamp(1.75rem, 3.2vw, 2.6rem);
  --fs-h3: clamp(1.2rem, 1.8vw, 1.5rem);
  --fs-lead: clamp(1.05rem, 1.6vw, 1.3rem);
  --fs-caps: clamp(0.95rem, 1.25vw, 1.1rem);   /* bold caps captions inside figures: the parts ladder, the model's three names */
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-title: 0.95rem;
  --fs-label: 0.72rem;
  --fs-micro: 0.64rem;   /* keys, tabs and tags inside figures */
  /* space: one scale, and generous room between sections */
  --sp-1: 0.5rem; --sp-2: 1rem; --sp-3: 1.5rem; --sp-4: 2.5rem; --sp-5: 4rem;
  --space: clamp(5rem, 10vw, 8.5rem);
  --measure: 60ch;
  --wrap: 80rem;   /* one column for everything, masthead included */
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body)/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--heat); outline-offset: 3px; }
canvas, svg { display: block; }

h1, h2, h3 { margin: 0; font-weight: 400; text-transform: uppercase; color: var(--ink); }
/* the mono stays where it is a voice or a label: headings, the wordmark, captions, window chrome, keys, buttons, tables, code */
h1, h2, h3, .wordmark, .hero .tagline, .bench-line, .win-bar, .scale, .legend, .traits strong, .bm-label, .eq-l, .pane span, .pt, .note, .an-table, .contact-btn, .raft-term { font-family: var(--mono); }
h2 { font-size: var(--fs-h2); line-height: 1.08; letter-spacing: -0.02em; max-width: 22ch; }
h2.one-line { max-width: none; font-size: min(var(--fs-h2), 5.3vw); white-space: nowrap; }   /* never wraps: shrinks instead, on phones */
h3 { font-size: var(--fs-h3); line-height: 1.15; letter-spacing: -0.01em; }
strong, b { color: var(--ink); }
h2 em { font-style: normal; color: var(--heat); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.label { font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.muted { color: var(--dim); }
.full { grid-column: 1 / -1; }

/* windows: the panel chrome every live figure sits in */
.win { position: absolute; background: var(--plate); border: 1px solid var(--edge); border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); }
.win-bar {
  --bar: 1.85rem;
  height: var(--bar); display: flex; align-items: center; gap: 0.4rem; padding: 0 0.75rem;
  background: #f0f0ec; border-bottom: 1px solid var(--line);
  font-size: var(--fs-micro); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim);
}
.win-bar i { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #d3d6dc; }
.win-bar i:first-child { background: var(--heat); }
.win-bar span { margin-left: 0.45rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-bar b { flex: none; margin-left: 0.9rem; font-weight: 400; color: var(--ink); text-transform: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.win > canvas, .win > .three-wrap { position: absolute; left: 0; right: 0; bottom: 0; top: 1.85rem; width: 100%; height: calc(100% - 1.85rem); }

/* ---------- header ---------- */
.site-header { display: flex; align-items: flex-start; justify-content: space-between; padding-top: 0; padding-bottom: 1.25rem; }
/* the wordmark, white on a tab of ink hung from the top edge, the tab's left edge on the column's */
.wordmark { display: block; padding: 2rem 0.75rem 1.15rem 1.15rem; font-weight: 400; font-size: 2.3rem; line-height: 1; letter-spacing: 0.3em; text-decoration: none; color: #fff; background: var(--ink); border-radius: 0 0 4px 4px; }

/* ---------- hero ---------- */
/* the hero has the first screen to itself: the headline and its lines in the lower left, open space above */
.hero { --head: 6.7rem; --peek: 0px; }
/* behind it all, from the top of the page to the foot of the hero and edge to edge: a search growing out of the left (js/explore.js) */
.wrap.hero { position: relative; }
/* the scene and the butterfly come in gently once the characters are ready to be drawn (each script adds .on) */
.hero-bg, .hero-fly { opacity: 0; transition: opacity 1.1s ease; }
.hero-bg.on, .hero-fly.on { opacity: 1; }
.hero-bg { position: absolute; left: 50%; top: calc(-1 * var(--head)); width: 100vw; height: calc(100% + var(--head)); transform: translateX(-50%); pointer-events: none; z-index: 0; }
/* at the right, a butterfly in characters beating its wings (js/butterfly.js, which also places it) */
.hero-fly { position: absolute; right: 0; top: 0; width: 20rem; height: 19.6rem; pointer-events: none; z-index: 0; background: radial-gradient(closest-side, rgba(58, 142, 230, 0.075), rgba(58, 142, 230, 0)); }   /* a faint glow about it */
.hero-intro {
  position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: calc(100vh - var(--head) - var(--peek)); min-height: calc(100svh - var(--head) - var(--peek));
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(4.25rem, 15vh, 9.5rem);   /* the words sit low, to leave the scene above them its room */
}
.hero h1 { font-size: min(calc((100vw - 2 * var(--gutter)) / 14.5), 3.7rem); line-height: 1.1; letter-spacing: -0.03em; }   /* the statement and its mirror */
.hero h1 { white-space: nowrap; width: max-content; max-width: 100%; }   /* no wider than its words, so the static only spills a little past them */
/* the statement, broken up now and then by a burst of TV static (js/glitch.js) */
.hero h1 { position: relative; }
.hero h1 .glitch { display: inline-block; will-change: transform; }
.glitch-fx { position: absolute; left: -6%; top: -35%; width: 112%; height: 170%; pointer-events: none; }
.hero h1 span { display: block; white-space: nowrap; }
.hero .tagline { margin: clamp(1.4rem, 2.6vw, 2.1rem) 0 0; font-size: clamp(0.95rem, 1.45vw, 1.22rem); line-height: 1.5; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }   /* how: in caps like the rest, a step quieter, set clear of the headline */

/* the thesis: two phrases in spaced caps, a double slash between them */
.lede { margin: clamp(1.4rem, 2.6vw, 2.1rem) 0 0; font-size: clamp(0.72rem, 1.05vw, 0.9rem); line-height: 1.9; letter-spacing: 0.16em; }
.lede b { font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.lede span { margin: 0 0.6em; letter-spacing: 0; color: var(--heat); }

.bench { margin: 0; }
/* the bench: a line, a loose collage of floating windows, another line and collage, and the line they add up to */
.bench-line { margin: 0 0 clamp(1.5rem, 3vw, 2.25rem); font-size: var(--fs-lead); line-height: 1.35; letter-spacing: -0.01em; color: var(--dim); }
.bench-line b { font-weight: 400; color: var(--ink); }
/* each collage sits beside its line: words left and windows right, then the other way round */
.bench-row { --bleed: clamp(0px, 4vw, 4rem); display: grid; grid-template-columns: minmax(0, 0.34fr) minmax(0, 0.66fr); gap: clamp(2.5rem, 7vw, 7rem); align-items: center; }   /* clear air between a collage and its words */
.bench-row .windows { margin-right: calc(-1 * var(--bleed)); }   /* each collage runs up to its wall and a little past it */
.bench-row.flip .windows { margin-right: 0; margin-left: calc(-1 * var(--bleed)); }
.bench-row.flip { grid-template-columns: minmax(0, 0.66fr) minmax(0, 0.34fr); }
.bench-row + .bench-row { margin-top: clamp(4rem, 8vw, 6.5rem); }
/* the statement: a heading in ink with a quiet line under it, as the headings beside the figures further down, centred on its collage */
.bench-row .bench-line { margin: 0; font-size: clamp(1.1rem, 2.15vw, 1.9rem); line-height: 1.14; letter-spacing: -0.01em; text-transform: uppercase; color: var(--ink); }
.bench-row .bench-line b { display: block; }
.bench-row.flip .bench-line { text-align: right; }   /* the second speaks from the right wall */
/* not everything is a window: some are bare sheets, some carry only a small label */
.win.sheet { border-color: var(--line); border-radius: 2px; box-shadow: 0 14px 28px -22px rgba(38, 55, 92, 0.5); }
.win.sheet > .win-bar { display: none; }
.win.sheet > canvas, .win.sheet > .three-wrap { top: 0; height: 100%; }
.w-wing.sheet .scale { top: 0.9rem; }
.w-three.sheet { transform: rotate(1.4deg); }
@media (max-width: 860px) {
  .bench-row, .bench-row.flip { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
  .bench-row .windows, .bench-row.flip .windows { margin-left: 0; margin-right: 0; }
  .bench-row.flip .bench-line { order: -1; text-align: left; }
}

.windows { position: relative; isolation: isolate; }
.plane-row { aspect-ratio: 100 / 62; }
/* the wing in its flow leads, top left; the airframe top right; the three-view on a sheet cut to its own drawing
   (260 by 190), in front, at the right; the chart under the wing, clear of the drawing. Corners overlap, nothing is buried */
.w-wing  { left: 0;   top: 0;   width: 62%; height: 66%; z-index: 1; }
.w-frame { left: 60%; top: 0;   width: 40%; height: 36%; z-index: 2; }
.w-three { left: 56%; top: 33%; width: 44%; height: auto; aspect-ratio: 260 / 190; z-index: 4; }
.w-hist  { left: 11%; top: 61%; width: 45%; height: 39%; z-index: 3; }
.three-wrap { background: #1f4f8f; }
.three-wrap svg { width: 100%; height: 100%; }
/* the machines, and one piece of pure software: windows on a 12-column grid, edges on shared lines.
   Raft leads, top left, over the engine; the alloy sits in front, low, well over the optics and the
   joint; faint construction lines carry the edges across */
.machine-row { aspect-ratio: 100 / 78; }
.w-raft   { left: 0;   top: 5%;  width: 46%; height: 39%; z-index: 2; container-type: inline-size; }   /* text and a schematic: the smallest */
.w-rde    { left: 42%; top: 0;   width: 58%; height: 50%; z-index: 6; }   /* the engine leads: the largest, and in front */
.w-litho  { left: 0;   top: 42%; width: 35%; height: 46%; z-index: 3; }
.w-stress { left: 61%; top: 49.5%; width: 39%; height: 45%; z-index: 4; }
.w-alloy  { left: 27%; top: 54%; width: 42%; height: 46%; z-index: 5; }
/* Raft: a terminal with the source, each block lit as it runs, and its log; the cluster beside it */
.raft-body { position: absolute; left: 0; right: 0; bottom: 0; top: 1.85rem; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.raft-term { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: #131a29; color: #c3cde0; }
.raft-tab { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.85rem; border-bottom: 1px solid rgba(255, 255, 255, 0.07); font-size: var(--fs-micro); letter-spacing: 0.06em; text-transform: uppercase; color: #75829c; white-space: nowrap; }
.raft-code { flex: 1; margin: 0; padding: 0.7rem 0.7rem 0.7rem 0; overflow: hidden; counter-reset: ln; font: clamp(0.42rem, 1.62cqi, 0.66rem)/1.62 var(--mono); white-space: pre; }
.raft-code .ln { position: relative; display: block; padding-left: 3em; transition: background-color 0.25s, color 0.25s; }
.raft-code .ln::before { counter-increment: ln; content: counter(ln); position: absolute; left: 0; width: 2.1em; text-align: right; color: #4c5870; }
.raft-code .ln.on { background: rgba(58, 142, 230, 0.2); box-shadow: inset 2px 0 0 var(--heat); color: #eef2f9; }
.raft-code .k { color: #7fb4ff; }
.raft-code .f { color: #eef2f9; }
.raft-code .c { color: #6c7a93; }
.raft-log { height: 5.6em; margin: 0; padding: 0.45rem 0.85rem 0.55rem; overflow: hidden; border-top: 1px solid rgba(255, 255, 255, 0.07); font: clamp(0.48rem, 1.5cqi, 0.6rem)/1.55 var(--mono); color: #7f8ba3; white-space: pre; }
.raft-log span { display: block; }
.raft-log span:last-child { color: #e6ecf6; }
.raft-body canvas { width: 100%; height: 100%; min-height: 0; }
.guides { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.guides path { fill: none; stroke: var(--edge); stroke-width: 1; stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; }

/* overlays inside windows: the wing's colour scale and the alloy's legend */
.scale, .legend { position: absolute; left: 0.9rem; bottom: 0.8rem; display: flex; align-items: center; pointer-events: none; color: var(--dim); }
.scale { gap: 0.5rem; font-size: var(--fs-micro); }
.scale i { width: 5rem; height: 0.35rem; border: 1px solid var(--line); border-radius: 1px; background: linear-gradient(90deg, #f6f6f3, #dce5f2, #bad0f0, #8cb6ec, #5a96e4, #3a78ce, #2c58a0, #243e70, #1c2a48); }
.scale.jet i { background: linear-gradient(90deg, #000080, #0000ff, #00ffff, #80ff80, #ffff00, #ff0000, #800000); }
.legend { flex-wrap: wrap; gap: 0.3rem 0.7rem; font-size: var(--fs-micro); }
/* the windows over their feet: the wing's and engine's keys move to the top, the alloy's to the right */
.w-wing .scale, .w-rde .scale { top: 2.6rem; bottom: auto; }
.w-alloy .legend { left: auto; right: 0.9rem; bottom: 0.7rem; }
.legend i { display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.3rem; border-radius: 50%; }
.el-co { background: #dee6f2; box-shadow: inset 0 0 0 1px #26375c; }
.el-cr { background: #c4d3ea; box-shadow: inset 0 0 0 1px #3d5a8f; }
.el-fe { background: #3a8ee6; }
.el-mn { background: #26375c; }
.el-ni { background: #eae8e2; box-shadow: inset 0 0 0 1px #8a8f99; }
.el-e  { background: #e8833a; }

/* ---------- sections ---------- */
/* learning leads: the first thing after the hero */
.learning > .block:first-child { margin-top: var(--sp-5); }
#foundations { margin-top: calc(var(--space) * 1.25); }   /* the epilogue */
.engine + .wrap .bench { margin-top: var(--sp-4); }   /* the statement leads straight into what it is spent on */
.block { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); margin-top: var(--space); }
.block > .head + .copy { margin-top: calc(var(--sp-2) * -0.5); }
.block > :is(.traits, .dims, .bigmodel, .map) { margin-top: var(--sp-4); }
.copy { max-width: var(--measure); }
.copy > p { margin: 0 0 var(--sp-2); }
.copy > p:last-child { margin-bottom: 0; }
.bullets { list-style: none; padding: 0; margin: var(--sp-2) 0 0; }
.bullets li { position: relative; padding-left: 1.4em; }
.bullets li::before { content: "▸"; position: absolute; left: 0; color: var(--heat); }

/* ---------- 01 intelligence: four trait plates ---------- */
.traits { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-3) clamp(1.5rem, 3vw, 2.75rem); margin: 0; padding: 0; list-style: none; }
.tviz { width: 100%; height: clamp(9rem, 13vw, 12.5rem); margin: 0 0 var(--sp-2); background: var(--plate); border: 1px solid var(--line); border-radius: 3px; }   /* one plate for all five: the same size and frame whatever is drawn in it */
.traits strong, .step h3 { display: block; font-size: var(--fs-title); font-weight: 700; line-height: 1.25; letter-spacing: 0.02em; text-transform: uppercase; }
.traits strong { margin-top: var(--sp-1); }
.traits span { display: block; margin-top: var(--sp-1); font-size: var(--fs-small); line-height: 1.6; color: var(--dim); }
.traits .label { margin-top: 0; }

/* ---------- 02 invention: the copy over a faint engine ---------- */
.engine { margin-top: calc(var(--space) * 0.85); }   /* clear air after the five traits */
.engine-stage { position: relative; display: flex; align-items: center; height: clamp(20rem, 30vw, 25rem); overflow: hidden; }
.engine-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.engine-copy { position: relative; width: 100%; pointer-events: none; }
.engine-copy h2 { max-width: 36rem; }
.engine-copy p { max-width: 36rem; margin: var(--sp-2) 0 0; }
.engine-copy p.muted { font-size: var(--fs-small); }
/* behind the copy the whole way down: above the paper, under the text */
.flyer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: -1; }

/* ---------- 03 complexity: parts, the design steps, abstraction and its many views ---------- */
.dims { margin: 0.75rem 0 0; }
.dim-list, .dim { min-width: 0; }
.dim { scroll-margin-top: 5rem; }
.dim + .dim { margin-top: clamp(4rem, 7vw, 6rem); }
.dim > h3, .dim-text > h3 { max-width: 24ch; }
.dim > h3.one-line { max-width: none; }
/* abstraction, then its many views: the stack on its own, then the same flow dealt out as a row, and
   one line under it */

.dim > h3.views-line { max-width: none; margin-bottom: var(--sp-3); }
.views-line span { color: var(--dim); }
.fan.row { perspective: 1600px; }
.fan.row .pane span { right: auto; left: 0.6rem; top: 0.45rem; margin: 0; font-size: var(--fs-micro); text-shadow: 0 0 6px var(--plate); }   /* names inside, clear of the next pane */
.fan.row > .pane span { color: #e8f0fc; text-shadow: none; left: 1.7rem; top: 0.95rem; }
.views-more { display: contents; }   /* on a desk the three fields are placed with the camera's view; on a phone they are a row of their own */   /* on film, inside the corner mark */
.dim > p, .dim-text > p { margin: var(--sp-2) 0 var(--sp-4); max-width: var(--measure); }
/* a panel with its words beside its figure */

/* parts: one log axis of parts per machine, each machine standing over its point with its count; centred under the copy */
.pchart { --pl: 4.5rem; --pr: 4.5rem; --pt: clamp(9.5rem, 16vw, 14rem); --pb: 6.4rem; position: relative; height: calc(var(--pt) + var(--pb)); max-width: 68rem; margin: var(--sp-4) auto 0; }
.pc-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* the engine again, opened into its parts beside the words; it closes up and takes its place at the end of the axis (js/visuals.js) */
#dim-parts { position: relative; }
.parts-engine { position: absolute; right: 0; top: -7.5rem; width: min(50%, 36rem); height: 17rem; pointer-events: none; }
.plot { position: absolute; left: var(--pl); right: var(--pr); top: var(--pt); bottom: var(--pb); }
.ladder { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.ladder li { position: absolute; left: calc(var(--x) * 100%); bottom: 0; width: 0; height: 0; opacity: 0; transition: opacity 0.55s ease; transition-delay: calc(0.1s + var(--i) * 0.22s); }
.pchart.in .ladder li, .ladder li.landed { opacity: 1; }
.ladder li.landed { transition: none; }
.pt { position: absolute; left: 0; bottom: 1.1rem; display: flex; flex-direction: column; align-items: center; padding-bottom: 0; font-size: 0.72rem; transform: translateX(-50%); white-space: nowrap; }
.ladder .wire { width: clamp(4.5rem, 10vw, 9rem); aspect-ratio: 1; }
/* the labels share one baseline whether or not a machine has one; the last ends where its machine ends */
.pt strong { position: absolute; top: calc(100% + 1.1rem + 2.6rem); left: 50%; transform: translateX(-50%); font-size: var(--fs-caps); font-weight: 700; line-height: 1.2; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }   /* caps under the decade numbers */
@media (max-width: 1199px) { .ladder li:last-child .pt strong { left: auto; right: 0; transform: none; } }   /* centred where the page has room, else kept inside */

/* models: four fidelity steps side by side, within the column; the two built from windows get
   more room, their windows overlapping like a bouquet */
.dim > h3 + .steps { margin-top: var(--sp-4); }
/* four steps in one line; the two built from windows get the room */
.steps { --vh: clamp(15rem, 24vw, 22rem); display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.36fr) minmax(0, 1.36fr) minmax(0, 0.86fr); border-top: 1px solid var(--line); }
.step { display: flex; flex-direction: column; min-width: 0; padding: var(--sp-2) clamp(0.9rem, 1.5vw, 1.4rem) 0; border-left: 1px solid var(--line); }
.step:first-child { padding-left: 0; border-left: 0; }
.step:last-child { padding-right: 0; }
.step h3 { margin-top: 0; }
.step p { margin: 0.3rem 0 0; font-size: var(--fs-small); line-height: 1.6; color: var(--dim); }
.step-viz { position: relative; height: var(--vh); margin: 0.75rem 0 1rem; }
/* three sheets of paper, one over another: scoping and feasibility showing above the working */
.napkin-viz svg { position: absolute; width: min(80%, calc(var(--vh) * 0.54)); height: auto; aspect-ratio: 1; filter: drop-shadow(0 10px 12px rgba(38, 55, 92, 0.2)); }
#napkin-scope { left: 20%; top: 1%;  transform: rotate(2.5deg); }
#napkin-feas  { left: 6%;  top: 19%; transform: rotate(-2.5deg); }
#napkin       { left: 13%; top: 43%; transform: rotate(-1deg); }
.sim-viz canvas { display: block; width: 100%; height: 100%; }
.bouquet > .win { position: absolute; width: 60%; height: 49%; container-type: inline-size; }
.bouquet > .win:nth-child(1) { left: 0;   top: 0;   z-index: 1; }
.bouquet > .win:nth-child(2) { left: 38%; top: 4%;  z-index: 2; }
.bouquet > .win:nth-child(3) { left: 0;   top: 51%; z-index: 3; }
.bouquet > .win:nth-child(4) { left: 38%; top: 47%; z-index: 4; }
.bouquet > .win.eq-win { z-index: 6; width: 74%; height: 58%; }   /* the equations, larger and in front */
/* a bouquet: two sheets and two windows, each over the edge of the last, every title showing */
.bouquet:is(.conceptual, .detailed) > .win { width: 55%; height: 52%; }
.bouquet:is(.conceptual, .detailed) > .win:nth-child(1) { left: 0;   top: 0;   z-index: 1; transform: rotate(-1.4deg); }
.bouquet:is(.conceptual, .detailed) > .win:nth-child(2) { left: 45%; top: 5%;  z-index: 2; }
.bouquet:is(.conceptual, .detailed) > .win:nth-child(3) { left: 2%;  top: 46%; z-index: 3; }
.bouquet:is(.conceptual, .detailed) > .win:nth-child(4) { left: 45%; top: 48%; z-index: 4; transform: rotate(1.2deg); }
.bouquet.detailed .cad-notes { display: none; }
/* detailed design: the whole engine in section, each part tagged with the equation that governs it */
.cad-notes { position: absolute; inset: 1.3rem 0 0; pointer-events: none; }
.note { position: absolute; padding: 0.5cqw 1.2cqw 0.4cqw; font-size: 2.3cqw; line-height: 1.25; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; color: var(--heat); background: rgba(251, 251, 249, 0.94); border: 1px solid var(--line); border-radius: 2px; }
.note .katex { display: block; margin-top: 0.3cqw; font-size: 3.3cqw; letter-spacing: 0; text-transform: none; color: var(--ink); }
/* detailed design: the governing equations as a card of their own, one row per law */
.eq-win > .eqs { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-evenly; padding: 1.5cqw 3cqw; border: 0; overflow: hidden; }
.eq-win .eq { padding: 0.2cqw 0; }
.eq-win .eq-l { padding-top: 0.5cqw; font-size: 2.9cqw; }
.eq-win .eq-r .katex { font-size: 5.5cqw; }   /* as large as the longest line allows */
.eq-win .eq-r .katex-display { margin: 0.1cqw 0 0.3cqw; }
.bouquet .note { padding: 0.4cqw 1cqw 0.3cqw; font-size: 2.2cqw; }   /* tags a touch larger than the drawn ones, to be read */
.bouquet .note .katex { font-size: 3.2cqw; }
.dd-win .win-bar { height: 1.3rem; padding: 0 0.45rem; gap: 0.3rem; font-size: 0.55rem; }
.dd-win .win-bar i { width: 0.38rem; height: 0.38rem; }
.dd-win > canvas { top: 1.3rem; height: calc(100% - 1.3rem); }
/* cards, not windows: no title bar or window dots, just a small label on the plate */
.card-win { border-color: var(--line); border-radius: 3px; box-shadow: 0 10px 22px -18px rgba(38, 55, 92, 0.45); }
.card-win .win-bar { background: none; border-bottom: 0; color: var(--heat); }
.card-win .win-bar i { display: none; }
.card-win .win-bar span { margin-left: 0.15rem; }
.nobar > .win-bar { display: none; }
.dd-win.nobar > canvas { top: 0; height: 100%; }

/* equation blocks, shared by the detailed-design card and the physics figure */
.eqs { background: var(--plate); border: 1px solid var(--line); }
.eq { padding: 0.15rem 0; border-top: 1px solid var(--line); }
.eq:first-child { border-top: 0; }
.eq-l { display: block; padding-top: 0.45rem; font-size: 0.62rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--heat); }
.eq-r { min-width: 0; }
.eq-r .katex-display { margin: 0.25rem 0 0.4rem; text-align: left; }
.eq-r .katex-display > .katex { text-align: left; }
.eq-r .katex { color: var(--ink); }

/* simulation: the stack of abstraction levels */
.multi { margin: 0; }
.multi canvas { width: 100%; aspect-ratio: 1 / 0.86; }   /* wider than tall: the sheets open, each still over part of the one below */
/* the stack beside its heading: the words at the left, centred on it; the figure takes the rest */
@media (min-width: 861px) {
  #dim-sim { display: grid; grid-template-columns: minmax(0, 0.27fr) minmax(0, 0.73fr); column-gap: clamp(1.5rem, 3vw, 3rem); align-items: center; }
  #dim-sim > h3 { white-space: normal; max-width: 9ch; }
}
@media (max-width: 860px) { .multi canvas { margin-top: 0.75rem; aspect-ratio: 1 / 0.86; } }

/* coupled physics: four cross sections that fan out as they come into view */
.stat-stage { position: relative; height: clamp(22rem, 36vw, 32rem); perspective: 1500px; overflow: hidden; }
.stat-stage.fan { height: clamp(18rem, 27vw, 24rem); overflow: visible; }
.pane { position: absolute; left: 0; top: 0; transform-origin: 0 50%; will-change: transform; }
.pane canvas { width: 100%; height: 100%; border: 1px solid var(--edge); border-radius: 2px; box-shadow: var(--shadow); }
.pane span { position: absolute; right: 0; top: 100%; margin-top: 0.5rem; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }

/* ---------- 04 real world: a physical test cell with digital windows floating over it ---------- */
.reality { margin-top: var(--space); }
.cell-stage { position: relative; }
.cell-stage > canvas { width: 100%; height: clamp(17rem, 44vw, 24rem); }
.cell-stage .win { will-change: transform; }
/* the heading runs the width of the page, above the cell and the words beside it */
.reality-line { max-width: none; margin-bottom: clamp(1.75rem, 3.5vw, 3rem); font-size: clamp(1.4rem, 2.3vw, 1.9rem); line-height: 1.12; text-wrap: balance; }
.nb { white-space: nowrap; }
.reality-head p { margin: var(--sp-2) 0 0; }
.reality-head p:first-child { margin-top: 0; }
.cell-wins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.cell-wins .win { position: relative; aspect-ratio: 16 / 10; }
@media (min-width: 1001px) {
  .cell-stage { --bleed: clamp(0px, 4vw, 4rem); height: clamp(33rem, 47vw, 40rem); }
  .cell-stage > canvas { position: absolute; left: calc(-1 * (var(--gutter) + var(--bleed))); top: 0; width: calc(62% + var(--gutter) + var(--bleed)); height: 100%; }
  .reality-line { white-space: nowrap; font-size: min(var(--fs-h2), calc((min(100vw, var(--wrap)) - 2 * var(--gutter)) / 35.5)); }   /* on one line: it shrinks to fit rather than wrap */
  .reality-head { position: absolute; right: 0; top: 50%; width: 30%; transform: translateY(-50%); }
  .cell-wins { display: contents; }
  .cell-wins .win { position: absolute; aspect-ratio: auto; }
  /* the readings gather under the engine: three sizes, stepping down to the right, each over the corner of the last */
  .cw-log   { left: 0;   top: 61%; width: 25%; height: 25%; z-index: 3; }   /* the telemetry, widest and furthest back */
  .cw-twin  { left: 19%; top: 56%; width: 21%; height: 42%; z-index: 4; }   /* the twin, tall, over the telemetry's right end */
  .cw-trace { left: 35%; top: 68%; width: 25%; height: 32%; z-index: 5; }   /* the thrust trace, lowest and in front, over the twin's lower right */
}

/* ---------- 05 physics: one model in the middle, spitting out the equations to the left and the fields to the right ---------- */
main { overflow-x: clip; }                      /* the fans may run past the column to the screen's edge, never into a sideways scroll */
.bigmodel { margin: 0.5rem 0 0; }
.bm-stage { position: relative; min-height: 26rem; }   /* its height is set to fit the ring */
.bm-paths { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.bm-paths path { fill: none; stroke: rgba(90, 103, 130, 0.38); stroke-width: 1; stroke-dasharray: 1 4; stroke-linecap: round; }
.bm-label { position: absolute; top: 0; z-index: 4; transform: translateX(-50%); font-size: var(--fs-caps); font-weight: 700; line-height: 1.25; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.bm-label::before { content: ""; display: block; width: 2rem; height: 2px; margin: 0 auto 0.7rem; background: var(--heat); }   /* each rule centred over its name */

.bm-nn { position: absolute; z-index: 4; }
.bm-nn svg { display: block; width: 100%; height: auto; overflow: visible; }
/* each equation its own plate; with the sheet, the tables and the fields it is laid in the ring by the figure (js/visuals.js) */
.bigmodel .analytic, .bigmodel .stat-stage { position: absolute; inset: 0; height: auto; display: block; background: none; border: 0; overflow: visible; perspective: none; }
.bigmodel .analytic > *, .bigmodel .pane { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; will-change: auto; }
.bigmodel .analytic .eq { width: max-content; }
.analytic .eq { padding: 0 0.85rem 0.1rem; background: var(--plate); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 10px 22px -18px rgba(38, 55, 92, 0.45); }
.analytic .eq-r .katex { font-size: 0.86em; }
.bigmodel .analytic .eq .eq-l { font-size: 0.72em; }   /* the figure scales each card with its table */
/* besides the laws: a sheet where something is worked through, and a table that settles a choice */
.an-work { width: 15rem; aspect-ratio: 1; filter: drop-shadow(0 10px 12px rgba(38, 55, 92, 0.2)); }
.an-table { width: 17rem; font-size: 0.62rem; padding: 0.9em 1.1em 1em; background: var(--plate); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 12px 24px -18px rgba(38, 55, 92, 0.5); }   /* sized in em: the figure sets its font size from its width */
.an-table .eq-l { padding-top: 0; font-size: 0.9em; }
.an-table table { width: 100%; margin-top: 0.6em; border-collapse: collapse; font-size: 1em; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.an-table th, .an-table td { padding: 0.42em 0 0.42em 0.6em; border-top: 1px solid var(--line); text-align: right; font-weight: 400; white-space: nowrap; }
.an-table thead th { border-top: 0; padding-top: 0; color: var(--dim); }
.an-table th:first-child { padding-left: 0.5em; text-align: left; color: var(--ink); }
.an-table small { font-size: 0.78em; }
.an-table .pick th, .an-table .pick td { color: var(--heat); font-weight: 700; background: rgba(58, 142, 230, 0.08); }
.an-table .pick th:first-child { box-shadow: inset 2px 0 0 var(--heat); }
.an-table p { margin: 0.7em 0 0; font-size: 1em; line-height: 1.35; color: var(--ink); }
.bigmodel .pane span { right: auto; left: 0.6rem; top: 0.45rem; margin: 0; font-size: var(--fs-micro); text-shadow: 0 0 6px var(--plate); }   /* names inside, where they stay visible */
@media (min-width: 861px) {
  /* the heading at the left with its words beside it; the figure across the full width under them */
  #physics { grid-template-columns: minmax(0, 0.47fr) minmax(0, 0.53fr); column-gap: clamp(2rem, 4vw, 4rem); align-items: start; }
  #h-physics { max-width: none; white-space: nowrap; }
  #h-physics em { display: block; }   /* two lines: forwards, then or backwards */
  #physics > .head { grid-column: 1; align-self: center; } #physics > .copy { grid-column: 2; margin-top: 0; max-width: 62ch; }   /* the heading centred on the words beside it */
  #physics > .bigmodel { grid-column: 1 / -1; margin-top: var(--sp-5); }
}
.map, .block > .map { margin: 0; }
.map-block { margin-top: calc(var(--space) * 1.4); }
.map-block h2 { max-width: none; font-size: clamp(1.9rem, 3.7vw, 3rem); line-height: 1.1; letter-spacing: -0.02em; text-align: center; }   /* a step above the section headings, standing alone over the map */
.map-block .map { margin-top: clamp(3.5rem, 7vw, 5.5rem); }
#abstraction { margin-top: clamp(4rem, 8vw, 6.5rem); }
.map { width: min(100%, 60rem); justify-self: center; }   /* the field of applications, smaller: a coda to the figure, not a second one */
.map svg { width: 100%; height: auto; overflow: visible; }
.map text { font-family: var(--mono); }
.map .tw { animation: twinkle 4s ease-in-out infinite; }
/* constellations: each group of systems fades in, its edges draw themselves between the stars,
   it holds a while and dissolves, every group on its own clock */
.map .sys { opacity: 0; animation: sys var(--du) ease-in-out var(--dl) infinite; }
.map .edge { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: edge var(--du) ease-in-out var(--dl) infinite; }
@keyframes sys { 0%, 100% { opacity: 0; } 12%, 52% { opacity: 1; } 66% { opacity: 0; } }
@keyframes edge { 0%, 10% { stroke-dashoffset: var(--len); } 34%, 100% { stroke-dashoffset: 0; } }
@keyframes twinkle { 50% { opacity: 0.12; } }

/* ---------- 06 foundations ---------- */
/* the research areas: a numbered index in three columns, each on a hairline */
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem 0.4rem; max-width: 44rem; margin: var(--sp-3) 0 0; padding: 0; list-style: none; }
.chips li { padding: 0.28rem 0.8rem 0.3rem; font-size: 0.8rem; letter-spacing: 0.01em; color: var(--text); background: rgba(38, 55, 92, 0.035); border: 1px solid rgba(38, 55, 92, 0.09); border-radius: 999px; }   /* quiet pills: a tint and a hairline, no box */

/* ---------- closing: the button you should not click ---------- */
/* ---------- contact ---------- */
.contact { padding: var(--sp-4) 0 0; }
.contact-btn { display: inline-block; padding: 0.7rem 1.2rem; font-weight: 700; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--ink); border: 1.5px solid var(--ink); transition: color 0.15s ease, border-color 0.15s ease; }
.contact-btn:hover, .contact-btn:focus-visible { color: var(--heat); border-color: var(--heat); }

/* the last joke, small, set in the terrain that closes the page (js/terrain.js): the land runs edge to edge behind it */
.closing { position: relative; padding: clamp(9.5rem, 21vw, 15rem) 0 clamp(2.75rem, 5vw, 4rem); }   /* the button low in the land, near its foot */
.terrain { position: absolute; left: 50%; top: -2.25rem; width: 100vw; height: calc(100% + 2.25rem); transform: translateX(-50%); pointer-events: none; z-index: 0; }
.closing .lunch-btn { position: relative; z-index: 1; }
.lunch-btn { display: block; margin-left: auto; padding: 0.45rem 0.9rem; font: inherit; font-family: var(--mono); font-weight: 400; font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); background: none; border: 1px dashed rgba(38, 55, 92, 0.38); border-radius: 999px; cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease; }   /* small and quiet, at the right: there to be found, not shown */
.lunch-btn:hover { color: var(--heat); border-color: var(--heat); }
.lunch-banner {
  position: fixed; left: 50%; top: 50%; z-index: 100; width: min(22rem, 86vw); padding: 0.6rem;
  background: var(--heat); cursor: pointer; border-radius: 6px; box-shadow: 0 24px 60px -18px rgba(38, 55, 92, 0.6);
  transform: translate(-50%, -50%) rotate(-3deg); animation: lunch-in 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); transition: opacity 0.35s ease;
}
.lunch-banner[hidden] { display: none; }
.lunch-banner.leaving { opacity: 0; }
.dasara { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 4px; background: #0a1232; }   /* the elephant, drawn live */
@keyframes lunch-in { from { transform: translate(-50%, -50%) rotate(-3deg) scale(0.3); opacity: 0; } }

.site-footer { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: var(--sp-3); padding-bottom: var(--sp-4); border-top: 1px solid var(--line); }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--heat); }

/* ---------- breakpoints ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .map .tw, .lunch-banner { animation: none; }
  .map .sys { animation: none; opacity: 1; }
  .map .edge { animation: none; stroke-dashoffset: 0; }
}

/* tablets: the four steps as two rows of two */
@media (min-width: 641px) and (max-width: 1024px) {
  .steps { --vh: clamp(15rem, 30vw, 19rem); grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(3) { padding-left: 0; border-left: 0; }
  .step:nth-child(n + 3) { border-top: 1px solid var(--line); margin-top: var(--sp-2); }
}

/* tablets and small laptops */
@media (max-width: 960px) {
  .traits { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* small names inside the panes */
@media (max-width: 860px) {
  .pane span { right: auto; left: 0.6rem; top: 0.45rem; margin: 0; font-size: 0.65rem; text-shadow: 0 0 6px var(--plate); }
}

/* phones: every collage stays a collage, its windows smaller and over one another, re-cut for an upright screen */
@media (max-width: 640px) {
  #h-map { white-space: normal; }   /* too long for one line on a phone */
  .plane-row { aspect-ratio: 100 / 118; }
  .machine-row { aspect-ratio: 100 / 124; }
  /* the planes: the wing in its flow on top; the three-view at the right, whole but for a strip under the wing; the
     airframe at the left beside it; the chart across the foot */
  .w-wing  { left: 0;   top: 0;   width: 88%; height: 40%; z-index: 5; }
  .w-three { left: 42%; top: 35%; width: 58%; z-index: 4; }
  .w-frame { left: 0;   top: 43%; width: 48%; height: 25%; z-index: 3; }
  .w-hist  { left: 6%;  top: 73%; width: 72%; height: 27%; z-index: 2; }
  /* the machines: the engine on top and the largest; under it two rows of two, each over a corner of its neighbour */
  .w-rde    { left: 6%;  top: 0;   width: 94%; height: 34%; z-index: 6; }
  .w-raft   { left: 0;   top: 33%; width: 68%; height: 29%; z-index: 4; }
  .w-litho  { left: 66%; top: 36%; width: 34%; height: 26%; z-index: 5; }   /* over the cluster window's edge, so its own name shows */
  .w-stress { left: 0;   top: 64%; width: 40%; height: 27%; z-index: 2; }
  .w-alloy  { left: 36%; top: 61%; width: 64%; height: 39%; z-index: 5; }
  /* small windows, small furniture */
  :is(.windows, .cell-wins) .win-bar { height: 1.3rem; padding: 0 0.45rem; gap: 0.3rem; font-size: 0.55rem; }
  :is(.windows, .cell-wins) .win-bar i { width: 0.38rem; height: 0.38rem; }
  :is(.windows, .cell-wins) .win > canvas, .windows .win > .three-wrap, .raft-body { top: 1.3rem; height: calc(100% - 1.3rem); }
  .windows .win.sheet > canvas, .windows .win.sheet > .three-wrap { top: 0; height: 100%; }
  .raft-body { height: auto; }
  .machine-row .guides { display: none; }
  .steps { --vh: 15rem; border-top: 0; }   /* phones: the four steps in a row to swipe */
  .step, .step:nth-child(n) { flex: 0 0 82%; margin-top: 0; padding: var(--sp-2) 0 0; border-left: 0; border-top: 1px solid var(--line); scroll-snap-align: start; }
  /* the design steps are one row you swipe through, the next card showing at the edge */
  .steps { display: flex; gap: 0.75rem; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 0.4rem var(--gutter) 1.1rem;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); overscroll-behavior-x: contain; scrollbar-width: none; }
  .steps::-webkit-scrollbar { display: none; }
  .w-three.sheet { transform: none; }
  .w-raft .raft-tab { padding: 0.3rem 0.5rem; font-size: 0.5rem; }
  .w-raft .raft-code { padding: 0.4rem 0.4rem 0.4rem 0; }
  .w-raft .raft-log { height: 3.6em; padding: 0.3rem 0.5rem; }
  .traits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) 1.25rem; }
  /* the parts axis stands up: few at the foot, millions at the top; each machine beside its point, upright */
  .pchart { height: 30rem; }
  .plot { left: 4.4rem; right: auto; width: 0; top: 3.4rem; bottom: 2.6rem; }
  .ladder li { left: 0; bottom: calc(var(--x) * 100%); }
  .pt { left: 1.5rem; bottom: auto; top: 0; transform: translateY(-50%); font-size: 0.85rem; }
  .ladder .wire { width: 3.6rem; }
  .ladder li .pt strong, .ladder li:last-child .pt strong { top: 50%; left: 5.2rem; right: auto; transform: translateY(-50%); font-size: 0.8rem; }
  .parts-engine { position: static; display: block; width: 100%; height: 12rem; margin-top: var(--sp-3); }
  .pchart { margin-top: 0; }
  /* the same flow four ways: the camera's view, and under it the three fields in a row: two in full and the third running
     off the edge, to be swiped along */
  .stat-stage.fan.row { height: auto; perspective: none; }
  .fan.row .pane { position: relative; will-change: auto; aspect-ratio: 100 / 42; }
  .fan.row > .pane { width: 80%; }
  .views-more { display: flex; gap: 0.6rem; margin: 0.6rem calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) 1rem; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 var(--gutter); overscroll-behavior-x: contain; scrollbar-width: none; }
  .views-more::-webkit-scrollbar { display: none; }
  .views-more .pane { flex: 0 0 44%; scroll-snap-align: start; }
  .bigmodel .pane span { font-size: 0.5rem; left: 0.4rem; top: 0.3rem; }
  .fan.row > .pane span { left: 1.1rem; top: 0.7rem; }
  /* the test cell's readings gather under the engine, over its floor and over one another */
  .cell-stage > canvas { height: 21rem; }
  .cell-wins { display: block; position: relative; width: 84%; aspect-ratio: 100 / 80; margin: -2.5rem auto 0; }
  .cell-wins .win { position: absolute; aspect-ratio: auto; }
  .cw-twin  { left: 44%; top: 0;   width: 56%; height: 64%; z-index: 4; }
  .cw-log   { left: 0;   top: 13%; width: 56%; height: 38%; z-index: 3; }
  .cw-trace { left: 5%;  top: 52%; width: 68%; height: 48%; z-index: 5; }
  /* the stack, larger than on a desk but still one stack: each sheet over half of the one below, its name at its right */
  .multi canvas { width: calc(100% + 2 * var(--gutter)); margin-left: calc(-1 * var(--gutter)); aspect-ratio: 1 / 1.06; }   /* edge to edge: its sheets as wide as the fields of the figure before it */

  /* the engine under the words, not behind them */
  .engine-stage { align-items: flex-start; height: auto; }
  .engine-copy { padding-bottom: clamp(14rem, 68vw, 18rem); }
  .closing { padding: 11rem 0 3rem; }
  /* more air between one section and the next: on a phone they came one on top of another */
  :root { --space: 7.5rem; }
  .learning > .block:first-child { margin-top: 5.5rem; }
  .engine + .wrap .bench { margin-top: 4.5rem; }
  .bench-row + .bench-row, .dim + .dim, #abstraction { margin-top: 6rem; }
  .bench-row, .bench-row.flip { gap: 2rem; }
  .tviz { height: 7rem; }
}

@media (max-width: 480px) {
  .wordmark { padding: 1.5rem 0.55rem 0.95rem 0.9rem; font-size: 1.85rem; letter-spacing: 0.26em; }
  .hero { --head: 5.6rem; }
  .scale { display: none; }
  .legend { font-size: 0.6rem; gap: 0.2rem 0.5rem; }
}

/* short landscape screens (phones on their side): keep the tall stages within reach */
@media (max-height: 520px) and (orientation: landscape) {
  .engine-stage { height: 28rem; }
  .stat-stage { height: 20rem; }
}
