/* Entrelinhas: paper, printing ink and illustrated editions. */
@font-face { font-family: Fraunces; src: url('/assets/fonts/fraunces.woff2') format('woff2'); font-style: normal; font-weight: 100 900; font-display: swap; }
:root { --band: #173d35; --band-ink: #f2efdf; --band-soft: #d1d7c8; --band-accent: #e9cf93; --band-active: #efd582; --band-mark: #e0e3c9; --note: #f4efd9; --note-sheet: #f2efdf23; --page-grain: url('/assets/paper.svg'); --focus: #ad382c; --accent-ink: #8e3026; }
:root { --paper: #f2efdf; --paper-light: #fffdf4; --paper-deep: #ddd8c3; --ink: #24332b; --ink-soft: #414d44; --wine: #173d35; --wine-dark: #0f2e27; --gold: #ad382c; --muted: #60675a; --line: #213f322e; --display: Fraunces, Georgia, serif; --sans: 'Segoe UI', system-ui, sans-serif; }
body { background: url('/assets/paper.svg') repeat, var(--paper); }
body::before { content: none; }
::selection { background: #efd582; color: #173d35; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
a, button { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
.shell { width: min(100% - 3rem, 77rem); }
.site-header { background: transparent; backdrop-filter: none; border-color: var(--line); }
.site-header__inner { min-height: 6rem; gap: 1rem; }
.brand { letter-spacing: -.06em; }
.brand strong { font: 650 2rem/.95 var(--display); }
.brand > span { font: 400 .75rem/1.2 var(--sans); letter-spacing: .06em; margin-top: .5rem; color: var(--muted); }
.brand strong .brand-dot { color: var(--gold); font: inherit; letter-spacing: inherit; }
.desktop-nav { gap: 1.6rem; }
.desktop-nav a { font-size: .86rem; padding-block: .6rem; }
.desktop-nav .nav-shelf { border: 1px solid var(--wine); border-radius: 3px; padding: .65rem 1rem; }
.nav-shelf span { margin-left: .7rem; }
.nav-shelf::after { content: none; }
.menu-button { border-color: var(--wine); border-radius: 50%; }
.mobile-menu { background: url('/assets/paper.svg'), var(--band); color: var(--band-ink); }
.mobile-menu .brand > span { color: var(--band-soft); }
.mobile-menu nav { padding-block: 2.5rem; }
.mobile-menu nav a { font-family: var(--display); }
.button { border-radius: 3px; min-height: 3.25rem; padding: .8rem 1.25rem; text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 600; transition: background .2s, box-shadow .2s; }
.button span { margin-left: 1.3rem; font-size: 1.2rem; line-height: 1; }
@media (hover: hover) { .button:hover { box-shadow: 3px 3px 0 var(--gold); } }
@media (hover: hover) { .button--ghost:hover { background: var(--wine); } }
.text-link { font-size: .87rem; letter-spacing: 0; text-transform: none; font-weight: 500; }
.text-link::after { content: '↗'; }
.quiet-link { font-size: .87rem; text-underline-offset: 5px; text-decoration-color: #748278; }
.eyebrow { font-size: .82rem; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--accent-ink); }
.press-hero { overflow: clip; padding: 4rem 0 3.8rem; }
.press-hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 1rem; }
.press-hero__copy { position: relative; z-index: 5; }
.edition-label { display: flex; align-items: center; gap: .65rem; font-size: .77rem; margin: 0 0 1.8rem; }
.edition-label > span { width: .55rem; height: .55rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 7%, transparent); }
.press-hero h1 { font: 520 clamp(3.5rem, 6.8vw, 6.4rem)/.98 var(--display); letter-spacing: -.055em; margin: 0; color: var(--wine); font-variation-settings: 'SOFT' 25, 'WONK' 1; }
.hero-description { font-size: 1.02rem; line-height: 1.75; margin: 1.7rem 0 1.65rem; color: var(--ink-soft); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.3rem; }
.hero-footnote { margin: 1.25rem 0 0; font-size: .72rem; color: var(--muted); }
.resume-note { display: inline-flex; gap: .5rem; margin-top: 1rem; font-size: .85rem; color: var(--accent-ink); text-underline-offset: 4px; }
.book-composition { min-width: 0; height: 28rem; position: relative; perspective: 1400px; }
.composition-orbit { width: 23rem; height: 23rem; border: 1px solid #173d3526; border-radius: 50%; position: absolute; top: 3rem; left: 3rem; background: repeating-radial-gradient(ellipse, transparent 0 7px, #173d350b 7px 8px); }
.composition-note { position: absolute; right: 1rem; top: -.1rem; font: italic 1rem var(--reading); transform: rotate(6deg); color: var(--muted); }
.composition-note::after { content: '⤵'; display: block; padding-left: 5rem; font-size: 2.4rem; line-height: 1.1; }
.composition-book { position: absolute; width: 14.5rem; text-decoration: none; transition: transform .35s ease, filter .35s ease; transform-origin: 50% 80%; }
.composition-book .cover { width: 100%; box-shadow: 5px 8px 0 #d3cbb4, 7px 10px 0 #e3dcc9, 13px 23px 25px #1731282d; }
.composition-book--back { left: 1rem; top: 1.4rem; transform: rotate(-17deg); z-index: 1; }
.composition-book--side { right: .1rem; top: 4.2rem; transform: rotate(14deg); z-index: 2; }
.composition-book--front { left: 25%; top: 4.4rem; transform: rotate(-5deg); z-index: 3; }
.composition-book:focus-visible { transform: translateY(-1.2rem) rotate(0deg); z-index: 4; }
@media (hover: hover) { .composition-book:hover { transform: translateY(-1.2rem) rotate(0deg); z-index: 4; } }
.library-stamp { position: absolute; bottom: .2rem; right: -.3rem; z-index: 5; display: grid; align-content: center; text-align: center; width: 7.3rem; height: 7.3rem; border: 1px solid var(--gold); outline: 1px dashed var(--gold); outline-offset: -6px; color: var(--gold); border-radius: 50%; background: url('/assets/paper.svg'), var(--paper); transform: rotate(13deg); }
.library-stamp strong { font: 550 1.4rem/1 var(--display); margin: .3rem 0; }
.library-stamp > span { font-size: .56rem; }
.library-strip { border-block: 1px solid var(--line); }
.library-strip .shell { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; }
.library-strip p { margin: 0; font-size: .79rem; }
.library-strip strong { font: 500 1.6rem var(--display); margin-right: .35rem; }
.library-strip .shell > span { color: var(--gold); font-size: 1.7rem; }
.selection-section { padding-block: 4.5rem 5rem; }
.editorial-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2.2rem; }
.editorial-heading .eyebrow { margin: 0 0 .6rem; }
.editorial-heading h2 { font: 480 clamp(1.9rem, 3.4vw, 3rem)/1.1 var(--display); letter-spacing: -.035em; margin: 0; max-width: 40rem; }
.editorial-heading > a { flex-shrink: 0; }
.selection-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.cover { --cover-art: url('/assets/engraving-sun.svg'); padding: 1.2rem 1.35rem; background: linear-gradient(90deg, #0004, transparent 3%, #fff2 4%, transparent 5%), url('/assets/paper.svg'), var(--cover); color: #fff4d7; border: 0; border-radius: 1px 3px 3px 1px; box-shadow: 1px 3px 0 #c5bea8, 3px 5px 0 #ded7c5, 5px 9px 15px #29352a20; justify-content: flex-start; }
.cover::before { inset: 15% 0 39%; border: 0; box-shadow: none; background: var(--cover-art) center / contain no-repeat; opacity: .95; z-index: -1; }
.cover::after { content: ''; top: auto; height: 2px; inset-inline: 1.35rem; bottom: 2.5rem; opacity: .5; background: #f3dda9; mix-blend-mode: normal; }
.cover--red { --cover: #a7352d; --cover-accent: #f3dda9; --cover-art: url('/assets/engraving-eye.svg'); }
.cover--green { --cover: #235148; --cover-accent: #dfdfad; --cover-art: url('/assets/engraving-leaf.svg'); }
.cover--black { --cover: #29384d; --cover-accent: #efd7a1; }
.cover--ochre { --cover: #8a5730; --cover-accent: #f4dfaf; }
.cover--blue { --cover: #365962; --cover-accent: #e0dfa7; --cover-art: url('/assets/engraving-leaf.svg'); }
.cover--violet { --cover: #684153; --cover-accent: #f4cfbb; --cover-art: url('/assets/engraving-eye.svg'); }
.cover__author { font: 450 .65rem/1.35 var(--sans); letter-spacing: .035em; text-transform: none; }
.cover__title { margin-top: auto; padding-bottom: 1.7rem; font: 500 clamp(1.7rem, 2.8vw, 2.5rem)/.98 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.cover__year { display: flex; justify-content: space-between; font: 400 .64rem/1 var(--sans); letter-spacing: .08em; }
.cover__year > span { letter-spacing: 0; }
.cover--long::before { inset: 15% 0 52%; }
.cover--long .cover__title { font-size: clamp(1.15rem, 2.3vw, 2rem); line-height: 1.04; }
.book-card .cover { transition: transform .25s ease, box-shadow .25s ease; }
@media (hover: hover) { .book-card:hover .cover { transform: translateY(-5px) rotate(-1deg); box-shadow: 1px 3px 0 #c5bea8, 3px 5px 0 #ded7c5, 8px 15px 20px #29352a30; } }
.book-card__caption { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.book-card h3, .book-card h2 { font: 500 1.2rem/1.2 var(--display); margin: 1.1rem 0 .4rem; letter-spacing: -.02em; }
.book-card__caption > span { font-size: 1.1rem; color: var(--accent-ink); }
.book-card p { font-size: .78rem; }
.book-card__tag { display: inline-block; font-size: .75rem; margin-top: .65rem; border-bottom: 1px solid var(--line); color: var(--wine); }
.discovery-section { position: relative; background: url('/assets/paper.svg'), var(--band); color: var(--band-ink); padding: 4.5rem 0; }
.discovery-section::before { content: ''; position: absolute; inset: -6px 0 auto; height: 7px; background: var(--band); clip-path: polygon(0 65%,5% 20%,10% 70%,15% 10%,20% 70%,25% 0,30% 60%,40% 10%,50% 55%,60% 5%,70% 60%,80% 0,90% 75%,100% 30%,100% 100%,0 100%); }
.discovery-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 6rem; }
.discovery-copy > .eyebrow { color: var(--band-accent); margin: 0 0 1rem; }
.discovery-copy h2 { font: 450 clamp(2.8rem, 5vw, 4.8rem)/1.01 var(--display); letter-spacing: -.045em; margin: 0 0 1rem; }
.discovery-copy > p:not(.eyebrow) { max-width: 24rem; font-size: .93rem; color: var(--band-soft); }
.discovery-choices { margin-top: 1.6rem; display: grid; }
.discovery-choices button { text-align: left; display: flex; align-items: center; justify-content: space-between; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--band-ink) 21%, transparent); padding: .9rem 0; background: transparent; color: inherit; font-size: .9rem; cursor: pointer; }
.discovery-choices button[aria-pressed='true'] { color: var(--band-active); }
.discovery-choices button[aria-pressed='true']::before { content: '•'; margin-right: .6rem; }
.discovery-choices button span { margin-left: auto; }
.discovery-section :focus-visible { outline-color: var(--band-active); }
.reading-note { position: relative; color: var(--ink); background: url('/assets/paper.svg'), var(--note); padding: 2.6rem; transform: rotate(2deg); box-shadow: 9px 10px 0 var(--note-sheet), 14px 19px 24px #00180f30; }
.note-pin { position: absolute; left: 42%; width: 5.5rem; height: 1.5rem; top: -.75rem; background: #ddc27dcc; transform: rotate(-6deg); }
.note-label { font-size: .72rem; margin: 0; color: var(--accent-ink); }
.reading-note h3 { font: 500 clamp(2rem, 3.5vw, 3.1rem)/1.06 var(--display); margin: 1.6rem 0 .7rem; letter-spacing: -.035em; }
.note-author { font-size: .8rem; color: var(--muted); }
.note-summary { font: 400 1.25rem/1.65 var(--reading); min-height: 6.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.note-bottom { border-top: 1px solid var(--line); padding-top: 1rem; display: grid; gap: 1.3rem; }
.note-bottom > span { font-size: .75rem; }
.note-bottom .button { justify-self: start; }
.history-section { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; padding-block: 5rem; }
.history-intro h2 { font: 450 clamp(2rem, 3.3vw, 3rem)/1.15 var(--display); letter-spacing: -.035em; margin: 1rem 0; }
.history-intro > p:not(.eyebrow) { max-width: 25rem; color: var(--muted); font-size: .93rem; }
.history-section .movement-row { grid-template-columns: 3.5rem 1fr 1.5rem; align-items: center; gap: 1rem; padding-block: 1.6rem; }
.history-section .movement-row strong { font-size: 1.7rem; }
@media (hover: hover) { .movement-row:hover strong { color: var(--gold); } }
@media (hover: hover) { .movement-row:hover > span:last-child { transform: translate(2px,-2px); } }
.serendipity { border-top: 1px solid var(--line); padding-block: 2.5rem 3.5rem; display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.serendipity-mark { font-size: 4.5rem; line-height: 1; color: var(--gold); }
.serendipity h2 { font: 500 1.7rem/1.2 var(--display); letter-spacing: -.03em; margin: 0 0 .5rem; }
.serendipity p { font-size: .86rem; margin: 0; color: var(--muted); }
.serendipity > button { margin-left: auto; }
.serendipity .random-status:empty { display: none; }
.serendipity .random-status { flex-basis: 100%; }
.site-footer { background: url('/assets/paper.svg'), var(--band); color: var(--band-ink); padding: 3rem 0 1.5rem; }
.site-footer .brand > span, .site-footer .muted { color: var(--band-soft); }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.footer-top > p { font: 400 1.7rem/1.25 var(--display); margin: 0; }
.footer-top nav { display: flex; gap: 1.8rem; font-size: .82rem; }
.footer-top nav a { text-decoration: none; text-underline-offset: 4px; }
@media (hover: hover) { .footer-top nav a:hover { text-decoration: underline; } }
.footer-note-small { font-size: .75rem; color: var(--band-soft); }
.footer-wordmark { font: 550 clamp(3rem, 14.5vw, 13rem)/1.15 var(--display); letter-spacing: -.065em; padding-top: 1.4rem; color: var(--band-mark); }
.footer-note { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; padding-top: 1rem; color: var(--band-soft); font-size: .75rem; }
/* Shared inner pages retain the same paper and edition language. */
.page-hero { padding: 3rem 0 1.6rem; }
.page-hero h1 { color: var(--wine); font-size: clamp(3rem, 7vw, 5rem); font-weight: 450; }
.page-hero .lead { font: 400 1.05rem/1.6 var(--sans); max-width: 43rem; }
.catalog-tools { grid-template-columns: 1fr; padding-block: 1rem; }
.search-field input { border-radius: 3px; background: #fffdf490; border-color: #173d3560; }
.filter-chip { font-size: .78rem; text-transform: none; letter-spacing: 0; border-radius: 2px; padding-inline: 1rem; }
@media (hover: hover) { .filter-chip:hover { border-color: var(--wine); } }
.catalog-grid { gap: 2.5rem 2rem; padding-top: 1rem; }
.catalog-grid .book-card { content-visibility: visible; contain-intrinsic-size: none; }
.book-card__access { font-size: .75rem; letter-spacing: 0; text-transform: none; color: #446050; }
.book-detail { gap: 4rem; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); padding-block: 3rem 4rem; }
.book-detail__cover { width: min(100%, 19rem); }
.book-detail__copy { min-width: 0; }
.book-detail__copy h1 { font-size: clamp(2.7rem, 5.5vw, 5.4rem); line-height: 1; overflow-wrap: break-word; color: var(--wine); }
.detail-grid { gap: 2.5rem; }
.detail-block h2 { font: 550 1.15rem/1.4 var(--display); text-transform: none; letter-spacing: 0; }
.reader-page { background: url('/assets/paper.svg'), #f6f2e6; }
.reader-page[data-theme='light'] { background: #fffdfa; }
.reader-page[data-theme='dark'] { background: #1e2824; color: #eeeadd; --wine: #d5ce9b; --muted: #b9c5b8; --paper-light: #28352e; --ink: #eeeadd; --line: #b9c5b838; --gold: #e4b283; }
.reader { padding-top: 3rem; }
.reader h1 { font-size: clamp(2.5rem, 7vw, 4.4rem); }
.reader__book, .reader__meta { text-transform: none; letter-spacing: .01em; font-weight: 400; font-size: .8rem; line-height: 1.5; }
.reader__ornament { margin-block: 1.8rem; }
.reader-header__title { font-family: var(--reading); }
.reader-content > p:first-child:not(.reader-loading):not(.reader-error)::first-letter { font-family: var(--reading); }
.reader-page :focus-visible { outline-color: var(--gold); }
.settings-dialog { border-radius: 4px; }
.settings-group label, .settings-group legend, .settings-label { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .85rem; }
.storage-notice { font: 400 .78rem/1.5 var(--sans); padding: .8rem; border: 1px solid var(--line); }
@media (min-width: 70rem) { .catalog-tools { grid-template-columns: minmax(17rem,1fr) auto; } }
@media (max-width: 69.99rem) {
  .desktop-nav { gap: 1rem; }
  .desktop-nav a { font-size: .77rem; }
  .brand strong { font-size: 1.7rem; }
  .press-hero__grid { grid-template-columns: 1fr 1fr; }
  .book-composition { transform: scale(.85); transform-origin: center; margin-inline: -1rem; }
  .composition-book { width: 12.5rem; }
  .composition-orbit { left: 0; width: 20rem; height: 20rem; }
  .composition-book--front { left: 22%; }
  .selection-grid { gap: 1.4rem; }
  .discovery-grid { gap: 3rem; }
  .history-section { gap: 2.5rem; }
  .book-detail { gap: 2.5rem; }
}
@media (max-width: 55rem) {
  .desktop-nav { display: none; }
  .menu-button { display: inline-grid; }
  .press-hero { padding-top: 2.8rem; }
  .press-hero__grid { grid-template-columns: 1fr; gap: 1rem; }
  .press-hero__copy { max-width: 38rem; }
  .press-hero h1 { font-size: clamp(3.3rem, 10vw, 5.5rem); }
  .book-composition { width: min(100%, 32rem); justify-self: center; transform: none; height: 27rem; margin: 2rem 0 0; }
  .composition-book { width: 14rem; }
  .composition-book--back { left: 2%; }
  .composition-book--side { right: 2%; }
  .composition-book--front { left: 27%; }
  .composition-orbit { left: 15%; width: 22rem; height: 22rem; max-width: 85%; }
  .selection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
  .cover__title { font-size: clamp(1.7rem, 4vw, 2.6rem); }
  .library-strip p { font-size: .7rem; }
  .discovery-grid { gap: 2rem; }
  .reading-note { padding: 1.7rem; }
  .history-section { grid-template-columns: 1fr; gap: 2rem; }
  .history-section .movement-row { grid-template-columns: 4rem 1fr 1.5rem; }
  .footer-top nav { flex-direction: column; gap: .8rem; }
}
@media (max-width: 39.99rem) {
  .shell { width: calc(100% - 2.5rem); }
  .site-header__inner { min-height: 5rem; }
  .brand strong { font-size: 1.8rem; }
  .brand > span { font-size: .75rem; }
  .press-hero { padding: 2.4rem 0 1.8rem; }
  .edition-label { font-size: .75rem; margin-bottom: 1.4rem; }
  .press-hero h1 { font-size: clamp(3.1rem, 11.9vw, 4.6rem); }
  .hero-description { font-size: .88rem; margin-block: 1.4rem; }
  .hero-description br { display: none; }
  .hero-actions { gap: 1.2rem; }
  .hero-actions .button { padding-inline: 1rem; font-size: .85rem; }
  .hero-actions .quiet-link { font-size: .79rem; }
  .hero-footnote { font-size: .75rem; }
  .book-composition { height: 22.5rem; width: 100%; margin-top: 1.4rem; }
  .composition-book { width: 46%; }
  .composition-book--front { left: 27%; top: 3.8rem; }
  .composition-book--back { top: 1.5rem; left: 6%; }
  .composition-book--side { right: 2%; top: 3.7rem; }
  .composition-book .cover { padding: .9rem; }
  .composition-book .cover__title { font-size: 1.6rem; padding-bottom: 1.4rem; }
  .composition-book .cover__author { font-size: .53rem; }
  .composition-book .cover__year { font-size: .52rem; }
  .composition-orbit { width: 17rem; height: 17rem; top: 2rem; left: 8%; }
  .composition-note { font-size: .8rem; right: 0; }
  .library-stamp { width: 5.8rem; height: 5.8rem; right: 0; bottom: .5rem; }
  .library-stamp strong { font-size: 1.1rem; }
  .library-stamp > span { font-size: .48rem; }
  .library-strip .shell { flex-wrap: wrap; gap: .45rem 1rem; justify-content: center; padding-block: .9rem; min-height: 0; }
  .library-strip .shell > p:nth-of-type(2), .library-strip .shell > span:nth-of-type(2) { display: none; }
  .library-strip .shell > span { font-size: 1.2rem; }
  .library-strip strong { font-size: 1.25rem; }
  .selection-section { padding-block: 3rem; }
  .editorial-heading { flex-direction: column; align-items: flex-start; gap: .5rem; margin-bottom: 1.5rem; }
  .editorial-heading h2 { font-size: 2.1rem; }
  .selection-grid { gap: 1.8rem 1.2rem; }
  .cover { padding: .85rem; }
  .cover__author { font-size: .55rem; }
  .cover__title { font-size: clamp(1.25rem, 5.4vw, 2rem); padding-bottom: 1.5rem; }
  .cover--long .cover__title { font-size: clamp(1rem, 4.2vw, 1.65rem); }
  .cover__year { font-size: .55rem; }
  .cover::after { inset-inline: .85rem; bottom: 2rem; }
  .book-card h3, .book-card h2 { font-size: 1.02rem; }
  .book-card p { font-size: .72rem; }
  .book-card__caption > span { display: none; }
  .discovery-section { padding-block: 3rem; }
  .discovery-grid { grid-template-columns: 1fr; gap: 2.7rem; }
  .discovery-copy h2 { font-size: 3.3rem; }
  .reading-note { margin-inline: .35rem; padding: 1.7rem; }
  .reading-note h3 { font-size: 2.3rem; }
  .note-summary { min-height: 0; font-size: 1.15rem; }
  .history-section { padding-block: 3rem; }
  .history-section .movement-row { grid-template-columns: 3rem 1fr 1rem; gap: .7rem; }
  .history-section .movement-row strong { font-size: 1.55rem; }
  .serendipity { gap: 1rem; padding-block: 2rem 3rem; }
  .serendipity-mark { font-size: 3rem; }
  .serendipity > div { flex: 1; }
  .serendipity h2 { font-size: 1.45rem; }
  .serendipity > button { margin: .7rem 0 0; }
  .footer-top { flex-wrap: wrap; }
  .footer-top > p { font-size: 1.45rem; }
  .footer-note-small { display: none; }
  .footer-note { flex-direction: column; }
  .footer-wordmark { font-size: 15vw; }
  .page-hero { padding: 2.2rem 0 1.2rem; }
  .page-hero h1 { font-size: 3.5rem; }
  .page-hero .lead { font-size: .93rem; }
  .catalog-grid { gap: 2rem 1.2rem; }
  .filter-row { gap: .4rem; }
  .filter-chip { font-size: .73rem; padding: .5rem .7rem; }
  .book-detail { grid-template-columns: 1fr; gap: 2rem; }
  .book-detail__cover { width: min(65vw, 17rem); }
  .book-detail__cover .cover__title { font-size: 2.5rem; }
  .detail-actions { flex-direction: column; align-items: stretch; }
  .movement-row > span { grid-column: 2; }
  .history-section .movement-row > span { grid-column: 3; }
  .reader { padding-top: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { .composition-book, .book-card .cover, .button { transition: none; } .composition-book:hover, .composition-book:focus-visible, .book-card:hover .cover { transform: none; } }

/* Shared navigation and the internal reading-room pages. */
.site-header__inner { display: grid; grid-template-columns: 1fr auto 1fr; min-height: 5.8rem; gap: 2rem; }
.site-header .brand { justify-self: start; }
.site-header .brand strong { font-size: 2.1rem; }
.site-header .desktop-nav { gap: 1.65rem; }
.site-header .desktop-nav a { padding-block: 1rem; font-size: .86rem; }
.site-header .desktop-nav a::after { bottom: .6rem; height: 2px; }
.site-header .desktop-nav a[aria-current='page'] { color: var(--wine); font-weight: 650; }
.header-actions { display: flex; align-items: center; gap: .8rem; justify-self: end; }
.header-shelf { display: inline-flex; align-items: center; gap: .6rem; padding: .65rem .9rem; min-height: 2.8rem; border: 1px solid #173d3545; border-radius: 3px; text-decoration: none; font-size: .8rem; white-space: nowrap; }
.header-shelf[aria-current='page'] { background: #173d350c; border-color: var(--wine); }
@media (hover: hover) { .header-shelf:hover { background: #173d350c; border-color: var(--wine); } }
.header-shelf svg { flex-shrink: 0; }
.mobile-menu nav a[aria-current='page'] { color: #efd582; }
.mobile-menu, .settings-dialog { overscroll-behavior: contain; }
.mobile-menu__inner { padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem 2rem; font-size: .82rem; }
.footer-links a { min-height: 2.75rem; display: inline-flex; align-items: center; text-decoration: none; text-underline-offset: 5px; }
@media (hover: hover) { .footer-links a:hover { text-decoration: underline; } }
.site-footer { padding-block: 2.8rem 2.5rem; }
.footer-wordmark { display: block; text-align: center; text-decoration: none; padding-block: 2rem 2.5rem; font-size: clamp(3.4rem, 14vw, 12rem); }
.footer-rule { border: 0; border-top: 1px solid color-mix(in srgb, var(--band-ink) 27%, transparent); margin: 0; }
.site-footer :focus-visible { outline-color: var(--band-active); }
.inner-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; padding-block: 3.8rem 2.8rem; }
.inner-heading h1 { margin-top: 0; text-wrap: balance; }
.inner-heading .lead { max-width: 34rem; margin-bottom: 0; }
.heading-count { color: var(--muted); font-size: .85rem; line-height: 1.8; white-space: nowrap; border-left: 1px solid var(--line); padding-left: 1.5rem; }
.reading-routes { margin: 0 0 2.8rem; padding: 1.7rem 0 2rem; border-block: 1px solid var(--line); }
.reading-routes__heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.4rem; }
.reading-routes__heading h2 { margin: .35rem 0 0; font: 500 1.65rem/1.2 var(--display); letter-spacing: -.025em; }
.reading-routes__heading > p { max-width: 27rem; margin: 0; color: var(--muted); font-size: .83rem; line-height: 1.6; }
.catalog-references { margin: -2rem 0 4rem; padding: 1.5rem 0; border-top: 1px solid var(--line); }
.catalog-references h2 { margin: 0; font: 500 1.6rem/1.25 var(--display); }
.catalog-references > p { font-size: .9rem; color: var(--ink-soft); }
.catalog-references ul { list-style: none; margin: 1rem 0 0; padding: 0; }
.catalog-references li { border-top: 1px solid var(--line); padding: 1rem 0; }
.catalog-references a { font: 500 1.25rem/1.4 var(--display); text-underline-offset: 4px; }
.catalog-references li p { margin: .5rem 0 0; font-size: .82rem; color: var(--muted); }
.book-reference__notice { color: var(--wine); border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1rem; font-size: .9rem; line-height: 1.6; }
.book-sources { margin: 0 0 5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.book-sources h2 { margin: 0; font: 500 2rem/1.25 var(--display); }
.book-sources > p { max-width: 48rem; color: var(--ink-soft); font-size: .95rem; line-height: 1.7; }
.book-sources__list { list-style: none; padding: 0; margin: 1.5rem 0; }
.book-sources__entry { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr); gap: 2rem; padding: 1.5rem 0; border-top: 1px solid var(--line); }
.book-sources__entry h3 { margin: 0; font: 500 1.35rem/1.35 var(--display); }
.book-sources__entry p { margin: 0 0 .7rem; color: var(--ink-soft); font-size: .9rem; line-height: 1.65; }
.book-sources__entry .book-sources__status { color: var(--wine); font-weight: 600; }
.book-sources__entry a { font-size: .86rem; line-height: 1.6; text-underline-offset: 4px; overflow-wrap: anywhere; }
.book-sources__record span { display: block; font-size: .82rem; }
.book-sources__note { max-width: 55rem; color: var(--muted); font-size: .82rem; line-height: 1.65; }
.reading-routes__grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.reading-route { position: relative; min-width: 0; padding: 1.25rem 1.3rem 1.15rem; border: 1px solid #173d3524; background: #fffdf43d; }
.reading-route::before { content: attr(data-route); position: absolute; right: 1rem; top: .85rem; color: var(--gold); font: italic 1rem var(--display); }
.reading-route h3 { margin: 0 2rem .55rem 0; font: 500 1.25rem/1.2 var(--display); letter-spacing: -.02em; }
.reading-route p { min-height: 3.7em; margin: 0 0 .8rem; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.reading-route ul { display: flex; flex-wrap: wrap; gap: .35rem .9rem; list-style: none; margin: 0; padding: .8rem 0 0; border-top: 1px solid var(--line); }
.reading-route a { color: var(--wine); font-size: .75rem; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
@media (hover: hover) { .reading-route a:hover { color: var(--accent-ink); text-decoration-color: currentColor; } }
.author-directory { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 4rem; padding-bottom: 5rem; }
.author-entry { display: grid; grid-template-columns: 4.5rem minmax(0,1fr); gap: 1.3rem; padding: 2.4rem 0; border-top: 1px solid var(--line); }
.author-monogram { font: 400 3.4rem/1 var(--display); letter-spacing: -.08em; color: #173d35a6; }
.author-entry:nth-child(3n+2) .author-monogram { color: #ad382cc4; }
.author-entry:nth-child(3n) .author-monogram { color: #8a5730d9; }
.author-entry h2 { font: 500 1.9rem/1.14 var(--display); margin: 0 0 .55rem; letter-spacing: -.03em; text-wrap: balance; }
.author-count { display: flex; flex-wrap: wrap; gap: .25rem .75rem; color: var(--muted); font-size: .72rem; margin: 0 0 .7rem; }
.author-count span + span::before { content: '·'; margin-right: .75rem; color: var(--gold); }
.author-note { min-height: 3.2em; max-width: 28rem; margin: 0 0 .8rem; color: var(--ink-soft); font: italic .88rem/1.55 var(--display); }
.work-links { list-style: none; margin: 0; padding: 0; }
.work-links li + li { border-top: 1px solid #173d3514; }
.work-links a { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; min-height: 2.75rem; padding-block: .55rem; font-size: .88rem; text-decoration: none; }
@media (hover: hover) { .work-links a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 4px; } }
.work-links a > span { color: var(--muted); font-size: .72rem; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.movement-sheets { margin-bottom: 5rem; }
.movement-sheet { display: grid; grid-template-columns: minmax(0,.75fr) minmax(0,1.25fr); gap: 5rem; border-top: 1px solid var(--line); padding: 2.7rem 0; scroll-margin-top: 2rem; }
.movement-sheet h2 { font: 450 clamp(2rem,3.5vw,3rem)/1.1 var(--display); margin: 1rem 0 0; letter-spacing: -.035em; overflow-wrap: break-word; }
.movement-sheet > header { border-left: 3px solid var(--gold); padding-left: 1.5rem; align-self: start; }
.movement-sheet:nth-child(2n) > header { border-color: #235148; }
.movement-period { font: 450 1.3rem/1 var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.movement-description { margin: 0 0 1.2rem; max-width: 35rem; font: 400 1.2rem/1.65 var(--reading); }
.movement-prompt { max-width: 35rem; margin: 0 0 1.1rem; padding: .75rem 1rem; border-left: 2px solid color-mix(in srgb, var(--gold) 50%, transparent); background: #fffdf438; }
.movement-prompt span { display: block; margin-bottom: .25rem; color: var(--accent-ink); font-size: .75rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.movement-prompt p { margin: 0; font: italic .93rem/1.5 var(--display); color: var(--ink-soft); }
.movement-sheet .text-link { margin-top: 1rem; }
.movement-empty { color: var(--muted); font-size: .88rem; }
.chronology-layout { display: grid; grid-template-columns: 11rem minmax(0,1fr); gap: 4rem; padding-bottom: 4rem; }
.timeline-note { display: grid; grid-template-columns: 11rem minmax(0,1fr); gap: 4rem; margin: -.6rem 0 2.7rem; padding: 1.4rem 0; border-block: 1px solid var(--line); }
.timeline-note > span { color: var(--accent-ink); font-size: .72rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.timeline-note div { max-width: 47rem; }
.timeline-note p { margin: 0 0 .65rem; font: 400 1.05rem/1.6 var(--display); }
.timeline-note strong { font-weight: 600; }
.timeline-note a { font-size: .78rem; }
.timeline-note.shell { margin: -1.5rem auto 4rem; }
.year-index { display: grid; grid-template-columns: 1fr 1fr; align-self: start; position: sticky; top: 2rem; }
.year-index > span { grid-column: 1/-1; margin-bottom: .8rem; font-size: .75rem; color: var(--muted); }
.year-index a { display: grid; align-items: center; min-height: 2.75rem; color: var(--wine); text-decoration: none; font: 400 1.1rem var(--display); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .year-index a:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 4px; } }
.chronology-year { display: grid; grid-template-columns: 7rem minmax(0,1fr); gap: 2rem; padding: 1.8rem 0; border-top: 1px solid var(--line); scroll-margin-top: 2rem; }
.chronology-year h2 { font: 450 2.7rem/1 var(--display); letter-spacing: -.04em; margin: .45rem 0 0; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.chronology-book { position: relative; display: block; text-decoration: none; padding: .5rem 2rem 1rem 0; }
.chronology-book + .chronology-book { padding-top: 1rem; border-top: 1px dashed var(--line); }
.chronology-book h3 { font: 450 1.75rem/1.2 var(--display); margin: 0 0 .5rem; letter-spacing: -.025em; }
.chronology-book > span { font-size: .78rem; color: var(--muted); }
.chronology-book .chronology-arrow { position: absolute; right: .3rem; top: .7rem; font-size: 1.2rem; color: var(--wine); }
@media (hover: hover) { .chronology-book:hover h3 { color: var(--accent-ink); } }
.historical-context { display: grid; grid-template-columns: 11rem 1fr; gap: 4rem; border-top: 1px solid var(--line); margin-bottom: 5rem; padding-top: 2rem; scroll-margin-top: 2rem; }
.historical-context h2 { font: 450 1.5rem var(--display); margin: 0; }
.historical-context p { font-size: .88rem; margin: 0 0 1rem; max-width: 47rem; }
.historical-context time { color: var(--accent-ink); margin-right: .6rem; font-variant-numeric: tabular-nums; }
.about-layout { display: grid; grid-template-columns: 19rem minmax(0,1fr); gap: 6rem; margin-bottom: 5rem; align-items: start; }
.library-card { position: relative; background: url('/assets/paper.svg'), #e3e4ce; padding: 2rem; border-block: 2px solid #173d3570; transform: rotate(-1.5deg); margin-block: .5rem 2rem; }
.library-card__mark { display: block; font: 500 6rem/.9 var(--display); letter-spacing: -.1em; color: var(--wine); padding-bottom: 2rem; }
.library-card h2 { margin: 0; font: 450 1.55rem/1.2 var(--display); }
.library-card dl { margin-block: 1.5rem; }
.library-card dl div { border-top: 1px solid var(--line); padding-block: .7rem; }
.library-card dt { font-size: .7rem; color: var(--muted); }
.library-card dd { margin: .25rem 0 0; font-size: .9rem; }
.about-copy section { border-top: 1px solid var(--line); padding: 1.5rem 0 2rem; }
.about-copy h2 { font: 500 1.6rem/1.3 var(--display); margin: 0 0 1rem; letter-spacing: -.02em; }
.about-copy p { font-size: 1rem; line-height: 1.85; max-width: 42rem; color: var(--ink-soft); margin: .8rem 0; }
.editorial-principles ol { display: grid; gap: 0; list-style: none; counter-reset: principle; margin: 0; padding: 0; }
.editorial-principles li { counter-increment: principle; display: grid; grid-template-columns: 2.5rem minmax(0,1fr); gap: 1rem; padding: 1rem 0; border-top: 1px dashed var(--line); }
.editorial-principles li::before { content: '0' counter(principle); color: var(--gold); font: italic 1rem/1.4 var(--display); }
.editorial-principles h3 { margin: 0 0 .25rem; font: 500 1.08rem/1.3 var(--display); }
.editorial-principles li p { margin: 0; font-size: .88rem; line-height: 1.65; }
.saved-library { margin: 1rem 0 5rem; }
.shelf-overview { display: grid; grid-template-columns: 9rem minmax(0,1fr) auto; gap: 2rem; align-items: center; margin: -1rem 0 1rem; padding: 1.25rem 0; border-block: 1px solid var(--line); }
.shelf-overview[hidden] { display: none; }
.shelf-overview .eyebrow { margin: 0; }
.shelf-overview__sentence { margin: 0; font: 450 1.35rem/1.35 var(--display); }
.shelf-overview__privacy { max-width: 13rem; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.saved-book { display: grid; grid-template-columns: 5rem minmax(0,1fr) auto; gap: 2rem; align-items: center; padding: 2rem .5rem; border-top: 1px solid var(--line); text-decoration: none; }
.saved-book__spine { display: block; width: 4.5rem; height: 7rem; padding: .7rem; writing-mode: vertical-rl; text-align: center; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; color: #f2efdf; background: url('/assets/paper.svg'), #235148; border-right: 4px solid #d9cfb6; box-shadow: 3px 5px 0 #173d3515; font: 450 .86rem var(--display); transform: rotate(-3deg); }
.saved-book:nth-child(3n+2) .saved-book__spine { background-color: #a7352d; }
.saved-book:nth-child(3n) .saved-book__spine { background-color: #29384d; }
.saved-book__copy { display: grid; gap: .55rem; }
.saved-book strong { font: 500 1.6rem/1.2 var(--display); letter-spacing: -.025em; }
.saved-book__author { font-size: .88rem; color: var(--muted); }
.saved-book__status { font-size: .75rem; }
.saved-book progress { width: min(100%, 24rem); height: 4px; border: 0; border-radius: 0; accent-color: var(--wine); margin-top: .3rem; background: #173d3518; }
.saved-book progress::-webkit-progress-bar { background: #173d3518; }
.saved-book progress::-webkit-progress-value { background: var(--wine); }
.saved-book__action { font-size: .82rem; white-space: nowrap; }
@media (hover: hover) { .saved-book:hover strong { color: var(--accent-ink); } }
.shelf-empty { text-align: center; border: 1px dashed #173d3540; padding: 3rem 1.5rem; }
.shelf-empty strong { display: block; font: 450 1.9rem var(--display); margin-top: 1.5rem; }
.empty-book { display: grid; place-items: center; width: 5rem; height: 5rem; border-radius: 50%; background: #173d350a; margin: 0 auto; }
.empty-book svg { width: 2.2rem; height: 2.2rem; }
.settings-dialog { max-height: calc(100dvh - 2rem); overflow-y: auto; }
html:has(.settings-dialog[open]) { overflow: hidden; scrollbar-gutter: stable; }
.segmented--two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.settings-help { font-size: .76rem; color: var(--muted); line-height: 1.5; margin: 0; }
/* As specific as the rule that creates the drop cap, so headings and dashes never get one. */
.reader-content > p.reader-no-dropcap:first-child:not(.reader-loading):not(.reader-error)::first-letter { float: none; color: inherit; font: inherit; padding: 0; }
.reader-page[data-theme='dark'] { --ink-soft: #d1d8cd; }
.reader-content p { overflow-wrap: break-word; }
.reader-content .reader-section-marker { margin: 3.5em 0 .45em; text-align: center; color: var(--wine); font: 600 .78em/1.4 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.reader-content .reader-section-title { margin: 0 0 2.35em; text-align: center; font: italic 1.18em/1.45 var(--reading); }
.reader-content .reader-speaker { margin: 1.8em 0 .3em; text-align: center; font: 600 .82em/1.4 var(--sans); letter-spacing: .08em; }
.reader-content .reader-symbolic-line { margin-bottom: .7em; text-align: center; white-space: pre-wrap; overflow-wrap: normal; letter-spacing: .08em; }
.reader-content .reader-section-title.reader-symbolic-line { margin-bottom: 2.35em; }
.reader-content .reader-section-group { margin-top: 4.5em; padding-top: 1.4em; border-top: 1px solid var(--line); font-size: .86em; letter-spacing: .16em; }
.reader-content [id^="secao-"] { scroll-margin-top: 5.5rem; }
.reader-content [id^="secao-"]:focus:not(:focus-visible) { outline: none; }
.reader-content sup { font-size: .64em; line-height: 0; }
.reader-content strong { font-weight: 600; }
.reader-retry { display: block; margin: 1.5rem auto 0; }
.toc-group { margin: 1.6rem 0 0; padding: 0 0 .65rem; border-bottom: 1px solid var(--line); color: var(--wine); font: 700 .7rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.toc-list a[aria-current="location"] { color: var(--wine); font-weight: 700; }
@media (max-width: 63.99rem) {
  .site-header__inner { grid-template-columns: 1fr auto; gap: 1rem; }
  .site-header .desktop-nav { display: none; }
  .site-header .menu-button { display: inline-grid; }
  .author-directory { column-gap: 2rem; }
  .author-entry { grid-template-columns: 3rem minmax(0,1fr); gap: 1rem; }
  .author-monogram { font-size: 2.5rem; }
  .author-entry h2 { font-size: 1.6rem; }
  .movement-sheet { gap: 3rem; }
  .chronology-layout, .historical-context, .timeline-note { grid-template-columns: 8rem minmax(0,1fr); gap: 2rem; }
  .chronology-year { grid-template-columns: 6rem minmax(0,1fr); gap: 1.2rem; }
  .about-layout { grid-template-columns: 15rem minmax(0,1fr); gap: 3rem; }
}
@media (max-width: 39.99rem) {
  .site-header__inner { min-height: 5rem; }
  .site-header .brand strong { font-size: 1.8rem; }
  .header-shelf { padding: .65rem; }
  .header-shelf > span { display: none; }
  .header-actions { gap: .55rem; }
  .inner-heading { padding-block: 2.5rem 2rem; align-items: flex-start; }
  .inner-heading h1 { font-size: clamp(2.7rem, 12vw, 3.5rem); }
  .heading-count { display: none; }
  .reading-routes__heading { display: block; }
  .reading-routes__heading > p { margin-top: .7rem; }
  .book-sources__entry { grid-template-columns: 1fr; gap: .75rem; }
  .book-sources { margin-bottom: 3rem; }
  .reading-routes__grid { grid-template-columns: 1fr; }
  .reading-route p, .author-note { min-height: 0; }
  .footer-links { gap: .3rem 1.3rem; font-size: .78rem; }
  .footer-wordmark { font-size: 14.5vw; padding-block: 2.2rem; }
  .site-footer { padding-block: 2rem; }
  .author-directory { grid-template-columns: 1fr; padding-bottom: 3rem; }
  .author-entry { grid-template-columns: 3.3rem minmax(0,1fr); padding-block: 1.9rem; }
  .author-entry h2 { font-size: 1.65rem; }
  .work-links a { font-size: .83rem; gap: .65rem; }
  .movement-sheet { grid-template-columns: 1fr; gap: 1.5rem; padding-block: 2rem; }
  .movement-sheet h2 { margin-top: .65rem; font-size: 2.2rem; }
  .movement-description { font-size: 1.1rem; }
  .movement-sheets { margin-bottom: 3rem; }
  .timeline-note { grid-template-columns: 1fr; gap: .55rem; margin-top: 0; }
  .chronology-layout { grid-template-columns: 1fr; gap: 1.8rem; padding-bottom: 2rem; }
  .year-index { position: static; display: flex; flex-wrap: wrap; gap: .1rem 1.3rem; }
  .year-index > span { flex-basis: 100%; margin: 0; }
  .year-index a { font-size: 1rem; }
  .chronology-year { grid-template-columns: 4.3rem minmax(0,1fr); gap: 1rem; }
  .chronology-year h2 { font-size: 1.9rem; }
  .chronology-book { padding-right: 0; }
  .chronology-book h3 { font-size: 1.4rem; }
  .chronology-book .chronology-arrow { display: none; }
  .chronology-book > span { font-size: .73rem; }
  .historical-context { grid-template-columns: 1fr; gap: 1rem; margin-bottom: 3rem; }
  .about-layout { grid-template-columns: 1fr; gap: 2rem; margin-bottom: 3rem; }
  .library-card { max-width: 25rem; transform: none; margin-block: 0; }
  .library-card__mark { font-size: 4.8rem; }
  .about-copy p { font-size: .94rem; }
  .shelf-overview { grid-template-columns: 1fr; gap: .45rem; margin-top: -.5rem; }
  .shelf-overview__privacy { max-width: none; }
  .saved-book { grid-template-columns: 3.5rem minmax(0,1fr); gap: 1rem; padding-block: 1.5rem; }
  .saved-book__spine { width: 3.2rem; height: 6rem; padding: .5rem; }
  .saved-book strong { font-size: 1.35rem; }
  .saved-book__action { grid-column: 2; margin-top: -.3rem; }
  .saved-book__status { line-height: 1.5; }
  .shelf-empty strong { font-size: 1.5rem; }
}

/* Reading typefaces (SIL OFL, licenses in /assets/fonts). Browsers download them only when chosen. */
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('/assets/fonts/atkinson-hyperlegible-next-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('/assets/fonts/atkinson-hyperlegible-next-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('/assets/fonts/atkinson-hyperlegible-next-700.woff2') format('woff2'); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: Lexend; src: url('/assets/fonts/lexend-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Lexend; src: url('/assets/fonts/lexend-700.woff2') format('woff2'); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: OpenDyslexic; src: url('/assets/fonts/opendyslexic-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: OpenDyslexic; src: url('/assets/fonts/opendyslexic-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: OpenDyslexic; src: url('/assets/fonts/opendyslexic-700.woff2') format('woff2'); font-weight: 600 700; font-style: normal; font-display: swap; }

/* Reader preferences: presentation only, the text is never rewritten. */
.reader { width: min(100% - 2.5rem, var(--reader-measure, 45rem)); }
.reader-content { letter-spacing: var(--reader-letter, 0); word-spacing: var(--reader-word, 0); }
.reader:is([data-font='atkinson'], [data-font='lexend'], [data-font='opendyslexic']) .reader-content > p:first-child:not(.reader-loading):not(.reader-error)::first-letter { float: none; color: inherit; font: inherit; padding: 0; }
.reader[data-focus='on'] .reader-content > p { opacity: .42; transition: opacity .2s ease; }
.reader[data-focus='on'] .reader-content > p.is-current, .reader[data-focus='on'] .reader-content > p.is-speaking { opacity: 1; }
.reader-content > p.is-speaking { background: color-mix(in srgb, var(--wine) 7%, transparent); box-shadow: 0 0 0 .45em color-mix(in srgb, var(--wine) 7%, transparent), -.75em 0 0 -.45em var(--wine); }
.segmented--four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.segmented--fonts { margin-top: -1px; }
.reader-tools .icon-button svg { display: block; margin: auto; }

/* End of a book: optional rating and explained suggestions. */
.reader-finale { margin: 4.5rem 0 1rem; padding-top: 2.2rem; border-top: 1px solid var(--line); font-family: var(--sans); line-height: 1.6; }
.reader-finale .eyebrow { margin: 0; }
.reader-finale h2 { margin: .4rem 0 .5rem; font: 450 clamp(1.7rem, 4.2vw, 2.35rem)/1.15 var(--display); letter-spacing: -.03em; text-wrap: balance; }
.reader-finale__ask { margin: 0 0 1rem; color: var(--ink-soft); font-size: 1rem; }
.finale-choices { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); }
.finale-choices button { min-height: 2.9rem; padding: .5rem; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 .82rem/1.2 var(--sans); cursor: pointer; }
.finale-choices button + button { border-left: 0; }
@media (hover: hover) { .finale-choices button:hover { background: color-mix(in srgb, var(--wine) 7%, transparent); } }
.finale-choices button[aria-pressed='true'] { background: var(--wine); border-color: var(--wine); color: var(--paper-light); }
.finale-details { display: grid; gap: .75rem; margin-top: 1.5rem; }
.finale-details[hidden], .finale-next[hidden] { display: none; }
.finale-details__label { margin: 0; font: 600 .92rem/1.4 var(--sans); }
.finale-chips, .shelf-interests__chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.finale-chips .filter-chip, .shelf-interests__chips .filter-chip { color: var(--ink); font-size: .8rem; letter-spacing: 0; text-transform: none; }
.finale-chips .filter-chip[aria-pressed='true'], .shelf-interests__chips .filter-chip[aria-pressed='true'] { color: var(--paper-light); }
.finale-next { margin-top: 2.2rem; }
.finale-next h3 { margin: 0 0 .3rem; color: var(--wine); font: 700 .72rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.finale-note { margin: .9rem 0 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.finale-note a { color: var(--wine); font-weight: 600; text-underline-offset: 3px; }
.finale-status { margin: 1rem 0 0; color: var(--ink-soft); font-size: .84rem; }
.finale-status:empty { margin: 0; }
.finale-reset { min-height: 2.75rem; padding: 0; border: 0; background: none; color: var(--muted); font: 600 .78rem var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.finale-reset[hidden] { display: none; }

.next-reads { list-style: none; margin: 0; padding: 0; counter-reset: next-read; }
.next-read { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .15rem 1.2rem; padding: 1.1rem 0 1.15rem 2.5rem; border-top: 1px solid var(--line); counter-increment: next-read; }
.next-read::before { content: '0' counter(next-read); position: absolute; left: 0; top: 1.2rem; color: var(--gold); font: italic 1rem/1.4 var(--display); }
.next-read--empty { display: block; padding-left: 0; color: var(--muted); font-size: .9rem; }
.next-read--empty::before { content: none; }
.next-read__title { grid-column: 1; justify-self: start; color: var(--ink); font: 500 1.3rem/1.25 var(--display); letter-spacing: -.015em; text-decoration: none; }
@media (hover: hover) { .next-read__title:hover { color: var(--wine); text-decoration: underline; text-underline-offset: 4px; } }
.next-read__meta { grid-column: 1; color: var(--muted); font-size: .78rem; }
.next-read__reason { grid-column: 1; margin: .35rem 0 0; color: var(--ink-soft); font-size: .9rem; line-height: 1.55; }
.next-read__hide { grid-column: 2; grid-row: 1 / span 3; align-self: start; min-height: 2.75rem; padding: 0; border: 0; background: none; color: var(--muted); font: 600 .76rem/1.3 var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (hover: hover) { .next-read__hide:hover { color: var(--wine); } }

/* Read aloud: the device's own voice, highlighted per paragraph. */
.read-aloud { position: fixed; z-index: 40; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); width: min(calc(100% - 1.5rem), 40rem); transform: translateX(-50%); border: 1px solid var(--line); background: var(--paper-light); color: var(--ink); box-shadow: 0 14px 34px rgba(18, 30, 24, .2); font-family: var(--sans); }
.read-aloud[hidden] { display: none; }
.read-aloud__inner { display: grid; grid-template-columns: auto auto auto minmax(0,1fr) auto; grid-template-areas: 'previous toggle next speed close' 'status status status status status'; align-items: center; gap: .4rem; padding: .6rem .7rem .5rem; }
.read-aloud__button { min-width: 2.75rem; min-height: 2.75rem; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 500 1.35rem/1 var(--sans); cursor: pointer; }
@media (hover: hover) { .read-aloud__button:hover { background: color-mix(in srgb, var(--wine) 7%, transparent); } }
[data-read-aloud='previous'] { grid-area: previous; }
[data-read-aloud='next'] { grid-area: next; }
[data-read-aloud='close'] { grid-area: close; }
.read-aloud .read-aloud__toggle { grid-area: toggle; min-width: 7.5rem; padding-inline: .9rem; border-color: var(--wine); background: var(--wine); color: var(--paper-light); font: 700 .76rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.read-aloud__speed { grid-area: speed; display: flex; align-items: center; justify-content: flex-end; gap: .45rem; color: var(--muted); font-size: .78rem; }
.read-aloud__speed select { min-height: 2.75rem; padding: 0 .55rem; border: 1px solid var(--line); background: var(--paper-light); color: var(--ink); font: 500 .85rem var(--sans); }
.read-aloud__status { grid-area: status; margin: .1rem 0 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
html.has-read-aloud .reader { padding-bottom: 12rem; }

/* Shelf: suggestions, adjustments and the visitor's own data. */
.shelf-next { margin: 4rem 0 0; padding-top: 2rem; border-top: 1px solid var(--line); }
.shelf-next__heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.6rem; }
.shelf-next__heading .eyebrow, .shelf-data .eyebrow { margin: 0; }
.shelf-next__heading h2, .shelf-data h2 { margin: .35rem 0 0; font: 500 clamp(1.7rem, 3vw, 2.1rem)/1.2 var(--display); letter-spacing: -.03em; }
.shelf-next__heading > p { max-width: 27rem; margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.6; }
.shelf-interests { display: grid; gap: .65rem; margin-bottom: 1.8rem; }
.shelf-interests .settings-label { margin: 0; font-weight: 600; }
.shelf-interests .settings-label .muted { margin-left: .35rem; font-weight: 400; }
.shelf-next .next-read__title { font-size: 1.5rem; }
.shelf-next__status { min-height: 1.3em; margin: .9rem 0 0; color: var(--ink-soft); font-size: .84rem; }
.shelf-adjust { margin-top: 1rem; border-top: 1px solid var(--line); }
.shelf-adjust summary { display: flex; align-items: center; min-height: 3rem; color: var(--wine); font: 700 .74rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.shelf-adjust > div { padding-bottom: 1rem; }
.shelf-adjust .muted { margin: 0 0 .5rem; font-size: .88rem; }
.adjust-list { list-style: none; margin: 0; padding: 0; }
.adjust-row { display: grid; grid-template-columns: minmax(0,14rem) minmax(0,1fr) auto; gap: .3rem 1.2rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--line); font-size: .86rem; }
.adjust-row__title { font: 500 1.05rem/1.3 var(--display); }
.adjust-row__value { color: var(--ink-soft); }
.adjust-row__action { min-height: 2.75rem; padding: 0; border: 0; background: none; color: var(--wine); font: 600 .78rem/1.3 var(--sans); text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.adjust-clear { margin-top: .4rem; }
.shelf-data { display: grid; grid-template-columns: minmax(0,17rem) minmax(0,1fr); gap: 2.5rem; margin: 4rem 0 5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.shelf-data p { max-width: 46rem; margin: 0 0 1.3rem; color: var(--ink-soft); font-size: .92rem; line-height: 1.7; }
.shelf-data__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.shelf-data .shelf-data__danger { border-color: var(--accent-ink); color: var(--accent-ink); }
.shelf-data .shelf-data__danger.is-confirming { border-color: var(--accent-ink); background: #8e3026; color: #fffdf4; }
@media (hover: hover) { .shelf-data .shelf-data__danger:hover { border-color: var(--accent-ink); background: #8e3026; color: #fffdf4; } }
.shelf-data__cancel { min-height: 2.75rem; padding: 0 .4rem; border: 0; background: none; color: var(--ink-soft); font: 600 .8rem var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.shelf-data__cancel[hidden] { display: none; }
.shelf-data .shelf-data__status { min-height: 1.3em; margin: 1rem 0 0; font-size: .86rem; }

@media (max-width: 39.99rem) {
  .finale-choices { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .finale-choices button:nth-child(3) { border-left: 1px solid var(--line); }
  .finale-choices button:nth-child(n+3) { border-top: 0; }
  .finale-choices button[aria-pressed='true'] { border-color: var(--wine); }
  .next-read { grid-template-columns: minmax(0,1fr); padding-left: 2.1rem; }
  .next-read__hide { grid-column: 1; grid-row: auto; justify-self: start; }
  .read-aloud__inner { grid-template-columns: auto minmax(0,1fr) auto auto; grid-template-areas: 'previous toggle next close' 'speed speed speed speed' 'status status status status'; }
  .read-aloud .read-aloud__toggle { min-width: 0; }
  .read-aloud__speed { justify-content: flex-start; }
  .shelf-next__heading { display: block; }
  .shelf-next__heading > p { margin-top: .8rem; }
  .shelf-data { grid-template-columns: minmax(0,1fr); gap: 1rem; }
  .adjust-row { grid-template-columns: minmax(0,1fr) auto; }
  .adjust-row__value { grid-column: 1; }
  .adjust-row__action { grid-column: 2; grid-row: 1 / span 2; }
  .adjust-clear { grid-column: auto; }
}
@media (max-width: 26rem) {
  .segmented--fonts { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .segmented--fonts button:nth-child(3) { grid-column: 1 / -1; border-top: 0; border-left: 1px solid var(--line); }
  .segmented button { padding-inline: .3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .reader[data-focus='on'] .reader-content > p { transition: none; }
}

/* Book page: audiobook and ENEM blocks (scripts/generate_book_extras.py). */
.book-extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 2.5rem 6rem; margin: -2rem 0 5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.book-extra h2 { margin: 0 0 .7rem; font: 550 1.15rem/1.4 var(--display); color: var(--wine); }
.book-extra > p { max-width: 40rem; margin: 0 0 1rem; color: var(--ink-soft); font-size: .93rem; line-height: 1.7; }
.book-extra .source-links { margin-bottom: 1.1rem; }
.book-extra .source-links a { color: var(--wine); font-weight: 700; font-size: .88rem; }
.book-extra > .book-extra__note { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.book-extra__note a { color: var(--wine); text-underline-offset: 3px; }
.book-audio__tracks { margin-bottom: 1rem; border-block: 1px solid var(--line); }
.book-audio__tracks summary { display: flex; align-items: center; min-height: 2.9rem; color: var(--wine); font: 700 .74rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.book-audio__tracks ol { margin: 0 0 .9rem; padding-left: 1.7rem; font-size: .88rem; line-height: 1.5; }
.book-audio__tracks li { padding: .28rem 0; }
.book-audio__tracks li a { color: var(--ink); text-underline-offset: 3px; }
.book-audio__tracks li span { margin-left: .35rem; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.book-enem__list { list-style: none; margin: 0 0 1rem; padding: 0; }
.book-enem__list li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .25rem 1rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.book-enem__list strong { font: 500 1.05rem/1.35 var(--display); }
.book-enem__list span { align-self: center; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.book-enem__list p { grid-column: 1 / -1; margin: 0; color: var(--ink-soft); font-size: .88rem; line-height: 1.6; }

/* Reader dictionary (assets/reader-glossary.js, served by /api/dicionario). */
.reader-glossary-open { display: flex; align-items: center; width: fit-content; min-height: 2.75rem; margin: .35rem auto 0; padding: 0 .25rem; border: 0; background: transparent; color: var(--wine); font: 600 .8rem/1.4 var(--sans); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; cursor: pointer; }
@media (hover: hover) { .reader-glossary-open:hover { text-decoration-color: currentColor; } }
.glossary-dialog { width: min(calc(100% - 2rem), 34rem); font-family: var(--sans); }
.glossary-form, .book-search { display: grid; gap: .5rem; padding-top: 1.1rem; }
.glossary-form__row, .book-search__row { display: grid; grid-template-columns: minmax(0,1fr) auto; }
:is(.glossary-form, .book-search) input { min-width: 0; min-height: 3rem; padding: .7rem .9rem; border: 1px solid color-mix(in srgb, var(--ink) 45%, transparent); border-right: 0; border-radius: 3px 0 0 3px; background: transparent; color: var(--ink); font-size: 1rem; }
:is(.glossary-form, .book-search) .button { min-height: 3rem; border-radius: 0 3px 3px 0; text-transform: none; letter-spacing: 0; font-size: .85rem; }
.glossary-result { padding-block: 1.1rem .3rem; line-height: 1.6; }
.glossary-result:empty { display: none; }
.glossary-message { margin: 0 0 .7rem; color: var(--ink-soft); font-size: .92rem; }
.glossary-retry { min-height: 2.75rem; padding: 0; border: 0; background: transparent; color: var(--wine); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.glossary-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .85rem; color: var(--muted); }
.glossary-suggestions .filter-chip { text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--ink); }
.glossary-entry + .glossary-entry { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.glossary-entry h3 { margin: 0 0 .2rem; color: var(--wine); font: 500 1.45rem/1.2 var(--display); }
.glossary-entry__meta { margin: .45rem 0 .1rem; color: var(--muted); font-size: .8rem; font-style: italic; }
.glossary-entry ol { margin: .2rem 0 0; padding-left: 1.3rem; font-size: .95rem; }
.glossary-entry li { padding: .12rem 0; }
.glossary-credit { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.glossary-credit a { color: var(--wine); text-underline-offset: 3px; }
@media (max-width: 26rem) {
  .glossary-form__row, .book-search__row { grid-template-columns: minmax(0,1fr); gap: .5rem; }
  :is(.glossary-form, .book-search) input { border-right: 1px solid color-mix(in srgb, var(--ink) 45%, transparent); border-radius: 3px; }
  :is(.glossary-form, .book-search) .button { border-radius: 3px; }
}

/* Colour palettes (assets/reader-settings.js). The mode (light/dark) and the
   palette are independent; Papel, Claro (Branco) and Escuro keep their colours.
   Always on in the reader; on other pages only when the visitor chooses it. */
:root[data-theme='light'], .reader-page[data-theme='light'] { --paper: #fffdfa; --paper-light: #ffffff; }
:root[data-theme='ocean'], .reader-page[data-theme='ocean'] { --paper: #f5f9fd; --paper-light: #ffffff; --paper-deep: #e5eef7; --ink: #10263b; --ink-soft: #2c4560; --wine: #175490; --wine-dark: #0f3c69; --gold: #b4532a; --muted: #425b73; --line: #17549033; }
:root[data-theme='solar'], .reader-page[data-theme='solar'] { --paper: #fffaf3; --paper-light: #ffffff; --paper-deep: #f8ead8; --ink: #21160d; --ink-soft: #4a3826; --wine: #9a4700; --wine-dark: #7a3800; --gold: #b3471d; --muted: #68503b; --line: #9a470033; }
:root[data-theme='dark'], .reader-page[data-theme='dark'] { --paper: #1e2824; --paper-light: #28352e; --paper-deep: #2f3d35; --ink: #eeeadd; --ink-soft: #d1d8cd; --wine: #d5ce9b; --wine-dark: #e6dfae; --gold: #e4b283; --muted: #b9c5b8; --line: #b9c5b838; }
:root[data-theme='dark'][data-palette='white'], .reader-page[data-theme='dark'][data-palette='white'] { --paper: #161616; --paper-light: #212121; --paper-deep: #2a2a2a; --ink: #ececec; --ink-soft: #d2d2d2; --wine: #e2dccb; --wine-dark: #f0ead9; --gold: #e0a17a; --muted: #ababab; --line: #ffffff24; }
:root[data-theme='dark'][data-palette='ocean'], .reader-page[data-theme='dark'][data-palette='ocean'] { --paper: #071421; --paper-light: #10263b; --paper-deep: #17354f; --ink: #eef4fa; --ink-soft: #c9d8e6; --wine: #6bb8ee; --wine-dark: #8fcaf3; --gold: #f0a37a; --muted: #b4c8db; --line: #b4c8db33; }
:root[data-theme='dark'][data-palette='solar'], .reader-page[data-theme='dark'][data-palette='solar'] { --paper: #1a1108; --paper-light: #2b1d10; --paper-deep: #3a2816; --ink: #fff7ed; --ink-soft: #ead9c6; --wine: #f7a440; --wine-dark: #f9b866; --gold: #f7941d; --muted: #d5bda6; --line: #d5bda633; }
:root[data-theme]:not([data-theme='paper']) body, .reader-page:not([data-theme='paper']) { background: var(--page-grain) repeat, var(--paper); color: var(--ink); }
:root[data-theme='dark'], .reader-page[data-theme='dark'] { --page-grain: url('/assets/paper-dark.svg'); }
:root[data-palette='white'], .reader-page[data-palette='white'] { --page-grain: none; }

/* Each palette composes its own coloured band (discovery, footer, mobile menu)
   and note card, in light and in dark, instead of inverting the paper theme. */
:root[data-theme='light'] { --note: #fffdf8; }
:root[data-theme='ocean'] { --accent-ink: #9c4421; --band: #0f3c69; --band-ink: #f5f9fd; --band-soft: #cddbea; --band-accent: #f6cf94; --band-active: #ffdc9c; --band-mark: #d6e4f2; --note: #fbfdff; --note-sheet: #f5f9fd26; }
:root[data-theme='solar'] { --gold: #b3471d; --accent-ink: #9c3418; --band: #7a3800; --band-ink: #fffaf3; --band-soft: #f3dfc7; --band-accent: #ffd28a; --band-active: #ffe0a3; --band-mark: #f9e3c7; --note: #fffaf3; --note-sheet: #fffaf326; }
:root[data-theme='dark'] { --accent-ink: var(--gold); --band: #173d35; --band-ink: #eeeadd; --band-soft: #cbd4c6; --band-accent: #e4b283; --band-active: #efd582; --band-mark: #d5ce9b; --note: #e2dac4; --note-sheet: #eeeadd1f; --focus: var(--gold); }
:root[data-theme='dark'][data-palette='white'] { --band: #2b2b2b; --band-ink: #ececec; --band-soft: #c8c8c8; --band-accent: #e0a17a; --band-active: #f0c99a; --band-mark: #dcd6c6; --note: #e3e0d8; --note-sheet: #ffffff1a; }
:root[data-theme='dark'][data-palette='ocean'] { --band: #0f3c69; --band-ink: #eef4fa; --band-soft: #c7d9ea; --band-accent: #f0a37a; --band-active: #ffd28a; --band-mark: #b9d9f2; --note: #dbe4ec; --note-sheet: #eef4fa1f; }
:root[data-theme='dark'][data-palette='solar'] { --band: #6a3306; --band-ink: #fff7ed; --band-soft: #f1dcc3; --band-accent: #ffc477; --band-active: #ffd9a0; --band-mark: #ffd9ad; --note: #eadcc7; --note-sheet: #fff7ed1f; }
:root[data-theme='dark'] .reading-note { --ink: #24332b; --ink-soft: #414d44; --muted: #555c50; --wine: #173d35; --wine-dark: #0f2e27; --gold: #8e3026; --line: #213f3238; --paper: #f2efdf; --paper-light: #fffdf4; --focus: #ad382c; --accent-ink: #8e3026; color-scheme: light; }
:root[data-theme='dark'][data-palette='ocean'] .reading-note { --ink: #10263b; --ink-soft: #2c4560; --muted: #3c546b; --wine: #175490; --wine-dark: #0f3c69; --gold: #9c4421; --line: #17549038; --paper: #f5f9fd; --paper-light: #ffffff; --accent-ink: #9c4421; }
:root[data-theme='dark'][data-palette='solar'] .reading-note { --ink: #21160d; --ink-soft: #4a3826; --muted: #5e4835; --wine: #8a4000; --wine-dark: #7a3800; --gold: #9a4700; --line: #9a470038; --paper: #fffaf3; --paper-light: #ffffff; --accent-ink: #9c3418; }
:root[data-theme='dark'] { color-scheme: dark; }

/* Reading settings: sections, − / + with a live preview, palettes. */
.reader-settings { width: min(calc(100% - 2rem), 32rem); }
.settings-dialog .settings-dialog__top { position: sticky; top: 0; z-index: 2; margin: -1.5rem -1.5rem 0; padding: 1.1rem 1.5rem 1rem; background: var(--paper-light); }
.settings-presets { border-bottom: 0; padding-bottom: .3rem; }
.settings-section { margin-top: .9rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.settings-section__title { margin: 0 0 1rem; color: var(--wine); font: 550 1.1rem/1.2 var(--display); letter-spacing: -.01em; }
.settings-field, .stepper { display: grid; gap: .55rem; margin-bottom: 1.15rem; }
.stepper__control { display: grid; grid-template-columns: 3rem minmax(0,1fr) 3rem; border: 1px solid var(--line); border-radius: 3px; background: var(--paper-light); }
.stepper__button { min-height: 3.4rem; border: 0; background: transparent; color: var(--wine); font: 400 1.4rem/1 var(--sans); cursor: pointer; }
@media (hover: hover) { .stepper__button:hover:not(:disabled) { background: color-mix(in srgb, var(--wine) 8%, transparent); } }
.stepper__button:disabled { color: var(--muted); opacity: .4; cursor: default; }
.stepper__preview { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-width: 0; padding: .3rem .85rem; border-inline: 1px solid var(--line); overflow: hidden; }
.stepper__value { color: var(--ink-soft); font: 500 .78rem/1.3 var(--sans); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper__sample { color: var(--ink); font-family: var(--reading, Georgia, serif); font-size: var(--preview-size, 19px); line-height: 1; white-space: nowrap; }
.stepper__sample--word { font-size: 1.05rem; letter-spacing: var(--preview-letter, 0); }
.stepper__lines { display: grid; flex: none; gap: calc((var(--preview-leading, 1.85) - 1) * 8px); width: 2.8rem; }
.stepper__lines i, .stepper__measure i { display: block; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 50%, transparent); }
.stepper__lines i:last-child { width: 65%; }
.stepper__measure { position: relative; display: block; flex: none; width: 4.4rem; height: 1.5rem; border-inline: 1px solid var(--muted); }
.stepper__measure i { position: absolute; top: 50%; left: 50%; width: var(--preview-measure, 72%); transform: translate(-50%, -50%); }
.palettes { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .5rem; }
.palette { display: grid; justify-items: center; gap: .45rem; min-width: 0; padding: .55rem .35rem .5rem; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--ink); font: 500 .8rem/1.2 var(--sans); cursor: pointer; }
@media (hover: hover) { .palette:hover { border-color: var(--wine); } }
.palette[aria-pressed='true'] { border-color: var(--wine); box-shadow: inset 0 0 0 1px var(--wine); font-weight: 700; }
.palette__swatch { position: relative; display: grid; place-items: center; width: 100%; max-width: 4.4rem; aspect-ratio: 4 / 3; border: 1px solid color-mix(in srgb, var(--sw-ink) 20%, transparent); border-radius: 2px; background: var(--sw-bg); color: var(--sw-ink); font: 500 1.1rem/1 var(--display); }
.palette__swatch i { position: absolute; right: .3rem; bottom: .3rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--sw-accent); }
.palette--paper { --sw-bg: #f2efdf; --sw-ink: #24332b; --sw-accent: #173d35; }
.palette--white { --sw-bg: #fffdfa; --sw-ink: #24332b; --sw-accent: #173d35; }
.palette--ocean { --sw-bg: #f5f9fd; --sw-ink: #10263b; --sw-accent: #175490; }
.palette--solar { --sw-bg: #fffaf3; --sw-ink: #21160d; --sw-accent: #9a4700; }
[data-theme='dark'] .palette--paper { --sw-bg: #1e2824; --sw-ink: #eeeadd; --sw-accent: #d5ce9b; }
[data-theme='dark'] .palette--white { --sw-bg: #161616; --sw-ink: #ececec; --sw-accent: #e2dccb; }
[data-theme='dark'] .palette--ocean { --sw-bg: #071421; --sw-ink: #eef4fa; --sw-accent: #6bb8ee; }
[data-theme='dark'] .palette--solar { --sw-bg: #1a1108; --sw-ink: #fff7ed; --sw-accent: #f7a440; }
.settings-check { display: flex; align-items: flex-start; gap: .7rem; padding: .85rem .9rem; border: 1px solid var(--line); border-radius: 3px; font: 500 .88rem/1.45 var(--sans); cursor: pointer; }
.settings-check input { flex: none; width: 1.15rem; height: 1.15rem; margin: .12rem 0 0; accent-color: var(--wine); }
.settings-footer { display: flex; justify-content: flex-end; margin-top: .4rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.settings-reset { min-height: 2.75rem; padding: 0 .2rem; border: 0; background: transparent; color: var(--wine); font: 600 .85rem/1 var(--sans); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--wine) 40%, transparent); text-underline-offset: 4px; cursor: pointer; }
@media (hover: hover) { .settings-reset:hover { text-decoration-color: currentColor; } }
@media (max-width: 26rem) {
  .palettes { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stepper__preview { flex-direction: column; justify-content: center; gap: .35rem; padding: .45rem .5rem; }
  .stepper__value { font-size: .74rem; text-align: center; white-space: normal; }
}

/* Scrollbars that belong to the page: thin in dialogs, tinted everywhere. */
:root { scrollbar-color: color-mix(in srgb, var(--wine) 45%, transparent) transparent; }
.settings-dialog { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--wine) 55%, transparent) transparent; }

/* Index: how the work numbers its chapters. */
.toc-note { margin: 1rem 0 0; padding: .8rem 0; border-top: 1px solid var(--line); color: var(--ink-soft); font: italic 400 .9rem/1.55 var(--reading, Georgia, serif); }

/* Marca-texto and the selection toolbar (assets/reader-highlights.js). */
.reader-mark { padding: .05em 0; border-radius: 2px; color: inherit; background: var(--mark-bg); box-decoration-break: clone; -webkit-box-decoration-break: clone; cursor: pointer; }
.reader-mark[data-color='amarelo'] { --mark-bg: #f2cf5b73; }
.reader-mark[data-color='verde'] { --mark-bg: #8fcf8c66; }
.reader-mark[data-color='azul'] { --mark-bg: #8ec3ec66; }
.reader-mark[data-color='rosa'] { --mark-bg: #f29fb666; }
[data-theme='dark'] .reader-mark[data-color='amarelo'] { --mark-bg: #d9b13a59; }
[data-theme='dark'] .reader-mark[data-color='verde'] { --mark-bg: #5fa85c59; }
[data-theme='dark'] .reader-mark[data-color='azul'] { --mark-bg: #4f95cc59; }
[data-theme='dark'] .reader-mark[data-color='rosa'] { --mark-bg: #d0708c59; }
.selection-toolbar { position: absolute; z-index: 45; display: flex; align-items: center; gap: .35rem; max-width: calc(100vw - 1rem); padding: .3rem; border: 1px solid var(--wine); border-radius: 4px; background: var(--wine); color: var(--paper-light); box-shadow: 0 10px 24px rgba(18, 30, 24, .24); font: 700 .78rem/1.2 var(--sans); }
.selection-toolbar[hidden] { display: none; }
.selection-toolbar__colors { display: flex; gap: .2rem; }
.selection-toolbar__color { position: relative; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 3px; background: transparent; cursor: pointer; }
.selection-toolbar__color::before { content: ''; position: absolute; inset: .55rem; border: 2px solid var(--paper-light); border-radius: 50%; background: var(--swatch); }
@media (hover: hover) { .selection-toolbar__color:hover { background: color-mix(in srgb, var(--paper-light) 14%, transparent); } }
.selection-toolbar__color[aria-pressed='true']::after { content: ''; position: absolute; left: 50%; bottom: .2rem; width: .9rem; height: 2px; transform: translateX(-50%); background: var(--paper-light); }
.selection-toolbar__color[data-color='amarelo'] { --swatch: #f2cf5b; }
.selection-toolbar__color[data-color='verde'] { --swatch: #8fcf8c; }
.selection-toolbar__color[data-color='azul'] { --swatch: #8ec3ec; }
.selection-toolbar__color[data-color='rosa'] { --swatch: #f29fb6; }
.selection-toolbar__action { min-height: 2.75rem; max-width: 14rem; padding: 0 .8rem; border: 0; border-left: 1px solid color-mix(in srgb, var(--paper-light) 30%, transparent); background: transparent; color: inherit; font: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
@media (hover: hover) { .selection-toolbar__action:hover { text-decoration: underline; text-underline-offset: 3px; } }
.toc-marks { margin-top: 1rem; border-block: 1px solid var(--line); }
.toc-marks summary { display: flex; align-items: center; min-height: 2.9rem; color: var(--wine); font: 700 .74rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.toc-marks__empty { margin: 0 0 1rem; color: var(--muted); font: 400 .86rem/1.55 var(--sans); }
.toc-marks ol { display: grid; gap: .1rem; margin: 0 0 .9rem; padding: 0; list-style: none; }
.toc-marks li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .2rem .8rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.toc-marks li[data-color='amarelo'] { --swatch: #e0b73a; }
.toc-marks li[data-color='verde'] { --swatch: #5fa85c; }
.toc-marks li[data-color='azul'] { --swatch: #4f95cc; }
.toc-marks li[data-color='rosa'] { --swatch: #d0708c; }
.toc-marks a { grid-column: 1; color: var(--ink); font: 400 .95rem/1.5 var(--reading, Georgia, serif); text-decoration: none; }
@media (hover: hover) { .toc-marks a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.toc-marks li > span { grid-column: 1; color: var(--muted); font: 500 .78rem/1.4 var(--sans); }
.toc-marks li > span::before { content: ''; display: inline-block; width: .6rem; height: .6rem; margin-right: .45rem; border-radius: 50%; background: var(--swatch, var(--gold)); }
.toc-marks__remove { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-height: 2.75rem; padding: 0 .3rem; border: 0; background: transparent; color: var(--wine); font: 600 .8rem/1 var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (forced-colors: active) { .reader-mark { forced-color-adjust: none; background: Mark; color: MarkText; } }

/* Read aloud: choice of the device's Portuguese voices. */
.read-aloud__inner { grid-template-areas: 'previous toggle next speed close' 'voice voice voice voice voice' 'status status status status status'; }
.read-aloud__voice { grid-area: voice; display: flex; align-items: center; gap: .45rem; min-width: 0; color: var(--muted); font-size: .78rem; }
.read-aloud__voice[hidden] { display: none; }
.read-aloud__voice select { flex: 1; min-width: 0; min-height: 2.75rem; padding: 0 .55rem; border: 1px solid var(--line); background: var(--paper-light); color: var(--ink); font: 500 .85rem var(--sans); }
@media (max-width: 39.99rem) {
  .read-aloud__inner { grid-template-areas: 'previous toggle next close' 'speed speed speed speed' 'voice voice voice voice' 'status status status status'; }
}

/* Front matter recognised by shape (assets/app.js): epigraphs and title line. */
.reader-content .reader-epigraph { max-width: 28em; margin: 0 auto .35em; color: var(--ink-soft); font-size: .9em; font-style: italic; line-height: 1.6; text-wrap: pretty; }
.reader-content .reader-epigraph-source { max-width: 35em; margin: 0 auto 2.2em; color: var(--muted); font: 500 .72em/1.5 var(--sans); letter-spacing: .05em; text-align: right; }
.reader-content .reader-book-title { margin: 3.5em 0 .6em; color: var(--wine); font: 500 1.7em/1.1 var(--display); letter-spacing: .08em; text-align: center; }

/* Craft details (Impeccable / web interface guidelines). */
.reader-content > p { text-wrap: pretty; }
.reader h1 { text-wrap: balance; }
input, textarea { caret-color: var(--wine); }
@media print {
  .reader-header, .reader-tools, .reader-navigation, .reader-finale, .read-aloud, .selection-toolbar, .reader-glossary-open, .reader__ornament, .skip-link, dialog { display: none !important; }
  body, .reader-page { background: #fff !important; color: #000 !important; }
  .reader { width: auto; padding: 0; font-size: 12pt; }
  .reader h1 { break-after: avoid; }
  .reader-content p { orphans: 3; widows: 3; color: #000; opacity: 1 !important; }
  .reader-mark { background: none !important; text-decoration: underline; text-decoration-thickness: 2px; }
  .reader-source a::after { content: ' (' attr(href) ')'; font-size: .85em; }
}

/* Movimentos: each movement opens and closes (native <details>). */
.movement-hint { margin: -1rem 0 1.6rem; color: var(--muted); font-size: .92rem; }
.movement-sheet { display: block; padding: 0; gap: 0; }
.movement-sheet > summary { display: grid; grid-template-columns: 5.5rem minmax(0,1fr) auto; grid-template-areas: 'period name count' 'period description count'; column-gap: 2rem; row-gap: .3rem; align-items: center; padding: 1.8rem 0; list-style: none; cursor: pointer; }
.movement-sheet > summary::-webkit-details-marker { display: none; }
.movement-sheet > summary .movement-period { grid-area: period; align-self: start; padding-top: .55rem; }
.movement-sheet > summary h2 { grid-area: name; margin: 0; }
.movement-sheet > summary .movement-description { grid-area: description; margin: 0; max-width: 40rem; }
.movement-count { grid-area: count; display: flex; align-items: center; gap: .9rem; color: var(--muted); font: 500 .85rem/1 var(--sans); white-space: nowrap; }
.movement-count::after { content: ''; width: .55rem; height: .55rem; border-right: 1.5px solid var(--wine); border-bottom: 1.5px solid var(--wine); transform: translateY(-25%) rotate(45deg); transition: transform .2s ease; }
.movement-sheet[open] .movement-count::after { transform: translateY(15%) rotate(-135deg); }
.movement-sheet > summary:focus-visible { outline-offset: 6px; }
.movement-sheet__body { padding: 0 0 2.4rem 7.5rem; }
@media (hover: hover) { .movement-sheet > summary:hover h2 { color: var(--wine); } }
@media (max-width: 47.99rem) {
  .movement-sheet > summary { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: 'period count' 'name name' 'description description'; row-gap: .5rem; padding: 1.4rem 0; }
  .movement-sheet > summary .movement-period { padding-top: 0; }
  .movement-sheet__body { padding: 0 0 2rem; }
}
@media (prefers-reduced-motion: reduce) { .movement-count::after { transition: none; } }

/* Site pages under a chosen palette: fixed paper/ink colours become tokens.
   Light palettes keep the red accents (enough contrast); dark ones use --gold. */
:root[data-theme]:not([data-theme='paper']) :is(.reading-route, .search-field input) { background: color-mix(in srgb, var(--paper-light) 70%, transparent); border-color: var(--line); }
:root[data-theme='dark'] .library-card { background-color: var(--paper-light); }
:root[data-theme] .discovery-section .discovery-copy > .eyebrow { color: var(--band-accent); }
:root[data-theme='dark'] :is(.eyebrow, .resume-note, .book-card__caption > span, .note-label, .reading-route a:hover, .work-links a:hover,
  .movement-prompt span, .timeline-note > span, .chronology-year h2, .chronology-book:hover h3, .historical-context time, .saved-book:hover strong,
  .library-strip .shell > span, .author-count span + span::before, .brand strong .brand-dot, .serendipity-mark, .movement-row:hover strong,
  .year-index a:hover, .editorial-principles li::before, .library-stamp, .shelf-data .shelf-data__danger) { color: var(--gold); }
:root[data-theme='dark'] :is(.library-stamp, .shelf-data .shelf-data__danger) { border-color: var(--gold); outline-color: var(--gold); }
:root[data-theme='dark'] .library-stamp { background-color: var(--paper-light); }
:root[data-theme='dark'] .site-header .desktop-nav a[aria-current='page'] { color: var(--wine); }
:root[data-theme='dark'] .book-card__access { color: var(--muted); }
:root[data-theme='dark'] .author-monogram { color: #7fa893; }
:root[data-theme='dark'] .author-entry:nth-child(3n+2) .author-monogram { color: #d98a76; }
:root[data-theme='dark'] .author-entry:nth-child(3n) .author-monogram { color: #c99a62; }
:root[data-theme='dark'] .movement-prompt { background: color-mix(in srgb, var(--paper-light) 60%, transparent); }
:root[data-theme='dark'] .saved-book progress::-webkit-progress-bar { background: var(--line); }

/* Book page, compact: context + folded source, audiobook and ENEM (09/11/2026). */
.detail-grid--compact { align-items: start; padding-block: 2.5rem 3rem; }
.detail-grid--compact .detail-block > p + p { margin-top: .8rem; }
.detail-author { color: var(--muted); font-size: .92rem; }
.detail-source, .book-extra { border-block: 1px solid var(--line); }
:is(.detail-source, .book-extra) > summary { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: 'title chevron' 'meta chevron'; gap: .15rem 1rem; align-items: center; min-height: 3rem; padding: .9rem 0; list-style: none; cursor: pointer; }
:is(.detail-source, .book-extra) > summary::-webkit-details-marker { display: none; }
:is(.detail-source, .book-extra) > summary h2 { grid-area: title; margin: 0; }
:is(.detail-source, .book-extra) > summary::after { content: ''; grid-area: chevron; width: .55rem; height: .55rem; border-right: 1.5px solid var(--wine); border-bottom: 1.5px solid var(--wine); transform: translateY(-25%) rotate(45deg); transition: transform .2s ease; }
:is(.detail-source, .book-extra)[open] > summary::after { transform: translateY(15%) rotate(-135deg); }
.detail-source__meta, .book-extra__meta { grid-area: meta; color: var(--muted); font-size: .88rem; }
.detail-source__body, .book-extra__body { padding: 0 0 1.4rem; }
.detail-source__body > p { margin: 0 0 .8rem; }
.detail-source .source-panel { margin: 0; padding: 0; border: 0; background: none; }
.detail-source .source-panel > strong:first-child { display: none; }
.book-extras { grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 0 4rem; margin: -1rem 0 4rem; padding-top: 0; border-top: 0; }
.book-extra__body > p { max-width: 40rem; margin: 0 0 1rem; color: var(--ink-soft); font-size: .93rem; line-height: 1.7; }
.book-extra__body > .book-extra__note { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.book-extra__body .source-links { margin-bottom: 1rem; }
.book-extra__body .source-links a { color: var(--wine); font-weight: 700; font-size: .88rem; }
@media (hover: hover) { :is(.detail-source, .book-extra) > summary:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; } }
@media (prefers-reduced-motion: reduce) { :is(.detail-source, .book-extra) > summary::after { transition: none; } }

/* Compact reading menu: one row per control, no help texts (09/11/2026). */
.reader-settings .settings-row { display: grid; grid-template-columns: 8.2rem minmax(0,1fr); align-items: center; gap: .9rem; margin: .7rem 0 0; }
.reader-settings .settings-row > .settings-label { margin: 0; }
.reader-settings .settings-section__title { margin: 1.1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); font-size: 1rem; }
.reader-settings .stepper__button { min-height: 2.9rem; }
.reader-settings .segmented button { padding-inline: .4rem; }
.settings-select { width: 100%; min-height: 2.9rem; padding: 0 .7rem; border: 1px solid var(--line); border-radius: 3px; background: var(--paper-light); color: var(--ink); font: 500 .9rem var(--sans); }
.reader-settings .palettes, .appearance .palettes { gap: .35rem; }
.reader-settings .palette, .appearance .palette { gap: .25rem; padding: .35rem .2rem .3rem; font-size: .74rem; }
.reader-settings .palette__swatch, .appearance .palette__swatch { max-width: 3.2rem; font-size: .9rem; }
.reader-settings .settings-footer { margin-top: 1rem; }
@media (max-width: 30rem) {
  .reader-settings .settings-row { grid-template-columns: minmax(0,1fr); gap: .4rem; }
  .reader-settings .palettes { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

/* Colours of the site outside the reader: button in the lower right corner. */
.appearance { position: fixed; z-index: 35; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); display: grid; justify-items: end; gap: .6rem; font-family: var(--sans); }
.appearance__toggle { display: grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid var(--line); border-radius: 50%; background: var(--paper-light); color: var(--wine); box-shadow: 0 8px 22px rgba(18, 30, 24, .18); cursor: pointer; }
.appearance__toggle[aria-expanded='true'] { border-color: var(--wine); background: var(--wine); color: var(--paper-light); }
.appearance__panel { display: grid; gap: .75rem; width: min(19rem, calc(100vw - 2rem)); padding: 1rem; border: 1px solid var(--line); border-radius: 4px; background: var(--paper-light); color: var(--ink); box-shadow: 0 14px 34px rgba(18, 30, 24, .2); }
.appearance__panel[hidden] { display: none; }
.appearance__title { margin: 0; color: var(--wine); font: 600 1rem/1.2 var(--display); }
.appearance .segmented button { min-height: 2.75rem; padding-inline: .3rem; font-size: .82rem; }
@media (hover: hover) { .appearance__toggle:hover { border-color: var(--wine); } }
@media print { .appearance { display: none; } }
.reader-settings .segmented:not(.segmented--two) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reader-settings .segmented button { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 22.5rem) {
  .reader-settings .settings-dialog__inner { padding: 1.1rem; }
  .reader-settings .settings-dialog__top { margin: -1.1rem -1.1rem 0; padding: .9rem 1.1rem .8rem; }
  .reader-settings .segmented button { padding-inline: .15rem; font-size: .78rem; }
}

/* Refinements of 10/11/2026: dictionary, back links, covers and accents in dark. */
/* Dictionary: one focus ring around the joined field and button. */
@media (min-width: 26.01rem) {
  @supports selector(:has(*)) {
    :is(.glossary-form__row, .book-search__row):has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
    :is(.glossary-form__row, .book-search__row) input:focus-visible { outline: none; }
  }
}
.glossary-modern { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; margin-top: .4rem; color: var(--wine); font-size: .88rem; font-weight: 600; text-underline-offset: 4px; }
.glossary-credit { margin-bottom: 0; }
.glossary-about { margin-top: .15rem; color: var(--ink-soft); font-size: .8rem; line-height: 1.55; }
.glossary-about > summary { display: inline-flex; align-items: center; min-height: 2rem; color: var(--wine); font-weight: 600; cursor: pointer; }
.glossary-about > p { margin: .2rem 0 0; }
/* Back links point back. */
.text-link--back::after { content: none; }
.text-link--back::before { content: '←'; font-size: 1.1rem; transition: transform .2s ease; }
@media (hover: hover) { .text-link--back:hover::before { transform: translateX(-.3rem); } }
@media (prefers-reduced-motion: reduce) { .text-link--back::before { transition: none; } }
/* Dark: big titles in a tinted cream (the paper theme's dark green plays an ink
   role), so the palette accent is kept for actions and small labels. */
:root[data-theme='dark'] { --title: #e9e2c6; }
:root[data-theme='dark'][data-palette='white'] { --title: #eee8da; }
:root[data-theme='dark'][data-palette='ocean'] { --title: #dcebf8; }
:root[data-theme='dark'][data-palette='solar'] { --title: #ffe4c4; }
:root[data-theme='dark'] :is(.press-hero h1, .page-hero h1, .book-detail__copy h1) { color: var(--title); }
:root[data-theme='dark'] .book-detail__author { color: var(--ink-soft); }
:root[data-theme='dark'] .button--ghost:not(:hover) { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 50%, transparent); }
/* Dark: covers a little dimmer, page edges in dim cream and a real shadow. */
:root[data-theme='dark'] .cover { background: linear-gradient(90deg, #0004, transparent 3%, #fff2 4%, transparent 5%), url('/assets/paper.svg'), color-mix(in srgb, var(--cover) 86%, #000); box-shadow: 1px 3px 0 #736d60, 3px 5px 0 #8e8776, 6px 12px 24px #000a; }
:root[data-theme='dark'] .cover::before { opacity: .82; }
@media (hover: hover) { :root[data-theme='dark'] .book-card:hover .cover { box-shadow: 1px 3px 0 #736d60, 3px 5px 0 #8e8776, 10px 18px 28px #000b; } }
:root[data-theme='dark'] .composition-book .cover { box-shadow: 5px 8px 0 #736d60, 7px 10px 0 #8e8776, 14px 24px 30px #000b; }
/* Drawn arrows (10/11/2026): → inside the site, ↗ only for links that leave it. */
:root {
  --arrow-in: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E");
  --arrow-out: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
}
.arrow, .text-link::after, .text-link--back::before { content: ''; display: inline-block; width: 1em; height: 1em; flex: none; vertical-align: -.14em; background: currentColor; -webkit-mask: var(--arrow-in) center / contain no-repeat; mask: var(--arrow-in) center / contain no-repeat; }
.text-link[target='_blank']::after { -webkit-mask-image: var(--arrow-out); mask-image: var(--arrow-out); }
.arrow--back, .text-link--back::before { transform: scaleX(-1); }
.text-link--back::after { content: none; }
@media (hover: hover) { .text-link--back:hover::before { transform: scaleX(-1) translateX(.3rem); } }
.icon-button .arrow { font-size: 1.15rem; }
/* The title in the reader's top bar leads back to the book page. */
a.reader-header__title { display: block; padding-block: .55rem; color: inherit; text-decoration: none; }
@media (hover: hover) { a.reader-header__title:hover { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 4px; } }
/* No coloured side stripes: a short printer's rule on top instead. */
.curation-note, .source-panel, .movement-prompt { border-left: 0; }
.curation-note { padding: 1.1rem 0 0; }
:is(.curation-note, .source-panel, .movement-prompt)::before { content: ''; display: block; width: 2.5rem; height: 2px; margin-bottom: .8rem; background: var(--gold); }
.detail-source .source-panel::before { content: none; }
/* Busca no livro (11/11/2026): a field at the top of the index; the magnifier only where the header has room. */
:root { --search-hit: #f2cf5b8c; }
:root[data-theme='dark'], .reader-page[data-theme='dark'] { --search-hit: #d9b13a66; }
.reader-tools [data-search-open] { display: grid; place-items: center; color: inherit; }
.reader-tools [data-search-open][hidden] { display: none; }
@media (max-width: 23.99rem) { .reader-tools [data-search-open] { display: none; } }
.reader-content > p[id^="trecho-"] { scroll-margin-top: 5.5rem; }
.book-search__status { margin: 0; color: var(--muted); font: 400 .82rem/1.5 var(--sans); }
.book-search__status:empty { display: none; }
.book-search__back { justify-self: start; min-height: 2.75rem; margin-top: .2rem; padding: 0; border: 0; background: transparent; color: var(--wine); font: 600 .82rem/1 var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.book-search__back[hidden], .book-search__results[hidden] { display: none; }
.toc-dialog.is-searching :is([data-toc-list], .toc-marks, .toc-note) { display: none; }
.book-search__results { display: grid; margin: .5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.book-search__results a { display: grid; gap: .3rem; padding: .85rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
@media (hover: hover) { .book-search__results a:hover .book-search__text { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; } }
.book-search__where { color: var(--accent-ink); font: 700 .75rem/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.book-search__text { font: 400 .95rem/1.55 var(--reading, Georgia, serif); }
.book-search__text mark { padding: 0 .08em; border-radius: 2px; color: inherit; background: var(--search-hit); }
::highlight(entrelinhas-busca) { background-color: #f2cf5b8c; color: inherit; }
.reader-page[data-theme='dark'] ::highlight(entrelinhas-busca) { background-color: #d9b13a66; }
.reader-content > p.is-search-target { border-radius: 3px; background: color-mix(in srgb, var(--gold) 9%, transparent); box-shadow: 0 0 0 .45rem color-mix(in srgb, var(--gold) 9%, transparent); transition: background-color 1s ease, box-shadow 1s ease; }
.reader-content > p.is-search-target.is-search-fading { background-color: transparent; box-shadow: 0 0 0 .45rem transparent; }
@media (prefers-reduced-motion: reduce) { .reader-content > p.is-search-target { transition: none; } }
@media (forced-colors: active) { ::highlight(entrelinhas-busca) { background-color: Mark; color: MarkText; } .reader-content > p.is-search-target { outline: 2px solid Highlight; } }

/* Notes on marks and quotations (11/11/2026). */
.reader-mark[data-note] { text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.selection-toolbar { flex-wrap: wrap; }
.selection-toolbar:has(> .selection-toolbar__note) { max-width: min(calc(100vw - 1rem), 26rem); }
.selection-toolbar__note { flex: 1 0 100%; margin: 0; padding: .45rem .55rem .4rem; font: italic 400 .88rem/1.45 var(--reading, Georgia, serif); white-space: pre-line; }
.selection-toolbar__actions { display: flex; flex-wrap: wrap; }
.note-dialog { width: min(calc(100% - 2rem), 32rem); }
.note-form { display: grid; gap: .7rem; font-family: var(--sans); }
.note-form__quote { margin: .9rem 0 0; color: var(--ink-soft); font: italic 400 .95rem/1.55 var(--reading, Georgia, serif); }
.note-form__quote[hidden] { display: none; }
.note-form__quote::before { content: '“'; }
.note-form__quote::after { content: '”'; }
.note-form textarea { width: 100%; min-height: 8rem; padding: .7rem .8rem; border: 1px solid color-mix(in srgb, var(--ink) 45%, transparent); border-radius: 3px; background: transparent; color: var(--ink); font: 400 1rem/1.5 var(--sans); resize: vertical; }
.note-form__hint { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.note-form__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.note-form__actions [hidden] { display: none; }
.toc-marks__note { grid-column: 1; margin: 0; color: var(--ink-soft); font: italic 400 .88rem/1.5 var(--reading, Georgia, serif); white-space: pre-line; }
.reader-toast { position: fixed; z-index: 60; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 2rem); margin: 0; padding: .75rem 1rem; transform: translateX(-50%); border-radius: 4px; background: var(--wine); color: var(--paper-light); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); font: 600 .85rem/1.4 var(--sans); }
.reader-toast[hidden] { display: none; }
html.has-read-aloud .reader-toast { bottom: 10rem; }

/* Recorded audiobook in the read-aloud bar (11/11/2026). */
.read-aloud__modes { grid-area: modes; }
.read-aloud__modes button { min-height: 2.5rem; padding: 0 .6rem; color: var(--ink); font: 600 .78rem/1.2 var(--sans); }
.read-aloud__modes button[aria-pressed='true'] { color: var(--paper-light); }
.read-aloud__inner:has(> .read-aloud__modes) { grid-template-areas: 'modes modes modes modes modes' 'previous toggle next speed close' 'voice voice voice voice voice' 'status status status status status'; }
.read-aloud[data-mode='gravacao'] .read-aloud__inner { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: 'recording close'; align-items: start; }
.read-aloud[data-mode='gravacao'] .read-aloud__inner:has(> .read-aloud__modes) { grid-template-areas: 'modes modes' 'recording close'; }
.read-aloud[data-mode='gravacao'] :is([data-read-aloud='previous'], [data-read-aloud='toggle'], [data-read-aloud='next'], .read-aloud__speed, .read-aloud__voice, .read-aloud__status) { display: none; }
.read-aloud:not([data-mode='gravacao']) .read-aloud__recording { display: none; }
.read-aloud__recording { grid-area: recording; display: grid; gap: .45rem; min-width: 0; }
.read-aloud__track { display: flex; align-items: center; gap: .45rem; min-width: 0; color: var(--muted); font-size: .78rem; }
.read-aloud__track select { flex: 1; min-width: 0; min-height: 2.75rem; padding: 0 .55rem; border: 1px solid var(--line); background: var(--paper-light); color: var(--ink); font: 500 .85rem var(--sans); }
.read-aloud__audio { display: block; width: 100%; height: 2.75rem; }
.read-aloud__hint, .read-aloud__credit { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.read-aloud__hint:empty { display: none; }
.read-aloud__credit a { color: var(--wine); text-underline-offset: 3px; }
