/* ── Type: one self-hosted variable family ───────────────
   Atkinson Hyperlegible Next only. It already draws the slashed zero and a
   distinct 1 / l / I, which is what the mono face used to be kept for, so
   numbers are set in the text face with tabular figures instead.
   Latin subset only; the arrow and icon glyphs come from the system font. */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-next-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  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;
}

/* ── Tokens ──────────────────────────────────────────────
   Bare alclad aluminium and the airfield: a white ground, one aluminium
   step for surfaces, graphite ink, and taxiway yellow as the one accent,
   black on yellow as an airfield's direction signs are. The accent fills
   things (the action, the switch, the closing band); where the same hue has
   to read as a line or a word on the ground it is --accent-deep. */
:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #EEF0EE;
  --ink: #1B1E20;
  --muted: #565D60;
  --accent: #F2C230;
  --accent-ink: #1B1E20;
  --accent-deep: #7A5C00;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Five sizes, far apart. Nothing on the page sits between them. */
  --step-small: 14px;
  --step-body: clamp(17px, 0.95rem + 0.2vw, 19px);
  --step-lead: clamp(20px, 1.05rem + 0.6vw, 26px);
  --step-head: clamp(30px, 1.1rem + 2.2vw, 48px);
  --step-display: clamp(44px, 0.9rem + 5.6vw, 104px);

  /* One pair of margins and one grid for every page. Sections hang from
     column 3 on a desktop; the bar, the hero copy and the footer from the
     margin. */
  --margin: clamp(20px, 2.4vw, 36px);
  --gutter: clamp(16px, 1.6vw, 28px);
  --max: 1680px;
  --bar-h: 64px;
  --section: clamp(64px, 8vw, 120px);

  /* Names the scripts still read (the interests graph, the gallery). */
  --font-sans: var(--font);
  --fs-micro: var(--step-small);
  --muted-2: var(--muted);
  --rust: var(--accent-deep);
  --border: color-mix(in srgb, var(--ink) 16%, var(--bg));
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121517;
  --surface: #1B1F21;
  --ink: #E7EAE8;
  --muted: #9EA6A8;
  --accent: #E8B923;
  --accent-ink: #121517;
  --accent-deep: #F0CF5E;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 580; hyphens: none; text-wrap: balance; }
a { color: inherit; }
button { font-family: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }
/* On a yellow field the ring takes the field's own dark ink: the deep gold
   is a pale yellow in the dark theme, 1.2:1 against the band. Over the
   viewer's near-black backdrop it is the yellow itself. */
.band :focus-visible,
.jump-list a.is-here:focus-visible { outline-color: var(--accent-ink); }
#lightbox :focus-visible { outline-color: var(--accent); }
[data-section] { scroll-margin-top: calc(var(--bar-h) + 16px); }

/* A number and its unit, kept on one line, in the text face's tabular
   figures so columns of results line up. */
.data { font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }

/* Running links: underlined clear of the descenders. */
.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent);
  transition: text-decoration-color 150ms ease;
}

.skip {
  position: absolute;
  left: var(--margin);
  top: -60px;
  z-index: 60;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--step-small);
}
.skip:focus { top: 8px; }

/* ── The grid ─────────────────────────────────────────── */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--margin); }
.grid12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}
.grid12 > * { min-width: 0; }
.col-read, .col-side, .col-wide, .col-full { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .col-read { grid-column: 1 / span 7; }
  .col-side { grid-column: 8 / -1; }
  .col-wide { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .col-read { grid-column: 3 / span 5; }
  .col-side { grid-column: 9 / -1; }
  .col-wide { grid-column: 3 / -1; }
}

.sec { padding: var(--section) 0; }
.sec-head { margin-bottom: clamp(28px, 3.4vw, 48px); }
.sec-title {
  font-size: var(--step-head);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 18ch;
}
.sec-lede {
  margin-top: 14px;
  max-width: 46ch;
  color: var(--muted);
  text-wrap: pretty;
}

/* ── The bar ──────────────────────────────────────────────
   Wordmark, the four pages, one action. Opaque, on the page's own ground,
   with no rule under it: it is told apart from what scrolls beneath by
   being solid, and once the page has moved it steps to the surface tone. */
nav.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  transition: background-color 200ms ease;
}
nav.bar.is-stuck { background: var(--surface); }
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--margin);
  min-height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.6vw, 44px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step-small);
  font-weight: 580;
  letter-spacing: 0.005em;
}
.brand-mark { height: 17px; width: auto; flex: none; display: block; }
.nav-scroll {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 32px);
  flex: 1 1 auto;
  min-width: 0;
}
.nav-link {
  position: relative;
  padding: 10px 0;
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms ease;
}
.nav-link[aria-current="page"] { color: var(--ink); }
.nav-mark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 2px;
  background: var(--accent-deep);
  pointer-events: none;
}
/* The chapter you are reading, after the page name on the Projects page. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Projects: the chapter you are reading, after the page's name, opening a
   list of all seven. A menu really floats, so it is the one thing here with
   a shadow. */
.nav-jump-wrap { position: relative; margin-left: calc(-1 * clamp(16px, 2vw, 32px) + 8px); }
html:not(.has-js) .nav-jump-wrap { display: none; } /* a button only script can open */
.nav-jump {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: color 150ms ease, transform 120ms var(--ease-out);
}
.nav-jump:active { transform: scale(0.97); }
.nav-jump[aria-expanded="true"] { color: var(--ink); }
.nav-here { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.nav-jump .icon-chev { transition: transform 180ms var(--ease-out); }
.nav-jump[aria-expanded="true"] .icon-chev { transform: rotate(180deg); }
.jump-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: -12px;
  z-index: 50;
  width: min(380px, calc(100vw - 2 * var(--margin)));
  padding: 8px;
  background: var(--bg);
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.14), 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent); /* taste-skill-ignore: a floating menu */
  transform-origin: 12px 0;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}
@starting-style { .jump-menu:not([hidden]) { opacity: 0; transform: translateY(-4px) scale(0.98); } }
[data-theme="dark"] .jump-menu { background: var(--surface); box-shadow: 0 16px 40px rgb(0 0 0 / 0.5), 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent); } /* taste-skill-ignore: a floating menu */
.jump-list { list-style: none; margin: 0; padding: 0; }
.jump-list .grp { padding: 10px 12px 4px; color: var(--muted); font-size: var(--step-small); }
.jump-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
}
.jump-list .k { color: var(--muted); font-variant-numeric: tabular-nums; }
.jump-list .jump-sep { height: 1px; margin: 8px 12px; background: var(--border); }
.jump-list a.is-here { background: var(--accent); color: var(--accent-ink); }
.jump-list a.is-here .k { color: var(--accent-ink); }
.jump-list a:focus-visible { outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
  .nav-jump:hover { color: var(--ink); }
  .jump-list a:not(.is-here):hover { background: var(--surface); }
  [data-theme="dark"] .jump-list a:not(.is-here):hover { background: var(--bg); }
}
.nav-chapter.active { color: var(--ink); }
.nav-chapter { display: none; }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  margin-left: auto;
}

/* ── Buttons ──────────────────────────────────────────────
   Square corners, decided once. One filled primary (yellow on the page, ink
   on the yellow band), one outlined action in the bar, one quiet tone-step
   button for repositories. Presses scale to 0.97 on the way down. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 580;
  line-height: 1.1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease,
              transform 120ms var(--ease-out);
}
.btn svg { width: 16px; height: 16px; flex: none; pointer-events: none; }
.btn .icon-contact, .btn .icon-mail { width: 18px; height: 18px; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ink { background: var(--ink); color: var(--bg); }
/* Get in touch in the bar: the outlined action, with the Gmail mark. */
.btn-ghost {
  min-height: 38px;
  box-sizing: border-box;
  padding: 0 14px;
  gap: 8px;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
}
.btn-quiet { background: var(--surface); color: var(--ink); min-height: 40px; padding: 0 16px; font-size: 15px; }
/* The arrow in its own square well at the trailing end, a shade darker than
   whatever the button is, so it reads at rest and on hover alike. */
.btn-well { padding: 6px 6px 6px 20px; gap: 16px; }
.btn-well .well {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: rgb(0 0 0 / 0.12);
}
.btn .icon-down { transition: transform 150ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: color-mix(in srgb, var(--accent) 84%, var(--ink)); }
  .btn-ink:hover { background: color-mix(in srgb, var(--ink) 84%, var(--bg)); }
  .btn-ghost:hover { background: var(--ink); color: var(--bg); }
  .btn-quiet:hover { background: color-mix(in srgb, var(--surface) 78%, var(--ink)); }
  .btn:hover .icon-down { transform: translateY(2px); }
  .nav-link:hover { color: var(--ink); }
  .text-link:hover { text-decoration-color: var(--ink); }
}

/* ── Theme toggle ─────────────────────────────────────── */
.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.theme-toggle:active { transform: scale(0.95); }
.theme-toggle .icon-moon,
.theme-toggle .icon-sun {
  position: absolute;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }
.theme-toggle .icon-sun  { opacity: 0; transform: rotate(90deg) scale(0.6); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.6); }
[data-theme="dark"] .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover { background: var(--surface); }
}

/* ── Home: the first screen ──────────────────────────────
   Two tones meeting at the middle. The left holds the title, the sentence
   that says what this is and the one action, anchored to the foot. The
   right holds the evidence and the switch that reads it: the nozzle, and
   where its stress is read. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: calc(100svh - var(--bar-h));
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(40px, 6vw, 96px) clamp(24px, 4vw, 72px) clamp(40px, 6vw, 88px)
           max(var(--margin), calc((100vw - var(--max)) / 2 + var(--margin)));
}
.hero-title {
  font-size: var(--step-display);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 clamp(22px, 2.6vw, 36px) -0.04em;
  max-width: 9.5em;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero-title .line > span { display: inline-block; }
.hero-lede {
  max-width: 40ch;
  font-size: var(--step-body);
  line-height: 1.55;
  text-wrap: pretty;
}
.hero-actions { margin-top: clamp(24px, 2.8vw, 36px); }
.hero-creds {
  margin-top: clamp(28px, 3vw, 44px);
  color: var(--muted);
  font-size: var(--step-small);
  line-height: 1.6;
}

/* The plot runs to the panel's top and both its edges, as large as the half
   allows; the switch, the reading and the sentence sit together in the
   room under it. */
.hero-rig {
  --rig-l: clamp(24px, 4vw, 72px);
  --rig-r: max(var(--margin), calc((100vw - var(--max)) / 2 + var(--margin)));
  margin: 0;
  background: var(--surface);
  padding: 0 var(--rig-r) clamp(32px, 4.4vw, 72px) var(--rig-l);
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2vw, 26px);
}
.rig-fig { display: block; margin: 0 calc(-1 * var(--rig-r)) 0 calc(-1 * var(--rig-l)); }
.hero-rig > .rig-switch { margin-top: auto; }
.hero-rig > .rig-cap { margin-bottom: auto; }
.rig-fig img { display: block; width: 100%; height: auto; }
.rig-switch {
  display: inline-flex;
  align-self: flex-start;
  background: var(--bg);
  padding: 4px;
  gap: 4px;
}
.rig-switch button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 14px 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 120ms var(--ease-out);
}
.rig-switch button:active { transform: scale(0.97); }
.rig-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.rig-switch .callout-balloon { position: static; margin: 0; width: 24px; height: 24px; }

/* ── Segmented switches: one block that travels ───────────
   The yellow block behind the hero switch and the revision toggles slides
   to the button pressed, at the page's ease-in-out for things moving on
   screen. Until the script has placed it (has-thumb), the pressed button
   keeps its own fill, so the first paint already shows the state. */
.rig-switch, .rev-toggle { position: relative; }
.rig-switch button, .rev-toggle button { position: relative; z-index: 1; }
.seg-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  background: var(--accent);
  pointer-events: none;
  transition: transform 240ms var(--ease-in-out), width 240ms var(--ease-in-out);
}
.rig-switch.has-thumb button[aria-pressed="true"],
.rev-toggle.has-thumb button[aria-pressed="true"] { background: transparent; }

.rig-read { display: grid; gap: 8px; }
.rig-readout {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.rig-num {
  position: relative;
  font-size: var(--step-head);
  font-weight: 580;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  transition: color 200ms ease;
}
.rig-num.is-withdrawn { color: var(--muted); }
/* The rolling figures (odometer() in site.js): each column one figure wide
   and one tall, its strip of digits moved under the opening. clip-path,
   not overflow, so the column keeps its digits' baseline. */
.odo { position: relative; display: inline-flex; align-items: baseline; }
.odo-col {
  display: inline-flex;
  flex-direction: column;
  width: var(--dw, 0.6em);
  height: 1em;
  clip-path: inset(0);
  transition: width 560ms var(--ease-out), opacity 300ms ease;
}
.odo-col.is-blank { width: 0; opacity: 0; }
.odo-strip { display: flex; flex-direction: column; }
.odo-strip > span { display: block; height: 1em; text-align: center; }
.odo-strip > span::before { content: attr(data-d); }
/* Withdrawn, the struck line draws across the number once its figures have
   landed, and goes back the way it came at once when the number changes
   again. */
.rig-strike {
  position: absolute;
  left: -0.04em;
  right: -0.04em;
  top: 0.45em;
  height: 0.06em;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 140ms var(--ease-out);
}
.rig-num.is-withdrawn .rig-strike { transform: scaleX(1); transition: transform 220ms var(--ease-out) 440ms; }
.rig-unit { color: var(--muted); font-size: var(--step-small); }
.rig-note { max-width: 52ch; color: var(--muted); font-size: var(--step-small); line-height: 1.5; }
/* Both releases' label and note share one cell; the one shown fades in
   after the other has started out. */
.rig-unit:has(> span), .rig-note:has(> span) { display: grid; }
.rig-unit > span, .rig-note > span {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, visibility 0s linear 140ms;
}
.rig-unit > span.is-on, .rig-note > span.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms ease 100ms, visibility 0s;
}
.rig-cap { max-width: 46ch; font-size: var(--step-body); line-height: 1.5; text-wrap: pretty; }
/* With no script the switch would do nothing, so it is only shown once the
   script has taken the figure over. Both callouts stay drawn either way. */
html:not(.has-js) .rig-switch { display: none; }
@media (hover: hover) and (pointer: fine) {
  .rig-switch button[aria-pressed="false"]:hover { color: var(--ink); }
}

/* ── Drawing callouts ──────────────────────────────────────
   Leader, dot and numbered balloon, as on a drawing sheet. On the switch's
   figure the reading you have not chosen steps back. */
.callout-fig { position: relative; display: block; }
.callout-fig img { display: block; width: 100%; height: auto; }
.callouts { position: absolute; inset: 0; pointer-events: none; }
.callouts svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.callouts line { stroke: var(--ink); stroke-width: 1.5; transition: opacity 200ms ease; }
[data-theme="dark"] .callouts line { stroke: #1B1E20; }
.callout-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #1B1E20;
  box-shadow: 0 0 0 2px #FFFFFF; /* taste-skill-ignore: the dot's ring on a contour plot, part of the drawing */
  transition: opacity 200ms ease, transform 200ms var(--ease-out);
}
.callout-balloon {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #1B1E20;
  box-shadow: inset 0 0 0 1.5px #1B1E20; /* taste-skill-ignore: the balloon's drawn outline */
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: opacity 200ms ease;
}
.hero-rig[data-rev] .callouts [data-rev] { opacity: 0.25; }
.hero-rig[data-rev="v1.0"] .callouts [data-rev="v1.0"],
.hero-rig[data-rev="v2.0"] .callouts [data-rev="v2.0"] { opacity: 1; }
.callout-key {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: var(--step-small);
  line-height: 1.45;
}
.callout-key li, .callout-key [role="listitem"] { display: flex; align-items: center; gap: 10px; }
.callout-key[hidden] { display: none; }
.callout-key .callout-balloon { position: static; margin: 0; flex: none; }
.callout-key .data { font-weight: 580; }
.callout-key s.data { color: var(--muted); font-weight: 400; text-decoration-thickness: 2px; }
.lead-cap-row .callout-key { flex-basis: 100%; margin: 4px 0 0; gap: 6px; }
.key-below { margin-top: 14px; }
@media (min-width: 641px) { .key-below { display: none !important; } }
@media (max-width: 640px) { .lead-cap-row .callout-key { display: none !important; } }

/* ── Home: four analyses ──────────────────────────────────
   A ledger, not cards: the name and the result on the left, the number to
   remember on the right, the check under it. The frame beside the column
   shows the row you are on and follows it down. */
.ledger { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(8px, 1vw, 14px); }
.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "thumb thumb" "name key" "result key" "check check";
  column-gap: clamp(16px, 2.4vw, 36px);
  padding: clamp(14px, 1.4vw, 20px) 0;
  color: var(--ink);
  text-decoration: none;
  transition: color 150ms ease, transform 120ms var(--ease-out);
}
.ledger-row:active { transform: scale(0.99); }
.ledger-thumb { grid-area: thumb; display: none; }
.ledger-name { grid-area: name; font-size: var(--step-lead); font-weight: 580; letter-spacing: -0.015em; line-height: 1.2; }
.ledger-result { grid-area: result; margin-top: 6px; max-width: 42ch; color: var(--muted); text-wrap: pretty; }
.ledger-key { grid-area: key; align-self: start; text-align: right; display: grid; justify-items: end; gap: 2px; }
.ledger-num {
  font-size: var(--step-lead);
  font-weight: 580;
  letter-spacing: -0.015em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
.ledger-k { max-width: 17ch; color: var(--muted); font-size: var(--step-small); line-height: 1.35; text-wrap: balance; }
.ledger-check { grid-area: check; margin-top: 8px; color: var(--muted); font-size: var(--step-small); }
.ledger-status { display: inline-block; margin-right: 8px; padding: 1px 8px; background: var(--surface); color: var(--ink); font-size: var(--step-small); }
.ledger-group { margin-top: clamp(28px, 3vw, 40px); color: var(--muted); font-size: var(--step-small); }
/* While one row is being read, the others step back to the soft ink. */
@media (hover: hover) and (pointer: fine) {
  .ledger:has(.ledger-row:hover) .ledger-row:not(:hover) .ledger-name,
  .ledger:has(.ledger-row:hover) .ledger-row:not(:hover) .ledger-num { color: var(--muted); }
}
.ledger-more { margin-top: clamp(24px, 2.4vw, 36px); font-size: 16px; }
.ledger-preview { position: relative; display: none; }
.ledger-frame {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  aspect-ratio: 4 / 3;
  background: var(--surface);
  overflow: hidden;
  transition: transform 300ms var(--ease-out);
}
.ledger-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 220ms ease, transform 620ms var(--ease-out);
}
.ledger-frame img.is-contain { object-fit: contain; padding: 18px; }
.ledger-frame img.is-on { opacity: 1; transform: none; }
@media (min-width: 760px) { .ledger-preview { display: block; } }
@media (min-width: 1100px) { .ledger-preview.col-side { grid-column: 8 / -1; } }
@media (max-width: 759.98px) {
  .ledger-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--surface);
    margin-bottom: 14px;
  }
  .ledger-thumb.is-contain { object-fit: contain; padding: 14px; }
  .ledger-row { padding-top: 0; }
  /* One column on a phone: the number follows the sentence it belongs to. */
  .ledger-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "thumb" "name" "result" "key" "check"; }
  .ledger-key { justify-items: start; text-align: left; grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 10px; margin-top: 12px; }
  .ledger-k { max-width: none; }
}

/* ── Home: built by hand ──────────────────────────────── */
.built-list { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; gap: clamp(18px, 2vw, 26px); }
.built-row {
  display: grid;
  grid-template-columns: clamp(104px, 14vw, 208px) minmax(0, 1fr);
  gap: clamp(14px, 1.8vw, 28px);
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  transition: transform 120ms var(--ease-out);
}
.built-row:active { transform: scale(0.99); }
.built-row img, .built-row > span:first-child {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--surface);
}
.built-row strong { display: block; font-size: clamp(18px, 1.55vw, 23px); font-weight: 580; letter-spacing: -0.015em; line-height: 1.2; }
/* Beside the turntable the three rows share out its height. */
@media (min-width: 760px) { .built-list { height: 100%; align-content: space-between; } }
.built-row strong + span { display: block; margin-top: 6px; max-width: 34ch; color: var(--muted); font-size: var(--step-small); line-height: 1.45; }
@media (hover: hover) and (pointer: fine) {
  .built-row:hover strong { text-decoration: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.2em; }
}
.holo { margin: 0; background: var(--surface); padding: clamp(10px, 1.2vw, 16px); }
.holo figcaption { padding: 10px 12px 2px; color: var(--muted); font-size: var(--step-small); }
/* The turntable: one model, large, that can be grabbed and spun. Its name
   and its number sit on the stage like a drawing's title; the six names
   under it choose the model. */
.holo-stage { position: relative; height: clamp(300px, 32vw, 430px); touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.holo-stage.is-drag { cursor: grabbing; }
.holo-stage canvas { display: block; width: 100%; height: 100%; }
.holo-read { position: absolute; top: 8px; left: 12px; right: 12px; margin: 0; display: grid; gap: 2px; pointer-events: none; }
.holo-name { justify-self: start; pointer-events: auto; color: var(--ink); font-size: var(--step-body); font-weight: 580; line-height: 1.3; text-decoration: none; }
.holo-fact { color: var(--muted); font-size: var(--step-small); line-height: 1.45; }
.holo-tabs { display: flex; flex-wrap: wrap; gap: 0 20px; padding: 6px 12px 0; }
.holo-tab {
  position: relative;
  margin: 0;
  padding: 8px 0 10px;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--step-small);
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease, transform 120ms var(--ease-out);
}
.holo-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 260ms var(--ease-out);
}
.holo-tab[aria-pressed="true"] { color: var(--ink); }
.holo-tab[aria-pressed="true"]::after { transform: scaleX(1); }
.holo-tab:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .holo-tab:hover { color: var(--ink); }
  .holo-name:hover { text-decoration: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.2em; }
}
@media (pointer: coarse) { .holo-tab { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .holo-tab::after { transition: none; } }
@media (max-width: 759.98px) { .holo { margin-top: 32px; } }
.holo-fallback {
  height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: var(--step-small);
}
.holo-fallback-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; max-width: 320px; color: var(--ink); }
holo-bay:defined .holo-fallback { display: none; }
holo-bay.is-failed .holo-fallback { display: flex; }

/* ── Home: tools ─────────────────────────────────────────
   Four stages of the work, side by side, each a plain list. */
.tools-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(28px, 3vw, 44px) var(--gutter);
}
.tool-group-label { color: var(--muted); font-size: var(--step-small); margin-bottom: 14px; }
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tool-item { display: flex; align-items: center; gap: 12px; font-size: 16px; line-height: 1.3; }
.tool-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 22px;
}
.tool-icon img { max-width: 30px; max-height: 20px; object-fit: contain; display: block; }
.tool-icon.is-plate { background: #FFFFFF; padding: 2px; }
.tool-icon.is-dark { background: #000000; padding: 2px; }
.tool-icon .initials { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); }

/* ── The closing band ─────────────────────────────────────
   Every page ends on the yellow: the one place the accent floods. */
.band { background: var(--accent); color: var(--accent-ink); padding: clamp(64px, 8vw, 128px) 0; }
.band-title { font-size: var(--step-head); line-height: 1.04; letter-spacing: -0.025em; max-width: 16ch; }
.band-text { margin-top: 16px; max-width: 34ch; font-size: var(--step-lead); line-height: 1.35; text-wrap: pretty; }
.band-actions { margin-top: clamp(26px, 3vw, 40px); display: flex; flex-wrap: wrap; gap: 12px; }
.band-side { display: grid; align-content: end; gap: clamp(22px, 2.4vw, 32px); margin-top: 40px; }
@media (min-width: 760px) { .band-side { margin-top: 0; } }
.band-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: var(--step-body); }
.band-links a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}
/* Copy, beside the address: a quiet tone step on the yellow whose label
   turns into "Copied" for a moment, the two labels crossfading through a
   2px blur so they read as one label changing. Both share one cell, so the
   button keeps its width. Shown only once the script can copy. */
.band-mail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.copy-btn {
  position: relative;
  display: inline-grid;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  background: rgb(0 0 0 / 0.1);
  color: var(--accent-ink);
  font: inherit;
  font-size: var(--step-small);
  line-height: 1;
  cursor: pointer;
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.copy-btn[hidden] { display: none; }
.copy-btn::after { content: ''; position: absolute; inset: -7px -4px; }
.copy-btn:active { transform: scale(0.97); }
.copy-btn > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 6px; transition: opacity 200ms ease, filter 200ms ease; }
.copy-btn svg { width: 14px; height: 14px; flex: none; }
.copy-btn .copy-done, .copy-btn.is-done .copy-idle { opacity: 0; filter: blur(2px); }
.copy-btn.is-done .copy-done { opacity: 1; filter: blur(0); }
@media (hover: hover) and (pointer: fine) {
  .copy-btn:hover { background: rgb(0 0 0 / 0.16); }
}
.band-bases { display: grid; gap: 2px; font-size: var(--step-small); line-height: 1.5; }
/* On the yellow the button is the band's own dark ink in both themes. */
.band .btn-ink { background: var(--accent-ink); color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .band .btn-ink:hover { background: color-mix(in srgb, var(--accent-ink) 82%, var(--accent)); }
}

.site-foot { padding: 26px 0 30px; color: var(--muted); font-size: var(--step-small); }
/* Three things on one baseline: the pages at the left margin, the motto
   centred whatever the two ends measure, the copyright at the right. */
.foot-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 12px 24px;
}
.foot-quote {
  display: grid;
  justify-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
/* The motto answers in English while it is pointed at, focused or tapped. */
.foot-quote > span { grid-area: 1 / 1; transition: opacity 260ms ease, filter 260ms ease; }
.foot-quote .fq-en { opacity: 0; filter: blur(3px); }
.foot-quote.is-en .fq-la, .foot-quote:focus-visible .fq-la { opacity: 0; filter: blur(3px); }
.foot-quote.is-en .fq-en, .foot-quote:focus-visible .fq-en { opacity: 1; filter: none; }
@media (hover: hover) and (pointer: fine) {
  .foot-quote:hover .fq-la { opacity: 0; filter: blur(3px); }
  .foot-quote:hover .fq-en { opacity: 1; filter: none; }
}
@media (pointer: coarse) { .foot-quote { min-height: 44px; align-items: center; } }
.foot-copy { justify-self: end; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.foot-links a { color: var(--ink); text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .foot-links a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
  .band-links a:hover { text-decoration-thickness: 0.12em; }
}
@media (max-width: 899.98px) {
  .foot-line { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .foot-quote { justify-items: start; }
  .foot-copy { justify-self: start; }
}

/* ── Inner pages: the head ─────────────────────────────── */
.page-head { padding: clamp(48px, 7vw, 120px) 0 clamp(36px, 4vw, 64px); }
.page-title {
  font-size: var(--step-display);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-left: -0.04em;
}
.page-lede { margin-top: clamp(16px, 1.8vw, 24px); max-width: 38ch; font-size: var(--step-lead); line-height: 1.35; text-wrap: pretty; }
.proj-index.page-index { margin-top: clamp(32px, 4vw, 56px); max-width: 36rem; }
.page-statement { margin-top: clamp(16px, 1.8vw, 24px); max-width: 30ch; font-size: var(--step-lead); line-height: 1.35; color: var(--muted); }
.nf-action { margin-top: clamp(24px, 2.8vw, 36px); }
/* The 404 page: the seven projects as pictures, two to a row, each with its
   number, so a wrong address still lands among the work. */
.nf-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px var(--gutter); }
.nf-grid a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step-small);
  transition: transform 120ms var(--ease-out);
}
.nf-grid a:active { transform: scale(0.98); }
.nf-grid img { grid-column: 1 / -1; display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface); }
.nf-grid img.is-contain { object-fit: contain; padding: 10px; }
.nf-grid .k { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) {
  .nf-grid a:hover .nf-name { text-decoration: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.2em; }
}

/* ── Projects: the index ──────────────────────────────── */
/* Projects opens on a picture: the figure of whichever project the index
   is pointing at, drawn across the last one from the left with a line at
   its front. It starts on the first project and is a link to the one shown. */
.proj-preview { position: relative; display: block; margin-top: clamp(28px, 3.4vw, 48px); max-width: 44rem; aspect-ratio: 2 / 1; background: var(--surface); overflow: hidden; transition: transform 120ms var(--ease-out); }
.proj-preview:active { transform: scale(0.995); }
.proj-preview img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; visibility: hidden; }
.proj-preview img.is-contain { object-fit: contain; padding: clamp(10px, 1.4vw, 20px); }
.proj-preview img.is-on { visibility: visible; }
.proj-preview img.is-in { visibility: visible; z-index: 1; background: var(--surface); }
.proj-preview-edge { position: absolute; top: 0; left: 0; z-index: 2; width: 2px; height: 100%; background: var(--ink); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.intro-seen) .proj-preview { animation: part-in 420ms var(--ease-out) 140ms backwards; }
}
/* While one row is pointed at, the others step back, as on the home ledger. */
@media (hover: hover) and (pointer: fine) {
  .proj-index:has(a:hover) a:not(:hover) span:first-child { color: var(--muted); }
}
@media print { .proj-preview { display: none !important; } }
.proj-index { list-style: none; margin: 0; padding: 0; display: grid; }
.proj-index a span:first-child { transition: color 150ms ease; }
.proj-index a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 11px 0;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step-body);
  transition: transform 120ms var(--ease-out);
}
.proj-index a:active { transform: scale(0.99); }
.proj-index .k { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.proj-index .grp { padding: 22px 0 6px; color: var(--muted); font-size: var(--step-small); }
.proj-index li:first-child .grp { padding-top: 0; }
@media (hover: hover) and (pointer: fine) {
  .proj-index a:hover span:first-child { text-decoration: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.2em; }
}

/* The hand builds' own heading on the projects page. */
.built-head { padding: clamp(72px, 9vw, 140px) 0 clamp(8px, 1vw, 16px); }
.built-jump { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-self: end; }
@media (min-width: 760px) { .built-jump { margin-top: 0; } }
.built-jump a { display: grid; gap: 8px; color: var(--ink); text-decoration: none; font-size: var(--step-small); transition: transform 120ms var(--ease-out); }
.built-jump a:active { transform: scale(0.98); }
.built-jump img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface); }
@media (hover: hover) and (pointer: fine) {
  .built-jump a:hover span { text-decoration: underline; text-underline-offset: 0.2em; }
}

/* The projects page is a document: its reading column and its figures run
   margin to margin, so the evidence gets the width. */
@media (min-width: 1100px) {
  .doc .col-read { grid-column: 1 / span 6; }
  .doc .col-side { grid-column: 8 / -1; }
  .doc .proj-read { grid-column: 1 / span 5; }
  .doc .proj-stage { grid-column: 6 / -1; }
}

/* ── Projects: a chapter ─────────────────────────────────
   The reading column on the anchor line, the figure held still beside it
   so the claim and its evidence stay on screen together. */
.proj-section { padding: clamp(56px, 7vw, 112px) 0; }
.proj-section:nth-of-type(even) { background: color-mix(in srgb, var(--surface) 55%, var(--bg)); }
.proj-split {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--margin);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}
.proj-split > * { min-width: 0; }
.proj-read { grid-column: 1 / -1; display: flex; flex-direction: column; }
.proj-stage { grid-column: 1 / -1; }
@media (min-width: 1100px) {
  .proj-read { grid-column: 3 / span 4; order: 1; }
  .proj-stage { grid-column: 7 / -1; order: 2; position: sticky; top: calc(var(--bar-h) + 24px); align-self: start; }
}
/* Narrower, the two cannot sit side by side, so the figure is placed right
   after the numbers it supports, and the story follows it. */
@media (max-width: 1099.98px) {
  .proj-split { display: flex; flex-direction: column; }
  .proj-read { display: contents; }
  .proj-read > * { order: 1; }
  .proj-stage { order: 2; margin-top: 28px; }
  .proj-read > .rev,
  .proj-read > .proj-layers,
  .proj-read > .proj-story,
  .proj-read > .proj-story ~ .proj-metrics,
  .proj-read > .proj-repo-btn,
  .proj-read > .proj-repo-note { order: 3; }
  .proj-read > .proj-story { margin-top: 28px; }
  .proj-read > .proj-title, .proj-read > .proj-result, .proj-read > .proj-tags,
  .proj-read > .proj-metrics, .proj-read > .rev { max-width: 40rem; width: 100%; }
}
.proj-tags { margin-top: 14px; color: var(--muted); font-size: var(--step-small); }
.proj-status { color: var(--ink); font-weight: 580; }
.proj-title { font-size: var(--step-head); line-height: 1.04; letter-spacing: -0.025em; max-width: 16ch; }
.proj-result { margin-top: 16px; font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.01em; max-width: 28ch; text-wrap: balance; }
.proj-story { margin-top: 20px; max-width: 54ch; text-wrap: pretty; }
.proj-read > .proj-story + .proj-story { margin-top: 0.9em; }
/* A subscript (σcr) would otherwise open its line wider than the rest. */
.proj-story sub { line-height: 0; }

/* Praxis's own lockup, as its app header sets it (src/practice.css in the
   Praxis repository): the mark at about 1.4 times the name, the name in
   lowercase at 650 with -0.06em tracking, then a muted descriptor after a
   thin rule. Segoe UI is the app's face; elsewhere the site's face stands
   in, at the same weight and tracking.
   When the column is too narrow the descriptor wraps to a line of its own.
   The row is pulled left by its rule's width and the heading clips it, so a
   rule that starts a line falls outside and only a rule between the two
   parts shows. */
.proj-title.proj-wordmark { max-width: none; overflow: hidden; letter-spacing: 0; --wm-pad: 0.62em; }
.wm-row { display: flex; flex-wrap: wrap; align-items: center; row-gap: 0.3em; margin-left: calc(-1 * var(--wm-pad) - 1px); }
.wm-lock, .wm-desc { padding-left: var(--wm-pad); border-left: 1px solid transparent; }
.wm-lock { display: inline-flex; align-items: center; gap: 0.46em; margin-right: 0.36em; }
.wm-tile { display: inline-flex; flex: none; padding: 0.05em; border-radius: 0.22em; line-height: 0; }
.wm-mark { width: 1.36em; height: 1.36em; fill: #000; }
.wm-name { font-family: "Segoe UI", var(--font); font-weight: 650; letter-spacing: -0.06em; line-height: 1.1; }
/* The text is sized on an inner span, so the padding above stays in the
   heading's em and matches the row's pull. */
.wm-desc { display: flex; align-items: center; border-left-color: var(--border); }
.wm-desc > span {
  font-family: "Segoe UI", var(--font); font-size: 0.42em; font-weight: 400;
  line-height: 1.35; letter-spacing: 0; color: var(--muted);
}
/* The brand notes ask for black on a light ground: on the dark theme the
   mark sits on a white tile, as the app's README shows it. */
[data-theme="dark"] .wm-tile { background: #fff; }
/* The Yamanaka Works mark is a picture on its own black tile, in both
   themes, and its name is set at the lab's ordinary tracking. */
.wm-tile:has(.wm-img), [data-theme="dark"] .wm-tile:has(.wm-img) { padding: 0; background: none; }
.wm-img { border-radius: 0.22em; }
[data-theme="dark"] .wm-img { box-shadow: 0 0 0 1px var(--border); }
.wm-name-plain { letter-spacing: -0.02em; }

/* Key results: a real table, so its rows keep their lines. */
.proj-metrics { margin-top: 26px; }
.metrics { width: 100%; border-collapse: collapse; font-size: var(--step-small); }
.metrics th, .metrics td { padding: 10px 0; border-top: 1px solid var(--border); vertical-align: baseline; }
.metrics tr:last-child th, .metrics tr:last-child td { border-bottom: 1px solid var(--border); }
.metrics th { text-align: left; font-weight: 400; color: var(--muted); padding-right: 16px; }
.metrics td { text-align: right; font-size: 16px; font-weight: 580; font-variant-numeric: tabular-nums lining-nums; }
.metrics td.is-num { font-size: var(--step-lead); letter-spacing: -0.015em; }
.rev.is-superseded .metrics tr:first-child td { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }

.rev { margin-top: 30px; }
.rev-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.rev-title { font-size: var(--step-small); color: var(--muted); }
.rev-toggle { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface); }
.proj-section:nth-of-type(even) .rev-toggle { background: var(--bg); }
.rev-toggle button {
  appearance: none;
  border: 0;
  margin: 0;
  min-height: 36px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-size: var(--step-small);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 120ms var(--ease-out);
}
.rev-toggle button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.rev-toggle button:active { transform: scale(0.97); }
.rev-note { margin-top: 12px; max-width: 46ch; color: var(--muted); font-size: var(--step-small); line-height: 1.5; }
@media (hover: hover) and (pointer: fine) {
  .rev-toggle button[aria-pressed="false"]:hover { color: var(--ink); }
}
@media (max-width: 640px), (pointer: coarse) {
  .rev-toggle button { min-height: 44px; }
}

/* Problem, approach, verification, lesson: a report's order, read down the
   labels alone or in full. */
.proj-layers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 36px 0 28px; }
.proj-layers dt {
  margin-top: 20px;
  font-size: var(--step-body);
  font-weight: 650;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.proj-layers dt:first-child { margin-top: 0; }
.proj-layers dd { margin: 0; max-width: 54ch; text-wrap: pretty; }
/* From a tablet up, the labels take their own column, so a reader can run
   down "Problem, Approach, Verification, Lesson" without reading the text. */
@media (min-width: 560px) {
  .proj-layers { grid-template-columns: 7.2em minmax(0, 1fr); column-gap: 20px; row-gap: 22px; }
  .proj-layers dt { margin-top: 0; }
}
.proj-repo-btn { align-self: flex-start; margin-top: 4px; }
.proj-section:nth-of-type(even) .btn-quiet { background: var(--bg); }
.proj-repo-note { margin-top: 10px; color: var(--muted); font-size: var(--step-small); }
.proj-read > .proj-metrics:last-child, .proj-story + .proj-metrics { margin-bottom: 18px; }

/* The stage: the figure, its caption and key, and the thumbnail strip. */
.gallery-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.lead-btn {
  appearance: none;
  border: 0;
  background: var(--surface);
  cursor: zoom-in;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  padding: 0;
  text-align: left;
  color: var(--ink);
  height: clamp(320px, 56svh, 600px);
  transition: transform 120ms var(--ease-out);
}
.proj-section:nth-of-type(even) .lead-btn { background: var(--bg); }
.lead-btn:active { transform: scale(0.985); }
.lead-media-area { position: relative; height: 100%; min-height: 100%; }
.lead-cap-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 16px;
  padding: 12px clamp(14px, 1.6vw, 20px) 14px;
}
.lead-cap { flex: 1 1 240px; min-width: 0; color: var(--muted); font-size: var(--step-small); line-height: 1.45; }
.lead-enlarge { flex: none; color: var(--muted); font-size: var(--step-small); }
.thumb-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 124px;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  padding-bottom: 4px;
}
.thumb-btn {
  appearance: none;
  cursor: pointer;
  padding: 6px;
  border: 0;
  background: var(--surface);
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  text-align: left;
  color: var(--muted);
  box-shadow: inset 0 0 0 2px transparent; /* taste-skill-ignore: selection ring in the viewer */
  transition: box-shadow 150ms ease, transform 100ms var(--ease-out);
}
.proj-section:nth-of-type(even) .thumb-btn { background: var(--bg); }
.thumb-btn[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); } /* taste-skill-ignore: selection ring */
.thumb-btn:active { transform: scale(0.95); }
.thumb-btn img, .thumb-btn video { transition: opacity 150ms ease; }
.thumb-label { font-size: 13px; line-height: 1.3; }
.thumb-backdrop {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 135% 135%;
  filter: blur(36px) brightness(0.8);
}
@media (max-width: 640px) {
  .lead-btn { height: 300px; }
}
@media (hover: hover) and (pointer: fine) {
  .thumb-btn:hover { color: var(--ink); }
}

/* ── Scroll area (the thumbnail strips) ─────────────────── */
.scroll-area { position: relative; min-width: 0; padding-bottom: 12px; }
.scroll-area > .thumb-rail { padding-bottom: 0; scrollbar-width: none; }
.scroll-area > .thumb-rail::-webkit-scrollbar { display: none; }
.scroll-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  padding: 1px;
  display: flex;
  flex-direction: column;
  touch-action: none;
  user-select: none;
  opacity: 0;
  transition: opacity 160ms var(--ease-out);
}
.scroll-area:not(.has-overflow) .scroll-bar { display: none; }
.scroll-area.is-active .scroll-bar { opacity: 1; }
.scroll-thumb {
  flex: 1;
  width: 0;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--ink) 22%, var(--bg));
  transition: background-color 150ms var(--ease-out);
}
.scroll-area.is-dragging .scroll-thumb { background: color-mix(in srgb, var(--ink) 38%, var(--bg)); }
@media (hover: hover) and (pointer: fine) {
  .scroll-thumb:hover { background: color-mix(in srgb, var(--ink) 38%, var(--bg)); }
}

/* ── Internships ───────────────────────────────────────── */
.intern + .intern { padding-top: 0; }
/* The internships page opens on the hangar door. */
.page-photo { margin: 32px 0 0; }
.page-photo img { display: block; width: 100%; aspect-ratio: 4 / 5; max-height: 70svh; object-fit: cover; background: var(--surface); }
.page-photo figcaption { padding-top: 8px; color: var(--muted); font-size: var(--step-small); }
@media (min-width: 760px) { .page-photo { margin-top: 0; } .page-head .page-photo { align-self: end; } }
.intern-title { font-size: var(--step-head); line-height: 1.04; letter-spacing: -0.025em; }
.intern-meta { margin-top: 10px; color: var(--muted); font-size: var(--step-small); }
.intern-text { margin-top: 22px; display: grid; gap: 14px; max-width: 54ch; }
.intern-text p { text-wrap: pretty; }
.intern-media { margin-top: 32px; }
@media (min-width: 760px) { .intern-media.col-side { margin-top: 0; } }
.intern-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gutter);
  margin: 32px 0;
}
.intern-photos figure { margin: 0; }
.intern-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface); }
.intern-photos img.is-contain { object-fit: contain; }
/* A portrait photo in the 4:3 frame sits on a blurred, cover-fit copy of
   itself, as the project figures do, in place of the bare bands that
   contain leaves either side. The copy is the same file, so it costs no
   second download; it overhangs the frame so the blur's soft edge is
   clipped away instead of showing as a pale rim. */
.intern-frame { position: relative; overflow: hidden; background: var(--surface); }
.intern-photos .intern-backdrop {
  position: absolute;
  top: -40px;
  left: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
  max-width: none;
  aspect-ratio: auto;
  filter: blur(36px) brightness(0.8);
}
.intern-frame img.is-contain {
  position: relative;
  background: none;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.28)); /* taste-skill-ignore: lifts the photo off its blurred copy, as in the project viewer */
}
.intern-photos figcaption { padding-top: 8px; color: var(--muted); font-size: var(--step-small); }
/* Alpha: what the two weeks held, beside the paragraph that says where. */
.alpha-did { margin-top: 32px; }
@media (min-width: 760px) { .alpha-did { margin-top: 0; } }
.alpha-did-title { margin: 0 0 14px; font-size: var(--step-body); font-weight: 600; }
.alpha-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 42ch; }
.alpha-list li { position: relative; padding-left: 22px; line-height: 1.45; text-wrap: pretty; }
.alpha-list li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); outline: 1.5px solid var(--ink); }

/* ── Beyond aero ───────────────────────────────────────── */
/* The page reuses the internship sections. Its one new part is a scan's
   stages: a real sequence, so the rows are numbered. */
/* The logo is white-backed, so in dark mode it reads as a plate. */
.beyond-logo { display: block; width: min(100%, 260px); height: auto; margin: 0 0 28px; border-radius: 6px; }
/* The logo is drawn on white. On the dark theme it is turned to light on
   black and the black is screened away, so it sits on the page itself. */
[data-theme="dark"] .beyond-logo { filter: invert(1) hue-rotate(180deg); mix-blend-mode: screen; border-radius: 0; }
.intern-media .sieve { margin-top: clamp(30px, 3.4vw, 48px); }
.beyond-pipeline-title { margin: 0 0 16px; font-size: var(--step-body); font-weight: 600; }
.beyond-pipeline { list-style: none; margin: 0; padding: 0; counter-reset: stage; display: grid; gap: 18px; }
.beyond-pipeline li {
  counter-increment: stage;
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr);
  column-gap: 10px;
}
.beyond-pipeline li::before { content: counter(stage); grid-row: span 2; color: var(--muted); font-variant-numeric: tabular-nums; }
.beyond-pipeline b { font-weight: 600; }
.beyond-pipeline span { color: var(--muted); font-size: var(--step-small); line-height: 1.45; }
/* One audited week as a field of dots: every listing Clover assessed
   appears, then all but the ones it shared step back. 23 by 14 is 322. */
.sieve { margin: clamp(28px, 3vw, 44px) 0 0; max-width: 460px; }
html:not(.has-js) .sieve { display: none; }
.sieve-field { display: grid; grid-template-columns: repeat(23, minmax(0, 1fr)); }
.sieve-field i {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 260ms ease, transform 460ms var(--ease-out), background-color 300ms ease;
  transition-delay: calc(var(--i, 0) * 2ms);
}
.sieve.is-in .sieve-field i { opacity: 1; }
.sieve.is-sorted .sieve-field i { opacity: 0.16; }
.sieve.is-sorted .sieve-field i.kept { opacity: 1; background: var(--accent); transform: scale(0.84); outline: 1.5px solid var(--ink); }
.sieve figcaption { margin-top: 14px; color: var(--muted); font-size: var(--step-small); line-height: 1.45; }
.sieve figcaption .data { color: var(--ink); font-weight: 580; }
@media (prefers-reduced-motion: reduce) {
  .sieve-field i { transition: none; }
  .foot-quote > span { transition: opacity 200ms ease; filter: none !important; }
  .ledger-frame img { transform: none; transition: opacity 220ms ease; }
}
@media print { .sieve-field i { opacity: 0.16; } .sieve-field i.kept { opacity: 1; } }

/* ── Carousels (internships, about) ─────────────────────── */
.carousel { position: relative; overflow: hidden; background: var(--surface); }
.internship-slide, .hobby-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  filter: blur(2px);
  transition: opacity 300ms var(--ease-out), filter 300ms var(--ease-out);
  pointer-events: none;
}
.internship-slide.active, .hobby-slide.active { opacity: 1; filter: blur(0); pointer-events: auto; }
/* The scrim is the one gradient allowed: neutral, under the caption only. */
.hobby-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 36px 14px 42px;
  line-height: 1.35;
  /* 68% black by the text's first line, so white text keeps 4.5:1 even over
     a white fuselage (at 0 to 60% across the box it fell to about 3.9:1). */
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.68) 32%, rgba(0, 0, 0, 0.86)); /* taste-skill-ignore: neutral scrim under a caption on a photo */
  font-size: var(--step-small);
  color: rgba(255, 255, 255, 0.92);
  pointer-events: none;
}
.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 18px;
  pointer-events: none;
  z-index: 2;
}
.hobby-dot, .internship-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  transition: background-color 200ms ease, transform 120ms var(--ease-out);
}
.hobby-dot::after, .internship-dot::after { content: ''; position: absolute; inset: -9px; }
.hobby-dot.active, .internship-dot.active { background: #FFFFFF; transform: scale(1.3); }
@media (hover: hover) and (pointer: fine) {
  .hobby-dot:hover, .internship-dot:hover { background: rgba(255, 255, 255, 0.8); }
}
.carousel-playpause, .carousel-arrow {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(20, 22, 24, 0.56);
  color: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  padding: 0;
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.carousel-playpause { top: 10px; right: 10px; width: 30px; height: 30px; overflow: hidden; }
/* The same button over a clip that plays by itself (site.js, clip-toggle):
   it sits in the clip's corner, so the clip's frame is its anchor. */
.gallery-split, .hobby-strip figure { position: relative; }
.clip-toggle[hidden] { display: none; }
.carousel-playpause:active { transform: scale(0.95); }
.carousel-playpause .icon-pause,
.carousel-playpause .icon-play {
  position: absolute;
  display: flex;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.carousel-playpause .icon-pause { opacity: 1; transform: scale(1); }
.carousel-playpause .icon-play  { opacity: 0; transform: scale(0.6); }
.carousel-playpause.is-paused .icon-pause { opacity: 0; transform: scale(0.6); }
.carousel-playpause.is-paused .icon-play  { opacity: 1; transform: scale(1); }
.carousel-arrow { top: 50%; width: 36px; height: 36px; transform: translateY(-50%); }
.carousel-arrow.arrow-prev { left: 10px; }
.carousel-arrow.arrow-next { right: 10px; }
.carousel-arrow:active { transform: translateY(-50%) scale(0.95); }
@media (hover: hover) and (pointer: fine) {
  .carousel-playpause:hover, .carousel-arrow:hover { background: rgba(20, 22, 24, 0.76); }
}

/* ── About ─────────────────────────────────────────────── */
.letter { display: grid; gap: 16px; max-width: 58ch; }
.letter p { text-wrap: pretty; }
.portrait img { object-position: center 18%; }
.facts { margin: clamp(32px, 4vw, 56px) 0 0; display: grid; max-width: 36rem; }
.facts > div {
  display: grid;
  grid-template-columns: minmax(7em, 0.4fr) minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
}
.facts dt { color: var(--muted); font-size: var(--step-small); padding-top: 2px; }
.facts dd { margin: 0; }
.learn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(18px, 2vw, 24px); }
.learn-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; }
.learn-name { font-size: var(--step-lead); font-weight: 580; line-height: 1.25; letter-spacing: -0.01em; }
.learn-state { align-self: baseline; padding: 1px 10px; background: var(--surface); font-size: var(--step-small); white-space: nowrap; }
.learn-why { grid-column: 1 / -1; max-width: 52ch; text-wrap: pretty; }
/* Three things, side by side: name, where it stands, why, what so far. */
.learn-cols { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); column-gap: var(--gutter); }
.learn-cols .learn-row { grid-template-columns: minmax(0, 1fr); align-content: start; }
.learn-cols .learn-state { justify-self: start; margin: 6px 0 8px; }
.learn-note { grid-column: 1 / -1; color: var(--muted); font-size: var(--step-small); }
.learn-date { margin-top: 18px; color: var(--muted); font-size: var(--step-small); }
.beyond-grid { row-gap: clamp(24px, 3vw, 40px); }
.learning-title { font-size: var(--step-lead); line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 20px; }
@media (min-width: 760px) { .learning { padding-top: 6px; } }
@media (max-width: 759.98px) { .learning { margin-top: 48px; } }
.learning .learn-name { font-size: var(--step-body); }
.learn-date { margin-top: 18px; }
.hobby-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.hobby-strip figure { margin: 0; }
.hobby-strip img, .hobby-strip video { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--surface); }
.hobby-strip figcaption { padding-top: 8px; color: var(--muted); font-size: var(--step-small); line-height: 1.4; }
@media (max-width: 899.98px) {
  .hobby-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hobby-strip li:first-child { grid-column: 1 / -1; }
  .hobby-strip li:first-child img { aspect-ratio: 4 / 3; }
}
.beyond-carousel { width: 100%; aspect-ratio: 1536 / 2730; max-height: 600px; }
.beyond-carousel .hobby-slide { background: #0B1118; overflow: hidden; }
.beyond-carousel .hobby-slide::before {
  content: '';
  position: absolute;
  inset: -24px;
  background: var(--bg-img, none) center / cover;
  filter: blur(18px) brightness(0.7);
}
.beyond-carousel .hobby-slide > img,
.beyond-carousel .hobby-slide > video { position: relative; object-fit: cover !important; }
/* The interests: an index by kind while it is left alone, and loose tiles
   once touched. Each one can be picked up and thrown; it knocks the others
   about and all of them find their way home. */
.beyond-graph { position: relative; background: var(--surface); overflow: hidden; padding: clamp(22px, 3vw, 44px) clamp(18px, 3vw, 44px) clamp(26px, 3.4vw, 52px); }
.kinds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 30px 20px; }
.kinds ul { list-style: none; margin: 0; padding: 0; display: grid; justify-items: start; gap: 8px; }
.kind { margin: 0 0 12px; color: var(--muted); font-size: var(--step-small); font-weight: 400; line-height: 1.3; }
.tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px 10px;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--step-body);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease;
}
.tile[data-photo]::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); outline: 1.5px solid var(--ink); }
.tile.is-on { background: var(--ink); color: var(--bg); }
.tile.is-on[data-photo]::before { outline-color: var(--bg); }
.has-js .tile { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.has-js .tile.is-held { cursor: grabbing; z-index: 3; }
.has-js .tile.is-loose { z-index: 2; }
@media (max-width: 1099.98px) { .kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 599.98px) { .kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile { padding: 8px 11px 9px; font-size: var(--step-small); } }
.graph-cap { margin-top: 10px; color: var(--muted); font-size: var(--step-small); }
.hobby-strip figure { transition: opacity 200ms ease; }
.hobby-strip.is-tracing li:not(.is-on) figure { opacity: 0.32; }
.hobby-strip li.is-on figcaption { color: var(--ink); }
.beyond-text { max-width: 46ch; text-wrap: pretty; }
@media (min-width: 1100px) {
  .beyond-carousel-cell { grid-column: 3 / span 3; }
  .beyond-graph-cell { grid-column: 6 / -1; }
}
@media (min-width: 760px) and (max-width: 1099.98px) {
  .beyond-carousel-cell { grid-column: 1 / span 5; }
  .beyond-graph-cell { grid-column: 6 / -1; }
}
@media (max-width: 759.98px) {
  .beyond-carousel { max-width: 320px; }
}

/* ── Lightbox (class-driven, always in DOM) ──────────────── */
html.lb-open { overflow: hidden; scrollbar-gutter: stable; }
#lightbox:focus { outline: none; }
#lightbox {
  touch-action: none;
  overscroll-behavior: contain;
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(14, 16, 17, 0.9);
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 52px);
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms var(--ease-out);
}
#lightbox.open { opacity: 1; pointer-events: auto; transition: opacity 200ms var(--ease-out); }
#lightbox-inner {
  position: relative;
  max-width: 1440px;
  width: 100%;
  transform: scale(0.98);
  opacity: 0;
  transition: transform 150ms var(--ease-out), opacity 150ms var(--ease-out);
}
#lightbox.open #lightbox-inner {
  transform: none;
  opacity: 1;
  transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
}
/* While the figure flies between the page and the viewer (openLightbox,
   closeLightbox), the viewer's own fades are held off: the figure has to
   stay opaque the whole way, and the backdrop is faded on its own. */
#lightbox.lb-flip, #lightbox.lb-flip #lightbox-inner { transition: none; }
.lb-caption-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  font-size: var(--step-small);
  color: #E4E8E6;
}
.lb-caption-row #lb-count { flex: none; font-variant-numeric: tabular-nums; }

/* ── Motion ───────────────────────────────────────────────
   The signature: the title's two lines rise from behind their own
   baselines on the first page of a visit, then the sentence and the action
   arrive. Every rule is gated so a page without script shows everything. */
@keyframes line-rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes part-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
html:not(.intro-seen) .hero-title .line > span { animation: line-rise 760ms var(--ease-out) backwards; }
html:not(.intro-seen) .hero-title .line:nth-child(2) > span { animation-delay: 110ms; }
html:not(.intro-seen) .hero-lede { animation: part-in 420ms var(--ease-out) 300ms backwards; }
html:not(.intro-seen) .hero-actions,
html:not(.intro-seen) .hero-creds { animation: part-in 420ms var(--ease-out) 380ms backwards; }
html:not(.intro-seen) .hero-rig > * { animation: part-in 420ms var(--ease-out) backwards; }
html:not(.intro-seen) .hero-rig > :nth-child(1) { animation-delay: 160ms; }
html:not(.intro-seen) .hero-rig > :nth-child(2) { animation-delay: 240ms; }
html:not(.intro-seen) .hero-rig > :nth-child(3) { animation-delay: 300ms; }
html:not(.intro-seen) .hero-rig > :nth-child(4) { animation-delay: 360ms; }
html:not(.intro-seen) .page-title,
html:not(.intro-seen) .page-lede,
html:not(.intro-seen) .page-statement,
html:not(.intro-seen) .page-index li,
html:not(.intro-seen) .page-head .facts > div,
html:not(.intro-seen) .page-photo,
html:not(.intro-seen) .proj-index li { animation: part-in 420ms var(--ease-out) backwards; }
html:not(.intro-seen) .page-photo { animation-delay: 140ms; }
/* The 404 page's seven pictures arrive one after another, 45ms apart. */
html:not(.intro-seen) .nf-grid li { animation: part-in 420ms var(--ease-out) backwards; animation-delay: calc(140ms + var(--i, 0) * 45ms); }
html:not(.intro-seen) .page-head .facts > div { animation-delay: 200ms; }
html:not(.intro-seen) .page-index li:nth-child(1), html:not(.intro-seen) .proj-index li:nth-child(-n+3) { animation-delay: 180ms; }
html:not(.intro-seen) .page-index li:nth-child(2), html:not(.intro-seen) .proj-index li:nth-child(n+4) { animation-delay: 230ms; }
html:not(.intro-seen) .page-lede,
html:not(.intro-seen) .page-statement { animation-delay: 90ms; }

/* Sections: the parts arrive in reading order as the section enters,
   heading first, 70ms apart, once. */
.js-reveal .section-reveal .rv {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
  transition-delay: calc(var(--rv, 0) * 70ms);
}
.js-reveal .section-reveal.visible .rv { opacity: 1; transform: none; }
.reveal-instant, .reveal-instant * { transition: none !important; }

/* ── For readers using their browser's translator ────────
   The note a Japanese-language browser gets: one line, bottom left, in ink.
   It is gone once the page has been translated (the translator marks <html>). */
.ja-hint {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: min(32rem, calc(100vw - 32px));
  padding: 6px 6px 6px 16px;
  background: var(--ink);
  color: var(--bg);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
}
.ja-hint p { margin: 0; line-break: strict; }
.ja-hint button {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  transition: transform 120ms var(--ease-out);
}
.ja-hint button:active { transform: scale(0.94); }
.ja-hint button:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
@media (hover: hover) and (pointer: fine) {
  .ja-hint button:hover { color: var(--accent); }
}
@media (prefers-reduced-motion: no-preference) {
  .ja-hint { animation: ja-hint-in 320ms var(--ease-out) 900ms backwards; }
  @keyframes ja-hint-in { from { opacity: 0; transform: translateY(8px); } }
}
html.translated-ltr .ja-hint, html.translated-rtl .ja-hint, html[lang^="ja"] .ja-hint { display: none; }
@media print { .ja-hint { display: none !important; } }

/* ── Reading progress (Projects) ─────────────────────────
   A line along the foot of the bar, as long as the share of the page read.
   Driven by the scroll itself, off the main thread. */
.read-progress { display: none; }
@supports (animation-timeline: scroll()) {
  .read-progress {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--accent-deep);
    transform-origin: left center;
    transform: scaleX(0);
    animation: read-progress linear both;
    animation-timeline: scroll(root block);
  }
  @keyframes read-progress { to { transform: scaleX(1); } }
}
@media print { .read-progress { display: none !important; } }

/* ── Theme swap ───────────────────────────────────────────
   The whole page changes as one object: a view transition crossfades a
   snapshot, and per-element colour transitions are held off underneath. */
.theme-swap *, .theme-swap *::before, .theme-swap *::after { transition: none !important; }
/* ── Moving between pages ─────────────────────────────────
   A cross-document view transition. The bar is its own layer and holds
   still, the yellow mark under the current page slides to the page you
   chose, and the page under the bar fades out fast while the new one
   fades in and settles 10px, all inside 300ms. Browsers without cross-page
   view transitions load the page as before. */
@view-transition { navigation: auto; }
nav.bar { view-transition-name: site-bar; }
.nav-mark { view-transition-name: nav-mark; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes vt-fade-in { from { opacity: 0; } }
::view-transition-old(root) { animation: 120ms var(--ease-out) both vt-out; }
::view-transition-new(root) { animation: 280ms var(--ease-out) 40ms both vt-in; }
/* The bar is near enough the same on every page that it swaps in one
   frame; crossfading it ghosted the links that shift on Projects. */
::view-transition-old(site-bar) { animation: none; opacity: 0; }
::view-transition-new(site-bar) { animation: none; }
::view-transition-group(nav-mark) { animation-duration: 300ms; animation-timing-function: var(--ease-in-out); }
/* The nozzle plot carried from the hero into its chapter (initPlotFlight):
   400ms on the drawer curve, a little longer than the pages' own change, so
   it lands after they have settled. */
::view-transition-group(nozzle-plot) { animation-duration: 400ms; animation-timing-function: var(--ease-drawer); }
::view-transition-old(nozzle-plot), ::view-transition-new(nozzle-plot) { animation-duration: 400ms; }
/* The theme switch keeps its plain crossfade of the whole page. */
/* The theme opens from the button that was pressed: the new page grows as a
   circle from the toggle over the old one, which holds still underneath.
   The bar joins the page for this one transition so the circle crosses it. */
.theme-swap nav.bar, .theme-swap .nav-mark { view-transition-name: none; }
@keyframes theme-iris {
  from { clip-path: circle(0px at var(--swap-x, 100%) var(--swap-y, 0px)); }
  to { clip-path: circle(var(--swap-r, 150vmax) at var(--swap-x, 100%) var(--swap-y, 0px)); }
}
.theme-swap::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
.theme-swap::view-transition-new(root) { animation: 560ms var(--ease-in-out) both theme-iris; mix-blend-mode: normal; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root) { animation: 120ms ease both vt-out; }
  ::view-transition-new(root) { animation: 160ms ease both vt-fade-in; }
  ::view-transition-group(*) { animation-duration: 0s; }
}
.theme-swap-fallback *, .theme-swap-fallback *::before, .theme-swap-fallback *::after {
  transition: background-color 220ms ease, color 220ms ease, fill 220ms ease !important;
}
.theme-swap-fallback .theme-toggle .icon-moon,
.theme-swap-fallback .theme-toggle .icon-sun {
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out) !important;
}

/* ── Reduced motion: no travel, short fades ──────────────
   Movement goes: rises, slides, rolls, scaled entrances, the frame that
   follows the ledger. Fades and colour changes that say something changed
   stay, at 150–200ms. A blanket 0.01ms on every transition used to cut those
   too, so the menus, the viewer and the theme snapped in as if broken. */
@keyframes part-in-still { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal .section-reveal .rv { transform: none; transition: opacity 200ms ease; transition-delay: 0s; }
  .hero-title .line > span { animation: none !important; }
  html:not(.intro-seen) .hero-lede, html:not(.intro-seen) .hero-actions, html:not(.intro-seen) .hero-creds,
  html:not(.intro-seen) .hero-rig > *, html:not(.intro-seen) .page-title, html:not(.intro-seen) .page-lede,
  html:not(.intro-seen) .page-statement, html:not(.intro-seen) .page-index li,
  html:not(.intro-seen) .page-head .facts > div, html:not(.intro-seen) .page-photo,
  html:not(.intro-seen) .proj-index li, html:not(.intro-seen) .nf-grid li { animation-name: part-in-still; animation-duration: 200ms; }
  .btn .icon-down { transform: none !important; }
  .ledger-frame { transition: none; }
  .jump-menu { transition: opacity 160ms ease; }
  .theme-toggle .icon-moon, .theme-toggle .icon-sun,
  [data-theme="dark"] .theme-toggle .icon-moon,
  [data-theme="dark"] .theme-toggle .icon-sun { transform: none; transition: opacity 200ms ease; }
  #lightbox-inner, #lightbox.open #lightbox-inner { transform: none; }
  .lb-media-el.settling { transition: none; }
  .seg-thumb { transition: none; }
  .odo-col { transition: opacity 200ms ease; }
  .rig-strike, .rig-num.is-withdrawn .rig-strike { transition: none; }
}

/* ── Print ────────────────────────────────────────────────
   For a reader who prints a page or saves it as a PDF for a hiring file.
   The controls go (the bar, menus, thumbnail strips, toggles, the viewer,
   the 3D turntable, the slideshow's buttons), grounds print white in the
   light palette whatever the theme, every section is shown however far
   the reader scrolled, each project starts a page with its figure kept
   whole beside its table, and the addresses behind the links are printed
   in full. Type steps down to print sizes. The name and the address head
   the first page; the site and the page number foot every page. */
.print-head { display: none; }
/* Touch: the footer and contact links, the wordmark, the "every project"
   link and the carousel dots get a 44px tap height (WCAG 2.2 asks 24px; 44 is
   the comfortable size), without being drawn any larger. */
@media (pointer: coarse) {
  .foot-links { row-gap: 0; }
  .foot-links a, .band-links li > a, .ledger-more .text-link { display: inline-flex; align-items: center; min-height: 44px; }
  .band-links { gap: 0; }
  .brand { padding: 13px 8px; margin: -13px -8px; }
  .carousel-dots { gap: 26px; }
  .hobby-dot::after, .internship-dot::after { inset: -13px; }
}

/* Without script: the <noscript> copies tools/build.mjs writes from the same
   data site.js renders, shown only when it cannot run. */
.static-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.static-list a { font-weight: 580; }
.static-k { color: var(--muted); }
.static-tools p { margin: 0 0 8px; }
.static-group { padding-top: clamp(48px, 6vw, 80px); }
.static-proj { padding-block: clamp(32px, 4vw, 56px); }
.static-proj > * + * { margin-top: 14px; }
.static-proj .proj-title { max-width: none; }
.static-fig { margin: 20px 0 0; max-width: 860px; }
.static-fig img { display: block; width: 100%; height: auto; background: var(--surface); }
.static-fig figcaption { margin-top: 8px; color: var(--muted); font-size: var(--step-small); }

@media print {
  :root, [data-theme="dark"] {
    color-scheme: light;
    --bg: #FFFFFF; --surface: #EEF0EE; --ink: #1B1E20; --muted: #565D60;
    --accent: #F2C230; --accent-ink: #1B1E20; --accent-deep: #7A5C00;
    --step-small: 11px; --step-body: 13.5px; --step-lead: 17px; --step-head: 26px; --step-display: 40px;
    --section: 28px;
  }
  @page {
    margin: 14mm 14mm 16mm;
    @bottom-left { content: "Mark Lorenz Yamanaka, www.mlyamanaka.com"; font: 8.5pt "Atkinson Hyperlegible Next", sans-serif; color: #565D60; }
    @bottom-right { content: counter(page) " / " counter(pages); font: 8.5pt "Atkinson Hyperlegible Next", sans-serif; color: #565D60; }
  }
  html { scroll-behavior: auto; }
  body { background: #FFFFFF; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .print-head { display: block; margin: 0 0 6mm; color: var(--muted); font-size: var(--step-small); }

  nav.bar, .skip, #lightbox, .jump-menu, .rig-switch, .ledger-preview, .holo, .beyond-graph, .graph-cap,
  .scroll-area, .thumb-rail, .lead-enlarge, .key-below, .rev-toggle, .built-jump, .band-actions, .copy-btn,
  .carousel-playpause, .carousel-arrow, .carousel-dots, .foot-links, .foot-quote, .theme-toggle,
  .hero-actions, .nf-action { display: none !important; }
  /* The page-head photographs (the hangar door, the portrait) at a size
     that leaves the page for its text. */
  .page-photo img { width: auto; max-width: 100%; max-height: 95mm; }
  .intern-backdrop { display: none !important; }
  .intern-frame img { filter: none !important; }

  .js-reveal .section-reveal .rv, .section-reveal .rv { opacity: 1 !important; transform: none !important; }
  .hero { min-height: 0; }
  .hero-rig, .band, .proj-section:nth-of-type(even), .proj-section { background: none !important; }
  .hero-copy, .hero-rig { padding-top: 0; padding-bottom: 6mm; }
  .page-head { padding: 0 0 6mm; }
  .sec { padding: 6mm 0; }

  /* A project chapter: its own page, the figure whole and its callouts on
     it. The figure prints at its own shape, so the callout layer (laid
     over a letterboxed frame on screen) simply covers the picture. */
  .proj-section { padding: 0; break-before: page; }
  .built-head { break-before: page; padding: 0 0 4mm; }
  .built-head + .proj-section { break-before: auto; }
  .proj-stage { position: static !important; }
  .lead-btn { height: auto !important; display: block; background: none !important; cursor: auto; transform: none !important; }
  .lead-media-area { height: auto !important; min-height: 0 !important; width: fit-content; max-width: 100%; margin: 0 auto; background: none !important; overflow: visible !important; }
  .lead-media-area > div:not(.callouts) { display: none !important; }
  .lead-media-area > img, .lead-media-area > video {
    position: static !important; display: block; width: auto !important; height: auto !important;
    max-width: 100%; max-height: 105mm; margin: 0 auto; padding: 0 !important; filter: none !important; visibility: visible !important;
  }
  .lead-media-area > .callouts { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; }
  .lead-cap-row { padding: 2mm 0 0; }
  .lead-btn, .metrics, .rev, .proj-layers dt, figure, .intern-photos figure, .hobby-strip li { break-inside: avoid; }
  .proj-title, .sec-title, .intern-title, .proj-layers dt { break-after: avoid; }

  /* The links' destinations, spelled out. */
  .proj-repo-btn { min-height: 0; padding: 0; gap: 0; background: none !important; }
  .proj-repo-btn svg { margin-right: 8px; }
  .proj-repo-btn::after { content: ": " attr(href); font-weight: 400; }
  .band-links a[href^="http"]::after { content: " (" attr(href) ")"; }
  .band { padding: 6mm 0 0; break-inside: avoid; }
  .site-foot { padding: 4mm 0 0; }
}
