@font-face { font-family: "Paper Mono"; src: url("PaperMono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
:root {
  --bg: #f1efeb;
  --bg-elev: #faf9f6;
  --ink: #1b1a18;
  --ink-2: #4b4842;
  --ink-3: #8a857c;
  --rule: #dcd8d0;
  --link: #1f9be0;
  --pill: #1f9be0;
  --prose: #3a3833;
  --shadow: rgba(30, 25, 15, .4);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Paper Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(16px, 4.6vw, 66px);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.645, .045, .355, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #131210;
  --bg-elev: #1a1916;
  --ink: #ece8e1;
  --ink-2: #b4aea3;
  --ink-3: #7e786e;
  --rule: #2d2b27;
  --link: #5bbcf2;
  --pill: #2a8fd0;
  --prose: #cfc9bf;
  --shadow: rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --bg: #131210;
  --bg-elev: #1a1916;
  --ink: #ece8e1;
  --ink-2: #b4aea3;
  --ink-3: #7e786e;
  --rule: #2d2b27;
  --link: #5bbcf2;
  --pill: #2a8fd0;
  --prose: #cfc9bf;
  --shadow: rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--bg); }

/* ---------- nav ---------- */
.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px var(--gutter);
  position: relative;
  z-index: 10;
}
.nav .mark { display: flex; align-items: center; gap: 12px; font: 400 24px/1 var(--serif); letter-spacing: -.01em; }
.nav .mark svg { width: 34px; height: 34px; flex: none; color: var(--ink); transition: transform .6s var(--ease); }
.nav .mark:hover svg { transform: rotate(-20deg); }
.nav .links { display: flex; gap: clamp(18px, 3.4vw, 50px); font-size: 13.5px; color: var(--ink-2); }
.nav .links a, .nav .right a { transition: color .2s var(--ease); }
.nav .links a:hover, .nav .right a:hover { color: var(--ink); }
.nav .links a[aria-current] { color: var(--ink); }
.nav .right { justify-self: end; font-size: 13.5px; display: flex; align-items: center; gap: 22px; }
.theme { background: none; border: 0; padding: 4px; margin: -4px; color: var(--ink-2); cursor: pointer; display: grid; transition: color .2s var(--ease), transform .4s var(--ease); }
.theme:hover { color: var(--ink); }
.theme svg { width: 17px; height: 17px; transition: transform .4s var(--ease); }
:root[data-theme="dark"] .theme svg { transform: rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme svg { transform: rotate(180deg); } }
@media (max-width: 720px) {
  .nav { grid-template-columns: auto 1fr auto; }
  .nav .right { margin-left: 20px; }
  .nav .links { justify-self: end; gap: 18px; font-size: 14px; }
  .nav .right .gh { display: none; }
  .nav .mark span { display: none; }
}

/* ---------- hero ---------- */
.hero { text-align: center; padding: clamp(60px, 13vh, 150px) var(--gutter) 0; }
.hero h1 { font: 400 clamp(52px, 7.4vw, 104px)/1 var(--serif); letter-spacing: -.02em; margin: 0; }
.hero .eyebrow { font: 500 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 22px; }
.hero p { margin: 22px auto 0; font-size: clamp(14px, 1.25vw, 17px); color: var(--ink-2); max-width: 60ch; letter-spacing: 0; }

/* ---------- 3d shelf ---------- */
.shelf {
  position: relative;
  height: clamp(330px, 46vw, 640px);
  margin-top: clamp(10px, 3vh, 40px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.shelf-cap {
  position: absolute; left: 0; top: 0; z-index: 100000; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 14px 10px; border-radius: 12px; white-space: nowrap;
  background: var(--ink); color: var(--bg); box-shadow: 0 12px 30px -12px rgba(0,0,0,.45);
  opacity: 0; transform: translate(-50%, calc(-100% + 6px)) scale(.97);
  transition: opacity .15s ease, transform .2s var(--ease-out);
}
.shelf-cap.on { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.shelf-cap b { font: italic 400 19px/1.1 var(--serif); letter-spacing: -.005em; }
.shelf-cap span { font: 400 11px/1.2 var(--sans); letter-spacing: .04em; opacity: .7; }
.shelf-cap::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: var(--ink); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.shelf-track { position: absolute; left: calc(50% - 90px); top: 24%; }
.book3d {
  --w: clamp(124px, 15vw, 220px);
  --h: calc(var(--w) * 1.36);
  --d: calc(var(--w) * .13);
  position: absolute;
  left: 0; top: 0;
  width: var(--w);
  height: var(--h);
  cursor: pointer;
  will-change: transform;
}
.book3d .rot {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(-24deg) rotateY(34deg);
}
.book3d .lift {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform .5s var(--ease);
}
@media (hover: hover) { .book3d:hover .lift { transform: translateY(-9%); } }
.book3d:focus-visible .lift { transform: translateY(-9%); }
.book3d .face { position: absolute; backface-visibility: hidden; }
.book3d .hinge3d {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform-origin: left center;
  transform: translateZ(calc(var(--d) / 2));
  transition: transform .5s var(--ease-out);
}
.book3d .front { inset: 0; background-size: cover; background-position: center; }
.book3d .inside { inset: 0; transform: rotateY(180deg); box-shadow: inset -10px 0 18px -10px rgba(0,0,0,.35); }
.book3d .page {
  inset: 0 1px 0 0;
  transform: translateZ(calc(var(--d) / 2 - 1px));
  background: #f7f4ec; color: #2b2925;
  container-type: inline-size;
}
@media (hover: hover) { .book3d:hover .hinge3d { transform: translateZ(calc(var(--d) / 2)) rotateY(-16deg); } }
.book3d.open .lift { transform: translateY(-9%); }
.book3d.open .hinge3d { transform: translateZ(calc(var(--d) / 2)) rotateY(-105deg); transition: transform .5s var(--ease-in-out); }
.book3d .front::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,0) 7%, rgba(255,255,255,.07) 9%, rgba(0,0,0,0) 14%);
}
.book3d .spine {
  top: 0; left: 0;
  width: var(--d); height: var(--h);
  transform: translateX(calc(var(--d) / -2)) rotateY(-90deg);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 10px 0 9px;
  color: #fff;
  overflow: hidden;
}
.book3d .spine .t {
  writing-mode: vertical-rl;
  font: italic 400 calc(var(--d) * .68)/1 var(--serif);
  white-space: nowrap;
  letter-spacing: .005em;
  display: flex; gap: .7em; align-items: baseline;
}
.book3d .spine .t small { font-size: .62em; opacity: .78; font-family: var(--sans); font-style: normal; letter-spacing: .08em; }
.book3d .spine .yr { font: 500 calc(var(--d) * .3)/1 var(--sans); opacity: .8; letter-spacing: .02em; }
.book3d .top {
  left: 0; top: 0;
  width: var(--w); height: var(--d);
  transform: translateY(calc(var(--d) / -2)) rotateX(90deg);
  background: repeating-linear-gradient(0deg, #f7f5ef 0 1.5px, #e7e3da 1.5px 2.5px);
}
.book3d .top::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; }
.shelf-hint { text-align: center; color: var(--ink-3); font-size: 13px; margin: 4px 0 0; }

/* ---------- section heads ---------- */
.wrap { padding: 0 var(--gutter); max-width: 1500px; margin: 0 auto; }
.head {
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px 40px;
  padding-top: clamp(40px, 7vw, 90px);
}
.head h2, .head h1 { font: italic 400 clamp(38px, 3.6vw, 52px)/1.05 var(--serif); margin: 0; letter-spacing: -.015em; }
.head .brace { font: italic 400 clamp(22px, 2.4vw, 34px)/1.1 var(--serif); color: var(--ink); }

.pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 34px 0 0; align-items: center; }
.pill {
  appearance: none; border: 0; background: none; cursor: pointer;
  font: 400 13.5px/1 var(--sans); color: var(--ink-2);
  padding: 10px 17px; border-radius: 999px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.pill:hover { color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--pill); color: #fff; }
.search {
  margin-left: auto;
  font: 400 13.5px/1 var(--sans); color: var(--ink);
  border: 0; border-bottom: 1px solid var(--rule); background: transparent;
  padding: 10px 2px; width: min(260px, 100%); outline: none;
  transition: border-color .2s var(--ease);
}
.search:focus { border-color: var(--ink); }
.pills.solo .search { margin-left: 0; width: 100%; font-size: 16px; padding: 14px 2px; }
@media (max-width: 720px) { .search { margin-left: 0; width: 100%; } }

/* ---------- library grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 42vw), 1fr));
  gap: clamp(26px, 3vw, 46px) clamp(16px, 2.2vw, 34px);
  padding: 40px 0 20px;
}
.card { display: block; }
.card .meta { margin-top: 14px; }
.card .meta b { display: block; font: 400 20px/1.15 var(--serif); }
.card .meta span { font-size: 12px; color: var(--ink-3); }

/* flat cover with typography */
.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 3px 6px 6px 3px;
  overflow: hidden;
  background: var(--c-ink, #333) center / cover no-repeat;
  color: var(--c-paper, #fff);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 24px -14px var(--shadow);
  container-type: inline-size;
}
.cover::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.24), rgba(0,0,0,0) 3.5%, rgba(255,255,255,.08) 4.5%, rgba(0,0,0,0) 8%);
  z-index: 1;
}
.cover img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .scrim { position: absolute; inset: 0; background: linear-gradient(180deg, var(--c-ink-a) 0%, transparent 26%, transparent 52%, var(--c-ink-a) 78%, var(--c-ink) 100%); }
.cover .ct { position: absolute; left: 9%; right: 8%; z-index: 2; }
.cover .ct.top { top: 6.5%; }
.cover .ct.bot { bottom: 6%; }
.cover .kicker { font: 600 3.6cqw/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; opacity: .92; }
.cover .title {
  font: 400 15cqw/.92 var(--serif);
  letter-spacing: -.02em;
  text-shadow: 0 1px 14px rgba(0,0,0,.25);
  overflow-wrap: anywhere;
}
.cover .title.long { font-size: 11.5cqw; }
.cover .title.xlong { font-size: 9.5cqw; }
.cover .sub { font: 600 3.2cqw/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; margin-top: 3.5cqw; opacity: .9; display: flex; justify-content: space-between; }

.empty { padding: 60px 0; color: var(--ink-3); text-align: center; display: none; }

/* ---------- directory list ---------- */
.list { margin-top: 40px; border-top: 1px solid var(--rule); }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(150px, .55fr);
  gap: 32px;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.row .nm { font: 400 22px/1.25 var(--serif); letter-spacing: -.005em; display: flex; gap: 16px; align-items: flex-start; }
.row .nm img { width: 38px; aspect-ratio: 3/4; border-radius: 2px; flex: none; margin-top: 2px; box-shadow: 0 4px 10px -6px rgba(0,0,0,.4); transition: transform .35s var(--ease); }
.row:hover .nm img { transform: rotate(-4deg) scale(1.06); }
.row .nm a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.row .nm small { font-size: 17px; color: var(--ink-2); }
.row .dk { color: var(--ink-2); font-size: 13px; line-height: 1.6; max-width: 52ch; }
.row .rt { text-align: right; font-size: 13px; }
.row .rt a { color: var(--link); display: block; }
.row .rt a:hover { text-decoration: underline; text-underline-offset: 3px; }
.row .rt span { color: var(--ink-3); display: block; margin-top: 4px; }
@media (max-width: 860px) {
  .row { grid-template-columns: 1fr; gap: 10px; }
  .row .rt { text-align: left; display: flex; gap: 16px; }
  .row .rt span { margin-top: 0; }
}
.more { display: block; margin: 40px auto 0; font: 400 14px var(--sans); color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--ink-3); padding: 2px 0; cursor: pointer; }

/* ---------- article ---------- */
.article { background: var(--bg-elev); min-height: 100vh; }
.article .nav { background: var(--bg-elev); }
.doc {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 720px) minmax(220px, 1fr);
  max-width: 1720px; margin: 0 auto;
  padding: clamp(24px, 4vw, 60px) var(--gutter) 120px;
}
.doc aside.l { padding-right: 40px; }
.doc aside.l h1 .h1s { font: 500 13px/1 var(--sans); letter-spacing: .12em; color: var(--ink-3); vertical-align: super; margin-left: 4px; }
.doc aside.l h1 { font: 400 clamp(40px, 3.4vw, 50px)/1.05 var(--serif); margin: 0 0 46px; letter-spacing: -.015em; }
.doc dl { margin: 0; }
.doc dt { font-size: 12px; color: var(--ink-3); margin-top: 28px; }
.doc dt:first-child { margin-top: 0; }
.doc dd { margin: 6px 0 0; font-size: 14px; line-height: 1.65; color: var(--ink); }
.doc dd a { display: block; }
.doc dd a:hover { text-decoration: underline; text-underline-offset: 3px; }
.doc main { border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); padding: 0 clamp(24px, 3.5vw, 52px); }
.doc .ttl { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; }
.doc .ttl h2 { font: italic 400 clamp(36px, 3.2vw, 48px)/1.04 var(--serif); margin: 6px 0 0; letter-spacing: -.015em; }
.doc .date { font-size: 12.5px; color: var(--ink-3); margin: 18px 0 34px; }
.polaroids { position: relative; width: 168px; height: 84px; flex: none; }
.polaroids div {
  position: absolute; top: 0; width: 64px; aspect-ratio: 3/4; background: #fff center/cover; padding: 0;
  border: 3px solid #fff; box-shadow: 0 6px 14px -6px rgba(0,0,0,.35);
  transition: transform .45s var(--ease);
}
.polaroids div:nth-child(1) { left: 0; transform: rotate(-7deg) translateY(10px); }
.polaroids div:nth-child(2) { left: 48px; transform: rotate(2deg); z-index: 2; }
.polaroids div:nth-child(3) { left: 98px; transform: rotate(8deg) translateY(8px); }
.polaroids:hover div:nth-child(1) { transform: rotate(-12deg) translate(-8px, 6px); }
.polaroids:hover div:nth-child(3) { transform: rotate(13deg) translate(8px, 4px); }
.prose { font-size: 14.5px; line-height: 1.78; color: var(--prose); }
.prose p { margin: 0 0 1.35em; }
.prose p.lede::first-letter { float: left; font: 400 4.1em/.82 var(--serif); margin: .08em .1em 0 0; color: var(--ink); }
.prose h3 { font: italic 400 30px/1.15 var(--serif); color: var(--ink); margin: 1.7em 0 .6em; letter-spacing: -.01em; }
.prose .credit { font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: 18px; margin-top: 3em; }
.prose .credit a { text-decoration: underline; text-underline-offset: 3px; }
.doc aside.r { padding-left: 40px; }
.doc aside.r .sticky { position: sticky; top: 30px; }
.doc aside.r .cover { max-width: 300px; }
.doc aside.r .cta { display: inline-flex; gap: 8px; margin-top: 22px; font-size: 13px; color: var(--link); }
.doc aside.r .cta.pdf { display: flex; margin-top: 10px; color: var(--ink-2); }
.doc aside.r .cta:hover { text-decoration: underline; text-underline-offset: 3px; }
.pager { display: flex; justify-content: space-between; gap: 20px; margin-top: 60px; padding-top: 26px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-3); }
.pager a b { display: block; font: 400 22px/1.2 var(--serif); color: var(--ink); margin-top: 4px; }
.pager a:last-child { text-align: right; }
@media (max-width: 1180px) {
  .doc { grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); }
  .doc main { border-right: 0; }
  .doc aside.r { grid-column: 1; grid-row: 2; padding: 40px 40px 0 0; }
}
@media (max-width: 760px) {
  .doc { grid-template-columns: 1fr; }
  .doc aside.l { padding: 0 0 30px; }
  .doc aside.l h1 { margin-bottom: 24px; }
  .doc dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
  .doc dt { margin-top: 18px; }
  .doc dt:nth-of-type(-n+2) { margin-top: 0; }
  .doc main { border: 0; border-top: 1px solid var(--rule); padding: 30px 0 0; }
  .doc aside.r { grid-row: auto; padding: 30px 0 0; }
  .polaroids { display: none; }
}

/* ---------- about + footer ---------- */
.about { max-width: 640px; margin: 0 auto; padding: 40px var(--gutter) 0; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.about h1 { font: italic 400 52px/1.05 var(--serif); color: var(--ink); margin: 30px 0 30px; }
.about a { text-decoration: underline; text-underline-offset: 3px; }
footer { padding: 90px var(--gutter) 40px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; }
footer a:hover { color: var(--ink); }
footer a.by { color: var(--ink); font: italic 400 16px/1 var(--serif); letter-spacing: -.005em; }
footer a { text-underline-offset: 3px; }

/* entrance */


/* ---------- S-1 reader ---------- */
.read footer { display: none; }
.reader { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: clamp(30px, 5vw, 80px); padding: 10px var(--gutter) 120px; max-width: 1280px; margin: 0 auto; }
.rbar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 30; }
.rprog { height: 100%; width: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); }
.rtoc { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow: auto; overscroll-behavior: contain; padding-right: 6px; }
.rbook { display: flex; gap: 14px; align-items: center; margin-bottom: 30px; }
.rbook .bk { width: 64px; flex: none; }
.rbook .leaf { display: none; }
.rbook b { display: block; font: 400 20px/1.15 var(--serif); }
.rbook small { font-size: 12px; color: var(--ink-3); }
.rtoc-h { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.rtoc-list a { display: block; padding: 6px 0 6px 12px; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); border-left: 1px solid var(--rule); transition: color .15s ease, border-color .15s ease; }
.rtoc-list a:hover { color: var(--ink); }
.rtoc-list a[aria-current] { color: var(--ink); border-color: var(--ink); }
.rmain { min-width: 0; max-width: 760px; }
.rhead { padding: 20px 0 34px; border-bottom: 1px solid var(--rule); margin-bottom: 34px; }
.rkick { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.rhead h1 { font: italic 400 clamp(40px, 6vw, 64px)/1 var(--serif); letter-spacing: -.02em; margin: 14px 0 16px; }
.rmeta { font-size: 12.5px; color: var(--ink-3); }
.rmeta a { color: var(--link); }
.rdoc { font: 400 18px/1.68 var(--serif); color: var(--prose); font-feature-settings: "kern", "liga", "onum"; overflow-wrap: break-word; }
.rdoc p { margin: 0 0 1em; }
.rdoc p.cv { text-align: center; font: 500 11.5px/1.6 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 auto .5em; max-width: 52ch; }
.rdoc p.cv + h2, .rdoc p.cv + h3 { margin-top: 2.6em; }
.rdoc h2 { font: italic 400 clamp(26px, 3.2vw, 34px)/1.15 var(--serif); color: var(--ink); margin: 2.2em 0 .7em; letter-spacing: -.01em; scroll-margin-top: 24px; }
.rdoc h3 { font: 600 13px/1.4 var(--sans); letter-spacing: .04em; color: var(--ink); margin: 2em 0 .6em; text-transform: none; scroll-margin-top: 24px; }
.rdoc strong { color: var(--ink); font-weight: 600; }
.rdoc a { color: var(--link); }
.rdoc img { max-width: 100%; height: auto; border-radius: 4px; margin: 1em 0; background: #fff; }
.rdoc ul, .rdoc ol { padding-left: 1.3em; margin: 0 0 1em; }
.rdoc li { margin: .3em 0; }
.rdoc .tw { overflow-x: auto; margin: 1.4em 0 1.8em; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.rdoc table { border-collapse: collapse; font: 400 12.5px/1.45 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 100%; }
.rdoc td, .rdoc th { padding: 6px 10px; vertical-align: bottom; border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); }
.rdoc td:first-child { position: sticky; left: 0; background: var(--bg); min-width: 180px; color: var(--ink); }
.rdoc td.num { text-align: right; white-space: nowrap; }
.rdoc tr:last-child td { border-bottom: 0; }
.rdoc pre { font: 400 12px/1.5 var(--sans); overflow-x: auto; padding: 14px 0; color: var(--ink-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.rlegal { display: inline-flex; align-items: center; gap: 8px; margin: -10px 0 30px; padding: 9px 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg-elev); color: var(--ink-2); font: 400 12.5px var(--sans); cursor: pointer; transition: color .15s ease, border-color .15s ease; }
.rlegal:hover { color: var(--ink); border-color: var(--ink-3); }
.rlegal::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.reader.hide-legal .rlegal::before { background: var(--link); }
.reader.hide-legal .rsec.legal:not(.open) { display: none; }
.reader.hide-legal .rtoc-list a.legal { opacity: .4; }
.rpre { margin-bottom: 2em; }
.rload { display: flex; align-items: center; gap: 14px; color: var(--ink-3); font: 400 14px var(--sans); padding: 40px 0; }
.rload span { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--rule); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.rtoc-btn, .rtop { position: fixed; z-index: 25; border: 1px solid var(--rule); background: var(--bg-elev); color: var(--ink); font: 400 13px var(--sans); border-radius: 999px; cursor: pointer; box-shadow: 0 8px 24px -12px var(--shadow); transition: transform .2s var(--ease-out), opacity .2s ease; }
.rtoc-btn { display: none; left: 50%; bottom: 18px; transform: translateX(-50%); padding: 12px 22px; }
.rtop { right: 20px; bottom: 18px; width: 44px; height: 44px; opacity: 0; pointer-events: none; }
.rtop.on { opacity: 1; pointer-events: auto; }
.rtoc-btn:active { transform: translateX(-50%) scale(.97); }
@media (max-width: 900px) {
  .reader { grid-template-columns: 1fr; padding-top: 0; }
  .rtoc { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 72vh; z-index: 40; background: var(--bg-elev); border-radius: 18px 18px 0 0; padding: 22px 22px 40px; box-shadow: 0 -20px 50px -20px rgba(0,0,0,.35); transform: translateY(105%); transition: transform .32s var(--ease-out); }
  .rtoc.open { transform: none; }
  .rtoc-btn { display: block; }
  .rdoc { font-size: 17px; }
  .rdoc td:first-child { min-width: 140px; }
}

/* ---------- books open: hinge + title page ---------- */
.bk { position: relative; perspective: 1400px; }
.bk .hinge {
  position: relative; z-index: 1;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform .5s var(--ease-out);
}
.bk .hinge .cover { transition: box-shadow .5s var(--ease-out); }
.leaf {
  position: absolute; inset: 0;
  border-radius: 2px 5px 5px 2px;
  background: #f7f4ec; color: #2b2925;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 24px -14px var(--shadow), inset 6px 0 10px -8px rgba(0,0,0,.25);
  container-type: inline-size;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3.4cqw;
  text-align: center; padding: 10% 9% 18%; overflow: hidden;
}
.leaf small { font: 500 2.7cqw/1.5 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: #6b665d; }
.leaf b { font: 400 10cqw/1 var(--serif); letter-spacing: -.01em; padding: 2.6cqw 0; margin: 1cqw 0; border-top: 1px solid #cfc9bc; border-bottom: 1px solid #cfc9bc; width: 70%; }
.leaf i { font: italic 400 6cqw/1.15 var(--serif); margin-top: 2cqw; }
.leaf .foot { position: absolute; bottom: 6%; }
.book3d .page .leaf { box-shadow: none; border-radius: 0; }
@media (hover: hover) {
  .card:hover .hinge, .doc aside.r .bk:hover .hinge { transform: rotateY(-24deg); }
  .card:hover .hinge .cover { box-shadow: 14px 16px 30px -18px var(--shadow); }
}
.card:active .bk { transform: scale(.985); }
.card .bk { transition: transform .16s var(--ease-out); }
.bk.open .hinge { transform: rotateY(-108deg); transition: transform .5s var(--ease-in-out); }

/* directory thumbnails peek open on hover */
.row .nm img { transform-origin: left center; }
@media (hover: hover) { .row:hover .nm img { transform: perspective(300px) rotateY(-28deg); } }
.row .nm img { transition: transform .35s var(--ease-out); }

/* ---------- theme switch: reveal from the toggle ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-swap::view-transition-new(root) { animation: reveal .5s var(--ease-out); }
@keyframes reveal { from { clip-path: circle(0 at var(--tx) var(--ty)); } to { clip-path: circle(var(--tr) at var(--tx) var(--ty)); } }

@media (prefers-reduced-motion: no-preference) {
  /* page turns between documents */
  @view-transition { navigation: auto; }
  html:not(.theme-swap)::view-transition-old(root) { animation: turn-out .22s var(--ease-out) both; }
  html:not(.theme-swap)::view-transition-new(root) { animation: turn-in .38s var(--ease-out) both; }
  @keyframes turn-out { to { opacity: 0; } }
  @keyframes turn-in { from { opacity: 0; transform: translateX(14px); } }

  /* the logo prints in, dot by dot, once per visit */
  html:not(.seen) .nav .mark circle { transform-box: fill-box; transform-origin: center; animation: dot .5s var(--ease-out) both; animation-delay: calc(var(--i) * 4ms + .1s); }
  @keyframes dot { from { transform: scale(0); } }

  /* article: columns settle in, polaroids fan out from a stack */
  .article .doc > * { animation: settle .6s var(--ease-out) both; }
  .article .doc > main { animation-delay: .05s; }
  .article .doc > aside.r { animation-delay: .1s; }
  @keyframes settle { from { opacity: 0; transform: translateY(10px); } }
  .polaroids div { animation: fan .8s var(--ease-out) both .25s; }
  @keyframes fan { from { transform: rotate(0) translateX(var(--fx, 0)); opacity: 0; } }
  .polaroids div:nth-child(1) { --fx: 48px; }
  .polaroids div:nth-child(3) { --fx: -50px; }
  .article .doc aside.r .hinge { animation: shut .9s var(--ease-out) both .15s; }
  @keyframes shut { from { transform: rotateY(-70deg); } }

  /* rows revealed by "Show more" */
  .row.in { animation: settle .32s var(--ease-out) both; animation-delay: calc(var(--k, 0) * 14ms); }
}
html.seen .rise { animation: none !important; opacity: 1 !important; transform: none !important; }

@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(14px); animation: rise .9s var(--ease) forwards; }
  .rise.d1 { animation-delay: .08s; } .rise.d2 { animation-delay: .18s; } .rise.d3 { animation-delay: .3s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}
