/* ACE.await — localized book editions.
   Paper, type, bookmarks and page turns follow the approved prototype
   (site-design/gpt/ace-await), with matching locale typography and RTL paper. */

:root {
  --paper: #f0e8d6;
  --paper-texture: url("/assets/site-texture.webp?v=20261110f");
  --ink: #302d26;
  --muted: #847760;
  --rust: #934d39;
  --rule: #bdad8d;
  --book-w: 440px;
  --book-h: 704px;
  --sample-header-top: calc((var(--book-h) - 918px * var(--sheet-scale, 1)) / 2 + 83px * var(--sheet-scale, 1) - 28px);
  --sample-reading-top: calc(var(--sample-header-top) + 24px);
  --body-size: 19px;
  --margin: 44px;
  --tab-width: 72px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #29251f;
  color: var(--ink);
  font-family: var(--book-serif);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 5px;
}

a {
  color: var(--rust);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

a:hover {
  color: #5c2f22;
}

::selection {
  background: #d7b88488;
}

/* ---------------------------------------------------------------- the room */

.reading-room {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  overflow: clip;
}

/* Keep the paper stationary while a keyboard resizes the layout viewport.
   Native visual-viewport panning can still bring the focused field into view. */
.book-form-editing .reading-room { height: var(--reader-height); }

.ambient {
  position: absolute;
  inset: -30px;
  z-index: -3;
  background:
    radial-gradient(ellipse at 48% 37%, #8273604f 0, transparent 55%),
    radial-gradient(ellipse at 53% 100%, #0c0b0980, transparent 70%),
    #29251f;
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.17;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' opacity='.5' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}

.book-stage {
  position: relative;
  width: var(--book-w);
  height: var(--book-h);
  flex: 0 0 var(--book-w);
  transform: translateX(-16px);
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  isolation: isolate;
}

.book-stage.is-closed {
  transform: translate(-3px, -18px) rotate(-1deg);
}

.book-shadow {
  position: absolute;
  inset: 8px -7px -8px 7px;
  border-radius: 3px;
  background: #120f0c;
  box-shadow: 0 40px 70px #0008, 0 16px 22px #0007, 2px 1px 2px #0009;
  z-index: -2;
}

.page-edges {
  position: absolute;
  inset: 3px -8px -5px 3px;
  background: repeating-linear-gradient(to right, #aaa97b 0, #d7d5aa 1px, #bebc8d 2px, #dedbb2 3px);
  border-radius: 0 4px 5px 0;
  border-right: 1px solid #87845d;
  border-bottom: 2px solid #b6b47e;
  z-index: -1;
}

.page-edges::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 1px;
  right: 2px;
  height: 4px;
  background: repeating-linear-gradient(to bottom, #aaa87a 0 1px, #d8d6a8 1px 2px);
}

.book-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 2px 4px 4px 2px;
  box-shadow: inset 1px 0 #fff3;
  z-index: 6;
}

/* A closed book seen from behind: the binding and fore edge swap sides. */
.book-stage.is-back-cover {
  transform: translateX(16px);
}

.is-back-cover .page-edges {
  inset: 3px 3px -5px -8px;
  border-radius: 4px 0 0 5px;
  border-right: 0;
  border-left: 1px solid #87845d;
}

.is-back-cover .book-shadow {
  inset: 8px 7px -8px -7px;
}

.is-back-cover .book-shell {
  border-radius: 4px 2px 2px 4px;
  box-shadow: inset -1px 0 #fff3;
}

.is-back-cover .ribbon {
  left: auto;
  right: 25px;
}

.book {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
}

/* Edge swipes belong to the reader, not browser history navigation. */
html.js { overscroll-behavior-x: none; }

.book-shell,
#book,
#book .stf__block,
#book .stf__wrapper {
  touch-action: pan-y pinch-zoom;
}

#book :is(input, textarea, select) {
  touch-action: pan-y pinch-zoom;
}

/* Overflow-clipped paper is itself a scrolling ancestor for touch-action.
   Set this on the sheet too, including its bare top/side edges. */
#book .page {
  touch-action: pan-y pinch-zoom;
}

.stf__wrapper {
  width: 100% !important;
  height: 100% !important;
  padding-bottom: 0 !important;
}

.stf__parent {
  min-width: 0 !important;
}

/* --------------------------------------------------------------- the sheet */

.page {
  background: var(--paper);
  background-image: var(--paper-texture);
  /* Fit one texture sample to each sheet. Repeating the 512px source exposed
     its uneven bottom/top edge as a horizontal crease halfway down the page. */
  background-size: 100% 100%;
  background-repeat: no-repeat;
  width: var(--book-w);
  height: var(--book-h);
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, #5a432218, transparent 9%, transparent 91%, #8d744d10);
  z-index: 1;
}

.page::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 18px;
  pointer-events: none;
  background: linear-gradient(90deg, #2d211b29, #fff2 40%, transparent);
  z-index: 3;
}

.page.cover {
  padding: 0;
  background: transparent;
}

.page.cover .cover-image {
  object-fit: cover;
}

.page.cover::before {
  background: linear-gradient(90deg, #0004, #fff2 2%, #0003 3%, transparent 6%);
}

.cover-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: transparent;
}

.page.back-cover {
  background-color: var(--paper);
  background-image: var(--paper-texture);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* PageFlip owns the sheet's display property; lay out its contents separately. */
.page.back-cover .back-cover__layout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  gap: clamp(10px, calc(var(--book-h) * 0.025), 24px);
  padding: 4% 0;
}

.page.back-cover::before {
  background: linear-gradient(270deg, #0004, #fff2 2%, #0003 3%, transparent 6%);
}

.page.back-cover::after {
  inset: 0 0 0 auto;
  background: linear-gradient(270deg, #2d211b29, #fff2 40%, transparent);
}

.page.back-cover .back-cover__artwork {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.page.back-cover .cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Preserve the complete supplied artwork edge to edge on the book sheet. */
  object-fit: fill;
  transform: none;
  mask-image: none;
}

.back-cover__ant {
  position: relative;
  z-index: 3;
  width: clamp(150px, calc(var(--book-w) * 0.58), 274px);
  height: auto;
  max-height: 17%;
  flex: 0 1 auto;
  object-fit: contain;
  pointer-events: none;
}

.back-cover__imprint {
  position: relative;
  z-index: 4;
  box-sizing: border-box;
  flex: 0 1 auto;
  min-height: 0;
  width: 88%;
  max-height: calc(100% - 30%);
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding: clamp(22px, calc(var(--book-h) * 0.045), 32px)
    clamp(14px, calc(var(--book-w) * 0.045), 24px);
  border-top: 1px solid #73474466;
  border-radius: 14px;
  background: #ded9b0e8;
  box-shadow: 0 -4px 16px #29251f26;
  text-align: center;
  color: #573a37;
}

.back-cover__studio {
  margin: clamp(10px, calc(var(--book-h) * 0.018), 16px) 0 5px;
  font: 600 clamp(15px, calc(var(--book-w) * 0.041), 19px)/1.3 var(--book-serif);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.back-cover__studio a { color: inherit; text-decoration: none; }
.back-cover__studio a:hover { text-decoration: underline; }

.back-cover__designer { margin-bottom: 3px; }

.back-cover__legal {
  margin: 0;
  font: 400 clamp(12px, calc(var(--book-w) * 0.032), 15px)/1.4 var(--book-serif);
  color: #51483c;
}

.back-cover__links {
  display: flex;
  flex-direction: column;
  margin: 9px auto 0;
  padding-inline-start: 1.5em;
  list-style: decimal;
  font: 500 clamp(14px, calc(var(--book-w) * 0.038), 17px)/1.35 var(--book-serif);
  text-align: start;
}

.back-cover__links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 27px;
  color: #713f43;
  text-decoration-color: #713f4388;
  text-underline-offset: 3px;
  border-bottom: 1px solid #c4b698;
  text-decoration: none;
}

.back-cover__links a::after { content: "↗"; color: var(--rust); }

.back-cover__links a:hover {
  text-decoration-color: currentColor;
}

.running-head {
  position: absolute;
  top: 27px;
  left: var(--margin);
  right: var(--margin);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #b0a1836b;
  padding-bottom: 12px;
  font-family: var(--book-ui);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1.9px;
  color: var(--muted);
  z-index: 2;
}

.running-head .book-name {
  margin-inline-start: 18px;
  font-family: var(--book-serif);
  font-size: 12px;
  letter-spacing: 1px;
}

.page-body {
  position: absolute;
  top: 80px;
  bottom: 71px;
  left: var(--margin);
  right: var(--margin);
  font-size: var(--body-size);
  line-height: 1.55;
  z-index: 2;
  overflow: hidden;
  overflow-wrap: break-word;
}

.page-body p {
  margin: 0 0 1em;
}

.page-body p:last-child {
  margin-bottom: 0;
}

.page-body h2,
.page-body h3 {
  font-family: var(--book-heading);
  font-weight: 400;
  margin: 0 0 0.65em;
  line-height: 1.05;
}

.page-body h2 {
  font-size: clamp(32px, calc(var(--book-w) * 0.102), 52px);
  letter-spacing: -1.4px;
}

.page-body h3 {
  font-size: 1.45em;
  margin-top: 0.45em;
}

.page-body h4 {
  font-family: var(--book-serif);
  font-size: 1em;
  font-weight: 600;
  margin: 1em 0 0.35em;
}

.page.screen-page .page-body h3 {
  font-family: var(--book-serif);
  font-size: 1.12em;
  font-weight: 500;
  line-height: 1.25;
  margin: 0.75em 0 0.4em;
}

.page-body ul,
.page-body ol {
  margin: 0 0 1em;
  padding-inline-start: 1.2em;
}

.page-body li {
  margin-bottom: 0.35em;
}

.page-body blockquote {
  margin: 0 0 1em;
  padding-inline-start: 18px;
  border-inline-start: 1px solid var(--rule);
  font-style: italic;
}

.page-body dfn {
  font-style: normal;
  font-weight: 600;
}

.chapter-kicker {
  font: 9px/1.7 var(--book-ui);
  letter-spacing: 2.1px;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 20px !important;
}

.small-rule {
  display: block;
  width: 34px;
  height: 1px;
  background: var(--rust);
  margin: 23px 0;
}

.page-body .lede {
  font-size: 1.13em;
  line-height: 1.5;
}

.page-body .aside {
  font-size: 0.75em;
  color: var(--muted);
  font-style: italic;
}

.page-body .dropcap::first-letter {
  float: left;
  font-family: var(--book-heading);
  font-size: 3.6em;
  line-height: 0.9;
  margin: 0.04em 0.11em 0 0;
  color: var(--rust);
}

.page-body .quiet {
  font-size: 0.72em;
  color: var(--muted);
  line-height: 1.6;
}

.ornament {
  display: block;
  font: 32px/1 var(--book-heading);
  color: var(--rust);
  margin: 24px 0;
  text-align: center;
}

.continued {
  color: var(--muted);
  font: italic 12px var(--book-serif);
  display: block;
  margin: 0 0 20px;
}

/* ------------------------------------------------------------ the headline */

.headline-page .page-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(12px, calc(var(--book-h) * .025), 20px);
  top: 65px;
  bottom: 70px;
}

.headline-page .page-body > * {
  flex-shrink: 0;
}

.headline-frontmatter {
  text-align: center;
}

.headline-imprint {
  font: 9px/1.8 var(--book-ui);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 clamp(20px, calc(var(--book-w) * 0.095), 46px) !important;
}

.headline-eyebrow {
  font: 10px/1.8 var(--book-ui);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #6f5944;
  margin: 0 !important;
  text-align: center;
  white-space: normal;
}

.headline-page .page-body > .headline-eyebrow {
  margin-top: auto !important;
}

.headline-title {
  font: 500 clamp(40px, calc(var(--book-w) * 0.16), 80px)/1 var(--book-heading);
  letter-spacing: -3.5px;
  margin: 0 0 10px !important;
  white-space: nowrap;
}

.headline-title .dot {
  color: var(--rust);
}

.headline-byline {
  font: 400 clamp(12.5px, calc(var(--book-w) * 0.035), 17px)/1.5 "Literata", Georgia, serif;
  font-optical-sizing: auto;
  white-space: nowrap;
  color: #78664e;
  margin: 0 !important;
}

.headline-tagline {
  font-size: 1.18em;
  line-height: 1.35;
  margin: 0 0 18px !important;
}

.headline-summary { text-align: center; }
.headline-awards {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin-top: 6px;
}

.headline-award {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(112px, calc(var(--book-w) * .32), 145px);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
}

.headline-award__medal {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.headline-award__title {
  margin-top: 3px;
  color: inherit;
  font: 600 clamp(11px, calc(var(--book-w) * .028), 13px)/1.3 var(--book-serif);
}

.headline-award__rule {
  width: 28px;
  height: 1px;
  margin-top: 6px;
  background: var(--rule);
  transition: width .18s ease, background .18s ease;
}

.headline-award:hover { color: var(--rust); }
.headline-award:hover .headline-award__rule { width: 42px; background: var(--rust); }
.headline-award:focus-visible { outline: 2px solid var(--rust); outline-offset: 4px; }
.headline-award:focus-visible .headline-award__title { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .headline-award__rule { transition: none; }
}

.headline-page .ornament {
  margin: 20px 0 0;
  text-align: center;
}

/* --------------------------------------------------------------- the story */

.story-heading {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(70px, calc(var(--book-w) * 0.23), 110px);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.story-heading .story-year {
  position: absolute;
  top: 0;
  right: 0;
  font: 600 clamp(72px, calc(var(--book-w) * 0.27), 132px)/0.85 var(--book-heading);
  letter-spacing: -0.04em;
  color: rgb(139 91 63 / 18%);
  pointer-events: none;
  user-select: none;
}

.page-body .story-heading h2 {
  position: relative;
  margin: 0;
}

/* ------------------------------------------------------------- the reviews */

.review-entry {
  display: flow-root;
}

.review-entry + .review-entry {
  margin-top: clamp(14px, calc(var(--book-w) * 0.04), 20px);
  padding-top: clamp(14px, calc(var(--book-w) * 0.04), 20px);
}

.review-page .chapter-kicker {
  margin-bottom: 18px !important;
}

.review-brand {
  font: 600 clamp(29px, calc(var(--book-w) * 0.085), 42px)/1 var(--book-heading);
  letter-spacing: -1.5px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 14px;
  margin-bottom: 16px !important;
}

.review-brand small {
  font: 8px var(--book-ui);
  letter-spacing: 3px;
  display: block;
  margin-top: 9px;
  color: var(--muted);
}

.quote-mark {
  font: 74px/0.7 var(--book-heading);
  color: #ad8b61;
  display: block;
  height: 28px;
  margin-top: 12px;
}

.review-page .pullquote {
  font: 400 clamp(20px, calc(var(--book-w) * 0.061), 30px)/1.28 var(--book-heading);
  margin: 0 0 18px !important;
  letter-spacing: -0.2px;
  border: 0;
  padding: 0;
  font-style: normal;
}

.review-excerpt {
  margin: 0 0 1em;
  padding: 0;
  border: 0;
  font-style: normal;
}

.review-page .lede {
  font-size: 1.05em;
}

.review-page .review-excerpt {
  font-size: 0.95em;
  line-height: 1.5;
}

.review-page .review-link {
  font: 9px/1.4 var(--book-ui);
  letter-spacing: .35px;
  text-transform: none;
}

.review-page .pullquote .review-link--inline {
  display: inline;
  margin: 0;
  margin-inline-start: .55em;
  padding-inline: .1em;
  color: var(--rust);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: .7px;
}

.review-page .pullquote .review-link--inline:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}

/* Shared sheets use closer internal spacing, with a clear gap between reviews. */
.shared-reviews .review-entry .chapter-kicker {
  margin-bottom: 12px !important;
}

.shared-reviews .review-entry .review-brand {
  padding-bottom: 10px;
  margin-bottom: 12px !important;
}

.shared-reviews .review-entry .quote-mark {
  height: 22px;
}

.shared-reviews .review-entry .pullquote {
  margin-bottom: 12px !important;
}

.shared-reviews .review-entry .lede {
  margin-bottom: 14px;
}

.shared-reviews .review-entry .review-link {
  margin-top: 6px;
}

.rating {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 15px 0;
  font-family: var(--book-heading);
}

.rating strong {
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
  color: var(--rust);
}

.rating span {
  font-size: 19px;
  color: var(--muted);
}

.score-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.83em;
  border-bottom: 1px solid #b0a1834a;
  padding: 3px 0;
  line-height: 1.4;
}

.comparison-row .score-row {
  gap: 16px;
}

.comparison-row .score-row span:first-child {
  flex: 0 0 35%;
}

.comparison-row .score-row span:last-child {
  flex: 1;
}

/* ------------------------------------------------- contents, lists, author */

.contents-row {
  display: flex;
  gap: 15px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px dotted #c1b397;
  font-size: 0.84em;
}

.contents-row span:first-child {
  font: 11px var(--book-ui);
  color: var(--rust);
  width: 21px;
  flex-shrink: 0;
}

.contents-row span:last-child {
  flex: 1;
}

.author-image {
  float: left;
  width: 35%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: sepia(0.3);
  margin: 0 22px 15px 0;
  border: 5px solid #f8f2e6;
  box-shadow: 0 3px 10px #36281a20;
  transform: rotate(-3deg);
}

.author-signature {
  font: italic 30px var(--book-heading);
  color: var(--rust);
  text-align: end;
}

.poem {
  border-inline-start: 1px solid var(--rust);
  padding-inline-start: 23px;
  margin: 25px 0;
  font-style: italic;
  line-height: 1.7;
}

.author-intro {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  align-items: center;
  gap: clamp(12px, calc(var(--book-w) * 0.05), 24px);
}

.author-intro .poem {
  margin: 0;
  padding-inline-start: clamp(10px, calc(var(--book-w) * 0.045), 23px);
  font-size: clamp(12px, calc(var(--book-w) * 0.049), 19px);
  line-height: 1.7;
}

.author-portrait {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--paper);
  mask-image: url("/assets/author-portrait-mask.svg");
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
  mask-mode: alpha;
}

.author-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 100%;
  filter: grayscale(1) contrast(0.88) brightness(1.1);
  mix-blend-mode: multiply;
  opacity: 0.9;
}

.author-opening .ornament {
  margin: 18px 0 22px;
}

.author-social {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font: 12px/1.5 var(--book-serif);
}

.author-social a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rust);
  text-underline-offset: 4px;
}

.author-social__icon,
.author-social__icon svg {
  display: block;
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.small-book .author-intro .poem {
  font-size: clamp(10px, calc(var(--book-w) * 0.049), 14px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--rust);
  font-size: 0.9em;
  text-decoration: none;
}

.ink-button {
  display: inline-block;
  background: #534d3e;
  color: #f4ecdc;
  padding: 11px 22px;
  font: 10px/1.5 var(--book-ui);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  border: 0;
}

.ink-button:hover:not(:disabled) {
  color: #fff;
  background: var(--rust);
}

.ink-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.section-index {
  display: flex;
  flex-direction: column;
}

.section-index button,
.section-index a {
  border-bottom: 1px solid #c4b698;
  padding: 13px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: start;
  font-size: 0.9em;
  color: inherit;
  text-decoration: none;
  width: 100%;
}

.section-index button::after,
.section-index a::after {
  content: "↗";
  color: var(--rust);
}

.section-index small {
  display: block;
  font-size: 0.72em;
  color: var(--muted);
  letter-spacing: 0.4px;
}

.back-to-index {
  font: 10px var(--book-ui);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-top: 22px !important;
}

/* Reference pages use a compact hierarchy, distinct from chapter openings. */
.page.appendix-page .page-body {
  font-size: clamp(15px, var(--body-size), 18px);
  line-height: 1.5;
}

.page.appendix-page .page-body h2 {
  font-size: 1.3em;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.2px;
  margin: 0.9em 0 0.4em;
}

.page.appendix-page .page-body h2.appendix-title {
  font-size: clamp(26px, calc(var(--book-w) * 0.07), 34px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.5px;
  margin: 0 0 0.65em;
}

.page.appendix-page .page-body h3,
.page.appendix-page .page-body h4 {
  font-family: var(--book-serif);
  font-size: 1.06em;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  margin: 0.8em 0 0.35em;
}

.page.appendix-page .page-body p,
.page.appendix-page .page-body ul,
.page.appendix-page .page-body ol {
  margin-bottom: 0.8em;
}

.page.appendix-page .page-body .legal-page__updated {
  font-size: 0.85em;
  color: var(--muted);
}

.page.appendix-page .chapter-kicker,
.page.appendix-page .continued {
  margin-bottom: 12px !important;
}

.page.appendix-page .page-body .lede {
  font-size: 1em;
}

.manifesto-edition {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75em;
  margin: 1em 0 1.4em;
  padding: 0.7em 0;
  border-block: 1px solid var(--rule);
}
.manifesto-edition dt, .manifesto-note {
  color: var(--ink);
  font-size: 0.85em;
}
.manifesto-edition dd { margin: 0.2em 0 0; }

.page.appendix-page .page-body .contents-row {
  margin-bottom: 0.3em;
}

.page.appendix-page .page-body .score-row {
  gap: 16px;
}

.page.appendix-page .page-body :is(h2, h3, h4):first-child,
.page.appendix-page .continued + :is(h2, h3, h4) {
  margin-top: 0;
}

.page.appendix-page .page-body p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ the ACE */

.ace-letters {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 28px 0;
  padding: 15px 0;
  text-align: center;
}

.ace-letters strong {
  font: 400 45px var(--book-heading);
  display: block;
  color: var(--rust);
}

.ace-letters span {
  font: 8px var(--book-ui);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* --------------------------------------------------------------- buy pages */

.buy-cover {
  width: 33%;
  height: auto;
  display: block;
  float: left;
  margin: 0 22px 16px 0;
  box-shadow: 4px 6px 9px #29221b3a;
  transform: rotate(-4deg);
}

.store-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 0;
}

.store-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 104px;
  padding: 14px 8px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: #f7f1e3;
  border: 1px solid var(--rule);
  box-shadow: 1px 2px 0 #d8caad;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.store-card:hover,
.store-card:focus-visible {
  background: #fbf6ea;
  transform: translateY(-2px);
  box-shadow: 2px 4px 0 #cdbc9b;
  color: var(--ink);
}

.store-card:active {
  transform: translateY(0);
  box-shadow: 1px 1px 0 #d8caad;
}

.store-card__mark {
  display: block;
  width: 34px;
  height: 34px;
  color: var(--rust);
}

.store-card__mark svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.store-card__store {
  font: 600 0.74em/1.2 var(--book-serif);
  letter-spacing: 0.4px;
}

.store-card__format {
  font: 8px/1.4 var(--book-ui);
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--muted);
}

.store-card[aria-disabled="true"] {
  opacity: 0.55;
  box-shadow: none;
  background: #efe7d6;
  cursor: default;
  transform: none;
}

.marketplace {
  margin: 14px 0 0;
}

.page-body p.clear {
  margin: 0;
  clear: both;
}

.marketplace label {
  display: block;
  font: 9px var(--book-ui);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.marketplace select {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #b9a98a;
  border-radius: 0;
  background: transparent;
  padding: 7px 2px;
  color: var(--ink);
  font-size: 15px;
}

.marketplace__note {
  font-size: 0.72em;
  color: var(--muted);
  margin-top: 10px !important;
}

/* ------------------------------------------------------- contact and forms */

.contact-email {
  font-size: 0.76em;
  overflow-wrap: anywhere;
}

.paper-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* The gift invitation and the existing reader form share one paper sheet. */
html .page.gift-page .page-body {
  font-family: var(--book-serif);
  font-size: var(--locale-body, var(--body-size));
  line-height: var(--locale-leading, 1.55);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b6a589 transparent;
  touch-action: pan-y pinch-zoom;
}

html .page.gift-page .page-body h2 { margin-bottom: .45em; }
html .page.gift-page .gift-description { margin-bottom: .65em; }
html .page.gift-page .gift-contact { margin-bottom: 1em; font-size: .88em; }
html .page.gift-page .gift-contact .text-link { margin: 0; padding: 4px 0; font-size: inherit; }
html[lang] .page.gift-page .page-body .gift-community-heading {
  margin: 1em 0 .45em;
}

html .page.gift-page .paper-form button { margin-top: 12px; }
.gift-page .community-honeypot { left: 0; top: 0; pointer-events: none; }

.paper-form label {
  display: block;
  font: 9px var(--book-ui);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 15px 0 7px;
  color: var(--muted);
}

.paper-form input,
.paper-form textarea {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #b9a98a;
  background: transparent;
  border-radius: 0;
  padding: 8px 2px;
  color: var(--ink);
  font-size: 16px;
  resize: none;
}

.paper-form textarea {
  height: 90px;
  line-height: 1.5;
  background: repeating-linear-gradient(transparent 0 24px, #b9a98a55 24px 25px);
}

.paper-form button {
  margin-top: 20px;
}

.paper-form .form-status {
  font-size: 13px;
  line-height: 1.5;
  min-height: 4.5em;
  color: var(--rust);
  margin-top: 12px !important;
}

/* Reserve three lines before pagination, including when no result is shown. */
.paper-form .form-status[hidden] {
  display: block;
  visibility: hidden;
}

.paper-form .form-status[data-state="error"] {
  color: #9a3a2c;
}

.paper-form input[aria-invalid="true"] {
  border-bottom-color: #9a3a2c;
}

.contact-form__honeypot,
.community-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ------------------------------------------------------------------- links */

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-list li {
  border-bottom: 1px solid #c4b69880;
  margin: 0;
}

.link-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  text-decoration: none;
  color: var(--ink);
}

.link-list a:hover .link-list__name,
.link-list a:focus-visible .link-list__name {
  color: var(--rust);
}

.link-list__icon {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--rust);
}

.link-list__icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.link-list__text {
  flex: 1;
  min-width: 0;
}

.link-list__name {
  display: block;
  font-size: 0.92em;
}

.link-list__handle {
  display: block;
  font: 9px var(--book-ui);
  letter-spacing: 1px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.link-list__go {
  color: var(--rust);
}

.page-body li.runs-on {
  list-style: none;
}

/* A page whose single block cannot be divided shrinks instead of clipping. */
.page-body.is-fitted {
  display: block;
}

.page-fit {
  transform: scale(var(--fit, 1));
  transform-origin: top center;
  width: 100%;
}

/* ---------------------------------------------- the printed sample chapters */

.sample-page .running-head {
  display: none;
}

/* The printed page is the whole sheet; it brings its own head and folio. */
.page.sample-page .page-body {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: visible;
}

.headline-page .running-head span:last-child {
  display: none;
}

.sample-sheet {
  position: absolute;
  inset: var(--sample-reading-top) 0 42px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
}

.sample-sheet__canvas {
  position: relative;
  flex: none;
  width: calc(594px * var(--sheet-scale, 1));
  height: calc(918px * var(--sheet-scale, 1));
  /* Preserve the printed text coordinates below the running title. */
  margin: calc((var(--book-h) - 918px * var(--sheet-scale, 1)) / 2 - var(--sample-reading-top)) auto 0;
  overflow: hidden;
}

.sample-sheet__inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 594px;
  height: 918px;
  flex: none;
  transform: scale(var(--sheet-scale, 1));
  transform-origin: top left;
  font-family: "Literata", Georgia, serif;
  color: #1a1a1a;
  font-size: 13px;
  line-height: 21.7px;
  text-align: justify;
  hyphens: none;
}

.sample-sheet__head {
  position: absolute;
  top: 83px;
  left: 79px;
  right: 79px;
  display: flex;
  justify-content: flex-start;
  font-size: 15px;
  line-height: 20px;
  padding-bottom: 9px;
  border-bottom: 0.8px solid #999;
}

.sample-sheet__head--recto {
  justify-content: flex-end;
}

/* Keep the running title and its continuous rule above the reading area. */
.js .sample-sheet__inner > .sample-sheet__head {
  display: none;
}

.sample-page__head {
  top: calc(var(--sample-header-top) + 5px);
  left: calc(79px * var(--sheet-scale, 1));
  right: calc(79px * var(--sheet-scale, 1));
  transform: translateY(-100%);
  padding: 0;
  border: 0;
  color: #1a1a1a;
  font: calc(15px * var(--sheet-scale, 1)) / calc(20px * var(--sheet-scale, 1)) "Literata", Georgia, serif;
}

.sample-page__head::after {
  content: "";
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  height: 1px;
  background: #9998;
  pointer-events: none;
}

.sample-page__head[lang="fa"] {
  font-family: Vazirmatn, sans-serif;
}

html[dir="rtl"] .sample-page__head {
  right: max(calc(79px * var(--sheet-scale, 1)), 50px);
}

.sample-sheet__divider {
  color: #777;
  padding: 0 2px;
}

.sample-page__head .sample-sheet__divider {
  padding: 0 calc(2px * var(--sheet-scale, 1));
}

.sample-smallcaps {
  font-variant: small-caps;
}

.sample-sheet__body {
  position: absolute;
  top: 128px;
  left: 79px;
  right: 79px;
  bottom: 120px;
}

.sample-sheet__body > :first-child {
  margin-top: 0;
}

.sample-sheet p {
  margin: 0;
  text-indent: 0;
}

.sample-sheet p.opens {
  text-indent: 7px;
}

.sample-sheet .sample-chapter {
  text-align: center;
  margin: 35px 0 33px;
}

.sample-sheet .sample-chapter__kicker {
  font-size: 16px;
  letter-spacing: 1.6px;
  color: #545454;
  margin-bottom: 12px;
}

.sample-sheet .sample-chapter__title {
  font-size: 22px;
  font-weight: 700;
  line-height: 29px;
  margin: 0;
}

.sample-sheet .sample-verse {
  margin: 16px 0 16px 49px;
  font-size: 14px;
  line-height: 23px;
  text-align: start;
}

.sample-sheet .sample-dialogue {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  text-align: start;
}

.sample-sheet .sample-dialogue li {
  position: relative;
  padding-left: 13px;
  margin: 0 0 3px 20px;
}

.sample-sheet .sample-dialogue li.level-2 {
  margin-left: 37px;
}

.sample-sheet .sample-dialogue__mark {
  position: absolute;
  left: 0;
  color: #777;
}

.sample-sheet .sample-ref {
  font-size: 0.7em;
  line-height: 0;
  vertical-align: super;
}

.sample-sheet .sample-notes {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 11px;
  line-height: 14.6px;
}

.sample-sheet .sample-notes::before {
  content: "";
  display: block;
  width: 142px;
  height: 0.8px;
  background: #777;
  margin-bottom: 7px;
}

.sample-sheet .sample-notes p {
  text-indent: 7px;
  margin: 0;
}

.sample-sheet .sample-notes sup {
  font-size: 0.72em;
  line-height: 0;
  vertical-align: super;
  margin-right: 1px;
}

.sample-console {
  margin: 20px 0;
  border: 1px solid #c9c4ba;
  border-radius: 10px;
  background: #faf9f6;
  overflow: hidden;
  text-align: start;
  font-family: "JetBrains Mono", "Consolas", monospace;
}

.sample-console__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  background: #ece9e3;
  border-bottom: 1px solid #d5d0c6;
  font-size: 12px;
  color: #666;
}

.sample-console__dots {
  position: absolute;
  right: 12px;
  display: flex;
  gap: 6px;
}

.sample-console__dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid #9a948a;
}

.sample-console__lines {
  list-style: none;
  margin: 0;
  padding: 14px 12px;
  font-size: 12px;
  line-height: 18.6px;
  color: #1a1a1a;
}

.sample-console__lines li {
  display: flex;
  gap: 6px;
  margin: 0;
}

.sample-console__lines li.reply {
  padding-left: 26px;
}

.sample-console__prompt {
  color: #999;
  flex: none;
}

/* --------------------------------------------------------------- bookmarks */

.book-menu-toggle {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 3px;
  color: #574633;
  touch-action: manipulation;
}
.book-menu-toggle[hidden] { display: none; }
/* Reserve a little space in the printed header for the in-page icon. */
.running-head { padding-inline-end: 32px; }
.book-menu-toggle:hover,
.book-menu-toggle[aria-expanded="true"] { color: var(--rust); background: #bdad8d20; }
.book-menu-toggle:focus-visible { outline-offset: -2px; }
html[dir="rtl"] .book-menu-toggle {
  right: auto;
  left: 8px;
}
/* Keep the back-cover ribbon free without moving the button off the paper. */
.is-back-cover .book-menu-toggle {
  right: 54px;
}
html[dir="rtl"] .is-back-cover .book-menu-toggle {
  right: auto;
  left: 54px;
}
.book-menu-dismiss {
  position: absolute;
  inset: 0;
  z-index: 9;
  touch-action: none;
}
.book-menu-dismiss[hidden] { display: none; }

.bookmarks {
  --tab-direction: 1;
  position: absolute;
  top: 45px;
  bottom: 64px;
  right: calc(-1 * var(--tab-width) + 8px);
  width: var(--tab-width);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  z-index: 10;
  opacity: 1;
  transition: transform 0.65s, opacity 0.5s;
}

.bookmark {
  --tab: #c1ae8b;
  position: relative;
  flex: 1;
  max-height: 48px;
  min-height: 29px;
  width: 100%;
  border-radius: 0 4px 4px 0;
  padding: 0 5px 0 11px;
  background: linear-gradient(90deg, #0002, transparent 25%), var(--tab);
  color: #3c3529;
  font: 11px/1 var(--book-ui);
  letter-spacing: 0.3px;
  box-shadow: 2px 3px 3px #0003;
  transform-origin: left center;
  transform: rotate(calc(var(--tilt, 0deg) * var(--tab-direction)));
  transition: transform 0.25s ease, filter 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
  text-align: center;
}

.bookmark:nth-child(2) { --tab: #c28f72; --tilt: 1.5deg; }
.bookmark:nth-child(3) { --tab: #9aa693; --tilt: -1deg; }
.bookmark[data-section="buy"] { --tab: #bac0ad; --tilt: 0.6deg; }
.bookmark[data-section="author"] { --tab: #c5b684; --tilt: -0.7deg; }
.bookmark[data-section="contact"] { --tab: #c2ada1; --tilt: 1deg; }
.bookmark[data-section="community"] { --tab: #9eaeb1; --tilt: -1.2deg; }
.bookmark:nth-child(8) { --tab: #bda46e; --tilt: 0.8deg; }
.bookmark[data-section="ace"] { --tab: #b6a2ad; --tilt: 1.1deg; }
.bookmark[data-section="characters"] { --tab: #b4acb9; --tilt: 0.6deg; }
.bookmark[data-section="back-cover"] { --tab: #c9ba99; --tilt: -0.8deg; }

.bookmark[data-section="back-cover"] {
  padding-inline: 9px 4px;
  line-height: 1.25;
}

.bookmark[data-section="community"] {
  padding-inline: 11px 5px;
  font-size: 10px;
  letter-spacing: 0;
}

@media (max-width: 600px) {
  .bookmark[data-section="community"] { padding-inline: 9px 4px; font-size: 8px; }
}

.small-book .bookmark[data-section="community"] { font-size: 7px; }

.bookmarks[data-active-section]:not([data-active-section="cover"]) .bookmark[aria-current="false"] {
  opacity: 0.76;
  transform: scale(0.93) rotate(calc(var(--tilt, 0deg) * var(--tab-direction)));
  filter: saturate(0.6);
}

.bookmarks[data-active-section] .bookmark[aria-current="false"]:hover,
.bookmarks[data-active-section] .bookmark[aria-current="false"]:focus-visible {
  opacity: 0.94;
  transform: translateX(calc(3px * var(--tab-direction))) scale(0.97) rotate(calc(var(--tilt, 0deg) * var(--tab-direction)));
  filter: saturate(0.85);
}

.bookmark[aria-current="true"] {
  opacity: 1;
  transform: translateX(calc(7px * var(--tab-direction))) scale(1.04);
  filter: brightness(1.12);
  font-weight: 600;
  box-shadow: 3px 4px 7px #0005, inset 0 1px #fff5;
}

.bookmark[aria-current="true"]::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--rust);
}

.is-closed .bookmarks {
  transform: translateX(-55px);
  opacity: 0;
  pointer-events: none;
}

/* Back-cover tabs attach to the left fore edge; their text stays upright. */
.is-back-cover .bookmarks {
  --tab-direction: -1;
  right: auto;
  left: calc(-1 * var(--tab-width) + 8px);
}

.is-back-cover .bookmark {
  border-radius: 4px 0 0 4px;
  padding-inline: 5px 11px;
  background: linear-gradient(270deg, #0002, transparent 25%), var(--tab);
  box-shadow: -2px 3px 3px #0003;
  transform-origin: right center;
}

.is-back-cover .bookmark[data-section="back-cover"] {
  padding-inline: 4px 9px;
}

.is-back-cover .bookmark[aria-current="true"] {
  box-shadow: -3px 4px 7px #0005, inset 0 1px #fff5;
}

.is-back-cover .bookmark[aria-current="true"]::after {
  right: auto;
  left: 5px;
}

/* ---------------------------------------------------------------- controls */

.book-controls {
  --controls-bottom: 12px;
  --controls-left: 19px;
  --controls-right: 15px;
  position: absolute;
  bottom: var(--controls-bottom);
  left: var(--controls-left);
  right: var(--controls-right);
  height: 41px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 7;
  pointer-events: none;
}

.book-controls[hidden] {
  display: none;
}

.book-controls > button {
  width: 48px;
  height: 44px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
  font: 19px Georgia, serif;
  color: #89785c;
  position: relative;
  border-radius: 50%;
}

.book-controls > button:focus-visible {
  color: var(--rust);
  background: #8d744d12;
  box-shadow: inset 0 0 0 1px #8d744d24;
}

.folio-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.book-studio {
  font: 400 clamp(10px, calc(var(--book-w) * .022), 12px)/1.25 "EB Garamond", Georgia, serif;
  letter-spacing: .035em;
  color: #7b705d;
  text-transform: none;
  white-space: nowrap;
}

.folio {
  font: 10px/1 var(--book-ui);
  letter-spacing: 2px;
  color: #94856b;
}

.curl {
  position: absolute;
  /* The 44px button extends 1.5px below the 41px footer row.
     Cancel the current footer insets to meet the paper in every layout. */
  bottom: calc(1.5px - var(--controls-bottom));
  right: calc(-1 * var(--controls-right));
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #c5b89e00 45%, #c7b99e 49%, #fff9e7 54%, #d7c9ad 95%);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  filter: drop-shadow(-3px -3px 3px #0005);
  transform-origin: center;
  pointer-events: none;
  transition: width .16s ease, height .16s ease;
}

@media (hover: hover) and (pointer: fine) {
  .book-controls > button:hover {
    color: var(--rust);
    background: #8d744d12;
    box-shadow: inset 0 0 0 1px #8d744d24;
  }
  .next:hover .curl { width: 40px; height: 40px; }
}

.is-turning .curl,
.is-riffling .curl {
  animation: none;
  opacity: 0;
}

.is-turning .book-shell .page,
.is-riffling .book-controls button,
.is-riffling .book-shell {
  pointer-events: none;
}

.ribbon {
  position: absolute;
  top: -3px;
  left: 25px;
  z-index: 8;
  width: 23px;
  height: 43px;
  background: linear-gradient(90deg, #542a22, #9b5948 35%, #7b3f30);
  color: #ecd3aa;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%);
  padding: 0 0 9px;
  font: italic 15px Georgia, serif;
  filter: drop-shadow(2px 3px 2px #0004);
  transition: height 0.2s;
}

.ribbon:hover {
  height: 50px;
}

.ribbon[hidden] {
  display: none;
}

.cover-open {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: block;
  padding: 0;
  background: none;
  color: #e8dcc4;
}

.cover-open[hidden] {
  display: none;
}

.cover-open .cover-invitation {
  position: absolute;
  top: calc(100% + 18px);
  left: 0;
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  font: 10px/1.5 var(--book-ui);
  letter-spacing: 2.1px;
  text-transform: uppercase;
  transform: rotate(1deg);
  opacity: 0.85;
}

.cover-open:hover .cover-invitation,
.cover-open:focus-visible .cover-invitation {
  opacity: 1;
}

/* ------------------------------------------------------------------ extras */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.measure {
  position: fixed !important;
  left: -10000px !important;
  top: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Without scripting the same content reads as an ordinary page. */
.book-source {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

html:not(.js) body {
  overflow: auto;
  background: var(--paper);
}

html:not(.js) .reading-room {
  display: none;
}

html:not(.js) .book-source {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  font-size: 18px;
  line-height: 1.6;
}

html:not(.js) .book-source img {
  max-width: 100%;
  height: auto;
}

/* Without scripting the printed pages follow one another down the page. */
html:not(.js) .sample-sheet {
  position: relative;
  inset: auto;
  display: block;
  container-type: inline-size;
  aspect-ratio: 594 / 918;
  overflow: hidden;
  margin: 0 0 2.5rem;
}

html:not(.js) .sample-sheet__inner {
  position: absolute;
  top: 0;
  left: 0;
  transform: scale(calc(100cqi / 594px));
  transform-origin: top left;
}

html:not(.js) .sample-sheet__canvas {
  display: contents;
}

/* Older engines without typed CSS division get readable, flowing text. */
@supports not (transform: scale(calc(100cqi / 594px))) {
  html:not(.js) .sample-sheet {
    aspect-ratio: auto;
    overflow: visible;
  }

  html:not(.js) .sample-sheet__inner {
    position: relative;
    width: 100%;
    height: auto;
    transform: none;
  }

  html:not(.js) .sample-sheet__head,
  html:not(.js) .sample-sheet__body,
  html:not(.js) .sample-notes {
    position: static;
    margin-block: 16px;
  }
}

/* ------------------------------------------------------------- small books */

@media (max-width: 600px) {
  :root {
    --tab-width: 54px;
    --margin: 24px;
    --body-size: 17px;
  }

  .book-stage {
    transform: translateX(-24px);
  }

  .book-stage.is-back-cover {
    transform: translateX(24px);
  }

  .book-stage.is-closed {
    transform: translate(-3px, -18px) rotate(-1deg);
  }

  .bookmarks {
    top: 34px;
    bottom: 48px;
    gap: 5px;
    right: calc(-1 * var(--tab-width) + 8px);
  }

  .bookmark {
    font-size: 9px;
    line-height: 1.2;
    writing-mode: horizontal-tb;
    min-height: 25px;
    max-height: 42px;
    padding: 0 4px 0 9px;
    letter-spacing: 0.15px;
  }

  .bookmark[aria-current="true"] {
    transform: translateX(calc(5px * var(--tab-direction))) scale(1.04);
  }

  .bookmark[aria-current="true"]::after {
    right: 3px;
  }

  .is-back-cover .bookmark,
  .is-back-cover .bookmark[data-section="community"] {
    padding-inline: 4px 9px;
  }

  .is-back-cover .bookmark[aria-current="true"]::after {
    left: 3px;
  }

  .running-head {
    top: 23px;
    font-size: 7px;
    letter-spacing: 1.2px;
    padding-bottom: 11px;
  }

  .page-body {
    top: 67px;
    bottom: 58px;
    line-height: 1.52;
  }

  .page-body h2 {
    font-size: 34px;
  }

  .chapter-kicker {
    font-size: 8px;
    margin-bottom: 15px !important;
  }

  .headline-page .page-body {
    top: 58px;
    bottom: 54px;
  }

  .headline-imprint {
    font-size: 8px;
    letter-spacing: 2.2px;
    margin-bottom: 20px !important;
  }

  .headline-title {
    margin-bottom: 8px !important;
    letter-spacing: -2.5px;
  }

  .headline-page .ornament {
    margin-top: 10px;
    font-size: 22px;
  }

  .headline-eyebrow {
    font-size: 8px;
    letter-spacing: 1.2px;
  }

  .review-page .pullquote {
    font-size: 22px;
  }

  .review-page .review-brand {
    font-size: 30px;
  }

  .review-page .chapter-kicker {
    margin-bottom: 14px !important;
  }

  .review-page .quote-mark {
    height: 24px;
    margin-top: 8px;
  }

  .review-page .rating strong {
    font-size: 45px;
  }

  .ribbon {
    left: 11px;
    width: 19px;
    height: 36px;
    font-size: 12px;
  }

  .author-image {
    width: 38%;
    margin-right: 15px;
  }

  .store-card {
    min-height: 88px;
  }

  .book-shadow {
    box-shadow: 0 25px 45px #0008, 0 10px 20px #0005;
  }
}

@media (max-height: 550px) {
  :root {
    --margin: 28px;
    --body-size: 16px;
  }

  .bookmarks {
    top: 23px;
    bottom: 35px;
    gap: 2px;
  }

  .bookmark {
    min-height: 22px;
    font-size: 8px;
  }

  .running-head {
    top: 13px;
    padding-bottom: 8px;
  }

  .page-body {
    top: 50px;
    bottom: 54px;
  }

  .headline-page .page-body {
    top: 25px;
    bottom: 50px;
  }

  .headline-title {
    font-size: 44px;
  }

  .page-body h2 {
    font-size: 31px;
  }

  .chapter-kicker {
    margin-bottom: 10px !important;
  }

  .ribbon {
    height: 30px;
    width: 19px;
    left: 6px;
  }

  .pullquote {
    font-size: 25px;
  }

  .review-brand {
    font-size: 29px;
    margin-bottom: 15px !important;
    padding-bottom: 12px;
  }

  .quote-mark {
    font-size: 65px;
    height: 30px;
    margin-top: 10px;
  }

  .book-controls {
    --controls-bottom: 5px;
  }

  .paper-form textarea {
    height: 48px;
  }

  .paper-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.paper-form label {
    margin-top: 9px;
  }

  .paper-form button {
    margin-top: 12px;
  }
}

.small-book {
  --margin: 18px;
  --body-size: 15px;
  --tab-width: 50px;
}

.small-book .bookmarks { top: 22px; bottom: 30px; gap: 3px; }
.small-book .bookmark { min-height: 0; font-size: 8px; }
.small-book .back-cover__ant {
  width: min(58%, 190px);
  max-height: 17%;
  object-fit: contain;
}
.small-book .back-cover__imprint {
  width: 90%;
  padding: 12px 4%;
  border-radius: 12px;
}
.small-book .back-cover__studio { font-size: 14px; letter-spacing: .7px; margin-bottom: 6px; }
.small-book .back-cover__legal { font-size: 12px; line-height: 1.4; }
.small-book .back-cover__links { font-size: 12px; margin-top: 7px; }
.small-book .back-cover__links a { min-height: 23px; }
.small-book .running-head { top: 17px; padding-bottom: 8px; font-size: 6px; letter-spacing: 0.7px; }
.small-book .running-head .book-name { font-size: 10px; }
.small-book .page-body { top: 54px; bottom: 51px; line-height: 1.48; }
.small-book .page-body h2 { font-size: 29px; }
.small-book .page-body h3 { font-size: 22px; }
.small-book .chapter-kicker { font-size: 7px; letter-spacing: 1.3px; margin-bottom: 12px !important; }
.small-book .headline-page .page-body { top: 48px; bottom: 54px; }
.small-book .headline-imprint { font-size: 6.5px; line-height: 1.5; letter-spacing: 1.5px; margin-bottom: 6px !important; }
.small-book .headline-title { font-size: 36px; letter-spacing: -2px; margin-bottom: 2px !important; }
.small-book .headline-byline { font-size: clamp(10px, calc(var(--book-w) * 0.045), 11px); line-height: 1.4; }
.small-book .headline-page .ornament { font-size: 16px; margin-top: 4px; }
.small-book .headline-eyebrow { font-size: 7px; letter-spacing: 0.8px; }
.small-book .headline-tagline { font-size: 15px; }
.small-book .review-brand { font-size: 25px; padding-bottom: 10px; margin-bottom: 10px !important; }
.small-book .review-brand small { font-size: 7px; letter-spacing: 2px; }
.small-book .review-page .pullquote { font-size: 19px; margin-bottom: 12px !important; }
.small-book .review-page .quote-mark { height: 24px; font-size: 64px; margin-top: 8px; }
.small-book .review-page .review-link { font-size: 7px; margin-top: 8px; }
.small-book .review-page .rating { margin: 10px 0; }
.small-book .review-page .rating strong { font-size: 38px; }
.small-book .review-page .score-row { font-size: 12px; }
.small-book .book-controls { --controls-bottom: 8px; }
.small-book .folio { font-size: 8px; }
.small-book .paper-form textarea { height: 64px; }
.small-book .store-card { min-height: 76px; gap: 5px; }
.small-book .store-card__mark { width: 26px; height: 26px; }

@media (max-height: 550px) {
  .small-book .review-page .page-body {
    top: 48px;
    bottom: 42px;
    font-size: 13px;
    line-height: 1.4;
  }

  .small-book .review-page .chapter-kicker {
    font-size: 6.5px;
    margin-bottom: 8px !important;
  }

  .small-book .review-page .review-brand {
    font-size: 22px;
    padding-bottom: 8px;
    margin-bottom: 8px !important;
  }

  .small-book .review-page .review-brand small {
    font-size: 6px;
    letter-spacing: 1px;
  }

  .small-book .review-page .quote-mark {
    font-size: 50px;
    height: 18px;
    margin-top: 6px;
  }

  .small-book .review-page .pullquote {
    font-size: 17px;
    line-height: 1.25;
    margin-bottom: 10px !important;
  }

  .small-book .review-page .continued {
    font-size: 10px;
    margin-bottom: 10px;
  }

  .small-book .paper-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.paper-form label { font-size: 8px; margin: 6px 0 4px; }
  .small-book .paper-form input { padding: 4px 2px; }
  .small-book .paper-form textarea { height: 40px; padding: 4px 2px; }
  .small-book .paper-form button { margin-top: 8px; padding: 9px 8px; font-size: 8px; }
}

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

  .book-stage.is-closed {
    transform: translate(-3px, -18px);
  }

  .cover-invitation {
    transform: none !important;
  }
}

/* Cover-only edition chooser: one quiet line, separate from the cover hit area. */
.cover-entry {
  position: absolute;
  top: calc(100% + 15px);
  left: 50%;
  transform: translateX(-50%) rotate(1deg);
  width: max-content;
  max-width: calc(100vw - 24px);
  display: flex;
  align-items: center;
  gap: 14px;
  direction: ltr;
  z-index: 20;
  color: #e8dcc4;
  font: 11px/1.5 var(--book-ui, Arial, sans-serif);
}
.cover-entry[hidden] { display: none; }
.cover-entry .cover-invitation {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0;
  font: inherit;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.book-language { position: relative; }
.book-language summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 3px;
  cursor: pointer;
  list-style: none;
}
.book-language summary::-webkit-details-marker { display: none; }
.language-chevron { opacity: .65; transition: transform .2s; }
.book-language[open] .language-chevron { transform: rotate(180deg); }
.book-language ul {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 174px;
  max-height: min(410px, calc(100dvh - 85px));
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 7px;
  list-style: none;
  background: #eee5d3;
  color: #302d26;
  border: 1px solid #bdad8d;
  border-radius: 4px;
  box-shadow: 0 12px 36px #0006;
}
.book-language a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 6px 11px;
  color: inherit;
  text-decoration: none;
  font: 13px/1.5 var(--book-ui, Arial, sans-serif);
  border-radius: 2px;
}
.book-language a[lang="fa"], .book-language a[lang="ar"] { font-family: Vazirmatn, sans-serif; }
.book-language a:hover, .book-language a:focus-visible { background: #ddcfb4; }
.book-language a[aria-current]::after { content: "✓"; color: #934d39; }
@media (pointer: coarse) { .book-language a { min-height: 44px; } }

/* Typography follows the language; original sample typography stays independent. */
@font-face { font-family: Vazirmatn; src: url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url('/assets/fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url('/assets/fonts/Vazirmatn-SemiBold.woff2') format('woff2'); font-weight: 600 900; font-display: swap; }
:root { --book-serif: "EB Garamond", Georgia, serif; --book-heading: "Cormorant Garamond", Georgia, serif; --book-ui: Arial, sans-serif; }
:root:lang(fa), :root:lang(ar) { --book-serif: Vazirmatn, sans-serif; --book-heading: Vazirmatn, sans-serif; --book-ui: Vazirmatn, sans-serif; }
:root:lang(ru) { --book-serif: "Noto Serif", Georgia, serif; --book-heading: "Noto Serif", Georgia, serif; }
:root:lang(zh) { --book-serif: "Noto Serif SC", serif; --book-heading: "Noto Serif SC", serif; --book-ui: "Noto Serif SC", serif; }
:root:lang(hi) { --book-serif: "Noto Serif Devanagari", serif; --book-heading: "Noto Serif Devanagari", serif; --book-ui: "Noto Serif Devanagari", serif; }
html:not([lang="en"]) .headline-summary { font-family: var(--book-serif); }
html:not([lang="en"]) .page-body { overflow-wrap: break-word; }
html:is([lang="fa"],[lang="ar"],[lang="hi"],[lang="zh"]) :is(.chapter-kicker,.running-head,.headline-eyebrow,.cover-invitation,.bookmark) { letter-spacing: 0; }
.headline-title { font-family: "Cormorant Garamond", Georgia, serif; }

/* The renderer's physical sheet and gestures are mirrored, never its text/art. */
html[dir="rtl"] .book-shell { transform: scaleX(-1); direction: ltr; }
.page-face { position: absolute; inset: 0; transform: scaleX(-1); direction: rtl; }
html[dir="rtl"] .book-stage { transform: translateX(16px); }
html[dir="rtl"] .book-stage.is-closed { transform: translate(3px, -18px) rotate(1deg); }
html[dir="rtl"] .book-stage.is-back-cover { transform: translateX(-16px); }
html[dir="rtl"] .cover-entry { transform: translateX(-50%) rotate(-1deg); }
html[dir="rtl"] .page-edges { inset: 3px 3px -5px -8px; border-radius: 4px 0 0 5px; border-right: 0; border-left: 1px solid #87845d; }
html[dir="rtl"] .is-back-cover .page-edges { inset: 3px -8px -5px 3px; border-left: 0; border-right: 1px solid #87845d; }
html[dir="rtl"] .bookmarks { right: auto; left: calc(-1 * var(--tab-width) + 8px); --tab-direction: -1; }
html[dir="rtl"] .bookmark { border-radius: 4px 0 0 4px; transform-origin: right center; padding: 0 11px 0 5px; }
html[dir="rtl"] .is-back-cover .bookmarks { left: auto; right: calc(-1 * var(--tab-width) + 8px); --tab-direction: 1; }
html[dir="rtl"] .is-back-cover .bookmark { border-radius: 0 4px 4px 0; transform-origin: left center; }
html[dir="rtl"] .ribbon { left: auto; right: 25px; }
html[dir="rtl"] .is-back-cover .ribbon { right: auto; left: 25px; }
html[dir="rtl"] .book-controls { flex-direction: row; }
html[dir="rtl"] .curl { right: auto; left: calc(-1 * var(--controls-left)); transform: scaleX(-1); }
html[dir="rtl"] .page-body :is(ul,ol) { padding-left: 0; padding-right: 1.2em; }
html[dir="rtl"] .page-body .dropcap::first-letter { float: none; font: inherit; margin: 0; }
html[dir="rtl"] .story-heading .story-year { right: auto; left: 0; }
html[dir="rtl"] .page-fit { transform-origin: top right; }
html[dir="rtl"] .back-cover__layout { direction: rtl; }
html[dir="rtl"] .sample-sheet[lang="en"] { text-align: left; }
@media (max-width: 600px) {
  html[dir="rtl"] .book-stage { transform: translateX(24px); }
  html[dir="rtl"] .book-stage.is-back-cover { transform: translateX(-24px); }
  html[dir="rtl"] .book-stage.is-closed { transform: translate(3px, -18px) rotate(1deg); }
  .cover-entry { gap: 9px; }
  .cover-entry .cover-invitation { letter-spacing: .8px; font-size: 9px; }
}

/* The Persian sample uses its published text in an upright RTL printed sheet. */
.sample-sheet[lang="fa"] .sample-sheet__inner { font-family: Vazirmatn, sans-serif; line-height: 21.7px; }
.sample-sheet[lang="fa"] .sample-chapter__title { font-family: Vazirmatn, sans-serif; font-size: 31px; line-height: 42px; }
.sample-sheet[lang="fa"] .sample-chapter__kicker { letter-spacing: 0; }
.sample-sheet[lang="fa"] .sample-console { font-family: Vazirmatn, sans-serif; }
.sample-sheet[lang="fa"] .sample-console__lines { padding: 14px 12px; line-height: 20px; }
.sample-sheet[lang="fa"] .sample-console__lines li.reply { padding-left: 0; padding-right: 26px; }
.sample-sheet[lang="fa"] .sample-dialogue { padding: 0; margin: 8px 0; }
.sample-sheet[lang="fa"] .sample-dialogue li { padding-left: 0; padding-right: 13px; margin-left: 0; margin-right: 20px; }
.sample-sheet[lang="fa"] .sample-dialogue li.level-2 { margin-right: 37px; }
.sample-sheet[lang="fa"] .sample-dialogue__mark { left: auto; right: 0; }
.sample-sheet[lang="fa"] .sample-verse { margin-left: 0; margin-right: 49px; }
html[dir="rtl"] .sample-sheet[lang="en"] :is(ul,ol) { padding-right: 0; }
html[dir="rtl"] .sample-sheet[lang="en"] .sample-console__lines { padding: 14px 12px; }
html[dir="rtl"] .is-closed .bookmarks { transform: translateX(55px); }
html[dir="rtl"] .bookmark[aria-current="true"]::after { right: auto; left: 5px; }
html[dir="rtl"] .is-back-cover .bookmark[aria-current="true"]::after { left: auto; right: 5px; }
html:not(.js) .reading-room { display: block; height: auto; overflow: visible; }
html:not(.js) .book-stage { width: auto; height: auto; transform: none !important; margin: 16px; }
html:not(.js) .book-stage > :not(.cover-entry) { display: none; }
html:not(.js) .cover-entry { position: relative; top: auto; left: auto; transform: none; margin: auto; color: var(--ink); }
html:not(.js) .cover-invitation { display: none; }
html:not(.js) .book-language ul { top: 100%; bottom: auto; }

.bookmark { overflow-wrap: anywhere; hyphens: auto; line-height: 1.2; }
.book-language summary:focus-visible { outline: 2px solid #d8b58b; outline-offset: 2px; }
html:not([lang="en"]) :is(.headline-byline,.headline-eyebrow) { white-space: normal; }
html:not([lang="en"]) .headline-byline { font-family: var(--book-serif); }
.is-turning .cover-entry, .is-riffling .cover-entry { visibility: hidden; pointer-events: none; }
.sample-sheet[lang="fa"] .sample-sheet__head--recto,
.sample-page__head[lang="fa"].sample-sheet__head--recto { justify-content: flex-start; }
.sample-sheet[lang="fa"] .sample-sheet__head--verso,
.sample-page__head[lang="fa"].sample-sheet__head--verso { justify-content: flex-end; }
html[dir="rtl"] .running-head .book-name { margin-left: 0; margin-right: 18px; }
/* An English original stays typographically English inside every locale. */
.sample-sheet[lang="en"] {
  --book-serif: "EB Garamond", Georgia, serif;
  --book-heading: "Cormorant Garamond", Georgia, serif;
  --book-ui: Arial, sans-serif;
}
.sample-sheet[lang="en"] h2.sample-chapter__title { line-height: 29px; }

/* Optical type scales: the English Garamond design is the reference, not a
   shared pixel size. Dense scripts need smaller display type and calmer weight.
   Printed samples have their own source typography and are excluded throughout. */
html:not([lang="en"]) {
  --locale-body: clamp(15px, calc(var(--book-w) * .053), 18.5px);
  --locale-reference: clamp(14px, calc(var(--book-w) * .05), 17px);
  --locale-heading: clamp(25px, calc(var(--book-w) * .09), 44px);
  --locale-brand: clamp(22px, calc(var(--book-w) * .073), 36px);
  --locale-quote: clamp(16px, calc(var(--book-w) * .05), 22px);
  --locale-appendix: clamp(23px, calc(var(--book-w) * .066), 31px);
  --locale-leading: 1.55;
  --locale-heading-leading: 1.15;
  --locale-quote-leading: 1.36;
  --locale-title-weight: 500;
  --locale-tracking: -.02em;
  --locale-caption-tracking: .1em;
  --locale-verse-style: italic;
}
html:lang(fa), html:lang(ar) {
  --locale-body: clamp(14px, calc(var(--book-w) * .048), 17px);
  --locale-reference: clamp(13.5px, calc(var(--book-w) * .046), 16px);
  --locale-heading: clamp(22px, calc(var(--book-w) * .067), 30px);
  --locale-brand: clamp(21px, calc(var(--book-w) * .063), 28px);
  --locale-quote: clamp(15px, calc(var(--book-w) * .048), 19px);
  --locale-appendix: clamp(20px, calc(var(--book-w) * .058), 27px);
  --locale-leading: 1.75;
  --locale-heading-leading: 1.45;
  --locale-quote-leading: 1.65;
  --locale-tracking: 0;
  --locale-caption-tracking: 0;
  --locale-verse-style: normal;
}
html:lang(ru) {
  --locale-body: clamp(14px, calc(var(--book-w) * .048), 17px);
  --locale-reference: clamp(13.5px, calc(var(--book-w) * .046), 16px);
  --locale-heading: clamp(23px, calc(var(--book-w) * .072), 34px);
  --locale-brand: clamp(21px, calc(var(--book-w) * .065), 30px);
  --locale-quote: clamp(15.5px, calc(var(--book-w) * .05), 20px);
  --locale-appendix: clamp(21px, calc(var(--book-w) * .06), 28px);
  --locale-heading-leading: 1.25;
  --locale-quote-leading: 1.45;
  --locale-tracking: -.015em;
}
html:lang(zh), html:lang(hi) {
  --locale-body: clamp(14px, calc(var(--book-w) * .047), 16.5px);
  --locale-reference: clamp(13.5px, calc(var(--book-w) * .045), 15.5px);
  --locale-heading: clamp(22px, calc(var(--book-w) * .067), 30px);
  --locale-brand: clamp(21px, calc(var(--book-w) * .063), 28px);
  --locale-quote: clamp(15px, calc(var(--book-w) * .048), 19px);
  --locale-appendix: clamp(20px, calc(var(--book-w) * .058), 27px);
  --locale-leading: 1.75;
  --locale-heading-leading: 1.45;
  --locale-quote-leading: 1.6;
  --locale-tracking: 0;
  --locale-caption-tracking: 0;
  --locale-verse-style: normal;
}
html:lang(zh) { --locale-body: clamp(14px, calc(var(--book-w) * .047), 16px); }

html:not([lang="en"]) .page:not(.sample-page) .page-body {
  font-size: var(--locale-body);
  line-height: var(--locale-leading);
}
html:not([lang="en"]) .page:not(.sample-page) .page-body h2 {
  font-size: var(--locale-heading);
  font-weight: var(--locale-title-weight);
  line-height: var(--locale-heading-leading);
  letter-spacing: var(--locale-tracking);
}
html:not([lang="en"]) .page:not(.sample-page) .page-body h3 {
  font-size: 1.25em;
  font-weight: 500;
  line-height: var(--locale-heading-leading);
  letter-spacing: var(--locale-tracking);
}
html:not([lang="en"]) .page:not(.sample-page) :is(strong,b) { font-weight: 600; }
html:not([lang="en"]) .page:not(.sample-page) .review-brand {
  font-size: var(--locale-brand);
  font-weight: var(--locale-title-weight);
  line-height: var(--locale-heading-leading);
  letter-spacing: var(--locale-tracking);
  padding-bottom: 12px;
  margin-bottom: 14px !important;
}
html:not([lang="en"]) .page:not(.sample-page) .review-brand small {
  font-size: clamp(8px, calc(var(--book-w) * .025), 10px);
  line-height: 1.5;
  letter-spacing: var(--locale-caption-tracking);
  margin-top: 8px;
}
html:not([lang="en"]) .page:not(.sample-page) .pullquote {
  font-size: var(--locale-quote);
  font-weight: 400;
  line-height: var(--locale-quote-leading);
  letter-spacing: 0;
  margin-bottom: 1em !important;
}
html:not([lang="en"]) .page:not(.sample-page) .review-excerpt {
  font-size: .95em;
  line-height: var(--locale-leading);
}
html:not([lang="en"]) .review-page .lede { font-size: 1.02em; line-height: var(--locale-leading); }
html:not([lang="en"]) .review-page .quote-mark {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(48px, calc(var(--book-w) * .135), 64px);
  height: clamp(20px, calc(var(--book-w) * .055), 26px);
  margin-top: 8px;
}
html:not([lang="en"]) .page:not(.sample-page) :is(.chapter-kicker,.review-link,.marketplace label,.paper-form label,.store-card__format,.back-to-index,.ace-letters span) {
  letter-spacing: var(--locale-caption-tracking);
}
html:not([lang="en"]) .page:not(.sample-page) .quiet { font-size: .78em; }
html:not([lang="en"]) .page:not(.sample-page) .continued { font-size: .78em; line-height: 1.5; }
html:not([lang="en"]) .headline-summary { font-size: var(--locale-body); }
html:not([lang="en"]) .headline-tagline { font-size: 1.15em; line-height: var(--locale-quote-leading); }
html:not([lang="en"]) .headline-byline { font-size: clamp(11px, calc(var(--book-w) * .04), 16px); line-height: 1.5; }
html:not([lang="en"]) :is(.headline-eyebrow,.headline-imprint) { letter-spacing: var(--locale-caption-tracking); }
html:not([lang="en"]) .author-intro .poem { font-size: .94em; line-height: var(--locale-leading); font-style: var(--locale-verse-style); }
html:not([lang="en"]) .page.appendix-page .page-body { font-size: var(--locale-reference); }
html:not([lang="en"]) .page.appendix-page .page-body h2 { font-size: 1.25em; }
html:not([lang="en"]) .page.appendix-page .page-body h2.appendix-title { font-size: var(--locale-appendix); }
html:not([lang="en"]) .page.appendix-page .page-body :is(h3,h4),
html:not([lang="en"]) .page.screen-page .page-body h3 { font-size: 1.08em; font-weight: 500; line-height: var(--locale-heading-leading); }
html:not([lang="en"]) .page:not(.sample-page) .ace-letters strong { font-family: "Cormorant Garamond", Georgia, serif; font-size: var(--locale-heading); font-weight: 400; }
html:not([lang="en"]) .page:not(.sample-page) .store-card__store { font-size: .8em; }
html:not([lang="en"]) .page:not(.sample-page) .paper-form .form-status { font-size: .8em; line-height: var(--locale-leading); }

/* On short screens keep the same hierarchy instead of oversized fixed display
   sizes. Form inputs and printed samples retain their independent sizing. */
@media (max-height: 550px) {
  html:not([lang="en"]) {
    --locale-body: 14px;
    --locale-reference: 13.5px;
    --locale-heading: 23px;
    --locale-brand: 21px;
    --locale-quote: 15.5px;
    --locale-appendix: 21px;
  }
  html:is(:lang(fa),:lang(ar),:lang(zh),:lang(hi)) {
    --locale-body: 13.5px;
    --locale-reference: 13px;
    --locale-heading: 21px;
    --locale-brand: 20px;
    --locale-quote: 14.5px;
    --locale-appendix: 20px;
  }
  html:not([lang="en"]) .headline-tagline { font-size: 1.08em; }
}

/* Translated reviews use a quieter scale so the opening reviews can share a
   sheet where the text fits. */
html:not([lang="en"]) .page.short-review-page .page-body {
  font-size: calc(var(--locale-body) * .94);
  line-height: 1.5;
}
html:not([lang="en"]) .page.short-review-page .chapter-kicker { margin-bottom: 8px !important; }
html:not([lang="en"]) .page.short-review-page .review-brand {
  font-size: clamp(19px, calc(var(--book-w) * .055), 27px);
  line-height: 1.15;
  padding-bottom: 8px;
  margin-bottom: 8px !important;
}
html:not([lang="en"]) .page.short-review-page .review-brand small {
  font-size: .34em;
  line-height: 1.45;
  margin-top: 5px;
}
html:not([lang="en"]) .page.short-review-page .quote-mark {
  font-size: 42px;
  height: 16px;
  margin-top: 4px;
}
html:not([lang="en"]) .page.short-review-page .pullquote {
  font-size: 1.08em;
  line-height: 1.5;
  margin-bottom: 8px !important;
}
html:not([lang="en"]) .page.short-review-page .lede {
  font-size: 1em;
  line-height: 1.5;
  margin-bottom: 8px;
}
html:not([lang="en"]) .page.short-review-page .quiet { font-size: .75em; margin-bottom: 8px; }
html:not([lang="en"]) .page.short-review-page .review-link { font-size: 8px; line-height: 1.5; margin-top: 4px; }
html:not([lang="en"]) .page.short-review-page .review-entry + .review-entry {
  margin-top: clamp(12px, calc(var(--book-w) * .035), 16px);
  padding-top: clamp(12px, calc(var(--book-w) * .03), 14px);
}

/* Reserve separate columns for translated story titles and the decorative
   port number. A long title can wrap without colliding with 2313. */
html:not([lang="en"]) .story-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(12px, calc(var(--book-w) * .035), 18px);
}
html:not([lang="en"]) .story-heading .story-year {
  position: static;
  grid-column: 2;
  grid-row: 1;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(48px, calc(var(--book-w) * .17), 84px);
  white-space: nowrap;
  direction: ltr;
}
html:not([lang="en"]) .page.story-page .story-heading h2 {
  grid-column: 1;
  grid-row: 1;
  font-size: min(var(--locale-heading), clamp(21px, calc(var(--book-w) * .064), 32px));
  overflow-wrap: normal;
  hyphens: auto;
}

/* English needs the same separation only on the shortest landscape sheets. */
@media (max-height: 550px) {
  html[lang="en"] .story-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  html[lang="en"] .story-heading .story-year {
    position: static;
    grid-column: 2;
    grid-row: 1;
    font-size: 48px;
  }
  html[lang="en"] .page.story-page .story-heading h2 {
    grid-column: 1;
    grid-row: 1;
    font-size: 21px;
  }
}

/* Open paper fills a phone or tablet; the closed cover keeps its own scale.
   The root class also styles pagination probes outside the visible book. */

/* Desktop uses the window's height while keeping the printed aspect ratio.
   Scale reading type with the larger paper, including each locale's optics. */
html.desktop-book {
  --body-size: calc(19px * var(--desktop-type-scale));
  --margin: clamp(24px, calc(var(--book-w) * .089), calc(44px * var(--desktop-type-scale)));
  --tab-width: min(clamp(160px, 19.5vh, 232px), calc((100vw - var(--book-w)) / 2 + 8px));
}
html.desktop-book .book-stage.is-closed { transform: translate(-3px, -14px) rotate(-1deg); }
html.desktop-book[dir="rtl"] .book-stage.is-closed { transform: translate(3px, -14px) rotate(1deg); }
.desktop-book .cover-entry { top: calc(100% + 6px); }
.desktop-book .cover-entry :is(.cover-invitation, summary) { min-height: 28px; }
html.desktop-book:not([lang="en"]) .page:not(.sample-page) .page-body,
html.desktop-book:not([lang="en"]) .headline-summary {
  font-size: calc(var(--locale-body) * var(--desktop-type-scale));
}
html.desktop-book:not([lang="en"]) .page.appendix-page .page-body {
  font-size: calc(var(--locale-reference) * var(--desktop-type-scale));
}
.desktop-book .headline-title { font-size: clamp(40px, calc(var(--book-w) * .16), calc(80px * var(--desktop-type-scale))); }
.desktop-book .headline-byline { font-size: clamp(12.5px, calc(var(--book-w) * .035), calc(17px * var(--desktop-type-scale))); }
html.desktop-book:not([lang="en"]) .headline-byline { font-size: clamp(11px, calc(var(--book-w) * .04), calc(16px * var(--desktop-type-scale))); }

/* Longer, softly uneven desktop slips stay outside the paper. They use the
   same matte stock as the compact tabs, with less than half the sample's tilt. */
.desktop-book .bookmarks {
  container-type: size;
  top: clamp(50px, 8.5vh, 100px);
  bottom: clamp(45px, 7vh, 88px);
  padding: 8px 20px 16px 0;
  gap: clamp(1.5px, calc((var(--book-h) - 260px) / 54), 9px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.desktop-book .bookmarks::-webkit-scrollbar { display: none; }
html.desktop-book[dir="rtl"] .bookmarks,
.desktop-book .is-back-cover .bookmarks { padding-left: 20px; padding-right: 0; }
html.desktop-book[dir="rtl"] .is-back-cover .bookmarks { padding-left: 0; padding-right: 20px; }
html.desktop-book .bookmark {
  --tab: #cbb991;
  flex: 1 1 0px;
  min-height: 0;
  max-height: clamp(48px, 6.8vh, 86px);
  padding: 4px 12px;
  font-size: min(clamp(12px, 1.5vh, 16px), clamp(9px, 2.8cqh, 16px));
  line-height: 1.35;
  letter-spacing: 0;
  background: var(--tab);
}
html.desktop-book .bookmark[aria-current="true"] {
  flex-basis: 2px;
  font-size: min(clamp(13px, 1.65vh, 17px), clamp(9.5px, 3cqh, 17px));
}
html.desktop-book .paper-breeze[data-active-section] .bookmark[aria-current] {
  opacity: 1;
  transform: none;
  filter: none;
  background: none;
  box-shadow: none;
}
.desktop-book .paper-breeze .bookmark::after { display: none; }
.desktop-book .bookmark-paper { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

html.immersive-reading {
  --margin: clamp(22px, 6vw, 76px);
  --body-size: clamp(19px, 2.5vw, 23px);
  --tab-width: clamp(140px, 38vw, 164px);
  --locale-body: clamp(17px, 2.3vw, 22px);
  --locale-reference: clamp(16px, 2.1vw, 20px);
}

html.immersive-reading:is(:lang(fa), :lang(ar)) {
  --locale-body: clamp(18px, 2.3vw, 21px);
  --locale-reference: clamp(16px, 2.1vw, 19px);
}

.immersive-reading .reading-room {
  padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

html.immersive-reading .book-stage,
html.immersive-reading .book-stage.is-back-cover {
  transform: none;
}

.immersive-reading .page-edges { inset: 2px -6px -4px 2px; }
html.immersive-reading[dir="rtl"] .page-edges,
html.immersive-reading .is-back-cover .page-edges { inset: 2px 2px -4px -6px; }
html.immersive-reading[dir="rtl"] .is-back-cover .page-edges { inset: 2px -6px -4px 2px; }
.immersive-reading .book-shadow { box-shadow: 0 8px 20px #0006, 1px 2px 3px #0008; }

/* Stable, evenly spaced buttons keep native scrolling and keyboard access.
   Paper Breeze supplies the curved surface; CSS is the no-canvas fallback. */
.bookmark-paper { display: contents; }
.bookmark-canvas { display: none; }
html.immersive-reading .bookmarks {
  --paper-origin: right center;
  container-type: size;
  top: clamp(64px, 9vh, 82px);
  bottom: 62px;
  left: auto;
  right: -6px;
  z-index: 10;
  justify-content: flex-start;
  gap: clamp(1.5px, calc((var(--book-h) - 260px) / 54), 10px);
  padding: 8px 0 16px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
  opacity: 1;
  transform: none;
  transition: none;
}
.immersive-reading .bookmarks::-webkit-scrollbar { display: none; }
html.immersive-reading[dir="rtl"] .bookmarks,
html.immersive-reading .is-back-cover .bookmarks {
  --paper-origin: left center;
  right: auto;
  left: -6px;
  padding-left: 0;
  padding-right: 20px;
}
html.immersive-reading[dir="rtl"] .is-back-cover .bookmarks {
  --paper-origin: right center;
  left: auto;
  right: -6px;
  padding-left: 20px;
  padding-right: 0;
}

html.immersive-reading .bookmark {
  --tab: #cbb991;
  --paper-scale: .94;
  --fold-angle: 0deg;
  flex: 1 1 0px;
  min-height: 0;
  max-height: 52px;
  padding: 0;
  font-size: clamp(9px, 2.8cqh, 11px);
  font-family: Arial, Tahoma, var(--book-ui);
  line-height: 1.35;
  letter-spacing: 0;
  perspective: 420px;
  perspective-origin: var(--paper-origin);
  background: none;
  box-shadow: none;
  border-radius: 0;
}
html:is(.immersive-reading, .desktop-book) .bookmark[data-section="reviews"] { --tab: #c2a394; }
html:is(.immersive-reading, .desktop-book) .bookmark[data-section="story"] { --tab: #a5afa0; }
html:is(.immersive-reading, .desktop-book) .bookmark[data-section="ace"] { --tab: #b6a9b5; }
html:is(.immersive-reading, .desktop-book) .bookmark[data-section="author"] { --tab: #bdb997; }
html:is(.immersive-reading, .desktop-book) .bookmark[data-section="buy"] { --tab: #bdc2b0; }
html:is(.immersive-reading, .desktop-book) .bookmark[data-section="contact"] { --tab: #c3b08a; }
html:is(.immersive-reading, .desktop-book) .bookmark[data-section="community"] { --tab: #a5b5b8; }
html:is(.immersive-reading, .desktop-book) .bookmark[data-section="sample"] { --tab: #beb195; }
html:is(.immersive-reading, .desktop-book) .bookmark[data-section="manifesto"] { --tab: #a6b8ad; }
html:is(.immersive-reading, .desktop-book) .bookmark[data-section="characters"] { --tab: #b4acb9; }
html:is(.immersive-reading, .desktop-book) .bookmark[data-section="back-cover"] { --tab: #b8b09b; }
/* Arial matches the prototype's Latin labels; retain the loaded script fonts
   where system Arial would substitute tiny or incomplete glyphs. */
html.immersive-reading:is(:lang(fa), :lang(ar), :lang(hi), :lang(zh)) .bookmark {
  font-family: var(--book-ui);
}
html.immersive-reading .bookmarks[data-active-section] .bookmark[aria-current] {
  opacity: 1;
  transform: none;
  filter: none;
  box-shadow: none;
}
html.immersive-reading .bookmark::after { display: none; }
html.immersive-reading .bookmark-paper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 6px 2px 2px 6px / 11px 2px 2px 11px;
  background: var(--tab);
  box-shadow: calc(-2px * var(--tab-direction)) 3px 5px #30281925;
  backface-visibility: hidden;
  transform-origin: var(--paper-origin);
  transform: rotateY(calc(var(--fold-angle) - var(--tab-curl, 0deg) * var(--tab-direction)))
    scale(calc(var(--paper-scale) + var(--tab-grow, 0)));
  filter: none;
  transition: transform .64s cubic-bezier(.18,.85,.2,1.06), box-shadow .5s, filter .35s, border-radius .5s;
  transition-delay: calc(var(--tab-index, 0) * 16ms);
}
html.immersive-reading[dir="rtl"] .bookmark-paper,
html.immersive-reading .is-back-cover .bookmark-paper { border-radius: 2px 6px 6px 2px / 2px 11px 11px 2px; }
html.immersive-reading[dir="rtl"] .is-back-cover .bookmark-paper { border-radius: 6px 2px 2px 6px / 11px 2px 2px 11px; }
.immersive-reading .bookmark-label { position: relative; transition: opacity .2s .12s; }
html.immersive-reading .bookmark[aria-current="true"] {
  --paper-scale: 1.02;
  flex-basis: 2px;
  max-height: 54px;
  font-size: clamp(9.5px, 3cqh, 12px);
}
html.immersive-reading .bookmark[aria-current="true"] .bookmark-paper {
  box-shadow: calc(-2px * var(--tab-direction)) 4px 7px #30281930;
}
.immersive-reading .bookmark[aria-current="true"] .bookmark-paper::after {
  content: "";
  position: absolute;
  inset-inline-start: 5px;
  top: calc(50% - 1.5px);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--rust);
}
html.immersive-reading .bookmark:focus-visible { outline-offset: -3px; }

/* Only the paper faces fold away, leaving the real coloured edges visible.
   The current section leaves a slightly wider bookmark in the closed stack. */
.is-reading-quiet .bookmarks { pointer-events: none; }
html.immersive-reading .is-reading-quiet .bookmark { --fold-angle: calc(86deg * var(--tab-direction)); }
html.immersive-reading .is-reading-quiet .bookmark[aria-current="true"] { --fold-angle: calc(82deg * var(--tab-direction)); }
html.immersive-reading .is-reading-quiet .bookmark-paper {
  animation: none;
  box-shadow: 0 1px 2px #30281930;
  transition-timing-function: cubic-bezier(.45,0,.3,1);
}
.immersive-reading .is-reading-quiet .bookmark-label { opacity: 0; transition-delay: 0s; }

/* The canvas includes a little room for the free lip and its diffuse shadow.
   Mirrored geometry is drawn by the renderer, so RTL labels stay upright. */
html:is(.immersive-reading, .desktop-book) .paper-breeze .bookmark { perspective: none; }
html:is(.immersive-reading, .desktop-book) .paper-breeze .bookmark .bookmark-paper {
  transform: none;
  background: none;
  box-shadow: none;
  filter: none;
  transition: none;
}
html:is(.immersive-reading, .desktop-book) .paper-breeze .bookmark-paper::after { display: none; }
html:is(.immersive-reading, .desktop-book) .paper-breeze .bookmark-label { opacity: 0; transition: none; }
html:is(.immersive-reading, .desktop-book) .paper-breeze .bookmark-canvas {
  display: block;
  position: absolute;
  top: -12px;
  right: 0;
  left: auto;
  width: calc(100% + 20px);
  height: calc(100% + 24px);
  pointer-events: none;
}
html.immersive-reading[dir="rtl"] .bookmark-canvas,
html.immersive-reading .is-back-cover .bookmark-canvas { left: 0; right: auto; }
html.immersive-reading[dir="rtl"] .is-back-cover .bookmark-canvas { right: 0; left: auto; }
html.desktop-book .paper-breeze .bookmark-canvas { left: 0; right: auto; }
html.desktop-book[dir="rtl"] .bookmark-canvas,
html.desktop-book .is-back-cover .bookmark-canvas { right: 0; left: auto; }
html.desktop-book[dir="rtl"] .is-back-cover .bookmark-canvas { left: 0; right: auto; }

/* Page navigation, folio and the cover ribbon stay available while
   reading. Only the section bookmarks retract. */
.immersive-reading .book-controls {
  --controls-left: 8px;
  --controls-right: 8px;
  --controls-bottom: 6px;
}
.immersive-reading .ribbon { top: 0; }
html.immersive-reading[dir="rtl"] .ribbon { right: 11px; left: auto; }
html.immersive-reading[dir="rtl"] .is-back-cover .ribbon { right: auto; left: 11px; }

@media (max-height: 550px) {
  html.immersive-reading { --margin: clamp(24px, 6vw, 76px); --body-size: 18px; }
  html.immersive-reading .bookmarks { top: 48px; bottom: 46px; }
}

/* Always one vertical stack of paper slips, including short landscape screens.
   Flex shares the measured height; container-relative type and tighter spacing
   keep all labels on the same book edge without changing the paper effect. */
@media (max-height: 650px) {
  html:is(.immersive-reading, .desktop-book) .bookmarks {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  html:is(.immersive-reading, .desktop-book) .bookmark-paper { padding-block: 2px; }
}

@media (max-height: 360px) {
  html.immersive-reading .bookmarks {
    gap: 1px;
    padding-block: 2px;
  }
}
