@font-face { font-family: "Pagella"; src: url("fonts/pagella-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Pagella"; src: url("fonts/pagella-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Pagella"; src: url("fonts/pagella-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Pagella"; src: url("fonts/pagella-bolditalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --paper: #f5f4f0;
  --ink: #23211e;
  --ink-2: #4c4943;
  --ink-3: #625e56;
  --rule: #cdc9bf;
  --frame: #8e897f;
  --eye: #3e7366;
  --eye-ink: #2e5a50;
  --eye-wash: #d3e1db;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --serif: "Pagella", "TeX Gyre Pagella", "P052", "Palatino Linotype", Palatino, "URW Palladio L", serif;

  /* the reading column (figure mode: centred, figures in flow) */
  --m: 16px;
  --measure: 38rem;
  --pad: 0px;
  --gut: 32px;

  /* one hundredth of the small and the large viewport height. On touch devices js/main.js pins both
     to px at each width change, so a URL bar sliding in or out (and an emulator changing svh and vh
     with it) never resizes a figure or moves the column; elsewhere they stay the live units */
  --svh: 1vh;
  --lvh: 1vh;
}
@supports (height: 1svh) { :root { --svh: 1svh; } }

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

html {
  /* a neutral fibre tile multiplied over a paper a shade lighter than --paper: the mean is the paper */
  background: #faf9f5 url("img/paper.webp") 0 0 / 256px 256px repeat;
  background-blend-mode: multiply;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: #a19c92 var(--paper);
  scrollbar-width: thin;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-kerning: normal;
  font-variant-numeric: lining-nums proportional-nums;
  text-rendering: optimizeLegibility;
  caret-color: var(--eye);
  min-height: 100svh;
}

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

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: rgba(35, 33, 30, 0.34);
}
a:active { color: var(--eye-ink); }
@media (hover: hover) and (pointer: fine) {
  a { transition: text-decoration-color 180ms var(--ease-out); }
  a:hover { text-decoration-color: var(--eye); }
}
:focus-visible { outline: 2px solid var(--eye); outline-offset: 3px; border-radius: 1px; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
b, strong { font-weight: 700; }
sup { line-height: 0; font-size: 0.72em; vertical-align: 0.42em; }
.math { white-space: nowrap; }
.math i { padding-right: 0.04em; }

.skip {
  position: absolute; left: 16px; top: 12px; z-index: 10;
  width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  background: var(--paper); padding: 0; border: 0; color: var(--ink);
}
.skip:focus { width: auto; height: auto; clip-path: none; padding: 8px 12px; border: 1px solid var(--frame); }

/* ------------------------------------------------------------------ the press: one GL canvas */
.page { position: relative; }
.press {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 10px;
  z-index: 1;
  pointer-events: none;
  display: none;
  overflow-anchor: none;
}
html.gl .press { display: block; }
html.mode-stage .press { position: fixed; height: 100%; height: 100lvh; }
/* figure mode: the canvas is a child of the figure it draws (js/main.js moves it), under the
   figure's text like ink under type; the other figures show a 2D copy of their last frame */
html.mode-fig .fig { position: relative; }
html.mode-fig .press { z-index: -1; }
.fig-cache {
  position: absolute; left: 0; top: 0;
  width: 100%;
  z-index: -1;
  pointer-events: none;
  visibility: hidden;
  overflow-anchor: none;
}
html.mode-stage .fig-cache { display: none; }
/* a lost WebGL context: the canvas goes, each figure keeps its copy or shows its designed still (its
   live insets have nothing to show meanwhile: hidden in place, so nothing moves) */
html.ctx-lost .press { visibility: hidden; }
html.ctx-lost .fig:not(.has-cache) .ins-row { visibility: hidden; }

/* ------------------------------------------------------------------ sections as steps
   Native scroll snapping (no wheel or touch handling anywhere): each section head (.snap) is a snap
   point. Beside the stage the snapping is mandatory, so one gesture lands on the next section and the
   stage changes scene as an event (js/main.js); js/main.js stretches each head's snap area down to the
   next head (scroll-margin-bottom), so a section taller than the viewport scrolls freely inside it.
   On narrow screens the sections are long: proximity only. Without JS there is no stage and no snap. */
html.mode-stage { scroll-snap-type: y mandatory; }
html.mode-stage .snap { scroll-snap-align: start; scroll-margin-top: clamp(48px, 9vh, 120px); }
html.mode-fig { scroll-snap-type: y proximity; }
html.mode-fig .snap { scroll-snap-align: start; scroll-margin-top: 16px; }
html.mode-fig .blk-hero.snap { scroll-margin-top: 0; }

/* ------------------------------------------------------------------ reading column */
.col {
  position: relative; z-index: 2;
  width: auto;
  max-width: calc(var(--measure) + 2 * var(--m));
  margin: 0 auto;
  padding: 0 var(--m);
}

.blk-hero { padding-top: clamp(28px, calc(7 * var(--lvh)), 96px); padding-bottom: 8px; }
h1 {
  font-size: clamp(2.7rem, 1.6rem + 4.2vw, 5.4rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.014em;
  margin-left: -0.04em;
}
.affil { margin-top: 0.7rem; font-size: clamp(1.0625rem, 0.9rem + 0.6vw, 1.3125rem); line-height: 1.35; color: var(--ink-2); }
.contacts {
  margin-top: 1.1rem;
  display: flex; flex-wrap: wrap;
  gap: 0.15rem 1.2rem;
  font-size: 0.9375rem;
}
.interests { margin-top: clamp(1.4rem, calc(5 * var(--lvh)), 4rem); overflow: hidden; }
/* the same heading as every section's, one step down the scale inside the header */
.interests h2 {
  position: relative;
  font-size: clamp(1.4rem, 1.15rem + 0.8vw, 1.8rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  padding-bottom: 0.45rem;
  margin-bottom: 0.6rem;
}
.interests h2::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--rule);
}
.kw { display: flex; flex-wrap: wrap; margin-left: -1.15em; font-size: clamp(1.125rem, 0.95rem + 0.7vw, 1.4375rem); line-height: 1.5; }
.kw li { position: relative; padding-left: 1.15em; white-space: nowrap; }
.kw li::before {
  content: ""; position: absolute; left: 0.56em; top: 0.3em;
  width: 1px; height: 0.95em; background: var(--rule);
}

/* sections */
.sec { padding-top: clamp(56px, calc(9 * var(--lvh)), 112px); }
.sec h2:not(.interests h2) {
  position: relative;
  font-size: clamp(1.9rem, 1.4rem + 1.5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.012em;
  padding-bottom: 0.65rem;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
.sec h2:not(.interests h2)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--rule);
}

/* entries: bold title, detail, date set right on the first line */
.entries { display: grid; gap: 1.1rem; }
.ent-l { display: flex; align-items: baseline; justify-content: space-between; gap: 0.2rem 1.25rem; flex-wrap: wrap; }
.ent-t { flex: 1 1 17rem; color: var(--ink-2); }
.ent-t b, .ent-l > b { color: var(--ink); }
.ent-w {
  flex: 0 0 auto; margin-left: auto;
  white-space: nowrap;
  font-size: 0.9375rem;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink-3);
}
.ent-d { margin-top: 0.1rem; color: var(--ink-2); }
.fld + .fld::before {
  content: ""; display: inline-block;
  width: 1px; height: 0.9em; margin: 0 0.6em; vertical-align: -0.1em;
  background: var(--rule);
}
.ent-p { margin-top: 0.3rem; color: var(--ink-2); }

/* project entries */
.proj { padding-top: 2.2rem; }
.blk > h2 + .fig + .proj, .blk > h2 + .proj { padding-top: 0.2rem; }
.blk > .fig:first-child + .proj { padding-top: 0.2rem; }
.proj h3 {
  font-size: clamp(1.25rem, 1.1rem + 0.4vw, 1.375rem);
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: -0.004em;
  text-wrap: balance;
}
.byline {
  margin-top: 0.5rem;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.15rem 1.25rem;
  font-size: 1rem;
  color: var(--ink-2);
}
.byline b { color: var(--ink); }
.status { font-style: italic; color: var(--ink-3); }
.bul { margin-top: 0.8rem; }
.bul li { position: relative; padding-left: 1.45em; line-height: 1.6; text-wrap: pretty; }
.bul li + li { margin-top: 0.38rem; }
.bul li::before {
  content: ""; position: absolute; left: 0.3em; top: 0.66em;
  width: 0.4em; height: 0.4em;
  border: 1.2px solid currentColor; border-radius: 50%;
  opacity: 0.55;
}

/* honors register */
.awards li {
  display: flex; align-items: last baseline; gap: 0.55rem;
  padding: 0.5rem 0;
  line-height: 1.45;
}
.aw { flex: 0 1 auto; color: var(--ink-2); }
.aw b { color: var(--ink); }
.lead {
  flex: 1 1 2rem; min-width: 1.75rem; height: 0.5em;
  background-image: radial-gradient(circle at 50% 50%, #8a857b 0 0.75px, transparent 1px);
  background-size: 7px 4px; background-repeat: repeat-x;
  background-position: right 0 bottom 0.04em;
}
.yr { flex: 0 0 auto; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; color: var(--ink-2); }

/* close */
.close { padding-top: clamp(64px, calc(12 * var(--lvh)), 140px); padding-bottom: clamp(64px, calc(12 * var(--lvh)), 140px); }
.close-name { font-size: clamp(2.2rem, 1.6rem + 2vw, 3.3rem); line-height: 1; letter-spacing: -0.012em; }
.close-links { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; font-size: 1.0625rem; }

/* ------------------------------------------------------------------ figures and captions */
.fig { margin: 1.6rem 0 2.6rem; overflow-anchor: none; }
.fig-plate {
  position: relative;
  width: 100%;
  height: clamp(300px, calc(54 * var(--svh)), 500px);
  touch-action: pan-y;
}
.fig-record .fig-plate { height: clamp(240px, calc(40 * var(--svh)), 400px); }
.fig-plate img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 0; }
html.no-gl .fig-plate { background-position: 50% 0; background-size: contain; background-repeat: no-repeat; }

.cap { margin-top: 0.7rem; font-size: 0.875rem; line-height: 1.46; color: var(--ink-2); }
.cap-t { color: var(--ink); font-size: 0.9375rem; line-height: 1.42; }
.cap-t b { font-weight: 700; }
.cap-s { margin-top: 0.3rem; }
.cap-hint { margin-top: 0.25rem; font-style: italic; color: var(--ink-3); }
.ro {
  margin-top: 0.4rem;
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  font-variant-numeric: lining-nums tabular-nums;
  min-height: 28px;
}
.ro-v { white-space: nowrap; }
.cap.pending .ro-v, .cap.pending .ro-i, .cap.pending .ro-mix { visibility: hidden; }
.cap .cap-hint.idle { visibility: hidden; }
.ro-v b { font-weight: 400; color: var(--ink); }
.ro-v b.n { display: inline-block; min-width: 1.7em; }
.ro-v b.n3 { min-width: 3.3em; }
.ro-v b.r { text-align: right; }
.ro-v i { color: var(--ink-3); }
.ro-i { color: var(--ink-3); min-width: 4.5em; }
.ro-item { overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-width: 0; flex: 0 1 auto; }
.ro-item i { color: var(--ink-3); }
.ro-mix { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--ink-3); white-space: nowrap; }
.ro-bar { position: relative; width: 56px; height: 1px; background: var(--frame); }
.ro-bar i {
  position: absolute; left: -1px; top: -4px;
  width: 2px; height: 9px; background: var(--eye);
  transform: translateX(calc(var(--a, 0) * 56px));
  transition: transform 220ms var(--ease-out);
}
.ro-btn {
  margin-left: auto;
  font: inherit; font-size: 0.8125rem; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--frame); border-radius: 0;
  padding: 2px 12px 3px; min-height: 28px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.ro-btn:active { background: var(--eye-wash); }
@media (hover: hover) and (pointer: fine) { .ro-btn:hover { border-color: var(--ink-2); } }

/* insets: small live panels with an italic label under each */
.ins-row { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 0.65rem; }
.ins { flex: 0 0 auto; display: none; width: calc(var(--ins-h, 96px) * var(--ins-ar, 1)); }
.ins[data-tier="s"] { display: block; }
.ins-box {
  position: relative;
  width: calc(var(--ins-h, 96px) * var(--ar, 1));
  height: var(--ins-h, 96px);
  box-shadow: 0 0 0 1px rgba(35, 33, 30, 0.16);
}
.ins-l {
  display: block; margin-top: 0.3rem;
  font-size: 0.8125rem; line-height: 1.3; font-style: italic; color: var(--ink-2);
}
.ins-tr .ins-box { box-shadow: none; }
.tr-l {
  position: absolute; left: 0;
  font-size: 0.75rem; line-height: 14px; color: var(--ink-2);
  /* a paper halo: the label stays legible while its panel is screened in or out */
  padding: 0 4px 1px 1px; margin-left: -1px;
  background: rgba(245, 244, 240, 0.94);
  border-radius: 1px;
}
.tr-l:nth-child(1) { top: 0; }
.tr-l:nth-child(2) { top: 25%; }
.tr-l:nth-child(3) { top: 50%; }
.tr-l:nth-child(4) { top: 75%; }
.lg { white-space: nowrap; }
.sw { display: inline-block; width: 16px; height: 0; vertical-align: 0.3em; margin: 0 0.25em 0 0.1em; }
.sw-ink { border-top: 1.3px solid var(--ink); }
.sw-eye { border-top: 1.3px solid var(--eye); }
.sw-band { height: 6px; vertical-align: 0.05em; background: rgba(35, 33, 30, 0.14); }
.tier-m, .tier-w { display: none; }

/* live parts need the live plates: hidden without JS or without WebGL2 */
html:not(.js) .live, html.no-gl .live, html:not(.js) .live-only, html.no-gl .live-only { display: none !important; }
html:not(.js) .ro-btn, html.still .ro-btn { display: none; }
.cap-hint { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.gl:not(.reduced) .cap-hint[data-hint] { display: block; }
}
html.gl .cap-hint[data-hint-touch] { display: block; }

/* the record's numerals (DOM, placed over the plate) */
.rec-labels { position: absolute; inset: 0; pointer-events: none; }
.rec-n, .rec-p {
  position: absolute;
  font-size: 0.6875rem; line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--eye-ink);
  white-space: nowrap;
  opacity: 0;
}
.rec-n.on, .rec-p.on { opacity: 1; }
.rec-n { padding: 1px 2px; margin: -1px -2px; background: var(--paper); border-radius: 2px; box-shadow: 0 0 0 2px var(--paper); }
.rec-p { font-size: 0.8125rem; font-style: italic; color: var(--ink-2); }
.rec-n.reader { font-style: italic; color: var(--ink-2); }

/* ------------------------------------------------------------------ the stage (wide screens) */
.stage { display: none; }

/* stills stand in for the live plates without WebGL2 (loaded only in that mode) */
html.no-gl [data-fig="hero"] .fig-plate, .fallback[data-fig="hero"] .fig-plate, html.ctx-lost [data-fig="hero"]:not(.has-cache) .fig-plate { background-image: url("img/still-hero-m.webp"); }
html.no-gl [data-fig="worldmodel"] .fig-plate, .fallback[data-fig="worldmodel"] .fig-plate, html.ctx-lost [data-fig="worldmodel"]:not(.has-cache) .fig-plate { background-image: url("img/still-worldmodel-m.webp"); }
html.no-gl [data-fig="memory"] .fig-plate, .fallback[data-fig="memory"] .fig-plate, html.ctx-lost [data-fig="memory"]:not(.has-cache) .fig-plate { background-image: url("img/still-memory-m.webp"); }
html.no-gl [data-fig="spots"] .fig-plate, .fallback[data-fig="spots"] .fig-plate, html.ctx-lost [data-fig="spots"]:not(.has-cache) .fig-plate { background-image: url("img/still-spots-m.webp"); }
html.no-gl [data-fig="cansat"] .fig-plate, .fallback[data-fig="cansat"] .fig-plate, html.ctx-lost [data-fig="cansat"]:not(.has-cache) .fig-plate { background-image: url("img/still-cansat-m.webp"); }
html.no-gl [data-fig="record"] .fig-plate, .fallback[data-fig="record"] .fig-plate, html.ctx-lost [data-fig="record"]:not(.has-cache) .fig-plate { background-image: url("img/still-record-m.webp"); }
.fallback .fig-plate, html.ctx-lost .fig-plate { background-position: 50% 0; background-size: contain; background-repeat: no-repeat; }

@media (min-width: 1024px) {
  :root { --m: clamp(24px, 3.4vw, 64px); --measure: 31rem; --pad: 0px; --gut: clamp(28px, 2.8vw, 52px); }

  /* without JS: the column alone (centred), figures in flow with their stills */
  html:not(.js) .col { max-width: calc(38rem + 2 * var(--m)); }

  html.js .col {
    margin: 0;
    margin-left: var(--col-l, var(--m));
    width: calc(var(--measure) + 2 * var(--m));
    max-width: none;
  }
  html.js .col .fig { display: none; }
  html.js .stage-foot .fig { margin: 0; }
  html.js .stage-foot .fig-plate { display: none; }
  html.js .stage {
    display: block;
    position: fixed; z-index: 2;
    top: 0; bottom: 0;
    left: var(--stage-l, 60vw); width: var(--stage-w, 38vw);
    pointer-events: none;
  }
  .stage-plate {
    position: absolute; left: 0; top: var(--plate-t, 16px);
    width: var(--plate-w, 100%); height: var(--plate-h, 70vh);
  }
  .stage-still {
    position: absolute; inset: 0; display: none;
    background-position: 0 100%; background-size: contain; background-repeat: no-repeat;
  }
  html.no-gl .stage-still, .stage.fallback .stage-still, html.ctx-lost .stage-still { display: block; }
  html.no-gl .stage[data-scene="hero"] .stage-still, .stage.fallback[data-scene="hero"] .stage-still, html.ctx-lost .stage[data-scene="hero"] .stage-still { background-image: url("img/still-hero.webp"); }
  html.no-gl .stage[data-scene="worldmodel"] .stage-still, .stage.fallback[data-scene="worldmodel"] .stage-still, html.ctx-lost .stage[data-scene="worldmodel"] .stage-still { background-image: url("img/still-worldmodel.webp"); }
  html.no-gl .stage[data-scene="memory"] .stage-still, .stage.fallback[data-scene="memory"] .stage-still, html.ctx-lost .stage[data-scene="memory"] .stage-still { background-image: url("img/still-memory.webp"); }
  html.no-gl .stage[data-scene="spots"] .stage-still, .stage.fallback[data-scene="spots"] .stage-still, html.ctx-lost .stage[data-scene="spots"] .stage-still { background-image: url("img/still-spots.webp"); }
  html.no-gl .stage[data-scene="cansat"] .stage-still, .stage.fallback[data-scene="cansat"] .stage-still, html.ctx-lost .stage[data-scene="cansat"] .stage-still { background-image: url("img/still-cansat.webp"); }
  html.no-gl .stage[data-scene="record"] .stage-still, .stage.fallback[data-scene="record"] .stage-still, html.ctx-lost .stage[data-scene="record"] .stage-still { background-image: url("img/still-record.webp"); }

  .stage-foot { position: absolute; left: 0; top: 0; width: var(--plate-w, 100%); height: 100%; }
  .stage-foot .cap {
    position: absolute; left: 0; top: 0; width: 100%;
    margin: 0;
    visibility: hidden; opacity: 0;
    transition: opacity 220ms var(--ease-out), visibility 0s linear 220ms;
    pointer-events: none;
  }
  .stage-foot .cap.on {
    visibility: visible; opacity: 1;
    transition: opacity 220ms var(--ease-out) 60ms, visibility 0s linear 60ms;
    pointer-events: auto;
  }
  .stage-foot .cap.measure { visibility: hidden; opacity: 0; transition: none; }
  .stage-foot .cap-t, .stage-foot .cap-s { max-width: 40rem; }
  .stage.narrow .more { display: none; }
  .stage-foot .ins[data-tier="m"] { display: block; }
  .stage-foot .tier-m { display: inline; }
  .stage-foot .cap.side { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; align-items: start; }
  .stage-foot .cap.side .ins-row { grid-column: 2; grid-row: 1 / span 6; margin: 0; }
  .stage-foot .cap.side > p { grid-column: 1; }

  /* the plate changes while the reader crosses from one section into the next (js/main.js computes
     each crossing from this geometry), so the column needs only one modest gap of paper above each
     scene's heading; the next section's first lines are already in view while the plate turns */
  :root { --scene-gap: clamp(96px, 15vh, 164px); }
  html.js .blk:not(.blk-hero) { padding-top: var(--scene-gap); }
  html.js .blk-hero { padding-top: clamp(56px, 13vh, 140px); }
  html.js #research-projects { padding-top: 0; }
  html.js #education { padding-top: clamp(48px, 8vh, 96px); }
  html.js #experience.blk { padding-top: var(--exp-gap, var(--scene-gap)); }
  html.js .blk > .proj:first-child { padding-top: 0.2rem; }
  html.js .blk-cansat { padding-bottom: var(--scene-gap); }
  html.js .blk-rest .proj { padding-top: 0; }
  html.js .blk.blk-close { padding-top: var(--scene-gap); }
  /* the close ends on the same line as Plate vii's caption (set from the layout) */
  html.js .close { padding-bottom: var(--close-pb, 12vh); }
  html.js .blk-hero h1 { font-size: clamp(3.2rem, 1.9rem + 3.6vw, 5.4rem); }
  .blk h2 + .proj { padding-top: 0.2rem; }
}

@media (min-width: 1280px) {
  :root { --measure: 34rem; }
  .stage-foot .ins[data-tier="w"] { display: block; }
  .stage-foot .tier-w { display: inline; }
}
@media (min-width: 1024px) and (max-height: 760px) {
  .stage-foot .ins[data-tier="w"] { display: none; }
  .stage-foot .tier-w { display: none; }
  .stage-foot .cap-hint { display: none !important; }
}

@media (max-width: 1023px) {
  .rec-n { font-size: 0.6875rem; }
  /* the traces are the only CanSat panel shown in a figure: no letter of a series it is not part of */
  .col .ins-n { display: none; }
}
@media (min-width: 700px) and (max-width: 1023px) {
  /* a wide figure has room for both of the spots plate's panels, (a) and (b), and their sentences */
  .col [data-ins="glimpse"] { display: block; }
  .col [data-cap="spots"] .tier-m { display: inline; }
}

@media (max-width: 699px) {
  body { font-size: 1rem; }
  .blk-hero { padding-top: 22px; }
  /* links a thumb can hit: each box is 41px tall (the line plus 9px above and below, given back by a
     negative margin so the line itself does not move) and the rows are as far apart as the boxes */
  .contacts { font-size: 0.9375rem; gap: 18px 1rem; }
  .contacts a { display: inline-block; padding-block: 9px; margin-block: -9px; }
  .close-links { gap: 16px 1.4rem; }
  .close-links a { display: inline-block; padding-block: 8px; margin-block: -8px; }
  .sec { padding-top: 40px; }
  .proj { padding-top: 1.6rem; }
  .close { padding-top: 56px; padding-bottom: 48px; }
  .bul li { line-height: 1.55; }
  .cap { font-size: 0.875rem; }
  .cap-t { font-size: 0.875rem; }
  .ins-l { font-size: 0.84375rem; }
  .tr-l { font-size: 0.84375rem; }
  .ro-btn { min-height: 36px; padding-inline: 14px; font-size: 0.84375rem; }
  .ro-mix { display: none; }
  .rec-p { font-size: 0.84375rem; }
  .awards li { padding: 0.45rem 0; }

  /* figures on a phone: a plate and its first sentence, so a figure never takes the screen from the
     CV. Each sits after the text it belongs to, closer to that text than to the next heading. */
  .fig { margin: 1rem 0 1.4rem; }
  .fig-plate { height: clamp(220px, calc(34 * var(--svh)), 330px); }
  [data-fig="hero"] .fig-plate { height: clamp(240px, calc(37 * var(--svh)), 350px); }
  [data-fig="worldmodel"] .fig-plate { height: clamp(190px, calc(26 * var(--svh)), 260px); }
  .fig-record .fig-plate { height: clamp(210px, calc(29 * var(--svh)), 300px); }
  .cap { margin-top: 0.55rem; }
  .cap .cap-s:not(.cap-keep), .cap .more, .cap .cap-more, .cap .cap-hint { display: none !important; }
  .ro { margin-top: 0.3rem; }
  /* one inset: the glimpse for the spots plate (it reads at this size; the relevance map does not) */
  .cap [data-ins="relevance"] { display: none; }
  .cap [data-ins="glimpse"] { display: block; }
  .ins-row { margin-bottom: 0.5rem; }
  .ins-l { margin-top: 0.2rem; }
  /* a square inset sits beside the caption's sentence */
  .col .cap.side { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; column-gap: 14px; align-items: start; }
  .col .cap.side .ins-row { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .col .cap.side > p { grid-column: 1; }
  .col .cap.side > .ro { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .stage-foot .cap, .stage-foot .cap.on { transition: none; }
}

@media print {
  .press, .stage, .fig { display: none !important; }
  .col { margin: 0; }
}
