/* Leggio: a parallel-text edition that only translates what you ask for. */

/* ---------- Fonts (self-hosted, no third-party requests) ---------- */

@font-face {
  font-family: "Alegreya";
  src: url("../fonts/alegreya-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Alegreya";
  src: url("../fonts/alegreya-latin-ext.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Alegreya";
  src: url("../fonts/alegreya-latin-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Alegreya";
  src: url("../fonts/alegreya-latin-ext-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { font-family: "Alegreya SC"; src: url("../fonts/alegreya-sc-latin-500.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122; }
@font-face { font-family: "Alegreya SC"; src: url("../fonts/alegreya-sc-latin-ext-500.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1E9F; }
@font-face { font-family: "Alegreya SC"; src: url("../fonts/alegreya-sc-latin-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122; }
@font-face { font-family: "Alegreya SC"; src: url("../fonts/alegreya-sc-latin-ext-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1E9F; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-latin-ext-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1E9F; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-latin-500.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-latin-ext-500.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1E9F; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-latin-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-latin-ext-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1E9F; }
/* Japanese: subset to the characters the site uses */
@font-face { font-family: "Leggio JP"; src: url("../fonts/noto-serif-jp-subset-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+3000-30FF, U+4E00-9FFF, U+FF00-FFEF; }
@font-face { font-family: "Leggio JP"; src: url("../fonts/noto-serif-jp-subset-600.woff2") format("woff2"); font-weight: 600 900; font-display: swap; unicode-range: U+3000-30FF, U+4E00-9FFF, U+FF00-FFEF; }

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  --paper: #fbfaf6;
  --paper-2: #eeede8;
  --paper-bright: #ffffff;
  --ink: #1c1b19;
  --ink-2: #57544c;
  --rule: #dcd8cd;

  --house: #1f4e3d;
  --house-deep: #163b2e;

  --font-text: "Alegreya", "Leggio JP", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --font-sc: "Alegreya SC", "Alegreya", Georgia, serif;
  --font-ui: "Alegreya Sans", "Leggio JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-jp: "Leggio JP", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;

  /* Bookcloth: luminance-only warp and weft, blended over the cloth colour */
  --cloth-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='c' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95 .05' numOctaves='2' seed='4' stitchTiles='stitch' result='warp'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.05 .95' numOctaves='2' seed='9' stitchTiles='stitch' result='weft'/%3E%3CfeComposite in='warp' in2='weft' operator='arithmetic' k2='.5' k3='.5'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='.95' intercept='.025'/%3E%3CfeFuncG type='linear' slope='.95' intercept='.025'/%3E%3CfeFuncB type='linear' slope='.95' intercept='.025'/%3E%3CfeFuncA type='linear' slope='0' intercept='1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23c%29'/%3E%3C/svg%3E");

  /* Default cloth is the house green */
  --cloth: var(--house);
  --cloth-deep: var(--house-deep);
  --cloth-ink: var(--house);
  --on-cloth: #f6f3ea;
  --on-cloth-2: rgb(246 243 234 / 0.8);
  --stamp: #e4c57e;
  --ring: var(--house);
}

/* One cloth per language, like a series colour-coded by source language */
[data-cloth="it"] { --cloth: #1f4e3d; --cloth-deep: #163b2e; --cloth-ink: #1f4e3d; --on-cloth: #f6f3ea; --on-cloth-2: rgb(246 243 234 / 0.8); --stamp: #e4c57e; }
[data-cloth="es"] { --cloth: #8a1c2b; --cloth-deep: #67131f; --cloth-ink: #8a1c2b; --on-cloth: #f8f1ea; --on-cloth-2: rgb(248 241 234 / 0.82); --stamp: #efcf8c; }
[data-cloth="fr"] { --cloth: #1c3963; --cloth-deep: #132946; --cloth-ink: #1c3963; --on-cloth: #f3f2ee; --on-cloth-2: rgb(243 242 238 / 0.8); --stamp: #e6c987; }
[data-cloth="de"] { --cloth: #c5962c; --cloth-deep: #a47b1d; --cloth-ink: #6f500e; --on-cloth: #1f1708; --on-cloth-2: rgb(31 23 8 / 0.93); --stamp: #2a1e07; }
[data-cloth="ja"] { --cloth: #4a2c5a; --cloth-deep: #351f41; --cloth-ink: #4a2c5a; --on-cloth: #f5f0f2; --on-cloth-2: rgb(245 240 242 / 0.8); --stamp: #e8cc94; }

/* Focus rings: light on cloth, cloth-ink on paper */
.cloth, [data-sync-cloth], .footer { --ring: var(--on-cloth); }
.leaf, .spread, .plate__leaf, .doc { --ring: var(--cloth-ink); }
/* The German footer sits on the darker ochre board: full-strength lettering keeps it above 4.5:1 */
[data-cloth="de"] .footer, .footer[data-cloth="de"] { --on-cloth: #140e03; --on-cloth-2: #140e03; }

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--house) var(--paper-2);
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

:lang(ja) { font-family: var(--font-jp); }

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

::selection { background: color-mix(in srgb, var(--house) 22%, white); color: var(--ink); }
.cloth ::selection { background: var(--stamp); color: var(--cloth-deep); }

:focus-visible {
  outline: 2px solid var(--ring, var(--house));
  outline-offset: 3px;
  border-radius: 3px;
}

.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--paper-bright);
  color: var(--ink);
  font: 700 1rem/1 var(--font-ui);
  border-radius: 6px;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Cloth ---------- */

.cloth {
  background-color: var(--cloth);
  background-image: var(--cloth-tex);
  background-blend-mode: soft-light;
  color: var(--on-cloth);
  transition: background-color 600ms ease, color 600ms ease;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 24px;
  border: 0;
  border-radius: 6px;
  font: 700 1.0625rem/1.15 var(--font-ui);
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
.button--primary {
  background: var(--paper-bright);
  color: var(--cloth-ink);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.6) inset, 0 14px 28px -14px rgb(0 0 0 / 0.55), 0 2px 4px rgb(0 0 0 / 0.12);
}
.button--on-paper {
  background: var(--house);
  color: #f6f3ea;
  box-shadow: 0 14px 28px -16px rgb(22 59 46 / 0.7), 0 2px 4px rgb(0 0 0 / 0.12);
}
.button--small {
  min-height: 40px;
  padding: 9px 16px;
  font-size: 0.95rem;
}
.button--on-cloth {
  background: var(--on-cloth);
  color: var(--cloth-ink);
}
.button.is-live:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .button--primary.is-live:hover { box-shadow: 0 1px 0 rgb(255 255 255 / 0.6) inset, 0 18px 32px -14px rgb(0 0 0 / 0.6), 0 2px 4px rgb(0 0 0 / 0.12); }
  .button--on-paper.is-live:hover { background: var(--house-deep); }
}

/* Before the store listing exists: honest, quiet, not clickable */
.button.is-pending {
  background: transparent;
  color: var(--on-cloth);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--on-cloth) 42%, transparent);
  cursor: default;
}
.button--on-paper.is-pending {
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 30%, transparent);
}

/* ---------- Header ---------- */

.site-header { position: relative; z-index: 3; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--stamp);
  font: 700 1.4rem/1 var(--font-sc);
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color 600ms ease;
}
.wordmark__mark {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 32px);
  font: 500 1.0625rem/1 var(--font-ui);
}
.nav__links > a:not(.button) {
  color: var(--on-cloth);
  text-decoration: none;
  padding-block: 8px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 220ms var(--ease-out), color 600ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .nav__links > a:not(.button):hover { background-size: 100% 1px; }
}
@media (max-width: 560px) {
  .nav__links .nav__how { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(24px, 5vw, 64px) clamp(64px, 8vw, 112px);
  overflow: clip;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(3rem, 1.4rem + 4.2vw, 5.5rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.022em;
  color: var(--on-cloth);
  transition: color 600ms ease;
}

.hero__lede {
  margin-top: 24px;
  max-width: 34ch;
  font-size: clamp(1.1875rem, 1.05rem + 0.45vw, 1.375rem);
  line-height: 1.5;
  color: var(--on-cloth-2);
  transition: color 600ms ease;
}

.hero__actions { margin-top: 36px; }

/* ---------- The book ---------- */

.hero__book { position: relative; }

.spread {
  --page-pad: 34px;
  position: relative;
  z-index: 2; /* the book and its gloss slip sit in front of the shelf */
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 720px;
  margin-inline: auto;
  isolation: isolate;
  color: var(--ink);
  font-variant-numeric: oldstyle-nums;
  /* stacked page edges under the spread */
  filter: drop-shadow(0 34px 34px rgb(0 0 0 / 0.28)) drop-shadow(0 6px 10px rgb(0 0 0 / 0.18));
}
/* The boards of the book, in the volume's cloth */
.spread::before {
  content: "";
  position: absolute;
  inset: -9px -12px -13px;
  z-index: -2;
  border-radius: 5px;
  background-color: var(--cloth-deep);
  background-image: var(--cloth-tex);
  background-blend-mode: soft-light;
  transition: background-color 600ms ease;
}
/* Page edges */
.spread::after {
  content: "";
  position: absolute;
  inset: auto 3px -6px;
  height: 7px;
  z-index: -1;
  border-radius: 0 0 3px 3px;
  background: repeating-linear-gradient(0deg, #f6f4ee 0 1px, #dedad0 1px 2px);
}

.page {
  position: relative;
  min-height: 436px;
  padding: 30px 30px 56px;
  background-color: var(--paper);
}
.page--original {
  padding-left: 52px;
  padding-right: 28px;
  border-radius: 3px 0 0 3px;
  background-image: linear-gradient(to left, rgb(40 30 10 / 0.12), rgb(40 30 10 / 0.03) 26px, transparent 60px);
}
.page--facing {
  padding-left: 30px;
  padding-right: 40px;
  border-radius: 0 3px 3px 0;
  background-image: linear-gradient(to right, rgb(40 30 10 / 0.14), rgb(40 30 10 / 0.03) 26px, transparent 60px);
}
.gutter {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgb(40 30 10 / 0.18);
  z-index: 1;
}

.runhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font: 500 0.8125rem/1.2 var(--font-sc);
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
.runhead__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page--original .runhead { flex-direction: row; }
.folio { font-variant-numeric: oldstyle-nums; }

.chapter {
  margin: 26px 0 18px;
  font: 500 0.9375rem/1.3 var(--font-sc);
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--cloth-ink);
  transition: color 600ms ease;
}

.nobr { white-space: nowrap; }

.passage {
  position: relative;
  font-size: 1.125rem;
  line-height: 1.62;
  hyphens: manual;
  overflow-wrap: normal;
  transition: opacity 170ms ease, filter 170ms ease;
}

/* Every word is a button: select one to see its gloss */
.w {
  appearance: none;
  margin: 0;
  padding: 0 0.04em;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.24em;
  transition: background-color 140ms ease, text-decoration-color 140ms ease, color 140ms ease;
  -webkit-tap-highlight-color: transparent;
}
.w.is-saved {
  text-decoration-style: dotted;
  text-decoration-color: var(--cloth-ink);
}
.w.is-active {
  background: color-mix(in srgb, var(--cloth) 17%, transparent);
  color: var(--ink);
  text-decoration-style: solid;
  text-decoration-color: var(--cloth-ink);
}
@media (hover: hover) and (pointer: fine) {
  .w:hover { background: color-mix(in srgb, var(--cloth) 10%, transparent); }
  .w.is-active:hover { background: color-mix(in srgb, var(--cloth) 17%, transparent); }
}
.w:focus-visible {
  outline: 2px solid var(--cloth-ink);
  outline-offset: 1px;
}

.linenos { position: absolute; inset: 0; pointer-events: none; }
.linenos span {
  position: absolute;
  left: 20px;
  font: 400 0.8125rem/1 var(--font-text);
  font-variant-numeric: oldstyle-nums;
  color: var(--ink-2);
  transform: translateY(0.62em);
}

.attribution {
  position: absolute;
  left: 52px;
  right: 28px;
  bottom: 22px;
  font: italic 400 0.875rem/1.3 var(--font-text);
  color: var(--ink-2);
}

/* Facing page */
.notes {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 7px;
}
.notes li {
  position: relative;
  padding-left: 2.9em;
  font-size: 1rem;
  line-height: 1.42;
}
.notes__line {
  position: absolute;
  left: 0;
  top: 0.12em;
  font: 400 0.8125rem/1.4 var(--font-text);
  font-variant-numeric: oldstyle-nums;
  color: var(--ink-2);
}
.notes__word { font-weight: 700; color: var(--cloth-ink); transition: color 600ms ease; }
.notes__meaning { color: var(--ink); }
.notes__word + .notes__meaning::before { content: " "; }
.notes li.is-new { animation: ink-in 560ms var(--ease-out) both; }
@keyframes ink-in {
  from { clip-path: inset(0 100% 0 0); opacity: 0.4; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}
.notes__full {
  margin-top: 12px;
  font-style: italic;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 28ch;
}
.notes__full[hidden] { display: none; }
.notes__empty {
  font-style: italic;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 24ch;
}

/* Swapping volumes: a short blur-fade masks the change of text */
.spread.is-swapping .passage,
.spread.is-swapping .notes,
.spread.is-swapping .runhead,
.spread.is-swapping .chapter,
.spread.is-swapping .attribution,
.spread.is-swapping .linenos {
  opacity: 0;
  filter: blur(3px);
}
.spread .notes,
.spread .runhead,
.spread .chapter,
.spread .attribution,
.spread .linenos {
  transition: opacity 170ms ease, filter 170ms ease;
}

/* ---------- Turning the page ---------- */

.spread { touch-action: pan-y; }
.spread.is-turning { -webkit-user-select: none; user-select: none; cursor: grabbing; }
.spread.is-turning .dogear { visibility: hidden; }

.turn {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  perspective: 2400px;
}
.turn__leaf {
  position: absolute;
  transform-style: preserve-3d;
  will-change: transform;
}
.turn__face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: rotateY(0deg);
}
.turn__face--back { transform: rotateY(180deg); }
.turn__shade,
.turn__cast {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
/* Light falls from the reader's side: the lifting page darkens toward its free edge */
.turn--next .turn__shade--front { background: linear-gradient(to left, rgb(24 18 8 / 0.42), rgb(24 18 8 / 0.1) 55%, rgb(24 18 8 / 0.04)); }
.turn--prev .turn__shade--front { background: linear-gradient(to right, rgb(24 18 8 / 0.42), rgb(24 18 8 / 0.1) 55%, rgb(24 18 8 / 0.04)); }
.turn--next .turn__shade--back { background: linear-gradient(to right, rgb(24 18 8 / 0.38), rgb(24 18 8 / 0.08) 60%, transparent); }
.turn--prev .turn__shade--back { background: linear-gradient(to left, rgb(24 18 8 / 0.38), rgb(24 18 8 / 0.08) 60%, transparent); }
/* The shadow the lifted leaf casts on the page it uncovers */
.turn--next .turn__cast { inset: auto; background: linear-gradient(to right, rgb(24 18 8 / 0.34), rgb(24 18 8 / 0.08) 40%, transparent 75%); }
.turn--prev .turn__cast { inset: auto; background: linear-gradient(to left, rgb(24 18 8 / 0.34), rgb(24 18 8 / 0.08) 40%, transparent 75%); }

/* A folded corner: the way to turn by click, and a hint that the page can be dragged */
.dogear {
  position: absolute;
  bottom: 0;
  z-index: 4;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dogear--next { right: 0; }
.dogear--prev { left: 0; }
.dogear::before,
.dogear::after {
  content: "";
  position: absolute;
  inset: 0;
  transition: transform 240ms var(--ease-out);
}
/* the page beneath, seen where the corner has lifted */
.dogear--next::before {
  transform-origin: 100% 100%;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  background: linear-gradient(to top left, #e6e2d6, #efece3 60%);
  border-bottom-right-radius: 3px;
}
.dogear--prev::before {
  transform-origin: 0 100%;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  background: linear-gradient(to top right, #e6e2d6, #efece3 60%);
  border-bottom-left-radius: 3px;
}
/* the folded flap */
.dogear--next::after {
  transform-origin: 100% 100%;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  background: linear-gradient(to bottom right, #e9e6dc, #fffefb 70%);
  box-shadow: inset 1px 1px 0 rgb(24 18 8 / 0.1);
}
.dogear--prev::after {
  transform-origin: 0 100%;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  background: linear-gradient(to bottom left, #e9e6dc, #fffefb 70%);
  box-shadow: inset -1px 1px 0 rgb(24 18 8 / 0.1);
}
.dogear--prev { opacity: 0.8; }
@media (hover: hover) and (pointer: fine) {
  .dogear:hover::before,
  .dogear:hover::after { transform: scale(1.32); }
  .dogear--prev:hover { opacity: 1; }
}
.dogear:active::before,
.dogear:active::after { transform: scale(1.2); }
.dogear:focus-visible { outline: 2px solid var(--cloth-ink); outline-offset: -4px; }

/* Japanese: set vertically, bound on the right */
.page--original[data-vertical="true"] { order: 2; padding-left: 28px; padding-right: 52px; border-radius: 0 3px 3px 0; background-image: linear-gradient(to right, rgb(40 30 10 / 0.12), rgb(40 30 10 / 0.03) 26px, transparent 60px); }
.page--facing[data-vertical="true"] { order: 1; padding-left: 40px; padding-right: 30px; border-radius: 3px 0 0 3px; background-image: linear-gradient(to left, rgb(40 30 10 / 0.14), rgb(40 30 10 / 0.03) 26px, transparent 60px); }
.page--original[data-vertical="true"] .runhead { flex-direction: row-reverse; }
.page--facing[data-vertical="true"] .runhead { flex-direction: row-reverse; }
.page[data-vertical="true"] .passage {
  writing-mode: vertical-rl;
  height: 15em;
  margin-top: 30px;
  margin-inline-start: auto;
  font-family: var(--font-jp);
  font-size: 1.125rem;
  line-height: 1.95;
  letter-spacing: 0.04em;
  line-break: strict;
}
.page[data-vertical="true"] .w {
  padding: 0.04em 0;
  text-underline-offset: 0.3em;
}
.page[data-vertical="true"] .attribution { left: 28px; right: 52px; text-align: right; }
.page[data-vertical="true"] .linenos span { left: 0; transform: none; }

/* The gloss: a slip of paper laid next to the word */
.gloss {
  position: absolute;
  z-index: 5;
  width: min(284px, calc(100% - 16px));
  padding: 15px 16px 14px;
  border-radius: 7px;
  background: var(--paper-bright);
  color: var(--ink);
  box-shadow:
    0 0 0 1px rgb(28 27 25 / 0.08),
    0 4px 10px -2px rgb(28 27 25 / 0.14),
    0 22px 44px -14px rgb(28 27 25 / 0.4);
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  filter: blur(2px);
  transition: opacity 120ms ease, transform 140ms var(--ease-out), filter 120ms ease;
  will-change: transform, opacity;
}
.gloss.is-open {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 180ms ease, transform 240ms var(--ease-out), filter 180ms ease;
}
.gloss.no-anim { transition: none; }
.spread[data-vertical="true"] .gloss { width: min(240px, calc(100% - 16px)); }
/* Phones: the slip sits in the page, under the passage */
.gloss.is-docked {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  margin-top: 18px;
  transform-origin: 50% 0;
}
.gloss-dock:empty { display: none; }
.gloss[hidden] { display: none; }

.gloss__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-right: 30px;
}
.gloss__word {
  font: 700 1.3125rem/1.2 var(--font-text);
  color: var(--cloth-ink);
}
.gloss__word:lang(ja) { font-family: var(--font-jp); font-weight: 600; }
.gloss__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, transform 160ms var(--ease-out);
}
.gloss__close .icon { width: 18px; height: 18px; }
.gloss__close:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) {
  .gloss__close:hover { background: var(--paper-2); color: var(--ink); }
}
.gloss__meaning {
  margin-top: 8px;
  font: 500 1.1875rem/1.3 var(--font-text);
}
.gloss__context {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font: 400 0.9375rem/1.45 var(--font-text);
  color: var(--ink-2);
}
@media (max-width: 639px) {
  .gloss__context { -webkit-line-clamp: 3; line-clamp: 3; }
}
.gloss__label {
  font: 500 0.8125rem/1 var(--font-sc);
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-right: 4px;
}
.gloss__save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-top: 14px;
  padding: 8px 14px 8px 12px;
  border: 0;
  border-radius: 6px;
  background: var(--cloth);
  color: var(--on-cloth);
  font: 700 0.9375rem/1 var(--font-ui);
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
.gloss__save .icon { width: 18px; height: 18px; }
.gloss__save .icon--saved { display: none; }
.gloss__save.is-saved {
  background: transparent;
  color: var(--cloth-ink);
  box-shadow: inset 0 0 0 1.5px var(--cloth-ink);
}
.gloss__save.is-full {
  background: transparent;
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1.5px var(--rule);
  cursor: not-allowed;
}
.gloss__save.is-full:active { transform: none; }
.gloss__save.is-saved .icon--save { display: none; }
.gloss__save.is-saved .icon--saved { display: block; }
.gloss__save:active { transform: scale(0.97); }
.gloss__save:focus-visible, .gloss__close:focus-visible { outline-color: var(--cloth-ink); }

/* Spines: the language switcher, a shelf of volumes */
.shelf {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  max-width: 720px;
  margin: 44px auto 0;
}
.spines-wrap { position: relative; flex: none; }
.spines {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  flex: none;
  padding-bottom: 6px;
  border-bottom: 3px solid color-mix(in srgb, var(--cloth-deep) 80%, black);
  transition: border-color 600ms ease;
}
.spine {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 132px;
  padding: 16px 0;
  border: 0;
  border-radius: 3px 3px 1px 1px;
  background-color: var(--cloth);
  background-image:
    linear-gradient(90deg, rgb(0 0 0 / 0.16), rgb(255 255 255 / 0.12) 22%, rgb(255 255 255 / 0) 48%, rgb(0 0 0 / 0.08) 72%, rgb(0 0 0 / 0.3)),
    var(--cloth-tex);
  background-blend-mode: normal, soft-light;
  color: var(--stamp);
  writing-mode: vertical-rl;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 0.2),
    0 8px 16px -8px rgb(0 0 0 / 0.55);
  transition: transform 260ms var(--ease-out);
}
.spine::before,
.spine::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  height: 0;
  border-top: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  padding-top: 2px;
  opacity: 0.85;
}
.spine::before { top: 7px; }
.spine::after { bottom: 7px; }
.spine__title {
  font: 700 1rem/1 var(--font-sc);
  letter-spacing: 0.06em;
}
.spine__title:lang(ja) { font-family: var(--font-jp); font-weight: 600; letter-spacing: 0.12em; }
.spine[aria-selected="true"] { transform: translateY(-16px); }
.spine:active { transform: translateY(-2px) scale(0.98); }
.spine[aria-selected="true"]:active { transform: translateY(-16px) scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .spine:not([aria-selected="true"]):hover { transform: translateY(-6px); }
}
.spine:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

/* How many more volumes the real extension can open, pinned to the shelf's top right */
.shelf__more {
  position: absolute;
  left: 100%;
  top: 2px;
  margin: 0 0 0 16px;
  white-space: nowrap;
  font: 700 0.9375rem/1.2 var(--font-sc);
  letter-spacing: 0.06em;
  color: var(--stamp);
  transition: color 600ms ease;
}
.shelf__note {
  max-width: 34ch;
  padding-bottom: 8px;
  font: 400 0.9375rem/1.45 var(--font-ui);
  color: var(--on-cloth-2);
  transition: color 600ms ease;
}

/* ---------- Leaves: paper pages laid on the cloth ---------- */

.leaf-section { padding-bottom: clamp(40px, 6vw, 72px); }
.leaf-section:first-of-type { padding-top: 8px; }
.leaf {
  position: relative;
  padding: clamp(24px, 3.5vw, 36px) clamp(22px, 6vw, 88px) clamp(56px, 8vw, 104px);
  border-radius: 3px;
  background-color: var(--paper);
  background-image: linear-gradient(to right, rgb(40 30 10 / 0.1), rgb(40 30 10 / 0.02) 30px, transparent 72px);
  color: var(--ink);
  box-shadow: 0 1px 0 #e4e1d8, 0 2px 0 var(--paper), 0 3px 0 #dedad0, 0 30px 50px -28px rgb(0 0 0 / 0.5), 0 8px 16px -8px rgb(0 0 0 / 0.25);
}
.leaf__runhead { margin-bottom: clamp(48px, 7vw, 96px); }

.preface__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.section-title,
.leaf h2,
.closing h2 {
  font-size: clamp(2.25rem, 1.3rem + 2.8vw, 3.75rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.leaf h2 { color: var(--ink); }
.preface__body p {
  max-width: 60ch;
  font-size: clamp(1.1875rem, 1.05rem + 0.4vw, 1.3125rem);
  line-height: 1.66;
}
.preface__body p + p { margin-top: 1.1em; }
.preface__body .preface__coda {
  font-size: clamp(1.375rem, 1.15rem + 0.7vw, 1.625rem);
  line-height: 1.45;
  color: var(--cloth-ink);
  transition: color 600ms ease;
}

/* ---------- How it works ---------- */

#how h2 { max-width: 16ch; }
.howto__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  margin-top: clamp(40px, 5vw, 64px);
}

/* A plate: a page from a PDF, tipped in on a board of the volume's cloth */
.plate {
  padding: clamp(18px, 3.5vw, 40px);
  border-radius: 4px;
  background-color: var(--cloth);
  background-image: var(--cloth-tex);
  background-blend-mode: soft-light;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12), inset 0 10px 24px -14px rgb(0 0 0 / 0.5);
  transition: background-color 600ms ease;
}
.plate__leaf {
  position: relative;
  padding: 22px clamp(20px, 4vw, 44px) 40px;
  border-radius: 2px;
  background: var(--paper-bright);
  color: #202020;
  font-size: 1.0625rem;
  line-height: 1.62;
  box-shadow: 0 2px 0 #e6e3da, 0 18px 30px -18px rgb(0 0 0 / 0.55);
}
.plate__runhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  font: 500 0.875rem/1.2 var(--font-ui);
  color: var(--ink-2);
}
.plate__file { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.plate__runhead .folio { font-family: var(--font-text); }
.plate__chapter {
  text-align: center;
  font-weight: 700;
  margin-bottom: 12px;
}
.plate__hl {
  padding: 0 2px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--cloth) 17%, transparent);
  color: inherit;
  text-decoration: underline 1.5px var(--cloth-ink);
  text-underline-offset: 0.24em;
}
.callout {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cloth-ink);
  color: #f6f3ea;
  font: 700 0.875rem/1 var(--font-ui);
  font-variant-numeric: lining-nums;
  box-shadow: 0 0 0 3px var(--paper-bright);
  transition: background-color 600ms ease;
}
.callout--gloss {
  position: absolute;
  top: -13px;
  left: -13px;
}
.minigloss {
  position: relative;
  width: 220px;
  margin: 18px 0 0;
  padding: 14px 14px 12px;
  border-radius: 7px;
  background: var(--paper-bright);
  box-shadow: 0 0 0 1px rgb(28 27 25 / 0.08), 0 4px 10px -2px rgb(28 27 25 / 0.14), 0 22px 44px -14px rgb(28 27 25 / 0.4);
  font-size: 0.9375rem;
  line-height: 1.35;
}
.minigloss.is-anchored { position: absolute; margin: 0; z-index: 2; }
.minigloss__word { font-weight: 700; font-size: 1.125rem; color: var(--cloth-ink); }
.minigloss__meaning { margin-top: 2px; font-weight: 500; font-size: 1.0625rem; }
.minigloss__save {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1.5px var(--cloth-ink);
  color: var(--cloth-ink);
  font: 700 0.8125rem/1 var(--font-ui);
}
.minigloss__save .icon { width: 15px; height: 15px; }
.callout--save { position: absolute; right: -40px; top: 50%; transform: translateY(-50%); }

.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: clamp(28px, 3.5vw, 40px);
}
.steps li {
  position: relative;
  padding-left: 48px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cloth-ink);
  color: #f6f3ea;
  font: 700 0.9375rem/1 var(--font-ui);
  font-variant-numeric: lining-nums;
  transition: background-color 600ms ease;
}
.steps h3 {
  font-size: clamp(1.3125rem, 1.15rem + 0.5vw, 1.5rem);
  line-height: 1.2;
  font-weight: 700;
}
.steps p {
  margin-top: 8px;
  max-width: 42ch;
  font-size: 1.125rem;
  line-height: 1.58;
  color: var(--ink-2);
}

/* ---------- Colophon (privacy) ---------- */

.colophon { padding-block: clamp(56px, 8vw, 104px) clamp(24px, 4vw, 40px); }
.colophon__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.colophon h2 {
  font-size: clamp(2.25rem, 1.3rem + 2.8vw, 3.75rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--on-cloth);
  max-width: 14ch;
}
.colophon__lead p {
  margin-top: 24px;
  max-width: 48ch;
  font-size: clamp(1.1875rem, 1.05rem + 0.4vw, 1.3125rem);
  line-height: 1.6;
  color: var(--on-cloth-2);
}
.textlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding-block: 6px;
  color: var(--stamp);
  font: 700 1.0625rem/1 var(--font-ui);
  text-decoration: none;
}
.textlink .icon { width: 18px; height: 18px; transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .textlink:hover .icon { transform: translateX(3px); }
  .textlink:hover { text-decoration: underline; }
}
.colophon__facts {
  border-top: 1px solid color-mix(in srgb, var(--stamp) 60%, transparent);
}
.colophon__facts > div {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: 16px;
  padding-block: 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--stamp) 35%, transparent);
}
.colophon__facts dt {
  font: 700 1rem/1.5 var(--font-sc);
  letter-spacing: 0.06em;
  color: var(--stamp);
}
.colophon__facts dd {
  font-size: 1.1875rem;
  line-height: 1.45;
  color: var(--on-cloth);
}

/* ---------- Closing ---------- */

.closing {
  padding-block: clamp(40px, 6vw, 72px) clamp(72px, 9vw, 120px);
  text-align: center;
}
.closing__inner { display: grid; justify-items: center; }
.ornament {
  width: 120px;
  height: 12px;
  margin-bottom: clamp(48px, 7vw, 88px);
  fill: none;
  stroke: var(--stamp);
  stroke-width: 1.2;
  transition: stroke 600ms ease;
}
.closing h2 { max-width: 18ch; font-size: clamp(2.5rem, 1.3rem + 3.6vw, 4.5rem); color: var(--on-cloth); }
.closing p {
  margin-top: 18px;
  font-size: clamp(1.1875rem, 1.05rem + 0.45vw, 1.375rem);
  color: var(--on-cloth-2);
}
.closing .button { margin-top: 36px; }
.shelf--closing { justify-content: center; margin-top: clamp(56px, 7vw, 88px); }
.shelf--closing .spine.is-current { transform: translateY(-16px); }
@media (hover: hover) and (pointer: fine) {
  .shelf--closing .spine:not(.is-current):hover { transform: translateY(-6px); }
}

/* ---------- Footer ---------- */

.footer {
  background-color: var(--cloth-deep);
  background-image: var(--cloth-tex);
  background-blend-mode: soft-light;
  color: var(--on-cloth);
  padding-block: 56px 44px;
  transition: background-color 600ms ease, color 600ms ease;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px 40px;
  align-items: start;
}
.footer__brand p {
  margin-top: 10px;
  font: 400 1rem/1.4 var(--font-ui);
  color: var(--on-cloth-2);
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  font: 500 1.0625rem/1 var(--font-ui);
}
.footer__links a { color: var(--on-cloth); text-decoration: none; padding-block: 6px; }
.footer__links a[href]:hover { text-decoration: underline; }
.footer__links a:not([href]) { color: var(--on-cloth-2); }
.footer__fine {
  grid-column: 1 / -1;
  max-width: 88ch;
  font: 400 0.875rem/1.55 var(--font-ui);
  color: var(--on-cloth-2);
}
.footer__fine + .footer__fine { margin-top: -16px; }
.footer__fine i { font-family: var(--font-text); }
.footer__fine i:lang(ja) { font-family: var(--font-jp); font-style: normal; }

/* ---------- Privacy policy (reading mode) ---------- */

.doc-hero { padding-block: clamp(40px, 7vw, 88px) clamp(48px, 7vw, 88px); }
.doc-hero h1 {
  font-size: clamp(2.75rem, 1.5rem + 3.6vw, 4.75rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.doc-hero__meta {
  margin-top: 18px;
  font: 500 1.0625rem/1.5 var(--font-ui);
  color: var(--on-cloth-2);
}

.doc {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  padding-block: clamp(48px, 7vw, 88px) clamp(80px, 10vw, 128px);
}
.doc__toc {
  position: sticky;
  top: 28px;
  align-self: start;
}
.doc__toc-title {
  font: 700 0.9375rem/1.2 var(--font-sc);
  letter-spacing: 0.08em;
  color: var(--house);
}
.doc__toc ol {
  list-style: none;
  padding: 0;
  margin-top: 14px;
  border-left: 1px solid var(--rule);
}
.doc__toc a {
  display: block;
  padding: 6px 0 6px 16px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--ink-2);
  font: 500 0.96875rem/1.35 var(--font-ui);
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .doc__toc a:hover { color: var(--ink); border-left-color: var(--house); }
}

.doc__body { max-width: 68ch; }
.doc__body h2 {
  margin: 2.2em 0 0.55em;
  font-size: clamp(1.5rem, 1.3rem + 0.6vw, 1.875rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  scroll-margin-top: 28px;
}
.doc__body p,
.doc__body li {
  font-size: 1.1875rem;
  line-height: 1.68;
}
.doc__body p + p { margin-top: 0.9em; }
.doc__body ul {
  margin-top: 0.8em;
  padding-left: 1.2em;
}
.doc__body ul + p { margin-top: 0.9em; }
.doc__body li + li { margin-top: 0.45em; }
.doc__body li::marker { color: var(--house); }
.doc__body a { color: var(--house); font-weight: 500; }
.doc__body strong { font-weight: 700; }

.doc__summary {
  padding-block: clamp(20px, 3vw, 28px) clamp(24px, 3.5vw, 32px);
  border-top: 2px solid var(--house);
  border-bottom: 1px solid var(--rule);
}
.doc__summary h2 { margin-top: 0; }
.doc__summary ul { padding-left: 1.2em; }

.doc__pending {
  padding: 1px 6px;
  border-radius: 4px;
  background: #fbeec9;
  color: #5a4306;
}

/* ---------- 404 ---------- */

.notfound {
  min-height: 70vh;
  display: grid;
  align-content: center;
  padding-block: 96px;
}
.notfound h1 {
  margin-top: 48px;
  font-size: clamp(2.75rem, 1.5rem + 4vw, 5rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.notfound p { margin-top: 18px; font-size: 1.25rem; color: var(--on-cloth-2); max-width: 40ch; }
.notfound .textlink { margin-top: 28px; }

/* ---------- Responsive ---------- */

@media (max-width: 1099px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .hero__copy { max-width: 40rem; }
  .hero__lede { max-width: 44ch; }
  .preface__grid,
  .howto__grid,
  .colophon__grid { grid-template-columns: minmax(0, 1fr); }
  .preface__grid h2 { max-width: 18ch; }
  .howto__grid .plate { max-width: 720px; }
}

@media (max-width: 860px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc__toc { position: static; }
  .doc__toc ol { columns: 2; column-gap: 24px; border-left: 0; }
  .doc__toc a { padding-left: 0; border-left: 0; }
}

@media (max-width: 639px) {
  .spread { grid-template-columns: minmax(0, 1fr); }
  .spread::before { inset: -7px -7px -10px; }
  .page { min-height: 0; }
  .page--original,
  .page--original[data-vertical="true"] {
    order: 1;
    padding: 24px 22px 52px 42px;
    border-radius: 3px 3px 0 0;
    background-image: linear-gradient(to top, rgb(40 30 10 / 0.1), transparent 36px);
  }
  .page--facing,
  .page--facing[data-vertical="true"] {
    order: 2;
    padding: 24px 22px 60px 22px; /* clears the folded corners */
    border-radius: 0 0 3px 3px;
    background-image: linear-gradient(to bottom, rgb(40 30 10 / 0.12), transparent 36px);
  }
  .page--original[data-vertical="true"] .runhead,
  .page--facing[data-vertical="true"] .runhead { flex-direction: row; }
  .page[data-vertical="true"] .attribution { left: 42px; right: 22px; text-align: left; }
  .gutter { top: auto; left: 0; right: 0; width: auto; height: 1px; }
  .page--facing .chapter { margin-top: 18px; }
  .attribution { left: 42px; right: 22px; }
  .linenos span { left: 14px; }
  .chapter { margin: 20px 0 14px; }
  .passage { font-size: 1.0625rem; }
  .page[data-vertical="true"] .passage { height: 17em; }

  .shelf { flex-direction: column; align-items: stretch; gap: 18px; margin-top: 36px; }
  .spines { justify-content: space-between; gap: 4px; }
  .spine { flex: 1 1 0; width: auto; max-width: 64px; height: 118px; }
  .shelf__note { max-width: none; }
  .shelf__more { position: static; margin: 12px 0 0; text-align: right; }

  .leaf { border-radius: 2px; }
  .minigloss { width: auto; max-width: 260px; }
  .callout--save { right: -38px; }
  .colophon__facts > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .footer__grid { grid-template-columns: minmax(0, 1fr); }
  .button { width: 100%; }
  .nav .button { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .cloth, .spread::before, .wordmark, .hero h1, .hero__lede, .chapter, .notes__word, .shelf__note, .spines, .footer, .plate, .callout, .steps li::before, .ornament { transition-duration: 1ms; }
  .gloss, .gloss.is-open { transform: none; filter: none; transition: opacity 120ms ease; }
  .spine, .spine[aria-selected="true"], .spine:not([aria-selected="true"]):hover { transition: none; }
  .notes li.is-new { animation: fade-in 200ms ease both; }
  .button.is-live:active, .gloss__close:active, .gloss__save:active, .spine:active, .spine[aria-selected="true"]:active { transform: none; }
  .spine[aria-selected="true"], .shelf--closing .spine.is-current { transform: translateY(-16px); }
  .textlink:hover .icon { transform: none; }
  .nav__links > a:not(.button) { transition: none; }
  .spread.is-swapping .passage, .spread.is-swapping .notes { filter: none; }
  .dogear::before, .dogear::after { transition: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
