/* ── lab variant 2 (content.THEME = "lab-variant2"; markup in lab_variant2.py) ──────────────────────
   A ruled layout (after pyxis.art) with large title bands that stay under the menu while scrolling, and an
   explore menu (after nts.live): a drawer on the right on wide screens, one row under the top bar on phones.
   This stylesheet stands alone: style.css and theme-lab.css are not loaded. All text in Figtree. */

:root {
  --accent: #FF4D14;                 /* highlight colour */
  --on-accent: #111111;
  --page: #ffffff;
  --ink: #111111;
  --line: #111111;
  --muted: #5c5c5c;
  --paper: #ffffff;
  --text: var(--ink);
  --drawer: #ffffff;
  --dink: #111111;
  --tileline: #111111;
  /* research-interest bricks */
  --bink: #1f1f1f;
  --bpaper: #ffffff;
  --bg-top: #e6e5e1; --bg-side: #b5b4af; --bg-label: #2d2d2b;
  --head: 'Figtree', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #04171a; --ink: #d9f7ec; --line: #5f8a7c; --muted: #9fbdb2; --paper: #0a2b24;
    --drawer: #111111; --dink: #ffffff; --tileline: #555555;
    --bink: #C0F3E2; --bpaper: #0a2b24;
    --bg-top: #3a4a45; --bg-side: #26332f; --bg-label: #c9d6d1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #04171a; --ink: #d9f7ec; --line: #5f8a7c; --muted: #9fbdb2; --paper: #0a2b24;
  --drawer: #111111; --dink: #ffffff; --tileline: #555555;
  --bink: #C0F3E2; --bpaper: #0a2b24;
  --bg-top: #3a4a45; --bg-side: #26332f; --bg-label: #c9d6d1;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--page); overflow-y: scroll; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.v2 {
  display: flex; flex-direction: column;
  min-height: 100vh; margin: 0;
  background: var(--page); color: var(--ink);
  font-family: var(--head); font-size: 17px; line-height: 1.5;
}
.v2 a { color: inherit; text-decoration: none; }
.v2 h1, .v2 h2, .v2 h3, .v2 p { margin: 0; }
.v2 :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── top bar: stays on screen ─────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--page); }
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 68px; padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 19px;
}
.home-btn { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; margin-right: 8px; }
.home-btn img { display: block; width: 36px; height: 36px; transition: transform .15s; }
.home-btn:hover img { transform: scale(1.12); }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; margin: 0; padding: 0 14px;
  font: inherit; color: var(--ink); background: none; border: 0; cursor: pointer;
}
.theme-toggle > span { display: inline-flex; align-items: center; gap: 8px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle:hover { color: var(--accent); }
.theme-toggle .to-light { display: none; }
:root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .to-dark { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .to-light { display: inline-flex; }
}
.site-header nav { display: flex; flex-wrap: wrap; gap: 6px; }
.site-header nav a { display: inline-flex; align-items: center; height: 44px; padding: 0 14px; }
.site-header nav a:hover { color: var(--accent); }
.site-header nav a.current { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.site-header .site-name { font-weight: 700; padding: 0 8px; margin-right: auto; }

/* ── layout ───────────────────────────────────────────────────────────────── */
.layout { display: flex; flex: 1 0 auto; align-items: stretch; }
.v2 main { flex: 1 1 0; min-width: 0; padding-bottom: 88px; }

.pagehead { padding: 28px 60px 0 14px; }
.pagehead h1 { margin-bottom: 24px; font-size: clamp(56px, 6.7vw, 96px); line-height: 1; font-weight: 700; letter-spacing: -.04em; }
.lede { max-width: 1040px; font-size: clamp(19px, 1.75vw, 25px); line-height: 1.42; }
.v2 .lede a, .v2 .ref a, .v2 .viewer-side p a, .v2 .viewer-side li a, .v2 .companion-intro a, .v2 .card-text a {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}
.v2 .lede a:hover, .v2 .ref a:hover, .v2 .viewer-side a:hover { color: var(--accent); }

/* ── title bands ──────────────────────────────────────────────────────────── */
.band { max-width: 1040px; margin-top: 88px; }
.pagehead + .band:not(:has(.row)) { margin-top: 16px; }          /* publications, explore: closer to the page title */
.band > h2, .v2 main.wide:not(.viewer-page) > h2 {
  position: sticky; top: 67px; z-index: 8;                       /* right under the top bar (1px over its rule) */
  padding: 12px 14px 14px;
  background: var(--page);
  border: 1px solid var(--line); border-left: 0;
  font-size: 40px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em;
}
.inset { display: flex; flex-wrap: wrap; }
.inset::before { content: ""; flex: 1 1 260px; }
.box { flex: 2.4 1 460px; min-width: 0; border: 1px solid var(--line); border-top: 0; }
.box > * + * { border-top: 1px solid var(--line); }
.empty { padding: 16px; color: var(--muted); }

/* contact */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-height: 58px; padding: 8px 16px; font-size: 19px; }
.row-label { flex: 0 0 110px; font-size: 14px; color: var(--muted); }
.row-value { display: flex; flex: 1 1 220px; min-width: 0; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.row-value svg { flex: none; width: 22px; height: 22px; }
.row-value > span { min-width: 0; }
a.row:hover .row-value, a.row:hover .row-go { color: var(--accent); }

/* grants and awards */
.award { padding: 16px; }
.award h3 { margin-bottom: 8px; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.award p { font-size: 18px; line-height: 1.45; }
.award strong { display: block; }
.award .pill { margin-top: 10px; }

/* publications: Chicago-style references with a hanging indent */
.ref { padding: 16px 16px 16px 40px; text-indent: -24px; font-size: 18px; line-height: 1.55; }
.ref em { font-style: italic; }
.ref-url { overflow-wrap: anywhere; }

.pill { display: inline-block; padding: 3px 10px; border: 1px solid var(--line); font-size: 12px; letter-spacing: .03em; }
.v2 a.pill:hover { background: var(--ink); color: var(--page); }

/* ── explore: wide cards ──────────────────────────────────────────────────── */
.xcard { display: flex; flex-wrap: wrap; }
.xcard-art { position: relative; display: block; flex: 1 1 260px; min-height: 240px; overflow: hidden; border-right: 1px solid var(--line); }
.xcard-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-image { background: #fff; }
.art-notebook { background: #085041; }
.art-blank { background: #005778; }
.code { padding: 2px 6px; background: #111; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.xcard-art .code { position: absolute; top: 10px; right: 10px; }
.bars { position: absolute; display: flex; flex-direction: column; }
.bars > span { display: block; background: rgba(192, 243, 226, .3); }
.xcard-art .bars { left: 24px; right: 24px; top: 56px; gap: 14px; }
.xcard-art .bars > span { height: 7px; }
.xcard-body { display: flex; flex-direction: column; flex: 1 1 300px; min-width: 0; }
.xcard-title { padding: 16px 16px 8px; font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.xcard-title a:hover { color: var(--accent); }
.xcard-text { padding: 0 16px 18px; font-size: 17px; line-height: 1.5; }
.xcard-links { margin-top: auto; border-top: 1px solid var(--line); }
.xcard-links a { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; font-size: 16px; font-weight: 700; }
.xcard-links a + a { border-top: 1px solid var(--line); }
.xcard-links a:hover { background: var(--accent); color: var(--on-accent); }

/* ── research interests: stacked bricks ───────────────────────────────────── */
.band-bricks .inset::before { flex: 0 0 158px; }
.band-bricks .box {                  /* no frame: the bricks and their boxes float under the title band */
  border: 0; container-type: inline-size; flex: 1 1 460px;
  --ink: var(--bink); --paper: var(--bpaper); --raised: var(--bpaper);
}
.bricks { position: relative; width: 978px; height: 580px; margin: 0; padding: 115px 24px 0; zoom: .9; }   /* drawn at 978px, shown at 90% */
.brick {
  position: relative; height: 104px;
  --cur-t: var(--bg-top); --cur-s: var(--bg-side);
  --cur-label: var(--bg-label); --cur-box: var(--raised); --cur-line: var(--ink);
}
.brick:has(.shape:hover, .brick-box:hover) {
  --cur-t: var(--top); --cur-s: var(--side);
  --cur-label: #fff; --cur-box: var(--top); --cur-line: var(--side);
}
@media (hover: none) {
  .brick { --cur-t: var(--top); --cur-s: var(--side); --cur-label: #fff; --cur-box: var(--top); --cur-line: var(--side); }
}
.brick-slab { position: absolute; left: 50%; top: 0; width: 320px; height: 184px; margin-left: -160px; overflow: visible; pointer-events: none; }
.brick-slab .shape { pointer-events: auto; }
.brick-slab .outline { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.brick-slab .side { fill: var(--cur-s); stroke: none; }
.brick-slab .top { fill: var(--cur-t); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.brick-slab .bevel { fill: none; stroke: rgba(255, 255, 255, .4); stroke-width: 1.5; pointer-events: none; }
.brick-slab text {
  fill: var(--cur-label); text-anchor: middle; pointer-events: none;
  font: 700 12px var(--head); letter-spacing: .14em;
}
.brick-slab .side, .brick-slab .top { transition: fill 120ms; }
.brick-side { position: absolute; top: calc(74px + var(--dy)); width: calc(50% - 131px - var(--gap)); transform: translateY(-50%); }
.brick-left .brick-side { left: 0; }
.brick-right .brick-side { right: 0; }
.brick-line { position: absolute; overflow: visible; pointer-events: none; }
.brick-line path { fill: none; stroke: var(--cur-line); stroke-width: 1.5; transition: stroke-width 120ms; }
.brick:has(.shape:hover, .brick-box:hover) .brick-line path { stroke-width: 3; }
.brick-left .brick-line { left: 100%; }
.brick-right .brick-line { right: 100%; transform: scaleX(-1); }
.brick-box {
  position: relative; display: grid; gap: 6px; margin: 0; padding: 10px; list-style: none;
  background: var(--cur-box); border: 1.12px solid var(--line);
  transition: transform 120ms ease-in-out, box-shadow 120ms ease-in-out, background-color 120ms;
}
@media (hover: hover) {
  .brick:has(.shape:hover, .brick-box:hover) .brick-box { transform: translate(6px, -6px); box-shadow: -12px 12px 0 var(--ink); }
  .brick-right:has(.shape:hover, .brick-box:hover) .brick-box { transform: translate(-6px, -6px); box-shadow: 12px 12px 0 var(--ink); }
}
.brick-box li { padding: 5px 10px; font-size: 13.5px; line-height: 1.4; background: var(--paper); border: 1.12px solid var(--line); }
/* not enough room for the staggered drawing: one slab beside its box per row */
@container (max-width: 879px) {
  .bricks { width: auto; height: auto; padding: 20px 24px 4px; }
  .brick { display: flex; align-items: center; gap: 16px; height: auto; margin: 0 0 16px; }
  .brick-right { flex-direction: row-reverse; }
  .brick-slab { position: relative; left: auto; top: auto; flex: none; width: 200px; height: 115px; margin: 0; }
  .brick-slab text { font-size: 19px; }
  .brick-side { position: relative; top: auto; flex: 1; width: auto; min-width: 0; transform: none; }
  .brick-line { display: none; }
}
/* research interests given as a plain list of strings */
.box ul.items { margin: 0; padding: 0; list-style: none; }
.box ul.items li { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.box ul.items li:last-child { border-bottom: 0; }

/* ── explore drawer (wide screens) ────────────────────────────────────────── */
.drawer {
  position: relative; flex: 0 0 224px; min-width: 0; padding: 8px;
  background: var(--drawer); color: var(--dink);
  border-left: 1px solid var(--line);
  transition: flex-basis .35s ease;
}
.drawer.open { flex-basis: min(600px, 55vw); }
.drawer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; align-content: start; }
.drawer-head { position: relative; min-height: 164px; padding: 12px; border: 1px solid var(--tileline); }
.drawer.open .drawer-head { grid-row: span 2; }
.drawer-title { margin-bottom: 12px !important; font-size: 28px; line-height: 1; font-weight: 900; text-transform: uppercase; }
.drawer-blurb { font-size: 15px; line-height: 1.4; }
.drawer-toggle {                      /* the "+" tab that comes out of the Explore tile */
  position: absolute; left: -54px; top: 12px; z-index: 5;
  width: 54px; height: 48px; padding: 0; cursor: pointer;
  border: 1px solid var(--tileline); border-right: 0;
  background: var(--drawer); color: var(--dink);
  font: 400 30px/1 var(--head);
}
.drawer-toggle span { display: block; transition: transform .3s ease; }
.drawer.open .drawer-toggle span { transform: rotate(45deg); }

.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-width: 0; height: 164px; padding: 10px 12px; overflow: hidden;
  border: 1px solid var(--tileline);
}
.v2 a.tile { color: #fff; }
.v2 a.tile:hover { filter: brightness(1.12); }
.tile-plot, .tile-published { background: #005778; }
.tile-plot.has-img { background: #222233; }
.tile-notebook { background: #085041; }
.v2 a.tile-all { background: var(--accent); color: var(--on-accent); }
.tile > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .15) 0%, rgba(0, 0, 0, .35) 45%, rgba(0, 0, 0, .88) 100%); }
.tile .bars { left: 14px; right: 14px; top: 42px; gap: 8px; }
.tile .bars > span { height: 5px; }
.tile-top, .tile-name { position: relative; display: flex; }
.tile-top { justify-content: space-between; align-items: flex-start; }
.tile-arrow { font-size: 20px; line-height: 1; font-weight: 700; }
.tile-name { gap: 8px; align-items: flex-end; font-size: 15px; line-height: 1.2; font-weight: 800; text-transform: uppercase; }
.tile-name svg { flex: none; width: 16px; height: 16px; stroke-width: 2.4; }
.tile-name > span { min-width: 0; overflow-wrap: break-word; }

.drawer.open .tile { animation: dr-open .35s ease both; animation-delay: var(--d); }
.drawer.closed .tile { animation: dr-closed .3s ease both; animation-delay: var(--d); }
@keyframes dr-open { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes dr-closed { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }

.xm { display: none; }                /* the phone menu */

/* ── footer ───────────────────────────────────────────────────────────────── */
.site-footer { padding: 14px 40px 28px 14px; border-top: 1px solid var(--line); text-align: right; font-size: 13px; letter-spacing: .08em; color: var(--muted); }

/* ── start page ───────────────────────────────────────────────────────────── */
.home-top { display: flex; justify-content: flex-end; padding: 8px 14px 0; font-size: 19px; }
.v2.home main { flex: 1 0 auto; padding: 136px 60px 64px clamp(28px, 5.6vw, 96px); }
.home h1 { margin-bottom: 24px; font-size: clamp(56px, 6.7vw, 96px); line-height: 1; font-weight: 700; letter-spacing: -.04em; }
.v2 .home-tagline { margin-bottom: 28px; font-size: 25px; line-height: 1.4; font-weight: 600; }
.v2 .home-intro { max-width: 760px; margin-bottom: 40px; font-size: 25px; line-height: 1.42; }
.v2 a.start {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 48px;
  min-height: 58px; padding: 0 22px;
  border: 1px solid var(--line); background: var(--accent); color: var(--on-accent);
  font-size: 22px; font-weight: 700;
}
.v2 a.start:hover { background: var(--ink); color: var(--page); }

/* ── figure and notebook pages (opened from explore) ──────────────────────── */
.v2 main.viewer-page { padding: 24px 24px 64px; }
.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto 1fr; gap: 0 32px; align-items: start; }
.v2 .viewer-title { grid-column: 1; grid-row: 1; margin-bottom: 14px; font-size: 32px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.viewer-frame { grid-column: 1; grid-row: 2; border: 1px solid var(--line); background: #fff; }
.viewer-frame iframe { display: block; width: 100%; height: clamp(520px, 78vh, 940px); border: 0; background: #fff; }
.viewer-frame[data-w] { overflow: hidden; }
.viewer-frame[data-w] iframe { height: auto; max-width: none; transform-origin: 0 0; }
.viewer-side { position: sticky; top: 92px; grid-column: 2; grid-row: 2; }
.viewer-side h2 { margin: 28px 0 12px; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 20px; font-weight: 700; text-transform: capitalize; }
.viewer-side h2:first-of-type { margin-top: 0; }
.v2 .viewer-side p, .viewer-side li { margin: 0 0 12px; font-size: 15px; line-height: 1.65; }
.v2 .viewer-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.v2 .viewer-licence { margin-top: 18px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.viewer-licence a { text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 860px) {
  .viewer { grid-template-columns: 1fr; grid-template-rows: none; row-gap: 24px; }
  .v2 .viewer-title, .viewer-frame, .viewer-side { grid-column: 1; grid-row: auto; margin-bottom: 0; }
  .viewer-side { position: static; }
  .viewer-frame iframe { height: 70vh; }
}

/* ── companion index and single-picture pages ─────────────────────────────── */
.v2 main.wide:not(.viewer-page):not([data-page="explore"]) { padding: 24px 0 88px; }
.v2 main.wide:not(.viewer-page) > h1:not(.sr-only), .v2 main.wide > .figure, .v2 main.wide > .download, .v2 .companion-intro { margin: 0 14px 20px; }
.v2 main.wide:not(.viewer-page) > h2 { margin: 40px 0 0; font-size: 28px; border-right: 0; }
.companion-intro { max-width: 68ch; }
.v2 main > img.figure { display: block; max-width: calc(100% - 28px); height: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; padding: 24px 14px 0; }
.card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); }
.v2 .card-title { padding: 14px 58px 10px 16px; font-size: 18px; font-weight: 700; line-height: 1.3; }
.card-title::before { display: block; margin-bottom: 5px; color: var(--accent); font-size: 12px; letter-spacing: .1em; }
.card-icon { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 46px; height: 46px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.v2 .card-text { padding: 4px 16px 16px; font-size: 15px; line-height: 1.6; }
.card-preview { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.card-preview img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.card-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding: 12px 16px; }

/* ── phones ───────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .site-header { flex-wrap: nowrap; gap: 2px; min-height: 57px; height: 57px; padding: 0 6px; font-size: 16px; }
  .home-btn { width: 40px; margin: 0; }
  .home-btn img { width: 32px; height: 32px; }
  .site-header .theme-toggle { padding: 0; }
  .theme-toggle > span > span { display: none; }
  .site-header nav { flex-wrap: nowrap; gap: 2px; margin-left: auto; }
  .site-header nav a { padding: 0 9px; }
  .site-header .site-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

  /* the explore menu: one row under the top bar; the tiles and the slanted tab hang over the page */
  .drawer { display: none; }
  .xm { display: block; position: relative; background: var(--drawer); color: var(--dink); }
  .xm-row {
    display: flex; width: 100%; align-items: center; gap: 12px; height: 52px; padding: 0 12px;
    border: 0; border-bottom: 1px solid var(--tileline); cursor: pointer;
    background: var(--drawer); color: var(--dink); font-family: var(--head); text-align: left;
  }
  .xm-count { flex: none; width: 34px; padding: 3px 0; text-align: center; background: var(--dink); color: var(--drawer); font-size: 16px; font-weight: 900; }
  .xm-label { flex: 1; font-size: 18px; font-weight: 900; text-transform: uppercase; }
  .xm-hang { position: absolute; left: 0; right: 0; top: 100%; pointer-events: none; }
  .xm-panel { display: grid; grid-template-rows: 0fr; visibility: hidden; pointer-events: auto; transition: grid-template-rows .35s ease, visibility .35s; }
  .xm.open .xm-panel { grid-template-rows: 1fr; visibility: visible; }
  .xm-clip { min-height: 0; overflow: hidden; }
  .xm-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px;
    max-height: calc(100vh - 180px); max-height: calc(100dvh - 180px); overflow-y: auto; overscroll-behavior: contain;
    background: var(--drawer); border-bottom: 1px solid var(--tileline);
  }
  .xm-grid .tile { height: 132px; opacity: 0; transform: translateY(-14px); transition: opacity .25s ease var(--d), transform .25s ease var(--d); }
  .xm.open .xm-grid .tile { opacity: 1; transform: none; }
  .xm-tabline { display: flex; justify-content: flex-end; height: 46px; }
  .xm-slant { display: block; flex: none; pointer-events: auto; }
  .xm-slant .fill { fill: var(--drawer); }
  .xm-slant .line { fill: none; stroke: var(--tileline); stroke-width: 1; }
  .xm-tab {
    display: flex; align-items: center; justify-content: center; width: 58px; padding: 0 6px 0 0;
    border: 0; border-bottom: 1px solid var(--tileline); cursor: pointer; pointer-events: auto;
    background: var(--drawer); color: var(--dink);
  }
  .xm-tab svg { transition: transform .3s ease; }
  .xm.open .xm-tab svg { transform: rotate(180deg); }

  .v2 main { padding-bottom: 48px; }
  .pagehead { padding: 22px 14px 0; }
  .has-menu .pagehead { padding-top: 46px; }          /* room for the slanted tab */
  .pagehead h1 { margin-bottom: 16px; font-size: clamp(38px, 11.8vw, 46px); line-height: 1.05; overflow-wrap: break-word; }
  .lede { font-size: 18px; line-height: 1.48; }

  .band { margin-top: 48px; }
  .pagehead + .band:not(:has(.row)) { margin-top: 8px; }
  .band > h2, .v2 main.wide:not(.viewer-page) > h2 { top: 56px; padding: 10px 14px 12px; border-right: 0; font-size: 26px; }
  .has-menu .band > h2 { top: 108px; padding-right: 84px; }
  .inset { display: block; margin-left: 20px; }
  .inset::before { content: none; }
  .box { border-right: 0; }
  .band-bricks .inset { margin-left: 0; }            /* no frame here, so the bricks sit centred */

  .row { gap: 2px 12px; padding: 10px 14px; font-size: 16px; }
  .row-label { flex-basis: 100%; font-size: 13px; }
  .row-value { flex: 1 1 0; }
  .award { padding: 14px; }
  .award h3 { font-size: 21px; }
  .award p { font-size: 16px; }
  .ref { padding: 14px 14px 14px 32px; text-indent: -18px; font-size: 16px; }

  .xcard { flex-direction: column; flex-wrap: nowrap; }
  .xcard-art { flex: none; width: 100%; min-height: 0; aspect-ratio: 900 / 616; border-right: 0; border-bottom: 1px solid var(--line); }
  .xcard-body { flex: none; }
  .xcard-title { font-size: 22px; }
  .xcard-text { font-size: 16px; }

  .site-footer { padding: 12px 14px 16px; font-size: 12px; }

  .home-top { padding: 8px 8px 0; }
  .home-top .theme-toggle { padding: 0; }
  .v2.home main { padding: 84px 20px 48px; }
  .home h1 { margin-bottom: 20px; font-size: clamp(48px, 15.4vw, 60px); }
  .home h1 span { display: block; }
  .v2 .home-tagline { margin-bottom: 20px; font-size: 17px; }
  .v2 .home-intro { margin-bottom: 32px; font-size: 19px; line-height: 1.45; }
  .v2 a.start { display: flex; min-height: 56px; padding: 0 20px; font-size: 21px; }

  .v2 main.viewer-page { padding: 18px 14px 48px; }
  .v2 .viewer-title { font-size: 24px; }
}
/* very narrow phones: tighten the top bar so the three pages still fit on one line */
@media (max-width: 360px) {
  .site-header { padding: 0 2px; font-size: 15px; }
  .home-btn { width: 34px; }
  .home-btn img { width: 28px; height: 28px; }
  .site-header .theme-toggle { min-width: 36px; }
  .site-header nav a { padding: 0 6px; }
}
/* phones: slabs on top of their boxes */
@media (max-width: 520px) {
  .bricks { width: auto; height: auto; padding: 18px 14px 2px; zoom: 1; }
  .band-bricks .brick { display: block; margin: 0 0 22px; }
  .band-bricks .brick-slab { display: block; width: 240px; max-width: 100%; height: 138px; margin: 0 auto 6px; }
  .band-bricks .brick-slab text { font-size: 18px; }
}

/* ── page changes cross-fade (Chrome, Edge, Safari) ───────────────────────── */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
@supports (-moz-appearance: none) { @view-transition { navigation: none; } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .drawer, .drawer-toggle span, .xm-panel, .xm-grid .tile, .xm-tab svg, .brick-box, .brick-line path, .brick-slab .side, .brick-slab .top, .home-btn img { transition: none !important; }
  .drawer.open .tile, .drawer.closed .tile { animation: none; }
}
