/* Yaxin Zheng — portfolio
   Light grey "gallery wall", ink-black type, works hung like prints. */

/* Fonts: self-hosted, SIL Open Font License (see /fonts/LICENSE-*.txt) */
@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-latin.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-latin-italic.woff2") format("woff2");
  font-weight: 400 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/pixelify-sans-latin.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
/* Greek and Chinese titles only: tiny subsets */
@font-face { font-family: "GFS Didot"; src: url("../fonts/gfs-didot-greek-title.woff2") format("woff2"); unicode-range: U+0370-03FF; font-display: swap; }
@font-face { font-family: "GFS Didot"; src: url("../fonts/gfs-didot-greek-ext-title.woff2") format("woff2"); unicode-range: U+1F00-1FFF; font-display: swap; }
@font-face { font-family: "Noto Serif SC"; src: url("../fonts/noto-serif-sc-titles-0.woff2") format("woff2"); unicode-range: U+679D; font-display: swap; }
@font-face { font-family: "Noto Serif SC"; src: url("../fonts/noto-serif-sc-titles-1.woff2") format("woff2"); unicode-range: U+6D53; font-display: swap; }
@font-face { font-family: "Noto Serif SC"; src: url("../fonts/noto-serif-sc-titles-2.woff2") format("woff2"); unicode-range: U+8273; font-display: swap; }
@font-face { font-family: "Noto Serif SC"; src: url("../fonts/noto-serif-sc-titles-3.woff2") format("woff2"); unicode-range: U+6625; font-display: swap; }
@font-face { font-family: "Noto Serif SC"; src: url("../fonts/noto-serif-sc-titles-4.woff2") format("woff2"); unicode-range: U+85CF; font-display: swap; }
@font-face { font-family: "Noto Serif SC"; src: url("../fonts/noto-serif-sc-titles-5.woff2") format("woff2"); unicode-range: U+4E00; font-display: swap; }
@font-face { font-family: "Noto Serif SC"; src: url("../fonts/noto-serif-sc-titles-6.woff2") format("woff2"); unicode-range: U+992E, U+9955; font-display: swap; }

:root {
  --wall: #E6E7E4;
  --wall-deep: #DCDDDA;
  --paper: #F6F6F4;
  --ink: #000;
  --graphite: #5A5A55;
  --pencil: #85857F;
  --rule: #C8C9C5;

  --serif: "Bodoni Moda", "GFS Didot", "Noto Serif SC", Didot, "Bodoni 72", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(1rem, 4.5vw, 4rem);
  --nav-h: 64px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: .5rem .75rem;
  background: var(--ink);
  color: var(--wall);
  font-size: .875rem;
}
.skip:focus { top: .75rem; }

/* ---------- navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 var(--gutter);
  background: rgb(230 231 228 / .84);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: box-shadow .3s ease;
}
.nav.is-scrolled { box-shadow: 0 1px 0 var(--rule); }

.nav-name {
  font: 400 1.25rem/1 var(--serif);
  font-variation-settings: "opsz" 24;
  letter-spacing: .005em;
  transition: opacity .3s ease;
}

.nav nav {
  display: flex;
  gap: clamp(1rem, 2.6vw, 2.25rem);
}
.nav nav a {
  font-size: .875rem;
  letter-spacing: .02em;
  color: var(--graphite);
  padding-block: .5rem;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - .35rem) / 0 1px no-repeat;
  transition: color .2s ease, background-size .3s var(--ease);
}
.nav nav a:hover,
.nav nav a[aria-current="page"] {
  color: var(--ink);
  background-size: 100% 1px;
}
.nav nav { align-items: center; }
.nav-pet {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.nav-pet img {
  width: 28px;
  height: 30px;
  image-rendering: pixelated;
  margin-block: -8px -6px;
  transition: transform .25s steps(2);
}
.nav-pet:hover img { transform: translateY(-3px); }

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(2rem, 5vw, 5rem);
  padding: calc(var(--nav-h) + clamp(1.5rem, 4vw, 3rem)) 0 clamp(2rem, 5vw, 4rem) var(--gutter);
}

.hero-text {
  align-self: end;
  padding-bottom: clamp(1rem, 4vh, 3rem);
}

.hero-name {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 96;
  font-size: clamp(4.5rem, 11.5vw, 11.5rem);
  line-height: .86;
  letter-spacing: -.015em;
  margin-left: -.04em;
}
.hero-name span { display: block; }
.hero-name span + span { padding-left: .62em; }

.hero-tagline {
  margin-top: clamp(1.75rem, 4vw, 3rem);
  font: italic 400 clamp(1.375rem, 2.2vw, 1.875rem)/1.25 var(--serif);
  font-variation-settings: "opsz" 28;
}

.hero-intro {
  margin-top: .75rem;
  max-width: 30ch;
  color: var(--graphite);
}

.hero-detail {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.hero-detail img {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 420px;
  max-height: calc(100svh - var(--nav-h) - 6rem);
  object-fit: cover;
  object-position: 50% 30%;
  background: var(--paper);
}
.hero-detail figcaption {
  margin-top: .75rem;
  font-size: .8125rem;
  color: var(--graphite);
}
.hero-detail figcaption em { font-family: var(--serif); font-size: .9375rem; }

/* one orchestrated entrance */
@media (prefers-reduced-motion: no-preference) {
  .hero-name span {
    animation: rise 1.1s var(--ease) both;
  }
  .hero-name span + span { animation-delay: .12s; }
  .hero-tagline, .hero-intro { animation: fade 1s ease .55s both; }
  .hero-detail img { animation: unveil 1.5s var(--ease) .1s both; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(.18em); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes unveil {
  from { clip-path: inset(100% 0 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

/* ---------- shared section heads ---------- */

.works, .archive, .about, .contact {
  padding: clamp(5rem, 11vw, 10rem) var(--gutter);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(2rem, 5vw, 5rem);
  align-items: baseline;
  margin-bottom: clamp(3rem, 7vw, 6rem);
}
.section-head h2 {
  font: 400 clamp(2.5rem, 5.2vw, 4.5rem)/1 var(--serif);
  font-variation-settings: "opsz" 72;
  letter-spacing: -.01em;
}
.section-head p {
  max-width: 42ch;
  color: var(--graphite);
}

/* ---------- new works: one piece per wall ---------- */

/* artwork centred on the wall, label hung just to its right */
.piece {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(13rem, 1fr);
  column-gap: clamp(1.75rem, 3.5vw, 3.5rem);
  align-items: end;
}
.piece + .piece { margin-top: clamp(5rem, 12vw, 11rem); }

.piece-art {
  grid-column: 2;
  display: flex;
  justify-content: center;
}
.piece .label {
  grid-column: 3;
  justify-self: start;
}

.art {
  display: block;
  cursor: zoom-in;
}
.art img {
  width: auto;
  height: auto;
  background: var(--paper);
  box-shadow: 0 1px 1px rgb(0 0 0 / .04), 0 18px 40px -22px rgb(0 0 0 / .35);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.art:hover img {
  transform: translateY(-3px);
  box-shadow: 0 1px 1px rgb(0 0 0 / .05), 0 26px 50px -24px rgb(0 0 0 / .4);
}

.piece .art img {
  max-height: min(84vh, 1080px);
  max-width: 100%;
}

.label {
  padding-bottom: .25rem;
  max-width: 22rem;
}
.label-title {
  font: italic 400 clamp(1.375rem, 2vw, 1.75rem)/1.2 var(--serif);
  font-variation-settings: "opsz" 28;
}
.label-meta {
  margin-top: .75rem;
  font-size: .875rem;
  line-height: 1.7;
  color: var(--graphite);
}

/* ---------- archive: a deeper wall, grouped by year ---------- */

.archive { background: var(--wall-deep); }

.year {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 9fr);
  column-gap: clamp(1.5rem, 4vw, 4rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--rule);
}
.year + .year { margin-top: clamp(3rem, 7vw, 6rem); }

.year-head {
  align-self: start;
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}
.year-head h3 {
  font: 400 clamp(1.75rem, 2.6vw, 2.25rem)/1 var(--serif);
  font-variation-settings: "opsz" 36;
}
.year-head p {
  margin-top: .5rem;
  font: italic 400 1rem/1.4 var(--serif);
  color: var(--graphite);
}

.wall {
  columns: 3;
  column-gap: clamp(1.25rem, 3vw, 2.75rem);
}

.tile {
  break-inside: avoid;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
.tile .art img { width: 100%; }
.tile figcaption {
  margin-top: .875rem;
  display: flex;
  flex-direction: column;
  gap: .125rem;
}
.tile-title {
  font: italic 400 1.0625rem/1.3 var(--serif);
  font-variation-settings: "opsz" 18;
}
.tile-meta {
  font-size: .8125rem;
  color: var(--graphite);
}

/* ---------- about ---------- */

.about .section-head { margin-bottom: 0; }
.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(2rem, 5vw, 5rem);
}
.about .section-head { display: block; }

.about-lead {
  font: 400 clamp(1.5rem, 2.6vw, 2.25rem)/1.3 var(--serif);
  font-variation-settings: "opsz" 36;
  max-width: 24ch;
}

.range {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  gap: 1.5rem;
  max-width: 36rem;
}
.range div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.range dt {
  font-size: .875rem;
  color: var(--graphite);
}

/* ---------- contact ---------- */

.contact { border-top: 1px solid var(--rule); }

.contact-body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(2rem, 5vw, 5rem);
  align-items: baseline;
  row-gap: 1.25rem;
}

.contact-mail {
  grid-column: 1 / -1;
  justify-self: start;
  font: 400 clamp(1.75rem, 5.6vw, 5rem)/1.1 var(--serif);
  font-variation-settings: "opsz" 72;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: .12em;
  transition: background-size .45s var(--ease);
}
.contact-mail:hover { background-size: 0 1px; background-position: 100% 100%; }

.contact-phone {
  grid-column: 2;
  font-size: 1.0625rem;
  color: var(--graphite);
}
.contact-phone:hover { color: var(--ink); }

/* ---------- footer ---------- */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--gutter) 2rem;
  font-size: .8125rem;
  color: var(--graphite);
  border-top: 1px solid var(--rule);
}
.foot a:hover { color: var(--ink); }

/* ---------- viewer (lightbox) ---------- */

.viewer {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--wall);
  color: var(--ink);
  display: none;
  grid-template-rows: minmax(0, 1fr) auto;
}
.viewer[open] { display: grid; }
.viewer::backdrop { background: var(--wall); }

@media (prefers-reduced-motion: no-preference) {
  .viewer[open] { animation: fade .35s ease both; }
  .viewer-img.is-loading { opacity: 0; }
  .viewer-img { transition: opacity .35s ease; }
}

.viewer-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vh, 3rem) var(--gutter) 0;
  min-height: 0;
}
.viewer-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: var(--paper);
  box-shadow: 0 1px 1px rgb(0 0 0 / .04), 0 24px 60px -30px rgb(0 0 0 / .4);
}

.viewer-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem var(--gutter) 1.5rem;
}
.viewer-title {
  font: italic 400 1.375rem/1.2 var(--serif);
  font-variation-settings: "opsz" 24;
}
.viewer-meta {
  margin-top: .25rem;
  font-size: .8125rem;
  color: var(--graphite);
}

.viewer-controls {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-shrink: 0;
}
.viewer-count {
  font-size: .8125rem;
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
  margin-right: .75rem;
}
.viewer button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 .875rem/1 var(--sans);
  letter-spacing: .02em;
  height: 44px;
  min-width: 44px;
  padding: 0 .5rem;
  cursor: pointer;
  border-radius: 999px;
  transition: background-color .2s ease;
}
.viewer button:hover { background: rgb(0 0 0 / .06); }
.viewer button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  vertical-align: middle;
}
.viewer-close { margin-left: .75rem; padding: 0 1rem !important; border: 1px solid var(--rule) !important; }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .wall { columns: 2; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-right: var(--gutter);
    row-gap: 2.5rem;
    min-height: 0;
  }
  .hero-text { padding-bottom: 0; }
  .hero-detail {
    margin-inline: calc(-1 * var(--gutter));
  }
  .hero-detail img {
    min-height: 0;
    max-height: none;
    height: auto;
    aspect-ratio: 4 / 5;
  }
  .hero-detail figcaption { padding-inline: var(--gutter); }

  .section-head,
  .about,
  .contact-body {
    grid-template-columns: 1fr;
  }
  .section-head p { margin-top: 1rem; }
  .about-body { margin-top: 2rem; }
  .contact-phone { grid-column: 1; }

  .piece {
    grid-template-columns: 1fr;
    row-gap: 1.25rem;
  }
  .piece-art,
  .piece .label { grid-column: 1; }
  .piece-art { justify-content: flex-start; }
  .piece .art img { max-height: 78vh; }

  .year { grid-template-columns: 1fr; row-gap: 1.75rem; }
  .year-head { position: static; }
}

@media (max-width: 560px) {
  .nav-name { display: none; }
  .nav { justify-content: center; }
  .nav nav { gap: 1.5rem; }
  .hero-name { font-size: clamp(4.25rem, 22vw, 6rem); }
  .wall { column-gap: 1rem; }
  .tile-meta { display: none; }
  .range div { grid-template-columns: 1fr; gap: .25rem; }
  .viewer-bar { flex-direction: column; align-items: stretch; gap: .75rem; }
  .viewer-controls { justify-content: space-between; }
  .viewer-count { margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* =====================================================================
   Shared bits added for the multi-page site
   ===================================================================== */

.hero-name-single {
  font-size: clamp(3.75rem, 8.6vw, 8.5rem);
}

.hero-cta { margin-top: 1.5rem; }
.hero-cta a,
.text-button {
  font-size: .9375rem;
  color: var(--ink);
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size .35s var(--ease);
}
.hero-cta a:hover,
.text-button:hover { background-size: 0 1px; background-position: 100% 100%; }

.text-button {
  appearance: none;
  border: 0;
  background-color: transparent;
  font-family: var(--sans);
  font-size: .8125rem;
  color: var(--graphite);
  cursor: pointer;
  padding: 0 0 2px;
}
.text-button:hover { color: var(--ink); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.35rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 .9375rem/1 var(--sans);
  letter-spacing: .01em;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease;
}
.button:hover { background: var(--ink); color: var(--wall); }

.pixel {
  font-family: "Pixelify Sans", var(--sans);
  font-weight: 500;
  letter-spacing: 0;
}

/* ---------- profile: Brownian motion hero ---------- */

.hero-math .brownian {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  height: calc(100svh - var(--nav-h) - 6rem);
  min-height: 420px;
  background: var(--paper);
}
.hero-math figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-right: var(--gutter);
}

/* ---------- profile: MimooPet teaser ---------- */

.project {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
  padding: clamp(4rem, 9vw, 7rem) var(--gutter);
  background: var(--wall-deep);
}
.project-kind {
  font-size: .875rem;
  color: var(--graphite);
}
.project h2 {
  margin-top: .5rem;
  font-size: clamp(3rem, 6.5vw, 5.5rem);
  line-height: 1;
}
.project-text > p:not(.project-kind) {
  margin-top: 1.25rem;
  max-width: 44ch;
}
.project .button { margin-top: 2rem; }

.project-pets {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: .25rem;
  padding: 0 0 .5rem;
  border-bottom: 1px solid var(--rule);
  --s: 2;
}

/* ---------- pet sprites (atlas: 4 cols x 11 rows of 48px) ---------- */

.sprite {
  --s: 2;
  --y: 0px;
  display: inline-block;
  flex: none;
  width: calc(48px * var(--s));
  height: calc(48px * var(--s));
  background-repeat: no-repeat;
  background-size: calc(192px * var(--s)) calc(528px * var(--s));
  background-position: 0 var(--y);
  image-rendering: pixelated;
  animation: sprite-3 1s steps(3) var(--d, 0s) infinite;
}
.project-pets .sprite { --s: inherit; }
.project-pets:hover .sprite,
.pet-card:hover .sprite {
  --y: calc(-48px * var(--s));
  animation-duration: .5s;
}
@keyframes sprite-3 {
  from { background-position: 0 var(--y); }
  to   { background-position: calc(-144px * var(--s)) var(--y); }
}

/* ---------- profile: CV entries ---------- */

.cv { padding: clamp(5rem, 10vw, 8.5rem) var(--gutter) 0; }
.cv + .contact { margin-top: clamp(5rem, 10vw, 8.5rem); }

.entry {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(2rem, 5vw, 5rem);
  row-gap: 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}
.entry + .entry { margin-top: clamp(2.5rem, 5vw, 3.75rem); }

.entry-date {
  font-size: .875rem;
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
}
.entry-place {
  margin-top: .35rem;
  font: 400 clamp(1.25rem, 1.9vw, 1.625rem)/1.25 var(--serif);
  font-variation-settings: "opsz" 28;
}
.entry-what h3 {
  font: italic 400 clamp(1.25rem, 1.9vw, 1.625rem)/1.25 var(--serif);
  font-variation-settings: "opsz" 28;
}
.entry-sub {
  margin-top: .35rem;
  color: var(--graphite);
  font-size: .9375rem;
}
.entry ul {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  max-width: 60ch;
}
.entry li {
  position: relative;
  padding-left: 1.1em;
}
.entry li + li { margin-top: .3rem; }
.entry li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--pencil);
}

.skills {
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 5rem);
  margin-top: 0;
}
.skills div { grid-template-columns: 8rem minmax(0, 1fr); }

/* ---------- MimooPet page ---------- */

.page-mimoopet .foot { padding-bottom: 150px; }

.mp-hero {
  padding: calc(var(--nav-h) + clamp(3rem, 8vw, 6.5rem)) var(--gutter) clamp(3rem, 6vw, 5rem);
}
.mp-hero-text {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
}
.mp-title {
  grid-column: 1 / -1;
  font-size: clamp(3.75rem, 15.5vw, 15rem);
  line-height: .85;
  margin: 0 0 clamp(2rem, 4vw, 3.25rem) -.04em;
}
.mp-lead { grid-column: 1; grid-row: 2 / span 2; align-self: start; }
.mp-status { grid-column: 2; grid-row: 2; }
.mp-lead {
  font: 400 clamp(1.375rem, 2.2vw, 1.875rem)/1.3 var(--serif);
  font-variation-settings: "opsz" 28;
  max-width: 26ch;
}
.mp-status {
  margin-top: .35rem;
  max-width: 44ch;
  color: var(--graphite);
}
.mp-hero .button { grid-column: 2; grid-row: 3; margin-top: 1.5rem; justify-self: start; }

.mp-gif {
  margin-top: clamp(3rem, 7vw, 5.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mp-gif img {
  width: min(1026px, 100%);
  height: auto;
  image-rendering: pixelated;
}
.mp-gif figcaption {
  margin-top: .5rem;
  font-size: .8125rem;
  color: var(--graphite);
}

.mp-section { padding: clamp(4.5rem, 9vw, 8rem) var(--gutter) 0; }
.mp-section .section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }

.roster {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 2rem);
}
.pet-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.sprite-lg { --s: 3; }
.pet-name {
  margin-top: .25rem;
  font: 500 1.0625rem/1.2 "Pixelify Sans", var(--sans);
}
.pet-zh {
  margin-top: .2rem;
  font-size: .8125rem;
  color: var(--graphite);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3.5rem);
}
.steps li {
  counter-increment: step;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ink);
}
.steps li::before {
  content: counter(step);
  display: block;
  font: 500 clamp(2.5rem, 4vw, 3.5rem)/1 "Pixelify Sans", var(--sans);
  margin-bottom: 1rem;
}
.steps h3 {
  font: italic 400 1.5rem/1.2 var(--serif);
  font-variation-settings: "opsz" 24;
}
.steps p {
  margin-top: .5rem;
  color: var(--graphite);
  max-width: 34ch;
}

.try {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(2rem, 5vw, 5rem);
}
.try p {
  grid-column: 2;
  max-width: 44ch;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--pencil);
  font: 500 1.0625rem/1.5 "Pixelify Sans", var(--sans);
}

.mp-follow { padding-bottom: clamp(4rem, 8vw, 7rem); }
.mp-follow .contact-mail { font-size: clamp(1.75rem, 4.5vw, 3.75rem); }

/* the pets that live at the bottom of the page */
.pet-floor {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  z-index: 30;
  pointer-events: none;
}
.pet-floor.is-hidden { display: none; }
.pet {
  position: absolute;
  left: 0;
  bottom: 0;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  will-change: transform;
}
.pet.is-dragging { cursor: grabbing; }
.emote {
  position: absolute;
  left: 0;
  bottom: 0;
  image-rendering: pixelated;
  pointer-events: none;
}

/* ---------- responsive for the new pieces ---------- */

@media (max-width: 1100px) {
  .roster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero-math .brownian {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 5;
  }
  .hero-math figcaption { flex-direction: column; gap: .5rem; }
  .project,
  .entry,
  .mp-hero-text,
  .try { grid-template-columns: 1fr; }
  .try p { grid-column: 1; }
  .project-pets { margin-top: 2.5rem; }
  .mp-lead, .mp-status, .mp-hero .button { grid-column: 1; grid-row: auto; }
  .mp-status { margin-top: 1rem; }
  .steps { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .nav nav { gap: 1.1rem; }
  .nav nav a { font-size: .8125rem; }
  .nav-pet img { width: 21px; height: 22.5px; }
  .project-pets { --s: 1; }
  .project-pets .sprite { --s: 1; }
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sprite-lg { --s: 2; }
  .skills div { grid-template-columns: 1fr; gap: .25rem; }
  .page-mimoopet .foot { padding-bottom: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .sprite { animation: none !important; }
}

.entry-loc {
  margin-top: .2rem;
  font-size: .875rem;
  color: var(--graphite);
}
.entry-skills {
  margin-top: .9rem;
  font-size: .8125rem;
  color: var(--graphite);
}

/* =====================================================================
   Languages
   ===================================================================== */

/* Chinese pages: serif subset holding only the characters used there */
@font-face {
  font-family: "Noto Serif SC ZH";
  src: url("../fonts/noto-serif-sc-zh.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+2E80-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF;
}
html:lang(zh) {
  --serif: "Bodoni Moda", "GFS Didot", "Noto Serif SC ZH", "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "Hanken Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
html:lang(zh) body { line-height: 1.75; }
/* Chinese has no italic: never fake one; same for untranslated titles */
:lang(zh), [lang="und"] { font-synthesis: none; }
html:lang(zh) .section-head h2,
html:lang(zh) .hero-name-single { letter-spacing: .02em; }
html:lang(zh) .about-lead,
html:lang(zh) .mp-lead { line-height: 1.5; }

/* language menu */
.lang {
  position: relative;
  margin-left: .25rem;
}
.lang summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .4rem;
  min-height: 36px;
  padding: 0 .7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: .8125rem;
  letter-spacing: .04em;
  color: var(--graphite);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s ease;
}
.lang[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.lang summary:hover,
.lang[open] summary { color: var(--ink); border-color: var(--ink); }
.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  margin: 0;
  padding: .4rem;
  list-style: none;
  min-width: 9.5rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 16px 40px -24px rgb(0 0 0 / .35);
}
.nav .lang ul a {
  display: block;
  padding: .55rem .75rem;
  border-radius: 8px;
  background: none;
  color: var(--graphite);
  font-size: .875rem;
}
.nav .lang ul a:hover { background: var(--wall); color: var(--ink); }
.nav .lang ul a[aria-current="true"] { color: var(--ink); font-weight: 500; }

@media (max-width: 560px) {
  .lang { margin-left: 0; }
  .lang summary { min-height: 32px; padding: 0 .55rem; }
}
