:root {
  color-scheme: dark;
  --plate-width: 350px;
  --plate-height: 230px;
  --plate-gap: 34px;
  --page-width: 990px;
  --bg: #12111c;
  --panel: #1b1928;
  --fg: #f0eaf0;
  --body: #d1cbd5;
  --sub: #aea6b9;
  --line: #3b3547;
  --link: #c4b3e6;
  --gold: #dabe90;
  --teal: #99c9c1;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Baskervville', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}
:root[data-theme=day] {
  color-scheme: light;
  --bg: #f8f5ef;
  --panel: #ede9e4;
  --fg: #292331;
  --body: #49424d;
  --sub: #665c6d;
  --line: #cdc5cf;
  --link: #654984;
  --gold: #805721;
  --teal: #28675f;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--body); font: 16px/1.68 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, figure, ul { margin: 0; }
h1, h2, h3, strong { color: var(--fg); }
a { color: var(--link); text-underline-offset: .23em; text-decoration-color: color-mix(in srgb, var(--link) 55%, transparent); }
a:hover { color: var(--gold); text-decoration-color: currentColor; }
button { background: none; color: inherit; border: 0; font: inherit; cursor: pointer; }
button[hidden] { display: none; }
summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
::selection { color: #181321; background: #d3bfdc; }
.wrap { width: min(var(--page-width), calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: absolute; top: -100px; padding: 8px; background: var(--bg); z-index: 5; }
.skip-link:focus { top: 10px; }
.mast { display: flex; align-items: center; gap: 24px; min-height: 57px; border-bottom: 1px solid var(--line); font: 12px/1.5 var(--mono); }
.wordmark { display: flex; align-items: center; text-decoration: none; font-size: 14px; color: var(--fg); }
.wordmark span { color: var(--gold); }
.pixel-star { width: 16px; height: 16px; margin-right: 12px; background: var(--gold); clip-path: polygon(43% 0,57% 0,57% 26%,73% 26%,73% 43%,100% 43%,100% 57%,73% 57%,73% 73%,57% 73%,57% 100%,43% 100%,43% 73%,27% 73%,27% 57%,0 57%,0 43%,27% 43%,27% 26%,43% 26%); }
nav { display: flex; gap: clamp(14px,2.4vw,31px); margin-left: auto; }
nav a { color: var(--sub); text-decoration: none; }
.theme-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 6px; color: var(--gold); }
.theme-toggle:hover { color: var(--fg); }
.hero { display: grid; grid-template-columns: minmax(0,270px) minmax(0,1fr); gap: var(--plate-gap); align-items: center; padding-block: 34px 25px; }
.profile-sidebar { min-width: 0; }
.portrait-frame {
  --cut: 6px;
  --rim: #bba989;
  --patina: #6b5e58;
  --bevel: #363440;
  --mat: #252631;
  --mat-edge: #3b3841;
  --keyline: #161823;
  --engraving: #d4bc8d;
  --pass: url('assets/night-pass.svg?v=2');
  position: relative;
  isolation: isolate;
  margin: 0;
  padding: 8px 8px 6px;
  background: linear-gradient(128deg,var(--rim),var(--patina) 23%,var(--bevel) 48%,var(--patina) 76%,var(--rim));
  clip-path: polygon(var(--cut) 0,calc(100% - var(--cut)) 0,100% var(--cut),100% calc(100% - var(--cut)),calc(100% - var(--cut)) 100%,var(--cut) 100%,0 calc(100% - var(--cut)),0 var(--cut));
}
.portrait-frame::before {
  content: ''; position: absolute; inset: 1px; z-index: -1;
  clip-path: inherit;
  background: linear-gradient(145deg,var(--mat-edge),var(--mat) 38% 74%,var(--mat-edge));
}
.portrait-frame::after {
  content: ''; position: absolute; inset: 3px; pointer-events: none;
  background:
    linear-gradient(135deg,transparent 44%,var(--engraving) 45% 54%,transparent 55%) top left / 7px 7px,
    linear-gradient(315deg,transparent 44%,var(--engraving) 45% 54%,transparent 55%) bottom right / 7px 7px,
    linear-gradient(90deg,var(--engraving),transparent) 11px 0 / 30px 1px,
    linear-gradient(270deg,var(--engraving),transparent) right 11px bottom / 30px 1px;
  background-repeat: no-repeat;
}
.portrait-inlay {
  display: block; width: 100%; aspect-ratio: 320 / 33; max-height: 36px;
  background: var(--mat) var(--pass) center / cover no-repeat;
  border-top: 1px solid var(--patina);
  box-shadow: 0 1px 0 var(--patina);
}
[data-theme=day] .portrait-frame {
  --rim: #b39b77;
  --patina: #b8aa94;
  --bevel: #978671;
  --mat: #eee8dd;
  --mat-edge: #ddd2c0;
  --keyline: #b5aca2;
  --engraving: #a5895e;
  --pass: url('assets/night-pass.svg?v=2#day');
}
.bio { max-width: 690px; }
.portrait { display: block; width: 100%; aspect-ratio: 1.5; height: auto; object-fit: cover; object-position: 29% 53%; box-shadow: 0 0 0 1px var(--keyline); }
.field, .status, .date, .equal-note, .profile-links, .work-links, .institution, .foot, figcaption, .honors time { font-family: var(--mono); }
.field { color: var(--gold); font-size: 11px; line-height: 1.65; letter-spacing: .045em; }
.bio .link-start { white-space: nowrap; }
.bio .link-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -.13em;
  margin-inline-end: .24em;
  object-fit: contain;
}
.bio .emblem-tsinghua { background: #f6edf9; border-radius: 50%; }
.bio .emblem-nus { filter: drop-shadow(0 0 .6px #fff); }
.bio h1 { font-family: var(--serif); font-size: clamp(36px,3.5vw,46px); line-height: 1.06; font-weight: 400; letter-spacing: -.054em; margin-block: 8px 12px; }
.bio h1 span { display: inline-block; vertical-align: middle; color: var(--gold); font: 400 clamp(16px,1.4vw,19px)/1.4 'Kaiti SC', KaiTi, STKaiti, serif; letter-spacing: .15em; margin-left: 10px; }
.bio .lead { color: var(--fg); font: 400 clamp(19px,1.7vw,22px)/1.33 var(--serif); letter-spacing: -.014em; margin-bottom: 13px; }
.bio p:not(.field):not(.lead) { font-size: 15.5px; line-height: 1.58; margin-top: 8px; }
.profile-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 16px;
  margin: 8px 0 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.35;
}
.profile-links li { min-width: 0; max-width: 100%; text-align: center; }
.profile-links li:first-child { flex-basis: 100%; }
.profile-links a { display: inline-flex; align-items: center; gap: .45em; min-height: 25px; max-width: 100%; }
.profile-links li:first-child span { overflow-wrap: anywhere; }
.profile-links svg { flex: none; fill: currentColor; }
.major { position: relative; padding-block: 18px 9px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-top: 15px; border-top: 1px solid var(--line); margin-bottom: 18px; }
.section-head h2 { position: relative; font: 400 clamp(25px,2.3vw,31px)/1.15 var(--serif); letter-spacing: -.043em; }
.section-head h2::before { content: ''; height: 2px; width: 48px; background: var(--gold); position: absolute; left: 0; top: -17px; }
.equal-note { color: var(--sub); font-size: 11px; }
.work { display: grid; grid-template-columns: var(--plate-width) minmax(0,1fr); gap: var(--plate-gap); align-items: center; padding-block: 24px; border-bottom: 1px solid var(--line); }
.section-head + .work { padding-top: 2px; }
.work:last-of-type { border-bottom: 0; }
.work-text { max-width: 69ch; }
.plate { min-width: 0; }
.figure-link { position: relative; display: block; overflow: hidden; padding: 12px; background: #fff; border: 1px solid #b7afbd; border-radius: 3px; }
.figure-link img { width: 100%; height: var(--plate-height); object-fit: contain; display: block; }
.zoom-mark { position: absolute; right: 5px; bottom: 5px; width: 24px; height: 24px; display: grid; place-items: center; background: #faf9f2; color: #453b50; border: 1px solid #d3cdd7; font: 17px/1 var(--mono); }
figcaption { font-size: 11.5px; color: var(--sub); line-height: 1.6; margin-top: 11px; }
.work h3 { font: 400 clamp(20px,1.8vw,24px)/1.19 var(--serif); letter-spacing: -.022em; margin-block: 5px 8px; }
.authors { font-size: 13.5px; line-height: 1.65; }
sup { font-size: 10px; line-height: 0; }
.status { font-size: 11px; line-height: 1.65; color: var(--teal); margin-top: 4px; }
.summary { margin-top: 10px; font-size: 15.5px; line-height: 1.58; }
.role { color: var(--sub); font-size: 13.5px; line-height: 1.65; margin-top: 9px; }
.work-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px; font-size: 12px; margin-top: 15px; }
details summary { width: fit-content; color: var(--link); font: 12px/1.7 var(--mono); }
details[open] { flex-basis: 100%; }
details p { color: var(--body); font: 14px/1.75 var(--sans); margin-top: 10px; }
@media (hover: hover) {
  .zoom-mark { opacity: 0; }
  .figure-link:hover .zoom-mark, .figure-link:focus-visible .zoom-mark { opacity: 1; }
}
.software-note { font-size: 14px; color: var(--sub); padding-block: 5px 12px; }
.lower-page { position: relative; isolation: isolate; overflow: clip; background: linear-gradient(180deg,transparent 0%,color-mix(in srgb,var(--panel) 52%,var(--bg)) 75%,var(--bg) 100%); }
.specimen-defs { position: absolute; pointer-events: none; }
.specimen-rail {
  position: absolute; z-index: -1; inset-block: 2%; display: flex; flex-direction: column;
  justify-content: space-around; width: min(175px, calc((100% - var(--page-width)) / 2 - 12px));
  pointer-events: none; opacity: .55;
}
.rail-left { left: 0; }
.rail-right { right: 0; }
.rail-right .specimen-svg:nth-child(even), .rail-left .specimen-svg:nth-child(odd) { align-self: flex-end; width: 89%; }
.specimen-band { display: grid; place-items: center; max-width: var(--page-width); margin: 4px auto 0; padding: 3px 4%; overflow: hidden; }
.specimen-svg { display: block; width: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.specimen-band svg { max-height: 109px; }
.carbon-art { color: var(--link); opacity: .74; }
.lattice-art { color: var(--teal); --ti-o: var(--teal); --p-o: var(--link); }
.flow-art { color: var(--gold); }
.molecular-drift, .crystal-rock { transform-box: fill-box; transform-origin: center; }
.molecular-drift { animation: carbon-drift 6s ease-in-out infinite alternate; }
@keyframes carbon-drift { from { transform: translateY(-2px) rotate(-2deg); } to { transform: translateY(3px) rotate(2deg); } }
.crystal-rock { animation: crystal-rock 5.6s ease-in-out infinite alternate; }
@keyframes crystal-rock { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.ion { stroke: var(--fg); stroke-width: 4.8; stroke-dasharray: .12 110; animation: ion-hop 2.8s ease-in-out infinite alternate; }
@keyframes ion-hop { 0%, 8% { stroke-dashoffset: 0; } 92%, 100% { stroke-dashoffset: -99.8; } }
.flow-trace { stroke: var(--fg); stroke-width: 3.3; stroke-dasharray: 2.8 9.7; animation: flow 1.2s linear infinite; }
@keyframes flow { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -12.5; } }
.rail-right .specimen-svg * { animation-delay: -1.5s; }
[data-paused] .specimen-svg * { animation-play-state: paused; }
@media (max-width: 1120px) {
  .specimen-rail { width: clamp(58px, 9vw, 88px); opacity: .34; }
  .rail-left { mask-image: linear-gradient(to right, #000 4px, transparent 52%); }
  .rail-right { mask-image: linear-gradient(to left, #000 4px, transparent 52%); }
}
.cv-layout { display: grid; grid-template-columns: minmax(0,.69fr) minmax(0,1.31fr); gap: clamp(35px,6vw,85px); }
.education { border-left: 2px solid var(--gold); padding-left: 22px; align-self: start; }
.education h3, .music-copy h3 { font: 400 24px/1.2 var(--serif); letter-spacing: -.025em; margin: 6px 0; }
.education p:not(.date):not(.field), .experience p:not(.date):not(.institution) { font-size: 14px; margin-top: 9px; }
.date, .institution { color: var(--sub); font-size: 11.5px; }
.grade strong { color: var(--teal); }
.education details { margin-top: 15px; }
.experience { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 17px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.experience:first-child { padding-top: 0; }
.experience:last-child { border: 0; }
.experience .date { color: var(--teal); }
.experience h3 { font: 500 17px/1.4 var(--sans); }
.experience a { font-size: 12px; }
.honors { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 58px; list-style: none; padding: 0; }
.honors li { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 13px; border-top: 1px solid var(--line); padding: 11px 0; }
.honors li:nth-child(-n+2) { border: 0; }
.honors time { color: var(--gold); font-size: 11.5px; }
.honors strong { font-size: 15px; font-weight: 550; }
.honors li span { display: block; color: var(--sub); font-size: 13px; }
.music-layout { display: grid; grid-template-columns: var(--plate-width) minmax(0,1fr); align-items: center; gap: var(--plate-gap); }
.band img { width: 100%; height: auto; display: block; }
.music-copy { max-width: 67ch; }
.band { max-width: 350px; }
.sign { display: inline-flex; align-items: center; }
.watch { width: 26px; height: 29px; display: block; }
.watch-hand { transform-origin: 16px 19.2px; transition: transform .35s ease; }
[data-theme=day] .watch-hand { transform: rotate(110deg); }
.music-copy p { margin-top: 13px; font-size: 15px; }
.music-copy .aside-note { color: var(--sub); font-size: 14px; }
.foot { border-top: 1px solid var(--line); margin-top: 24px; padding: 13px 0 0; display: flex; gap: 18px; align-items: center; color: var(--sub); font-size: 11px; }
.visitor-map { width: min(100%, 344px); margin: 20px auto 28px; text-align: center; }
.visitor-map summary { margin-inline: auto; padding: 5px 9px; font-size: 13px; }
.visitor-map-image { display: block; margin-top: 7px; }
.visitor-map-image img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 3px; }
.visitor-stats { font: 12px/1.8 var(--mono); }
.foot .sign { margin-right: auto; }
.sign i { font-style: normal; color: var(--gold); margin-inline: 5px; }
.foot a { text-decoration: none; padding-inline: 5px; font-size: 17px; }
.motion-toggle { color: var(--sub); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.secret-toggle { font: 22px/1 var(--serif); color: var(--gold); }
dialog { max-height: 90dvh; color: var(--fg); background: var(--panel); border: 1px solid var(--line); padding: 18px; }
dialog::backdrop { background: #0c0b14da; }
.figure-dialog { width: min(1160px,95vw); }
.dialog-top, .extra-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.dialog-top { margin-bottom: 14px; }
.dialog-top p { font-size: 13px; }
.dialog-top button { font: 24px/1 var(--mono); }
.dialog-image { display: block; width: 100%; height: auto; max-height: 72dvh; object-fit: contain; }
.original-link { display: inline-block; margin-top: 10px; font: 12px/1.5 var(--mono); }
.extra-dialog { width: min(400px,94vw); background: #171321; color: #e5dfea; }
.extra-dialog h2 { font: 13px var(--mono); color: #dcbeed; }
.extra-dialog h2 span { margin-left: 10px; }
.extra-dialog canvas { width: 100%; height: auto; display: block; background: #100e18; }
.extra-footer { margin-top: 12px; font: 11px var(--mono); }
/* A small game map shares the same room art in attract and playable modes. */
.workshop { width: min(100%, 606px); margin: 18px auto 0; padding-bottom: 12px; }
.workshop [hidden] { display: none; }
/* Keep the visitor disclosure in place while the workshop controls load. */
.workshop .world-ui[hidden], .workshop .outdoor-details[hidden] { display: block; visibility: hidden; pointer-events: none; }
.lab-map {
  --interior-width: 81.81818%; /* The original three stations occupy 360 of 440 map pixels. */
  position:relative; isolation:isolate; overflow:hidden; aspect-ratio:440 / 120; image-rendering:pixelated;
  background:#24202b url('assets/eientei-engawa.webp') center / 100% 100% no-repeat;
  outline-offset:3px; box-shadow:0 0 0 1px var(--line);
}
.lab-demo, .lab-demo img, .lab-map canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.lab-demo { width:var(--interior-width); }
.lab-map .outdoor-layer { position:absolute; inset:0; z-index:-1; pointer-events:none; }
.outdoor-details { margin-top:4px; color:var(--sub); font:11px/1.55 var(--mono); }
.outdoor-details summary { cursor:pointer; padding:5px 0; }
.outdoor-place { color:var(--gold); }
.outdoor-sky { margin-left:10px; }
.outdoor-details label { display:inline-flex; align-items:center; gap:8px; margin-block:3px; }
.outdoor-details select { max-width:100%; color:var(--fg); background:var(--panel); border:1px solid var(--line); padding:3px 5px; font:inherit; }
.outdoor-details p { margin:3px 0; }
.outdoor-source:not([hidden]) + .outdoor-no-source { display:none; }
@media(max-width:440px){.outdoor-sky { display:block; min-height: 1lh; margin-left:14px; }}

.lab-stations { position:absolute; inset:0 auto 37% 0; width:var(--interior-width); display:flex; }
.lab-stations button { position: relative; flex: 1; min-width: 0; padding: 0; }
.lab-stations button:focus-visible { outline-offset: -4px; }
.lab-stations span { position: absolute; bottom: 5%; left: 50%; transform: translateX(-50%); white-space: nowrap; opacity: 0; background: #1b1824; color: #f1e5ce; padding: 2px 5px; border: 1px solid #8b7763; font: 11px/1.3 var(--mono); }
.lab-stations button:focus-visible span { opacity: 1; }
@media (hover: hover) { .lab-stations button:hover span { opacity: 1; } }
.lab-stations[data-next="0"] button:nth-child(1)::before,
.lab-stations[data-next="1"] button:nth-child(2)::before,
.lab-stations[data-next="2"] button:nth-child(3)::before { content: ""; position: absolute; top: 6px; left: calc(50% - 4px); width: 8px; height: 7px; background: #ffe5a0; clip-path: polygon(0 0,100% 0,100% 35%,50% 100%,0 35%); }
.lab-controls { display: flex; align-items: center; justify-content: center; gap: 8px 16px; min-height: 34px; font: 12px/1.45 var(--mono); }
.lab-controls p:empty { display: none; }
.lab-controls p:not(:empty) { flex: 1; color: var(--gold); }
.lab-controls button { min-height: 34px; white-space: nowrap; padding: 4px; color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.lab-controls .lab-enter { color: var(--gold); }

/* The workbench opens like a compact RPG dialogue window below the map. */
.world-map { cursor:pointer; }
.world-bar, #world-desk { font: 12px/1.5 var(--mono); }
.world-bar { display:flex; gap: 4px 14px; align-items:center; flex-wrap:wrap; min-height:35px; border-bottom:1px solid var(--line); }
.world-sign { display:flex; align-items:baseline; gap:4px 12px; flex-wrap:wrap; flex:1 1 160px; padding-block:4px; }
.world-title { font: 17px var(--serif); color:var(--fg); }
.world-dock-status,.world-freight { color:var(--sub); font-size:10px; }
.world-freight { display:flex; gap:12px; align-items:baseline; }
.world-dispatch { color:var(--link); text-decoration:underline; text-underline-offset:3px; }
.world-title i { margin-left:3px; font: 11px var(--serif); color:var(--gold); }
.world-bar button, .world-tools button, .world-bays button { padding:6px 1px; color:var(--link); text-underline-offset:3px; }
.world-bar button:hover, .world-tools button:hover { text-decoration:underline; }
#world-desk { border:1px solid var(--line); border-top:0; padding:12px 14px 7px; background:var(--panel); color:var(--body); }
.world-bays, .world-instrument, .world-tools { display:flex; align-items:center; flex-wrap:wrap; gap:4px 14px; }
.world-bays button { color:var(--sub); border-bottom:1px solid transparent; }
.world-bays button[aria-pressed=true] { color:var(--gold); border-color:currentColor; }
.world-weather, .world-phase { margin-left:auto; color:var(--sub); font-size:11px; }
.world-instrument { margin-top:8px; }
.world-device { font:21px/1.25 var(--serif); }
.world-meter { margin-block:7px 3px; height:3px; background:var(--line); }
.world-meter i { display:block; height:100%; background:var(--teal); }
.world-help { font-weight:600; }
.world-tools .world-remove { color:var(--sub); }
.world-tools button:disabled { opacity:.5; cursor:default; }
.world-inventory { color:var(--sub); font-size:11px; }
.world-conversation { display:grid; grid-template-columns:98px 1fr; align-items:center; gap:12px; margin-top:10px; padding-top:9px; border-top:1px solid var(--line); }
.world-portrait { width:100%; aspect-ratio:1; padding:0; border-bottom:1px solid var(--gold); background:linear-gradient(145deg,transparent,var(--line)); }
.world-portrait span { display:block; height:100%; background:url('assets/world-portraits.webp') var(--cast-x) var(--cast-y)/500% 300% no-repeat; }
.world-crew-label { display:flex; gap:6px; align-items:center; flex-wrap:wrap; color:var(--sub); font-size:11px; }
.world-cast { max-width:100%; min-height:27px; font:600 13px var(--sans); color:var(--fg); background:var(--panel); border:1px solid var(--line); border-radius:0; }
.world-role { margin:3px 0 4px; display:block; font-size:10px; color:var(--gold); }
.world-quote { font:16px/1.35 var(--serif); }
.world-feedback:not(:empty) { margin-top:8px; color:var(--teal); }
.world-journal { border-top:1px solid var(--line); margin-top:9px; }
.world-journal summary { padding:7px 0; color:var(--sub); }
.world-journal ol { padding-left:19px; margin:0; }
.world-journal li { padding-bottom:5px; }
.world-journal .world-finds:not(:empty) { color:var(--teal); margin-bottom:8px; }
.world-journal .world-finds:empty { display:none; }
.world-journal p { margin-top:6px; font-size:10px; color:var(--sub); }
@media(max-width:440px) {
 .lab-map { margin-inline:-8px; }
 .world-bar { gap:3px 9px; }
 .world-sign { flex-basis:112px; display:grid; gap:1px; }
 #world-desk { padding-inline:9px; }
 .world-conversation { grid-template-columns:76px 1fr; gap:8px; }
 .world-title { font-size:15px; }
}
@media (max-width: 1100px) {
  :root { --plate-width: 285px; --plate-height: 200px; --plate-gap: 35px; }
  .hero { grid-template-columns: minmax(0,250px) minmax(0,1fr); }
}
@media (max-width: 800px) {
  :root { --plate-width: 235px; --plate-height: 175px; --plate-gap: 30px; }
}
@media (max-width: 970px) {
  .wrap { width: calc(100% - 62px); }
  .hero { gap: 25px; padding-block: 28px 20px; grid-template-columns: minmax(0,min(30%,245px)) minmax(0,1fr); }
  .portrait { aspect-ratio: 1.29; object-position: 26% center; }
  .bio h1 { font-size: 40px; }
  .bio p:not(.field):not(.lead) { font-size: 14.5px; }
  .experience { grid-template-columns: 1fr; gap: 3px; }
}
@media (max-width: 730px) {
  .wrap { width: calc(100% - 40px); }
  .mast { gap: 5px 14px; min-height: 0; padding-block: 12px; flex-wrap: wrap; }
  .mast nav { order: 3; width: 100%; justify-content: space-between; gap: 7px; font-size: 11px; }
  .mast nav a { padding-block: 5px; }
  .theme-toggle { margin-left: auto; }
  .hero { grid-template-columns: 1fr; gap: 17px; padding-block: 20px 14px; }
  .profile-sidebar { width: min(100%,275px); }
  .portrait { aspect-ratio: 1.93; object-position: 36% 35%; }
  .bio .lead { font-size: 20px; }
  .bio h1 { margin-block: 8px 13px; font-size: clamp(34px,6vw,41px); }
  .bio h1 span { font-size: 18px; margin-left: 5px; }
  .major { padding-block: 19px 5px; }
  .section-head { margin-bottom: 22px; padding-top: 16px; align-items: end; gap: 12px; }
  .section-head h2::before { top: -18px; width: 36px; }
  .section-head h2 { font-size: 27px; }
  .equal-note { font-size: 9.5px; text-align: right; }
  .work h3 { font-size: 22px; margin-block: 6px 8px; }
  .summary { font-size: 15px; margin-top: 11px; }
  .plate figcaption, .band figcaption { font-size: 10.5px; margin-top: 6px; }
  .cv-layout, .music-layout { grid-template-columns: 1fr; gap: 25px; }
  .honors { grid-template-columns: 1fr; }
  .honors li:nth-child(2) { border-top: 1px solid var(--line); }
  .honors li { gap: 9px; padding-block: 11px; }
  .specimen-band { padding-inline: 0; margin-block: 14px 0; }
  .specimen-band svg { width: 100%; }
  .lower-page::before { opacity: .24; mask-image: linear-gradient(to right,#000 0%,transparent 9%,transparent 91%,#000 100%); }
  .foot { display: flex; flex-wrap: wrap; gap: 7px 14px; font-size: 10px; margin-top: 28px; }
  .foot .sign { margin-right: auto; }
}
@media (max-width: 650px) {
  .work { grid-template-columns: 1fr; gap: 14px; padding-block: 23px; }
  .plate { grid-row: 2; width: min(100%,350px); }
  .figure-link img { height: auto; max-height: 250px; }
}
@media (max-width: 400px) {
  .mast nav { flex-wrap: wrap; justify-content: flex-start; column-gap: 12px; row-gap: 0; }
  .wrap { width: calc(100% - 32px); }
  .foot .motion-toggle { order: 3; flex-basis: 100%; padding-left: 0; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  :root:not([data-background-playing]) .specimen-svg * { animation-play-state: paused; }
}
@media print {
  :root, :root[data-theme=night] { color-scheme: light; --fg: #191723; --body: #252332; --sub: #514855; --bg: #fff; --link: #493461; --gold: #5f492e; --teal: #32554d; --line: #ccc; }
  .wrap { width: 100%; }
  .workshop, .visitor-map, .mast, .specimen-band, .foot button, .foot a, .specimen-rail, .zoom-mark, dialog { display: none; }
  .portrait-frame { clip-path: none; padding: 0; background: transparent; }
  .portrait-inlay, .portrait-frame::before, .portrait-frame::after { display: none; }
  .lower-page { background: white; overflow: visible; }
  .hero { grid-template-columns: .65fr 1.35fr; padding: 10px 0; gap: 25px; }
  .work { grid-template-columns: 180px 1fr; gap: 25px; break-inside: avoid; padding-block: 17px; }
  .plate { grid-row: auto; }
  .figure-link img { height: 150px; }
  .honors li, .experience, .music-layout { break-inside: avoid; }
  .section-head { break-after: avoid; }
}
