/* ==========================================================================
   Hang Yu — a shelf of books on a Monet wall
   Vanilla CSS. Books are CSS 3D boxes; the wall is a procedurally painted
   canvas (assets/js/monet.js); interactions live in assets/js/shelf.js.
   ========================================================================== */

:root {
  --u: 1;                              /* shelf unit scale, set by JS */
  --paper: #f6f0e2;
  --paper-2: #efe6d3;
  --ink: #1b1a17;
  --muted: #5f5d56;
  --wall: #d3dbe2;
  --blue: #3e5f86;
  --rose: #c97b7f;
  --sage: #7d9a7a;
  --ochre: #c9a24e;
  --lilac: #a99cc4;
  --tile-brush: none;                  /* set by monet.js */
  --tile-weave: none;                  /* set by monet.js */
  --painting: none;                    /* set by monet.js */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-inout: cubic-bezier(.65, 0, .35, 1);
  --serif: "Cormorant Garamond", "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; overflow-x: hidden; }
html.no-anim .book, html.no-anim .volume, html.no-anim .hinge { transition: none !important; }
html, body { margin: 0; padding: 0; }
html.is-reading { overflow: hidden; }
body {
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, .5), transparent 34rem),
    linear-gradient(180deg, #dfe4ec 0%, #cdd8dd 55%, #b7c6bf 100%);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid rgba(27, 26, 23, .7); outline-offset: 4px; }
::selection { background: rgba(201, 123, 127, .35); }

/* --------------------------------------------------------------------------
   The wall: painted canvas + canvas weave + registration marks
   -------------------------------------------------------------------------- */
.painting {
  position: fixed; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  opacity: 0; transition: opacity 1.4s ease;
}
.painting.is-ready { opacity: 1; }
.wall-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--tile-weave);
  background-size: 4px 4px;
  opacity: .3;
}
.mark {
  position: fixed; width: 22px; height: 22px; opacity: .45; pointer-events: none; z-index: 1;
}
.mark::before, .mark::after { content: ""; position: absolute; background: rgba(27, 26, 23, .6); }
.mark::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.mark::after { top: 50%; left: 0; right: 0; height: 1px; }
.mark.tl { top: 18px; left: 18px; }
.mark.br { right: 18px; bottom: 18px; }

/* --------------------------------------------------------------------------
   Header: headshot + bio (top-left), volume index (top-right)
   -------------------------------------------------------------------------- */
.wall-header {
  padding: 24px 32px 0;
}
.card {
  position: relative;
  display: flex; gap: 32px; align-items: flex-start;
  width: min(100%, max(70%, 640px));
  padding: 26px 30px 24px 26px;
  background:
    var(--tile-weave),
    linear-gradient(180deg, #faf5ea, #f3ecdb);
  background-size: 4px 4px, auto;
  box-shadow: 0 14px 34px rgba(30, 40, 60, .22), 0 1px 0 rgba(255, 255, 255, .7) inset;
  transform: rotate(-.35deg);
}
.card::before, .card::after {
  content: ""; position: absolute; width: 74px; height: 22px; top: -11px;
  background: rgba(220, 205, 172, .62);
  border-left: 1px dashed rgba(255, 255, 255, .55);
  border-right: 1px dashed rgba(255, 255, 255, .55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.card::before { left: 34px; transform: rotate(-5deg); }
.card::after { right: 40px; transform: rotate(4deg); }
.portrait { flex: 0 0 auto; width: 256px; position: relative; margin-top: 4px; }
.portrait img {
  display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover;
  border: 8px solid #fff; border-bottom-width: 26px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .2);
  transform: rotate(-2.4deg);
  background: #fff;
}
.portrait .tape {
  position: absolute; left: 50%; top: -10px; width: 68px; height: 20px; margin-left: -34px;
  background: rgba(214, 196, 160, .6);
  border-left: 1px dashed rgba(255, 255, 255, .5); border-right: 1px dashed rgba(255, 255, 255, .5);
  transform: rotate(2deg);
}
.bio { min-width: 0; flex: 1 1 auto; }
.bio-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.bio h1 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 1.3rem + 1.4vw, 2.6rem);
  letter-spacing: .01em; line-height: 1.05; margin: 0;
}
.bio h1 .cn { font-weight: 500; color: var(--muted); font-size: .72em; margin-left: .35em; }
.bio .role {
  margin: 0; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); font-weight: 600;
}
.bio p.text { margin: 0; font-size: 1.02rem; line-height: 1.55; color: #2a2925; }
.social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill {
  font-size: .8rem; padding: 4px 12px; letter-spacing: .04em; text-align: center; white-space: nowrap;
  border: 1px solid rgba(27, 26, 23, .28); color: var(--ink); background: rgba(255, 255, 255, .45);
  border-radius: 2px;
}
.pill:hover { background: #fff; text-decoration: none; border-color: var(--ink); }


/* --------------------------------------------------------------------------
   Shelf
   -------------------------------------------------------------------------- */
.shelf-wrap {
  margin-top: auto;                    /* keep the books and shelf at the bottom, above the footer */
  padding: clamp(64px, 11vh, 130px) 24px 40px;
}
.shelf {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end;
  row-gap: calc(64px * var(--u)); margin: 0 auto;
}
.shelf-row {
  position: relative;
  display: flex; align-items: flex-end;
  gap: calc(16px * var(--u));
  padding: 0 calc(22px * var(--u));
}
.shelf-row::after {              /* the plank */
  content: ""; position: absolute; left: calc(-6px * var(--u)); right: calc(-6px * var(--u));
  bottom: calc(-15px * var(--u)); height: calc(15px * var(--u));
  z-index: -1;
  background:
    var(--tile-brush),
    linear-gradient(180deg, #d5b78a 0%, #b9955f 36%, #9c7a48 70%, #7f6138 100%);
  background-size: 128px 128px, auto;
  box-shadow: 0 10px 22px rgba(30, 30, 40, .28), 0 1px 0 rgba(255, 255, 255, .35) inset;
}
.shelf-row::before {             /* wall shadow above plank */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(30px * var(--u));
  z-index: -1;
  background: linear-gradient(180deg, transparent, rgba(40, 50, 70, .16));
}
.shelf-tag {
  text-align: center; margin: 16px auto 0; font-size: .7rem; letter-spacing: .28em; text-transform: uppercase;
  color: rgba(27, 26, 23, .7); font-weight: 600;
}
.shelf-tag small { display: block; letter-spacing: .12em; text-transform: none; font-weight: 400; margin-top: 4px; opacity: .8; }

.slot {
  position: relative;
  --bw: calc(var(--w) * var(--u) * 1px);
  --bh: calc(var(--h) * var(--u) * 1px);
  --bd: calc(var(--d) * var(--u) * 1px);
  width: var(--bd); height: var(--bh);
}
.slot::after {                  /* shadow on the plank */
  content: ""; position: absolute; left: -8%; right: -8%; bottom: calc(-6px * var(--u)); height: calc(10px * var(--u));
  background: radial-gradient(ellipse at center, rgba(20, 30, 50, .42), transparent 68%);
  filter: blur(2px); z-index: 1; pointer-events: none;
}
.slot.has-sheet::before {        /* translucent backing sheet behind the book */
  content: ""; position: absolute; left: -14%; right: -12%; top: -5%; bottom: 0;
  background: rgba(244, 241, 232, .45);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset;
  transform: rotate(var(--sheet-tilt, -.8deg)); transform-origin: 50% 100%;
}

.book {
  position: absolute; top: 0;
  left: calc((var(--bd) - var(--bw)) / 2);
  width: var(--bw); height: var(--bh);
  perspective: none;                 /* orthographic on the shelf, like the reference */
  transform-origin: 50% 50%;
  transform: translate3d(0, 0, 0) scale(1);
  transition: transform .42s var(--ease-out);
  z-index: 2; cursor: pointer;
  will-change: transform;
  pointer-events: none;              /* the box is cover-wide; only the faces are real targets */
}
.book .face { pointer-events: auto; }
.slot:hover .book:not(.is-out) { transform: translate3d(0, calc(-16px * var(--u)), 0) scale(1); }
.book:has(.spine:focus-visible):not(.is-out) { transform: translate3d(0, calc(-16px * var(--u)), 0) scale(1); }
.book.is-fixed { position: fixed; }
.book.has-depth { perspective: calc(1500px * var(--u)); }
.book.is-out {
  z-index: 50;
  transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) scale(var(--s, 1));
  transition: transform .85s var(--ease-inout);
  cursor: default;
}
.book.is-out:not(.is-open) { cursor: pointer; }

.volume {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform: rotateZ(var(--tilt, 0deg)) translateX(0px) translateZ(calc(var(--bw) * -.5)) rotateX(0deg) rotateY(90deg);
  transition: transform .85s var(--ease-inout);
  will-change: transform;
}
.slot:hover .book:not(.is-out) .volume {
  transform: rotateZ(var(--tilt, 0deg)) translateX(0px) translateZ(calc(var(--bw) * -.5)) rotateX(0deg) rotateY(80deg);
}
.book:has(.spine:focus-visible):not(.is-out) .volume {
  transform: rotateZ(var(--tilt, 0deg)) translateX(0px) translateZ(calc(var(--bw) * -.5)) rotateX(0deg) rotateY(80deg);
}
.book.is-out .volume {
  transform: rotateZ(0deg) translateX(0px) translateZ(calc(var(--bd) * -.5)) rotateX(-3deg) rotateY(-8deg);
}
.book.is-open .volume {
  transform: rotateZ(0deg) translateX(calc(var(--bw) * .5)) translateZ(calc(var(--bd) * -.5)) rotateX(0deg) rotateY(0deg);
}

/* Faces ------------------------------------------------------------------ */
.face {
  position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  margin: 0; padding: 0; border: 0; font: inherit; color: inherit; text-align: left; background: none;
}
button.face { cursor: pointer; }
.face::before {                      /* oil-paint brush grain on every board */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--tile-brush), var(--tile-weave);
  background-size: 256px 256px, 4px 4px;
  opacity: .8;
}
.spine, .fore {
  left: calc((var(--bw) - var(--bd)) / 2); top: 0;
  width: var(--bd); height: var(--bh);
}
.spine { transform: rotateY(-90deg) translateZ(calc(var(--bw) * .5)); }
.fore  { transform: rotateY(90deg) translateZ(calc(var(--bw) * .5)); }
.edge-top, .edge-bottom {
  left: 0; top: calc((var(--bh) - var(--bd)) / 2);
  width: var(--bw); height: var(--bd);
}
.edge-top    { transform: rotateX(90deg) translateZ(calc(var(--bh) * .5)); }
.edge-bottom { transform: rotateX(-90deg) translateZ(calc(var(--bh) * .5)); }
.back  { inset: 0; transform: rotateY(180deg) translateZ(calc(var(--bd) * .5)); }
.page  { inset: 0; transform: translateZ(calc(var(--bd) * .5 - 2px)); }
.hinge {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform-origin: 0 50%;
  transform: translateZ(calc(var(--bd) * .5)) rotateY(0deg);
  transition: transform 1.05s var(--ease-inout);
  will-change: transform;
}
.book.is-open .hinge { transform: translateZ(calc(var(--bd) * .5)) rotateY(-180deg); }
.cover        { inset: 0; transform: translateZ(1.5px); }
.cover-inside { inset: 0; transform: rotateY(180deg) translateZ(1.5px); }

/* Page block edges: cream paper with leaf lines */
.fore, .edge-top, .edge-bottom {
  background:
    repeating-linear-gradient(180deg, rgba(120, 100, 70, .16) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, #e2d8c2, #f2ebda 40%, #eee6d3 70%, #d9cfb7);
}
.edge-top, .edge-bottom {
  background:
    repeating-linear-gradient(90deg, rgba(120, 100, 70, .14) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #e2d8c2, #f2ebda 45%, #d9cfb7);
}
.edge-top::before, .edge-bottom::before, .fore::before { opacity: .3; }
.page::before, .cover-inside::before { background-image: var(--tile-weave); background-size: 4px 4px; opacity: .35; }
.cover-inside::before { display: none; }
.two-page .cover-inside {
  background:
    linear-gradient(270deg, rgba(60, 40, 20, .2), rgba(60, 40, 20, .06) 4%, transparent 9%),
    linear-gradient(180deg, #f9f4e8, #f3ecdb);
}
.two-page .cover-inside::after { display: none; }
.two-page .page-inner { font-size: calc(14.5px / var(--s, 1)); padding: 4% 5% 3.5% 7%; line-height: 1.3; }
.two-page .page-left { padding: 4% 7% 3.5% 5%; }
@media (max-height: 930px) { .two-page .page-inner { font-size: calc(13.5px / var(--s, 1)); } }
@media (max-height: 820px) { .two-page .page-inner { font-size: calc(12.5px / var(--s, 1)); } }
.two-page .page-inner .folio { display: none; }   /* both pages are content; no running heads */
.two-page .page-inner h2 { font-size: 1.75em; margin: 0 0 .15em; }
.two-page .page-inner h3 { font-size: 1.15em; margin: .55em 0 .3em; }
.two-page .page-left h3:first-of-type { margin-top: .1em; }
.two-page .page-inner > h3:first-child { margin-top: .1em; }
.two-page .pub { grid-template-columns: 50% 1fr; gap: .75em; padding: .38em 0; align-items: center; }
.two-page .pub img { aspect-ratio: 2.3 / 1; border-width: 3px; }
.two-page .pub h4 { font-size: 1em; line-height: 1.2; margin-bottom: .15em; }
.two-page .pub .authors { font-size: .86em; line-height: 1.25; margin-bottom: .1em; }
.two-page .pub .venue { font-size: .82em; margin-bottom: .15em; line-height: 1.25; }
.two-page .pub .links { font-size: .74em; }
/* the right page: journals with half-width figures, then three compact workshop cards in a row */
.two-page .pub-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9em; }
.two-page .pub-row .pub { display: block; padding: 0; border: 0; }
.two-page .pub-row .pub img { width: 100%; aspect-ratio: 1.7 / 1; margin-bottom: .45em; }
.two-page .pub-row .pub h4 { font-size: .86em; line-height: 1.25; }
.two-page .pub-row .pub .venue { font-size: .76em; }
@media (max-width: 760px) {
  .two-page .pub-row { grid-template-columns: 1fr; }
}
/* when the left page has been folded into the right page (phones) it flows inline */
.page-inner .page-left { position: static; padding: 0 0 1em; overflow: visible; font-size: inherit; }
.page-inner .page-left .folio { display: none; }

/* Board surfaces (spine, cover, back) */
.spine, .cover, .back {
  color: var(--ink-c, var(--ink));
  background:
    linear-gradient(180deg, transparent calc(100% - var(--band-h, 0%)), var(--band, transparent) calc(100% - var(--band-h, 0%))),
    var(--surface, none),
    var(--base);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06) inset;
}
.spine {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .22), rgba(255, 255, 255, .08) 18%, rgba(255, 255, 255, .16) 46%, rgba(0, 0, 0, .04) 78%, rgba(0, 0, 0, .3)),
    linear-gradient(180deg, transparent calc(100% - var(--band-h, 0%)), var(--band, transparent) calc(100% - var(--band-h, 0%))),
    var(--surface, none),
    var(--base);
}
.cover {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .04) 6%, transparent 12%),
    linear-gradient(180deg, transparent calc(100% - var(--band-h, 0%)), var(--band, transparent) calc(100% - var(--band-h, 0%))),
    var(--surface, none),
    var(--base);
}
.back {
  background:
    linear-gradient(270deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .04) 6%, transparent 12%),
    var(--surface, none),
    var(--base);
}

/* Materials */
.m-paper  { --surface: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(180, 160, 120, .08)); }
.m-vellum { --surface: repeating-linear-gradient(0deg, rgba(255, 255, 255, .18) 0 2px, rgba(170, 180, 200, .08) 2px 5px); }
.m-matte  { --surface: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(0, 0, 0, .1)); }
.m-cloth  {
  --surface:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .08) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .1) 0 1px, transparent 1px 3px);
}
.m-cloth .face::before { opacity: .7; }

/* Spine typography */
.spine .num {
  position: absolute; left: 0; right: 0; top: 7%;
  text-align: center; font-size: calc(var(--bh) * .034); letter-spacing: .12em;
  font-variant-numeric: tabular-nums; opacity: .85;
}
.spine .label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; transform: rotate(180deg);
  text-transform: uppercase; letter-spacing: .34em; font-weight: 600;
  font-size: min(calc(var(--bd) * .3), calc(var(--bh) * .05));
  padding-top: calc(var(--bh) * .08);
}
.spine .rule {
  position: absolute; left: 50%; top: 13%; width: 1px; height: 6%;
  background: currentColor; opacity: .5;
}

/* Tape pieces and tabs */
.tape {
  position: absolute; pointer-events: none;
  background: rgba(214, 196, 160, .58);
  border-left: 1px dashed rgba(255, 255, 255, .5); border-right: 1px dashed rgba(255, 255, 255, .5);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}
.tape.blue  { background: rgba(48, 84, 150, .55); }
.tape.linen { background: rgba(214, 208, 190, .62); }
.tab {
  position: absolute; pointer-events: none; border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
}

/* Cover layout (visible when the book is out) */
.cover { display: flex; flex-direction: column; justify-content: space-between; }
.cover .c-num { position: absolute; top: 6%; right: 8%; font-size: calc(15px / var(--s, 1)); letter-spacing: .12em; opacity: .85; }
.cover .c-body { padding: 13% 10% 10% 13%; display: flex; flex-direction: column; height: 100%; }
.cover .c-title {
  display: block;
  font-family: var(--serif); font-weight: 600; font-size: calc(46px / var(--s, 1)); line-height: 1.02; margin: 0 0 .35em;
  letter-spacing: .005em; max-width: 9ch;
}
.cover .c-copy { font-size: calc(15.5px / var(--s, 1)); line-height: 1.5; opacity: .88; max-width: 26ch; margin: 0; }
.cover .c-hint {
  margin-top: auto; font-size: calc(11px / var(--s, 1)); letter-spacing: .22em; text-transform: uppercase; opacity: .75;
  display: flex; align-items: center; gap: .8em;
}
.cover .c-hint::before { content: ""; width: 3em; height: 1px; background: currentColor; }
.cover .c-rule { position: absolute; left: 13%; right: 10%; bottom: 8%; height: 1px; background: currentColor; opacity: .35; }

/* Inside of the front cover: Monet endpaper with a pasted title label */
.cover-inside {
  background: var(--painting), linear-gradient(180deg, #c9d3dd, #aebfbb);
  background-size: cover; background-position: var(--endpaper-pos, 50% 50%);
  color: var(--ink);
}
.cover-inside::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(270deg, rgba(0, 0, 0, .22), transparent 14%);
}
.title-page {
  position: absolute; left: 12%; right: 14%; top: 14%;
  padding: 7% 8% 8%;
  background: var(--paper);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .22);
  font-size: calc(14px / var(--s, 1));
  transform: rotate(-.6deg);
}
.title-page .tp-num { font-size: .78em; letter-spacing: .2em; color: var(--muted); }
.title-page h3 { font-family: var(--serif); font-weight: 600; font-size: 2.1em; line-height: 1.02; margin: .3em 0 .35em; }
.title-page p { margin: 0; font-size: .95em; line-height: 1.5; color: #2a2925; }
.title-page .tp-notes { margin-top: 1.1em; padding-top: .8em; border-top: 1px solid rgba(27, 26, 23, .25); display: flex; flex-wrap: wrap; gap: .45em .9em; }
.title-page .tp-notes span { font-size: .72em; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* The page ---------------------------------------------------------------- */
.page {
  background:
    linear-gradient(90deg, rgba(60, 40, 20, .2), rgba(60, 40, 20, .06) 4%, transparent 9%),
    linear-gradient(180deg, #f9f4e8, #f3ecdb);
  color: var(--ink);
  overflow: hidden;
}
.page-inner {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 8% 8% 9% 11%;
  font-size: calc(17px / var(--s, 1));
  line-height: 1.55;
  outline: none;
}
@supports not selector(::-webkit-scrollbar) {
  .page-inner { scrollbar-width: thin; scrollbar-color: rgba(27, 26, 23, .35) transparent; }
}
.page-inner::-webkit-scrollbar { width: 5px; }
.page-inner::-webkit-scrollbar-button { display: none; }
.page-inner::-webkit-scrollbar-track { background: transparent; }
.page-inner::-webkit-scrollbar-thumb { background: rgba(27, 26, 23, .28); border-radius: 3px; }
.page-inner > *:first-child { margin-top: 0; }
.page-inner .folio {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .7em; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 1.4em; padding-bottom: .6em; border-bottom: 1px solid rgba(27, 26, 23, .22);
}
.page-inner h2 {
  font-family: var(--serif); font-weight: 600; font-size: 2.15em; line-height: 1.05; margin: 0 0 .5em;
}
.page-inner h3 {
  font-family: var(--serif); font-weight: 600; font-size: 1.35em; margin: 1.6em 0 .5em; line-height: 1.15;
  display: flex; align-items: center; gap: .6em;
}
.page-inner h3::after { content: ""; flex: 1; height: 1px; background: rgba(27, 26, 23, .18); }
.page-inner h4 { font-size: 1.02em; font-weight: 600; margin: 0 0 .25em; line-height: 1.3; }
.page-inner p { margin: 0 0 .9em; }
.page-inner .lede { font-size: 1.05em; }
.page-inner .kicker { font-size: .72em; letter-spacing: .18em; text-transform: uppercase; color: var(--blue); font-weight: 600; }
.page-inner .meta { color: var(--muted); font-size: .92em; }
.page-inner .callout {
  border: 1px dashed rgba(27, 26, 23, .3); padding: .7em .9em; margin: 1em 0 1.2em;
  background: rgba(255, 255, 255, .35); font-size: .95em; color: #2a2925;
}
.page-inner ul { padding-left: 1.2em; margin: .3em 0 1em; }
.page-inner li { margin: .25em 0; }
.page-inner .entry { padding: .85em 0; border-bottom: 1px solid rgba(27, 26, 23, .14); }
.page-inner .entry:last-child { border-bottom: 0; }
.page-inner .entry .meta { margin-top: .15em; }
.page-inner .entry ul { margin-bottom: 0; }

.ri-figs { display: grid; grid-template-columns: 1fr 1fr; gap: .7em; margin: .6em 0 1em; }
.ri-figs img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; border: 4px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
.ri-figs figcaption { font-size: .72em; color: var(--muted); margin-top: .35em; }

/* News */
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 5.6em 1fr; gap: .8em; padding: .7em 0; border-bottom: 1px solid rgba(27, 26, 23, .14); }
.news li:last-child { border-bottom: 0; }
.news .date { font-size: .74em; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: .35em; font-weight: 600; }
.news .venue { font-weight: 600; }
.stamp {
  display: inline-block; font-size: .66em; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  padding: .15em .55em; margin-right: .5em; border: 1px solid currentColor; border-radius: 2px; vertical-align: .1em;
  transform: rotate(-1.5deg);
}
.st-work  { color: #6b4b8e; }
.st-talk  { color: #a13f5c; }
.st-mentor{ color: #3f7250; }
.st-award { color: #a5701a; }
.st-paper { color: #2f5a8a; }

/* Publications */
.pubs { list-style: none; padding: 0; margin: 0; }
.pub { display: grid; grid-template-columns: 32% 1fr; gap: .9em; padding: .9em 0; border-bottom: 1px solid rgba(27, 26, 23, .14); align-items: start; }
.pub:last-child { border-bottom: 0; }
.pub img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
.pub .authors { font-size: .9em; color: #2a2925; margin: 0 0 .15em; }
.pub .venue { font-size: .86em; color: var(--muted); margin: 0 0 .3em; }
.pub .links { font-size: .8em; letter-spacing: .06em; text-transform: uppercase; margin: 0; display: flex; flex-wrap: wrap; gap: .3em 1em; }

/* Life */
.life-grid { display: grid; gap: .6em; grid-template-columns: 1fr 1fr; }
.life-grid > * { border: 4px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .18); overflow: hidden; background: #fff; }
.life-grid img, .life-grid video { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 4/3; }
.life-grid .wide { grid-column: 1 / -1; }
.life-grid .wide video { aspect-ratio: 16/9; }

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 0 0 1em; }
.contact-list li { display: grid; grid-template-columns: 6.5em 1fr; gap: .8em; padding: .55em 0; border-bottom: 1px solid rgba(27, 26, 23, .14); }
.contact-list .k { font-size: .72em; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding-top: .3em; font-weight: 600; }

/* --------------------------------------------------------------------------
   Reading stage: veil + close control
   -------------------------------------------------------------------------- */
.veil {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(30, 38, 54, .32);
  backdrop-filter: blur(6px) saturate(.85); -webkit-backdrop-filter: blur(6px) saturate(.85);
  opacity: 0; pointer-events: none; transition: opacity .6s ease;
}
html.is-reading .veil { opacity: 1; pointer-events: auto; }
.stage-ui {
  position: fixed; top: 16px; right: 20px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity .4s ease, transform .4s var(--ease-out);
}
html.is-reading .stage-ui { opacity: 1; pointer-events: auto; transform: none; }
.stage-ui .hint { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.stage-close {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .6);
  background: rgba(246, 240, 226, .92); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
  display: grid; place-items: center; font-family: var(--sans);
}
.stage-close:hover { background: #fff; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  text-align: center; padding: 4px 20px 16px; font-size: .74rem; letter-spacing: .06em;
  color: rgba(27, 26, 23, .72);
}
.footer a { color: inherit; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .wall-header { padding: 22px 18px 0; }
  .card { width: 100%; }
}
@media (max-width: 640px) {
  .card { flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px 18px 16px; }
  .portrait { width: 132px; }
  .bio p.text { font-size: .9rem; }
  .shelf-wrap { padding: 36px 8px 60px; }
  .stage-ui { top: 10px; right: 10px; }
  .stage-ui .hint { display: none; }
  .pub { grid-template-columns: 1fr; }
  .pub img { max-width: 60%; }
  .news li { grid-template-columns: 1fr; gap: .15em; }
  .ri-figs { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  /* Mobile reader: the cover faces you squarely; opened, it swings away and only the page stays centered */
  .book.is-out .volume {
    transform: rotateZ(0deg) translateX(0px) translateZ(calc(var(--bd) * -.5)) rotateX(-2deg) rotateY(-5deg);
  }
  .book.is-open .volume {
    transform: rotateZ(0deg) translateX(0px) translateZ(calc(var(--bd) * -.5)) rotateX(0deg) rotateY(0deg);
  }
  .book.is-open .cover-inside { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .book, .volume, .hinge, .veil, .stage-ui, .painting, .index a { transition-duration: .01ms !important; }
}
