:root {
  color-scheme: light;
  --active: var(--deep);
  --focus: var(--accent);
  --gutter: var(--site-gutter);
  --world-width: 62.5rem;
  font-family: var(--font-ui);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
/* A soft lamp-light pool behind the world, on warm paper. */
html { background: radial-gradient(ellipse 70% 58% at 50% 44%, #fffcf6 30%, rgb(255 252 246 / 0) 100%) no-repeat var(--paper); }
body { display: flex; flex-direction: column; min-block-size: 100svh; color: var(--ink); }
button { font: inherit; color: inherit; touch-action: manipulation; }
.habitats {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1rem calc(var(--gutter) + env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) calc(var(--gutter) + env(safe-area-inset-left));
  overflow-x: clip;
}
.site-head--habitats { --chrome-width: min(var(--world-width), calc(100% - 2 * var(--gutter))); }
.world, .intro { grid-area: 1 / 1; min-width: 0; }
.world { inline-size: min(100%, var(--world-width)); display: flex; flex-direction: column; align-items: center; gap: 1rem; }

.pixel-button {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  inline-size: min(100%, 16rem);
  min-block-size: 2.75rem;
  padding: .625rem 1rem;
  border: 0;
  overflow: hidden;
  background: var(--deep);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  clip-path: polygon(0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px));
}
.pixel-mosaic { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.pixel-button::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgb(9 9 11 / .64); }
.pixel-label { display: inline-flex; align-items: center; gap: .625rem; text-shadow: 0 1px 0 rgb(0 0 0 / .4); }
.pixel-label::after { content: ""; flex: none; width: 9px; height: 12px; background: currentColor; clip-path: polygon(0 0, 33.3% 0, 33.3% 16.7%, 66.7% 16.7%, 66.7% 33.3%, 100% 33.3%, 100% 66.7%, 66.7% 66.7%, 66.7% 83.3%, 33.3% 83.3%, 33.3% 100%, 0 100%); }
.pixel-button:focus-visible { outline: none; }
.pixel-button:focus-visible .pixel-label { outline: 2px solid #fff; outline-offset: 6px; }
.pixel-button:disabled { cursor: progress; }
.portal-split { position: absolute; z-index: 2; pointer-events: none; }
.portal-split canvas { position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 50% 60%; }

.habitats:is([data-view="opening"], [data-view="closing"]) .habitat { visibility: hidden; }
.habitats:not([data-view="world"]) .habitat-stage { opacity: 0; }
.habitats:not([data-view="world"]) .pixel-button { opacity: 0; pointer-events: none; }
.habitats:not([data-view="world"]) .world { visibility: hidden; }

/* Restore the original handwritten typography within the introduction. */
@font-face {
  font-family: "Intro WenKai";
  src: url("/fonts/intro-wenkai.woff2?v=76f028e3") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Reenie Beanie";
  src: url("/fonts/reenie-beanie.woff2?v=86d405e0") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
.intro {
  --intro-ink: #3a332b;
  --intro-body: #574f45;
  --intro-meta: #6b6357;
  --intro-rule: #dcd2bf;
  --intro-action: var(--accent);
  --intro-text: "Intro WenKai", "Kaiti SC", "STKaiti", serif;
  --intro-enter: 380ms;
  --intro-exit: 180ms;
  --intro-ease: cubic-bezier(.16, 1, .3, 1);
  inline-size: min(100%, 39rem);
  scroll-margin-block-start: calc(5rem + env(safe-area-inset-top));
  align-self: start;
  margin-block: 0 3rem;
  padding-block-end: max(1.5rem, env(safe-area-inset-bottom));
  color: var(--intro-body);
  font-family: var(--intro-text);
  visibility: hidden;
}
.habitats:is([data-view="opening"], [data-view="intro"], [data-view="closing"]) .intro { visibility: visible; }
.intro :where(p, h1, h2, ul) { margin: 0; }
.intro h1:focus { outline: none; }
.intro :where(a, button):focus-visible { outline: 2px solid var(--intro-action); outline-offset: 6px; }
.back-button { display: inline-flex; align-items: center; gap: 8px; min-block-size: 44px; margin: 0 0 2rem; padding: 0; border: 0; background: transparent; color: var(--intro-meta); font-size: .875rem; cursor: pointer; }
.back-button span { display: inline-block; }
.intro-identity { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem; column-gap: 1.5rem; align-items: start; }
.intro h1 { grid-column: 1; font-family: var(--intro-text); font-size: 3.5rem; font-weight: 400; line-height: 1.25; letter-spacing: 0; font-optical-sizing: auto; color: var(--intro-ink); }
.intro h1:lang(en) { font-family: "Reenie Beanie", cursive; font-size: 4.5rem; line-height: 1; }
.intro h1 { position: relative; justify-self: start; }
/* A crayon stroke under the name, drawn twice like a quick underline by hand. */
.name-scribble { position: absolute; inset-inline: -6%; inset-block-end: -.15em; inline-size: 112%; overflow: visible; fill: none; stroke: var(--crayon); stroke-width: 2.4; stroke-linecap: round; opacity: .85; pointer-events: none; }
.name-scribble path + path { stroke-width: 1.6; opacity: .6; }
.intro h1:lang(en) .name-scribble { inset-block-end: -.05em; stroke-width: 1.3; }
.intro h1:lang(en) .name-scribble path + path { stroke-width: .9; }
.intro-role, .intro-line, .work-role, .work-description { font-family: var(--intro-text); font-size: 1.125rem; font-weight: 400; line-height: 1.65; letter-spacing: 0; text-wrap: pretty; }
.intro-role { grid-column: 1; margin-block-start: .5rem; color: var(--intro-ink); }
.intro-perch { position: relative; grid-column: 2; grid-row: 1 / span 2; block-size: 9rem; }
/* The twig the guide lands on. */
.perch-twig { position: absolute; inset-inline: -30%; inset-block-end: -.5rem; inline-size: 160%; overflow: visible; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.twig-branch { stroke: var(--twig); stroke-width: 2.6; }
.twig-leaf { fill: var(--leaf); stroke: #74905c; stroke-width: .8; transform-box: fill-box; transform-origin: 0% 100%; }
.twig-leaf.is-tip { transform-origin: 0% 50%; }
.intro-line { grid-column: 1 / -1; margin-block-start: 1rem; }
.intro-layout { overflow-wrap: break-word; }
.intro-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.5rem; margin-block-start: 2.5rem; padding-block-start: 1rem; border-block-start: 1px solid var(--intro-rule); }
.intro-foot a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-inline-size: 44px; min-block-size: 44px; max-inline-size: 100%; color: var(--intro-body); font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--intro-rule); text-underline-offset: 5px; }
.intro-foot a[data-line="link:mail"] { justify-content: start; }
.intro-foot a[data-line="link:resume"] { color: var(--intro-ink); }
.contact-icon { flex: none; inline-size: 16px; block-size: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.intro-history { margin-block-start: 2.5rem; }
.intro-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.intro-section + .intro-section { margin-block-start: 2.5rem; }
.intro-label { padding-block-end: .625rem; border-block-end: 1px solid var(--intro-rule); color: var(--intro-meta); font-size: .875rem; font-weight: 400; line-height: 1.5; letter-spacing: .025em; }
.intro-work { display: grid; gap: 1.75rem; padding: 0; list-style: none; }
.intro-work a, .education-entry { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) auto 1.25rem; align-items: center; gap: .125rem 1rem; color: inherit; text-decoration: none; }
.work-name { grid-column: 1; grid-row: 1; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--intro-rule); text-underline-offset: 5px; color: var(--intro-ink); font-family: var(--intro-text); font-size: 1.5rem; font-weight: 400; line-height: 1.33; }
.work-date { grid-column: 2; grid-row: 1; color: var(--intro-meta); font-size: .875rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.work-role, .work-description { grid-column: 1 / -1; }
.work-role { color: var(--intro-ink); }
.work-description { color: var(--intro-body); font-size: 1rem; line-height: 1.75; }
.work-arrow { grid-column: 3; grid-row: 1; inline-size: 20px; block-size: 20px; margin-inline-end: -.25rem; align-self: center; justify-self: end; color: var(--intro-meta); }
/* Each internship lifts into a paper card under the pointer. */
.intro-work a::before { content: ""; position: absolute; inset: -.875rem -1rem; z-index: -1; border-radius: 16px; background: var(--card); box-shadow: var(--lift); opacity: 0; scale: .97; pointer-events: none; }
/* Keyboard focus shows the same card, ringed, instead of a square outline. */
.intro .intro-work a:focus-visible { outline: none; }
.intro-work a:focus-visible::before { opacity: 1; scale: 1; box-shadow: var(--lift), 0 0 0 2px var(--intro-action); }
.education-entry .work-name { text-decoration: none; }
.education-entry .work-date { grid-column: 2 / -1; }
.education-entry .work-role { color: var(--intro-body); }
.intro-work a:active .work-name, .intro-foot a:active, .back-button:active { color: var(--intro-action); }
/* Freeze the exiting sheet before returning the world to its natural height. */
.habitats[data-view="world"] .intro { block-size: 0; margin: 0; padding: 0; overflow: hidden; }
.habitats[data-view="closing"] .intro { grid-area: auto; position: absolute; inset-block-start: var(--closing-top); inset-inline: 0; inline-size: var(--closing-width); margin-inline: auto; }
.habitats[data-view="closing"] .intro-layout, .habitats[data-view="closing"] .back-button { opacity: 0; }

.habitat-stage { width: 100%; min-width: 0; padding: 0; background: transparent; box-shadow: none; }
.habitat-figure { margin: 0; width: 100%; }
.habitat-frame { position: relative; width: 100%; }
/* The painting rests on the paper: a soft contact shadow under its lower edge. */
.habitat-frame::before { content: ""; position: absolute; inset: auto 7% 0; height: 18%; border-radius: 50%; background: radial-gradient(closest-side, rgb(var(--shade) / .2), rgb(var(--shade) / 0)); translate: 0 22%; pointer-events: none; }
.habitats[data-view="world"] .habitat-frame::before { transition: opacity 300ms ease-out; }
.habitats:is(:not([data-ready]), :not([data-view="world"])) .habitat-frame::before { opacity: 0; }
/* Until the first frame lands, a faint wash holds the place the world will fill. */
.habitats:not([data-ready]) .habitat::before { content: ""; position: absolute; inset: 7% 4%; border-radius: 36px; background: rgb(var(--shade) / .05); }
.habitat {
  display: block;
  position: relative;
  isolation: isolate;
  width: 100%;
  block-size: clamp(10rem, 56svh, 34rem);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: crosshair;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.habitat canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: auto; }
.habitat .scenery { overflow: visible; }
.habitat:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.scene-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .25rem .75rem;
  margin-block-start: .5rem;
}
.scene-switcher {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 3.125rem), 1fr));
  gap: .25rem;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(var(--shade) / .04);
}
.scene-switcher button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  min-block-size: 44px;
  padding: .375rem 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.3;
  cursor: pointer;
}
.scene-switcher button:focus-visible { outline-offset: -2px; border-radius: .75rem; }
.scene-switcher button[aria-pressed="true"] { color: var(--deep); font-weight: 500; }
/* The chosen scene is a small slip of paper lifted off the page. */
.scene-switcher button::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: .75rem; background: var(--card); box-shadow: var(--lift); opacity: 0; scale: .92; }
.scene-switcher button[aria-pressed="true"]::before { opacity: 1; scale: 1; }
.scene-icon { display: none; flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.scene-switcher button[aria-pressed="true"] .scene-icon { color: var(--accent); }
.scene-hint { margin: 0; text-wrap: balance; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.scene-tools { display: flex; gap: .25rem; margin-inline-end: -.875rem; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 7px; border: 0; border-radius: 50%; background: transparent; background-clip: content-box; color: var(--muted); cursor: pointer; }
.icon-button svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-button .play-icon, .icon-button[data-paused="true"] .pause-icon { display: none; }
.icon-button[data-paused="true"] .play-icon { display: block; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 6; transform: translateY(-160%); padding: 12px 18px; border-radius: 999px; background: var(--card); box-shadow: var(--lift); color: var(--ink); text-decoration: none; }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.no-script { max-width: 320px; margin: 0 auto; font-size: 14px; line-height: 1.7; }
@media (hover: hover) {
  .scene-switcher button:hover, .icon-button:hover, .back-button:hover { color: var(--active); }
  .scene-switcher button:not([aria-pressed="true"]):hover::before { opacity: .55; scale: .96; box-shadow: none; }
  .icon-button:hover { background-color: rgb(var(--shade) / .07); }
  .intro-work a:hover .work-name { color: var(--deep); text-decoration-color: var(--crayon); }
  .intro-work a:hover .work-arrow { color: var(--intro-action); }
  .intro-foot a:hover { color: var(--intro-ink); text-decoration-color: var(--crayon); }
  .intro-foot a:hover .contact-icon { color: var(--intro-action); }
  .intro-work a:hover::before { opacity: 1; scale: 1; }
  .pixel-button:hover .pixel-label { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

}
.scene-switcher button, .back-button, .work-role { transition: color 150ms ease-out; }
.icon-button { transition: color 150ms ease-out, background-color 150ms ease-out; }
.scene-switcher button:active { color: var(--accent); }
.icon-button:active { background-color: rgb(var(--shade) / .12); }
.intro-foot a { transition: color 160ms ease-out, background-color 160ms ease-out, text-decoration-color 160ms ease-out; }
.work-name, .work-arrow, .contact-icon { transition: color 160ms ease-out, text-decoration-color 160ms ease-out; }
@media (prefers-reduced-motion: no-preference) {
  .scene-switcher button { transition: color 150ms ease-out, scale 120ms var(--ease-settle); }
  .icon-button { transition: color 150ms ease-out, background-color 150ms ease-out, scale 120ms var(--ease-settle); }
  .scene-switcher button:active { scale: .97; }
  .icon-button:active { scale: .94; }
  .intro-work a:active::before { opacity: 1; scale: .99; }
  .scene-switcher button::before { transition: scale 320ms var(--ease-settle), opacity 180ms ease-out, box-shadow 180ms ease-out; }
  /* A pointer pick makes the little icon hop; keyboard moves stay still. */
  .scene-switcher button[aria-pressed="true"]:not(:focus-visible) .scene-icon { animation: scene-hop 460ms var(--ease-settle); }
  .pixel-button { transition: opacity 240ms ease-out, translate 160ms var(--ease-settle); }
  @media (hover: hover) and (pointer: fine) { .pixel-button:not(:disabled):hover { translate: 0 -2px; } }
  .pixel-button:not(:disabled):active { translate: 0 1px; transition-duration: 60ms; }
  .back-button span, .work-arrow { transition: translate 200ms var(--ease-settle); }
  .contact-icon { transition: translate 260ms var(--ease-settle), rotate 260ms var(--ease-settle), color 160ms ease-out; }
  .intro-work a::before { transition: opacity 200ms ease-out, scale 260ms var(--ease-settle); }
  /* The underline and the twig are drawn in as the paper opens; the leaves then sway with the breeze. */
  .habitats:is([data-view="opening"], [data-view="intro"]) .name-scribble path { stroke-dasharray: 1; animation: ink-draw 520ms 280ms cubic-bezier(.6, 0, .3, 1) both; }
  .habitats:is([data-view="opening"], [data-view="intro"]) .name-scribble path + path { animation-delay: 640ms; animation-duration: 420ms; }
  .habitats:is([data-view="opening"], [data-view="intro"]) .twig-branch { stroke-dasharray: 1; animation: ink-draw 600ms 120ms var(--intro-ease) both; }
  .habitats:is([data-view="opening"], [data-view="intro"]) .twig-leaf { animation: leaf-pop 420ms 520ms var(--ease-settle) both, leaf-sway 5.2s 1s ease-in-out infinite; }
  .habitats:is([data-view="opening"], [data-view="intro"]) .twig-leaf:nth-of-type(2n) { animation-delay: 620ms, 1.6s; }
  .habitats:has(.sprite-home[data-paused="true"]) .twig-leaf { animation-play-state: running, paused; }
  @media (hover: hover) and (pointer: fine) {
    .back-button:hover span { translate: -3px 0; }
    .intro-work a:hover .work-arrow { translate: 3px 0; }
    .intro-foot a[data-line="link:resume"]:hover .contact-icon { translate: 0 2px; }
    .intro-foot a[data-line="link:mail"]:hover .contact-icon { translate: 3px -3px; rotate: -8deg; }
  }
  /* Reveal two content groups as the paper opens; deep links and keyboard visits are already readable. */
  .habitats[data-view="opening"] .intro-identity { animation: intro-arrive var(--intro-enter) 100ms var(--intro-ease) both; }
  .habitats[data-view="opening"] .intro-foot { animation: intro-arrive var(--intro-enter) 160ms var(--intro-ease) both; }
  .habitats[data-view="opening"] .intro-history { animation: intro-arrive var(--intro-enter) 140ms var(--intro-ease) both; }
  .habitats[data-view="closing"] .intro-layout, .habitats[data-view="closing"] .back-button { transition: opacity var(--intro-exit) ease-out; }
}
@keyframes intro-arrive { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes wash-breathe { 50% { opacity: .45; } }
@keyframes ink-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes leaf-pop { from { scale: 0; } }
@keyframes leaf-sway { 0%, 100% { rotate: 0deg; } 50% { rotate: 7deg; } }
@keyframes scene-hop { 35% { translate: 0 -4px; rotate: -10deg; } 65% { translate: 0 0; rotate: 6deg; } 85% { rotate: -2deg; } }
/* Use the stable viewport so scrolling the browser chrome doesn't resize the canvas. */
@media (width <= 47.5rem) {
  .habitats { padding-block-start: .5rem; }
  .habitat { block-size: clamp(10rem, calc(100svh - 15rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)), min(38rem, 145vw)); }
}
@media (width > 47.5rem) {
  .scene-controls { grid-template-columns: minmax(0, 1fr) auto auto; gap: 1rem; }
  .scene-switcher { grid-column: auto; display: flex; flex-wrap: wrap; justify-self: start; }
  .scene-switcher button { gap: .375rem; min-block-size: 2.25rem; padding-inline: .625rem; }
  .scene-icon { display: block; }
  .scene-hint { text-align: end; }
}
@media (min-width: 48rem) and (max-width: 64rem) and (min-height: 44rem) and (orientation: portrait) {
  .habitat { block-size: min(64svh, 38rem); }
}
@media (max-height: 30rem) and (orientation: landscape) {
  .site-head--habitats { min-block-size: 3rem; }
  .habitats { padding-block-start: .5rem; padding-block-end: calc(.5rem + env(safe-area-inset-bottom)); }
  .world { gap: .5rem; }
  .habitat { block-size: clamp(8rem, calc(100svh - var(--landscape-controls, 11rem) - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 26rem); }
}
@media (width <= 47.5rem) and (max-height: 30rem) and (orientation: landscape) {
  .habitat { --landscape-controls: 14rem; }
}
@media (pointer: coarse) {
  .scene-switcher button { min-block-size: 44px; }
}
@media (max-width: 40rem) {
  .intro { margin-block-end: 1rem; }
  .back-button { margin-block-end: 1.25rem; }
  .intro h1 { font-size: 2.75rem; }
  .intro h1:lang(en) { font-size: clamp(2.625rem, 1.875rem + 4vw, 3.25rem); }
  .intro-identity { grid-template-columns: minmax(0, 1fr) clamp(3rem, 21vw, 6.5rem); column-gap: .75rem; }
  .intro :is(.intro-label, .intro-role, .intro-line, .work-date, .work-role, .work-description, .intro-foot) { font-family: var(--font-ui); }
  .intro-role, .intro-line, .work-role { font-size: 1rem; }
  .intro-perch { block-size: clamp(5rem, 22vw, 6.5rem); translate: 0 -1.25rem; }
  .intro-line { margin-block-start: .875rem; }
  .perch-twig { inset-inline: -22% -8%; inset-block-end: -1.1rem; inline-size: 130%; }
  .intro-foot { gap: .25rem 1rem; margin-block-start: 1.75rem; padding-block-start: .5rem; }
  .intro-history { margin-block-start: 1.75rem; }
  .intro-work a, .education-entry { grid-template-columns: minmax(0, 1fr) 1.25rem; }
  .work-name { grid-column: 1; grid-row: 1; }
  .work-date, .education-entry .work-date { grid-column: 1 / -1; grid-row: 2; margin-block-end: .375rem; }
  .work-arrow { grid-column: 2; grid-row: 1; color: var(--intro-action); }
}
@media (min-width: 56rem) {
  .intro { inline-size: min(100%, 52rem); }
  .intro-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 4fr);
    align-items: start;
    gap: 2.5rem clamp(2rem, 5vw, 5rem);
  }
  .intro-identity { grid-template-columns: minmax(0, 1fr); }
  .intro h1:lang(en) { font-size: clamp(3.25rem, 2rem + 2.5vw, 4.5rem); }
  .intro-perch { grid-column: 1; grid-row: 4; justify-self: center; inline-size: 8.5rem; margin-block-start: 2rem; }
  .intro-history, .intro-foot { margin-block-start: 0; }
}
.icon-button[hidden] { display: none; }
.sound-off, #sound[aria-pressed="false"] .sound-wave { display: none; }
#sound[aria-pressed="false"] .sound-off { display: initial; }

/* The guide sits in the corner of the scene. */
.sprite-home { position: absolute; top: 0; left: 0; width: 120px; height: 150px; z-index: 3; }
.sprite-home[hidden] { display: none; }
.sprite { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; color: var(--deep); cursor: grab; touch-action: none; user-select: none; }
.sprite-home[data-dragging] .sprite { cursor: grabbing; }
.sprite-art, .sprite-body { display: block; position: relative; width: 100%; height: 100%; }
.sprite-art canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.sprite-art .sprite-3d, .sprite-art .sprite-still { position: absolute; top: 0; left: -35%; display: block; width: 170%; height: 100%; pointer-events: none; }
.sprite-body { transform-origin: 50% 90%; }
.sprite-sparks { opacity: 0; transform-origin: 85% 35%; }
.sprite-home:not([data-render]) .sprite-art { opacity: 0; }
.sprite-home[data-render="3d"] .sprite-still { display: none; }
/* Keep the GPU canvas measurable while the still covers context loss or shader warm-up. */
.sprite-home[data-render="still"] .sprite-3d { visibility: hidden; }
/* The note is a small popover hung over the bird's crown, its tail one seamless piece with the border.
   --head-x and --crown are where the renderer projects the top of the head inside the box. */
.sprite-home { --head-x: 48%; --crown: 29%; }
.sprite-note { --tail: 50%; position: absolute; left: var(--head-x); bottom: calc(100% - var(--crown) + 10px); width: max-content; max-width: min(208px, calc(100vw - 40px)); translate: -50% 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgb(var(--shade) / .06), 0 6px 16px -6px rgb(var(--shade) / .22); color: var(--deep); font-size: 13px; font-weight: 400; line-height: 18px; text-align: left; text-wrap: balance; opacity: 0; pointer-events: none; }
.sprite-note::after { content: ""; position: absolute; left: calc(var(--tail) - 5px); bottom: -5.5px; box-sizing: border-box; width: 10px; height: 10px; border: solid var(--line); border-width: 0 1px 1px 0; border-bottom-right-radius: 2px; background: var(--card); box-shadow: 1px 1px 2px rgb(var(--shade) / .06); rotate: 45deg; }
.sprite-home[data-note-align="start"] .sprite-note { --tail: 22px; left: calc(var(--head-x) - 22px); translate: none; }
.sprite-home[data-note-align="end"] .sprite-note { --tail: calc(100% - 22px); left: auto; right: calc(100% - var(--head-x) - 22px); translate: none; }
.sprite-home[data-note-below="true"] .sprite-note { top: calc(95% + 10px); bottom: auto; }
.sprite-home[data-note-below="true"] .sprite-note::after { top: -5.5px; bottom: auto; border-width: 1px 0 0 1px; border-radius: 2px 0 0; box-shadow: none; }
.sprite-home:has(:focus-visible) .sprite-note, .sprite-home[data-reacting] .sprite-note { opacity: 1; }
/* A moving speech bubble would cross the text while the guide changes its perch. */
.habitats:is([data-view="opening"], [data-view="closing"]) .sprite-note { opacity: 0; }
@media (hover: hover) { .sprite-home:hover .sprite-note { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .habitats[data-ready="true"] .habitat-stage { animation: paper-arrive 650ms var(--ease-settle) backwards; }
  .habitats:not([data-ready]) .habitat::before { animation: wash-breathe 1.8s ease-in-out infinite; }
  .habitat-stage { transition: opacity 200ms ease-out; }
  .habitats[data-ready="true"] .pixel-button { animation: paper-arrive 520ms 180ms var(--ease-settle) backwards; }
  .sprite-art { transition: opacity 500ms 120ms var(--ease-settle), translate 500ms 120ms var(--ease-settle); }
  @starting-style { .sprite-art { opacity: 0; translate: 0 6px; } }
  .sprite-home[data-gliding] { transition: transform 600ms var(--ease-settle); }
  .sprite-note { transition: opacity 150ms ease-out, transform 180ms ease-out; transform: translateY(3px); }
  .sprite-home[data-note-below="true"] .sprite-note { transform: translateY(-3px); }
  .sprite-home:has(:focus-visible) .sprite-note, .sprite-home[data-reacting] .sprite-note, .sprite-home:hover .sprite-note { transform: none; }
  .sprite-home[data-render="still"]:not([data-paused="true"]):not([data-dragging]):not([data-reacting]) .sprite-body { animation: sprite-tilt 9s ease-in-out infinite; }
}
/* The still can only tilt: lean, hold, and come back level. */
@keyframes sprite-tilt { 0%, 100% { rotate: 0deg; } 25%, 40% { rotate: 1.5deg; } 62%, 78% { rotate: -1deg; } }
@media (max-width: 640px) { .sprite-home { width: 96px; height: 120px; } }
@media (max-width: 380px) {
  .sprite-home { width: 72px; height: 90px; }
}

/* Personal information remains readable when scripts are unavailable or initialization fails. */
.habitats:is([data-fallback], :has(.no-script)) .world,
.habitats:is([data-fallback], :has(.no-script)) .back-button,
.habitats:is([data-fallback], :has(.no-script)) .sprite-home { display: none; }
.habitats:is([data-fallback], :has(.no-script)) .intro { visibility: visible; block-size: auto; margin-block: 0 3rem; overflow: visible; }
.habitats:has(.no-script) .no-script { display: none; }
