﻿:root {
  --bg: #f2ecdf;
  --bg-secondary: #ebe3d5;
  --paper: rgba(250, 246, 238, 0.86);
  --paper-solid: #faf6ee;
  --ink: #1d2a26;
  --muted: #66706b;
  --line: rgba(35, 45, 41, 0.12);
  --line-strong: rgba(35, 45, 41, 0.22);
  --accent: #8c4b36;
  --accent-soft: rgba(140, 75, 54, 0.12);
  --accent-green: #48695f;
  --shadow: 0 20px 60px rgba(32, 26, 18, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(140, 75, 54, 0.12), transparent 36%),
    radial-gradient(circle at bottom right, rgba(72, 105, 95, 0.14), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-secondary) 100%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: 0;
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.background-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 90%);
}

.site-header,
.site-footer,
.hero-section,
.feature-section,
.library-section,
.featured-section,
.reader-shell,
.studio-shell {
  position: relative;
  z-index: 1;
}

.site-header,
.site-footer,
.hero-section,
.feature-section,
.library-section,
.featured-section {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0 18px;
}

.site-header--reader {
  width: min(1320px, calc(100vw - 40px));
}

.brand-mark {
  display: inline-flex;
  gap: 14px;
  align-items: center;
}

.brand-mark strong,
.brand-mark small {
  display: block;
}

.brand-mark strong {
  font-size: 1.02rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark small {
  color: var(--muted);
  font-size: 0.84rem;
}

.brand-mark__symbol {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--accent), #6e3427);
  color: #fff5ee;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.site-nav {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav a,
.site-nav button {
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #f6f0e7;
  border: 1px solid transparent;
  transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--secondary {
  background: var(--accent-green);
}

.button--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button--small {
  padding: 10px 14px;
  font-size: 0.94rem;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 42px;
  align-items: center;
  padding: 36px 0 60px;
}

.hero-copy h1,
.section-heading h2,
.chapter-header h1,
.reader-sidebar__card h1,
.auth-view h1 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 0.94;
  letter-spacing: -0.02em;
}

.hero-copy h1 {
  font-size: clamp(3.6rem, 7vw, 6.3rem);
  max-width: 11ch;
}

.hero-copy__lead,
.section-heading p,
.feature-card p,
.book-card p,
.featured-panel p,
.auth-view__lead {
  color: var(--muted);
  line-height: 1.75;
}

.metric-strip {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.metric-strip li,
.feature-card,
.book-card,
.featured-panel,
.paper-surface,
.reader-sidebar__card,
.toc-panel,
.status-bar,
.studio-sidebar,
.studio-preview {
  backdrop-filter: blur(14px);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.metric-strip li {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
}

.hero-stage {
  display: flex;
  justify-content: center;
}

.hero-book {
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: 26px 1fr;
  min-height: 520px;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(47, 32, 22, 0.2);
}

.hero-book__spine {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  letter-spacing: 0.16em;
  background: linear-gradient(180deg, #6e3427, var(--accent));
  color: #fdf7f0;
  padding: 18px 0;
}

.hero-book__cover {
  padding: 34px;
  background:
    linear-gradient(180deg, rgba(252, 247, 238, 0.92), rgba(244, 235, 219, 0.92)),
    linear-gradient(135deg, rgba(140, 75, 54, 0.14), rgba(72, 105, 95, 0.08));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-book__cover h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 0.98;
}

.hero-equation {
  display: grid;
  gap: 6px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.8rem;
}

.hero-equation small {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--muted);
}

.feature-section,
.library-section,
.featured-section {
  padding: 36px 0 60px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(2.6rem, 5vw, 4.4rem);
}

.library-controls {
  margin-bottom: 18px;
  padding: 22px 24px;
  display: grid;
  gap: 16px;
}

.library-controls__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.library-search {
  display: grid;
  gap: 8px;
  flex: 1 1 360px;
}

.library-search__label {
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.library-search__input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.78);
  padding: 14px 16px;
  color: var(--ink);
}

.library-search__input:focus {
  outline: 2px solid rgba(140, 75, 54, 0.15);
  border-color: rgba(140, 75, 54, 0.42);
}

.library-tag-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.filter-chip:hover {
  transform: translateY(-1px);
}

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #f6f0e7;
}

.library-results-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.library-results-summary strong {
  color: var(--ink);
}

.book-card--empty {
  align-content: start;
}

.featured-panel--empty {
  grid-template-columns: 1fr;
}

.featured-panel__empty {
  display: grid;
  gap: 14px;
  max-width: 560px;
}

.feature-grid,
.book-grid {
  display: grid;
  gap: 18px;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.book-card,
.featured-panel,
.paper-surface,
.reader-sidebar__card,
.toc-panel,
.status-bar,
.studio-sidebar,
.studio-preview {
  border-radius: var(--radius-lg);
}

.feature-card {
  padding: 26px;
}

.feature-card h3,
.book-card h3,
.featured-panel h3,
.status-bar h2,
.form-section h3,
.preview-topline h2,
.studio-sidebar__top h2,
.toc-panel h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

.book-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.book-card {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.book-card__cover {
  width: 78px;
  height: 104px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  letter-spacing: 0.12em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.book-card__meta,
.featured-panel__meta,
.chapter-topline__meta,
.preview-summary,
.save-state,
.credential-note {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.95rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
}

.book-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.book-card__link {
  color: var(--accent);
  font-weight: 600;
}

.featured-panel {
  padding: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 28px;
}

.featured-panel__chapter-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.featured-panel__chapter-list li {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--line);
}

.site-footer {
  padding: 24px 0 60px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  flex-wrap: wrap;
}

.reader-shell {
  width: min(1320px, calc(100vw - 40px));
  margin: 18px auto 56px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.reader-sidebar {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 18px;
}

.reader-sidebar__card,
.toc-panel {
  padding: 22px;
}

.reader-sidebar__card h1 {
  font-size: 2.8rem;
}

.reader-main {
  display: grid;
  gap: 18px;
}

.chapter-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.paper-surface {
  padding: clamp(24px, 4vw, 46px);
}

.chapter-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.chapter-header h1 {
  font-size: clamp(3rem, 5vw, 4.8rem);
}

.chapter-summary {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.8;
  max-width: 72ch;
}

.toc-list,
.book-list,
.chapter-list {
  display: grid;
  gap: 10px;
}

.toc-button,
.book-list__item,
.chapter-list__item {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid transparent;
  color: var(--ink);
}

.toc-button.is-active,
.book-list__item.is-active,
.chapter-list__item.is-active {
  border-color: var(--line-strong);
  background: rgba(140, 75, 54, 0.1);
}

.toc-button small,
.book-list__item small,
.chapter-list__item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.chapter-navigation {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.chapter-navigation a {
  min-width: min(320px, 100%);
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--paper);
  border: 1px solid var(--line);
}

.rich-copy {
  color: #22302b;
  line-height: 1.82;
  font-size: 1.08rem;
}

.rich-copy > :first-child {
  margin-top: 0;
}

.rich-copy h1,
.rich-copy h2,
.rich-copy h3,
.rich-copy h4 {
  margin: 2.4rem 0 1rem;
  font-family: var(--font-display);
  line-height: 1;
  letter-spacing: -0.01em;
}

.rich-copy h1 {
  font-size: 3rem;
}

.rich-copy h2 {
  font-size: 2.35rem;
}

.rich-copy h3 {
  font-size: 1.86rem;
}

.rich-copy h4 {
  font-size: 1.46rem;
}

.rich-copy p,
.rich-copy li,
.rich-copy blockquote {
  max-width: 72ch;
}

.rich-copy ul,
.rich-copy ol {
  padding-left: 1.35rem;
}

.rich-copy blockquote {
  margin: 1.6rem 0;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.rich-copy code {
  font-family: var(--font-mono);
  padding: 0.14rem 0.34rem;
  background: rgba(30, 40, 35, 0.08);
  border-radius: 6px;
  font-size: 0.94em;
}

.rich-copy pre {
  overflow: auto;
  padding: 18px 20px;
  background: #1e2624;
  color: #eff2ef;
  border-radius: 18px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.55;
}

.rich-copy pre code {
  padding: 0;
  background: transparent;
}

.rich-copy hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.8rem 0;
}

.rich-copy figure {
  margin: 2rem 0;
  display: grid;
  gap: 12px;
}

.rich-copy figcaption {
  color: var(--muted);
  font-size: 0.95rem;
}

.rich-copy img {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.math-block,
.diagram-block {
  margin: 1.8rem 0;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  overflow: auto;
}

.diagram-block .mermaid {
  text-align: center;
}

.studio-shell {
  width: min(1440px, calc(100vw - 40px));
  margin: 18px auto 56px;
}

.auth-view {
  max-width: 620px;
  margin: 64px auto;
}

.auth-view h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  margin-bottom: 16px;
}

.auth-form,
.form-stack,
.field-grid,
.chapter-editor {
  display: grid;
  gap: 16px;
}

.credential-note {
  margin-top: 18px;
}

.credential-note small {
  width: 100%;
  font-size: 0.84rem;
  line-height: 1.5;
}

.dashboard-view {
  display: block;
}

.studio-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1.2fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.studio-sidebar,
.studio-preview {
  padding: 22px;
  position: sticky;
  top: 20px;
}

.studio-sidebar__top,
.status-bar,
.form-section__header,
.preview-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.status-bar {
  padding: 22px 26px;
}

.status-bar__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.studio-sidebar__actions {
  justify-content: flex-end;
}

.studio-sidebar__hint {
  margin: 0 0 14px;
}

.save-state {
  align-items: center;
}

.form-section {
  display: grid;
  gap: 20px;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.7);
  padding: 12px 14px;
  color: var(--ink);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid rgba(140, 75, 54, 0.15);
  border-color: rgba(140, 75, 54, 0.42);
}

.field--full {
  grid-column: 1 / -1;
}

.chapter-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
}

.chapter-editor {
  min-width: 0;
}

#chapter-body {
  min-height: 360px;
  font-family: var(--font-mono);
  line-height: 1.6;
}

.syntax-tips {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(72, 105, 95, 0.08);
  border: 1px solid rgba(72, 105, 95, 0.16);
  color: var(--muted);
  font-size: 0.95rem;
}

.syntax-tips p {
  margin: 0;
}

.chapter-annotation-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(140, 75, 54, 0.16);
}

.chapter-annotation-list {
  display: grid;
  gap: 12px;
}

.chapter-annotation-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.chapter-annotation-card.is-active {
  border-color: rgba(140, 75, 54, 0.42);
  box-shadow: 0 0 0 1px rgba(140, 75, 54, 0.14);
  background: rgba(255, 250, 245, 0.88);
}

.chapter-annotation-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.chapter-annotation-card__eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chapter-annotation-card__top h4 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.05;
}

.chapter-annotation-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chapter-annotation-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-board {
  gap: 18px;
}

.review-board__filters {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.8fr);
  gap: 14px;
}

.review-board-list {
  display: grid;
  gap: 14px;
}

.review-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 242, 233, 0.72)),
    linear-gradient(135deg, rgba(140, 75, 54, 0.06), rgba(72, 105, 95, 0.03));
}

.review-card.is-active {
  border-color: rgba(140, 75, 54, 0.42);
  box-shadow: 0 0 0 1px rgba(140, 75, 54, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.92), rgba(250, 242, 233, 0.86)),
    linear-gradient(135deg, rgba(140, 75, 54, 0.1), rgba(72, 105, 95, 0.04));
}

.review-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.review-card__top h4 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.02;
}

.review-card__chapter {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.review-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.review-card__excerpt,
.review-card__note {
  margin: 0;
  line-height: 1.72;
}

.review-card__excerpt {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(72, 105, 95, 0.08);
  border: 1px solid rgba(72, 105, 95, 0.14);
  color: #31413c;
}

.review-card__note {
  color: #24342f;
}

.review-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-error {
  color: #9d2d2d;
  min-height: 1.4em;
}

[hidden] {
  display: none !important;
}

[data-reveal] {
  animation: rise-in 600ms ease both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1140px) {
  .hero-section,
  .featured-panel,
  .reader-shell,
  .studio-grid,
  .chapter-layout {
    grid-template-columns: 1fr;
  }

  .reader-sidebar,
  .studio-sidebar,
  .studio-preview {
    position: static;
  }
}

@media (max-width: 900px) {
  .feature-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .book-card__footer,
  .site-footer,
  .status-bar,
  .studio-sidebar__top,
  .form-section__header,
  .preview-topline {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header,
  .site-footer,
  .hero-section,
  .feature-section,
  .library-section,
  .featured-section,
  .reader-shell,
  .studio-shell {
    width: min(100vw - 24px, 100%);
  }

  .paper-surface,
  .reader-sidebar__card,
  .toc-panel,
  .feature-card,
  .book-card,
  .featured-panel,
  .status-bar,
  .studio-sidebar,
  .studio-preview {
    border-radius: 22px;
  }

  .hero-book__cover {
    padding: 24px;
  }

  .chapter-header h1,
  .reader-sidebar__card h1,
  .section-heading h2,
  .hero-copy h1,
  .auth-view h1 {
    line-height: 1;
  }
}

.toc-panel__top {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.toc-search {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
  padding: 11px 14px;
  color: var(--ink);
}

.toc-empty {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.reader-progress {
  display: grid;
  gap: 8px;
  min-width: min(240px, 100%);
}

.reader-progress__track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(29, 42, 38, 0.08);
  border: 1px solid rgba(29, 42, 38, 0.08);
}

.reader-progress__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-green));
  transition: width 160ms ease;
}

.reader-progress__label {
  justify-self: end;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-bar__secondary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.studio-cover {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}

.studio-cover__book {
  min-height: 140px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  color: #fff7ef;
  font-weight: 700;
  letter-spacing: 0.14em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.studio-cover__meta h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

.studio-cover__meta p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

.snippet-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.snippet-button {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
}

.empty-state {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  color: var(--muted);
}

.book-list__item strong,
.chapter-list__item strong {
  display: block;
}

.is-disabled {
  opacity: 0.48;
  pointer-events: none;
}

.table-wrap {
  margin: 2rem 0;
  overflow-x: auto;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.rich-copy table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.rich-copy th,
.rich-copy td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.rich-copy th {
  font-weight: 600;
  background: rgba(72, 105, 95, 0.08);
}

.rich-copy tbody tr:last-child td {
  border-bottom: 0;
}

.callout {
  margin: 2rem 0;
  padding: 20px 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.callout--note {
  border-color: rgba(72, 105, 95, 0.18);
  background: rgba(72, 105, 95, 0.08);
}

.callout--warning {
  border-color: rgba(140, 75, 54, 0.24);
  background: rgba(140, 75, 54, 0.08);
}

.callout--definition {
  border-color: rgba(29, 42, 38, 0.18);
  background: rgba(29, 42, 38, 0.06);
}

.callout--insight {
  border-color: rgba(97, 76, 50, 0.22);
  background: rgba(214, 187, 127, 0.16);
}

.callout__eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.callout__title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
}

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

.callout__body > :last-child {
  margin-bottom: 0;
}

.academic-block {
  --academic-accent: rgba(72, 105, 95, 0.82);
  margin: 2rem 0;
  padding: 22px 24px 18px;
  border-radius: 28px;
  border: 1px solid rgba(29, 42, 38, 0.12);
  border-inline-start: 6px solid var(--academic-accent);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.64));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.academic-block--theorem,
.academic-block--proposition,
.academic-block--lemma,
.academic-block--corollary {
  --academic-accent: rgba(72, 105, 95, 0.82);
}

.academic-block--definition {
  --academic-accent: rgba(140, 75, 54, 0.82);
  background: linear-gradient(180deg, rgba(255, 248, 241, 0.88), rgba(255, 255, 255, 0.66));
}

.academic-block--example {
  --academic-accent: rgba(214, 187, 127, 0.92);
  background: linear-gradient(180deg, rgba(255, 251, 243, 0.9), rgba(255, 255, 255, 0.68));
}

.academic-block--remark {
  --academic-accent: rgba(97, 76, 50, 0.72);
  background: linear-gradient(180deg, rgba(250, 246, 238, 0.9), rgba(255, 255, 255, 0.68));
}

.academic-block--figure {
  --academic-accent: rgba(56, 92, 136, 0.82);
  background: linear-gradient(180deg, rgba(244, 249, 255, 0.9), rgba(255, 255, 255, 0.68));
}

.academic-block--table {
  --academic-accent: rgba(84, 88, 122, 0.8);
  background: linear-gradient(180deg, rgba(245, 246, 252, 0.9), rgba(255, 255, 255, 0.68));
}

.academic-block--equation {
  --academic-accent: rgba(108, 73, 118, 0.78);
  background: linear-gradient(180deg, rgba(250, 246, 252, 0.9), rgba(255, 255, 255, 0.68));
}

.academic-block--proof {
  --academic-accent: rgba(29, 42, 38, 0.72);
  background: linear-gradient(180deg, rgba(246, 242, 235, 0.88), rgba(255, 255, 255, 0.66));
}

.academic-block__header {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.academic-block__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.academic-block__eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
}

.academic-block__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.1;
}

.academic-block__anchor {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-decoration: none;
}

.academic-block__anchor:hover,
.academic-block__anchor:focus-visible {
  color: var(--accent);
}

.academic-block__body > :first-child {
  margin-top: 0;
}

.academic-block__body > :last-child {
  margin-bottom: 0;
}

.academic-block--figure .academic-block__body figure,
.academic-block--table .academic-block__body .table-wrap,
.academic-block--equation .academic-block__body .math-block {
  margin: 0;
}

.academic-block__qed {
  margin: 1rem 0 0;
  text-align: right;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
}

.academic-ref {
  color: var(--accent-green);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.academic-ref--definition,
.academic-ref--example {
  color: var(--accent);
}

.academic-ref--figure,
.academic-ref--table,
.academic-ref--equation {
  color: #35526f;
}

.academic-ref--proof,
.academic-ref--remark {
  color: var(--ink);
}

.academic-ref:hover,
.academic-ref:focus-visible {
  color: var(--accent);
}

.academic-ref--missing {
  color: var(--muted);
  border-bottom-style: dashed;
}

@media (max-width: 640px) {
  .academic-block {
    padding: 18px 18px 16px;
  }

  .academic-block__meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .studio-cover {
    grid-template-columns: 1fr;
  }

  .snippet-bar {
    gap: 8px;
  }
}

button:disabled,
input:disabled,
textarea:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.asset-panel {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 18px;
}

.asset-upload {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
}

.asset-upload__actions {
  justify-content: space-between;
}

.asset-grid {
  display: grid;
  gap: 14px;
}

.asset-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
}

.asset-card__thumb {
  width: 92px;
  height: 92px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.asset-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-card__body {
  min-width: 0;
}

.asset-card__body h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.asset-card__body p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.asset-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.asset-card__link {
  text-decoration: none;
}

#site-hero-title,
#site-hero-lead,
#site-footer-note {
  transition: opacity 180ms ease;
}

@media (max-width: 900px) {
  .asset-card {
    grid-template-columns: 1fr;
  }

  .asset-card__thumb {
    width: 100%;
    height: 180px;
  }
}

.cover-picker-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cover-picker-row input {
  flex: 1 1 auto;
}

.field-help {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.book-card__cover,
.featured-book__cover,
.reader-book-card__cover {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--book-accent, var(--accent)), #24342f);
  color: #fff7ef;
}

.book-card__cover,
.featured-book__cover,
.reader-book-card__cover,
.studio-cover__book {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.book-card__cover img,
.featured-book__cover img,
.reader-book-card__cover img,
.studio-cover__book img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-panel__hero {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.featured-book__cover {
  width: 120px;
  aspect-ratio: 3 / 4.2;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.reader-book-card__cover {
  width: min(100%, 220px);
  aspect-ratio: 3 / 4.2;
  margin-bottom: 18px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.history-panel {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
}

.history-list {
  display: grid;
  gap: 12px;
}

.revision-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
}

.revision-card h4 {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1;
}

.revision-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.revision-card__actions {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.revision-card__actions small {
  color: var(--muted);
  line-height: 1.5;
}

.snippet-button.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #f6f0e7;
}

.asset-card.is-cover {
  border-color: rgba(140, 75, 54, 0.28);
  background: rgba(140, 75, 54, 0.08);
}

@media (max-width: 900px) {
  .cover-picker-row,
  .revision-card__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .featured-panel__hero {
    grid-template-columns: 1fr;
  }

  .featured-book__cover,
  .reader-book-card__cover {
    width: min(220px, 100%);
  }
}

.field select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.7);
  padding: 12px 14px;
  color: var(--ink);
}

.field select:focus {
  outline: 2px solid rgba(140, 75, 54, 0.15);
  border-color: rgba(140, 75, 54, 0.42);
}

.field--checkbox {
  justify-content: end;
}

.toggle-row {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 0 2px;
  color: var(--ink);
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.reader-controls {
  display: grid;
  gap: 14px;
}

.reader-controls__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reader-controls__top h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1;
}

.reader-controls__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.reader-controls__toggle {
  width: 100%;
}

#reader-paper-surface {
  --reader-copy-scale: 1;
}

#reader-paper-surface .rich-copy {
  font-size: calc(1.08rem * var(--reader-copy-scale));
}

.reader-page--focus #reader-paper-surface {
  max-width: 860px;
  margin-inline: auto;
}

.footnote-ref {
  margin-left: 0.18rem;
  font-size: 0.78em;
  vertical-align: super;
}

.footnote-ref a,
.footnote-backlink {
  color: var(--accent);
}

.footnotes {
  margin-top: 3rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}

.footnotes h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1;
}

.footnotes ol {
  margin: 0;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.9rem;
}

.footnotes li {
  padding-left: 0.25rem;
  color: var(--muted);
}

.footnotes li > div > :first-child {
  margin-top: 0;
}

.footnotes li > div > :last-child {
  margin-bottom: 0;
}

.footnote-backlink {
  display: inline-flex;
  margin-top: 0.45rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  .reader-controls__row,
  .toggle-row {
    flex-wrap: wrap;
  }
}


@media (max-width: 900px) {
  .library-controls__top {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .library-controls {
    padding: 18px;
  }
}


.toc-panel__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.reader-share {
  display: grid;
  gap: 14px;
}

.reader-share__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.reader-share__top h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1;
}

.reader-share__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.reader-share__preview,
.reader-share__status {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.reader-share__preview {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
}

.toc-button--outline {
  align-items: flex-start;
}

.toc-button__title {
  display: block;
  font-weight: 600;
}

.toc-list--academic {
  gap: 8px;
}

.toc-button--academic {
  position: relative;
  padding-inline-start: 18px;
  border-left: 4px solid rgba(72, 105, 95, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.5));
}

.toc-button--academic.academic-type-definition {
  border-left-color: rgba(140, 75, 54, 0.42);
}

.toc-button--academic.academic-type-figure,
.toc-button--academic.academic-type-table,
.toc-button--academic.academic-type-equation {
  border-left-color: rgba(56, 92, 136, 0.42);
}

.toc-button--academic.academic-type-proof,
.toc-button--academic.academic-type-remark {
  border-left-color: rgba(29, 42, 38, 0.28);
}

.reader-academic__ref {
  display: block;
  font-weight: 700;
}

.reader-academic__title {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.55;
}

.reader-annotations {
  display: grid;
  gap: 14px;
}

.reader-annotation-list {
  display: grid;
  gap: 12px;
}

.reader-annotation-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.reader-annotation-card:hover,
.reader-annotation-card:focus-within {
  transform: translateY(-1px);
  border-color: rgba(140, 75, 54, 0.24);
}

.reader-annotation-card.is-active {
  border-color: rgba(140, 75, 54, 0.32);
  background: rgba(140, 75, 54, 0.08);
}

.reader-annotation-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.reader-annotation-card__eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.reader-annotation-card__top h3 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.05;
}

.reader-annotation-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reader-annotation-card__excerpt {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(140, 75, 54, 0.16);
  background: rgba(140, 75, 54, 0.08);
  color: var(--muted);
  line-height: 1.7;
}

.reader-annotation-card__body {
  margin-top: 14px;
  color: #31413c;
  line-height: 1.75;
}

.reader-annotation-card__body > :first-child {
  margin-top: 0;
}

.reader-annotation-card__body > :last-child {
  margin-bottom: 0;
}

.reader-annotation-card__body p,
.reader-annotation-card__body li,
.reader-annotation-card__body blockquote {
  max-width: none;
}

.reader-annotation-card__actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.reader-annotation-card__actions .snippet-button[disabled] {
  opacity: 0.56;
  cursor: not-allowed;
}

.reader-context {
  display: grid;
  gap: 14px;
}

.reader-context__index {
  display: grid;
  gap: 8px;
}

.reader-context-chip {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.reader-context-chip:hover,
.reader-context-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(140, 75, 54, 0.24);
}

.reader-context-chip.is-active {
  border-color: rgba(140, 75, 54, 0.32);
  background: rgba(140, 75, 54, 0.08);
}

.reader-context-chip.context-type-reference {
  border-left: 4px solid rgba(72, 105, 95, 0.38);
}

.reader-context-chip.context-type-note {
  border-left: 4px solid rgba(140, 75, 54, 0.34);
}

.reader-context-chip__label {
  display: block;
  font-weight: 700;
}

.reader-context-chip small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.reader-context__detail {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
}

.reader-context__index:empty,
.reader-context__detail:empty {
  display: none;
}

.reader-context-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.reader-context-card__eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
}

.reader-context-card__top h3 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.05;
}

.reader-context-card__body {
  margin-top: 14px;
  color: #31413c;
  line-height: 1.75;
}

.reader-context-card__body > :first-child {
  margin-top: 0;
}

.reader-context-card__body > :last-child {
  margin-bottom: 0;
}

.reader-context-card__body .footnote-backlink,
.reader-context-card__body .reference-backlink,
.reader-context-card__body .footnotes,
.reader-context-card__body .references {
  display: none;
}

.reader-context-card--note {
  border-left: 4px solid rgba(140, 75, 54, 0.28);
  padding-left: 12px;
}

.reader-context-card--reference {
  border-left: 4px solid rgba(72, 105, 95, 0.28);
  padding-left: 12px;
}

@media (max-width: 900px) {
  .chapter-annotation-card__top,
  .review-card__top,
  .review-card__meta,
  .review-card__actions,
  .reader-annotation-card__top,
  .reader-annotation-card__meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .chapter-annotation-card__grid,
  .review-board__filters {
    grid-template-columns: 1fr;
  }

  .reader-context-card__top {
    flex-direction: column;
    align-items: stretch;
  }
}

.toc-button--outline.depth-3 {
  padding-left: 24px;
}

.toc-button--outline.depth-4 {
  padding-left: 34px;
}

.rich-copy .content-heading {
  position: relative;
  scroll-margin-top: 120px;
}

.heading-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.45rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68em;
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  transform: translateY(-0.04em);
}

.rich-copy .content-heading:hover .heading-anchor,
.rich-copy .content-heading:focus-within .heading-anchor {
  opacity: 1;
}

@media (max-width: 900px) {
  .reader-share__top,
  .reader-share__actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .heading-anchor {
    opacity: 1;
  }
}


.citation-ref {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  color: var(--accent-green);
  font-size: 0.94em;
  white-space: nowrap;
}

.citation-ref a {
  color: inherit;
  font-weight: 600;
}

.references {
  margin-top: 3rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}

.references h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1;
}

.references__list {
  margin: 0;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.9rem;
}

.references__list li {
  padding-left: 0.25rem;
  color: var(--muted);
}

.references__list li > div > :first-child {
  margin-top: 0;
}

.references__list li > div > :last-child {
  margin-bottom: 0;
}

.reference-backlink {
  display: inline-flex;
  margin-top: 0.45rem;
  font-weight: 600;
  color: var(--accent-green);
}

.glossary-list {
  display: grid;
  gap: 12px;
}

.glossary-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.glossary-card.is-active {
  border-color: rgba(140, 75, 54, 0.32);
  background: rgba(140, 75, 54, 0.08);
  box-shadow: inset 0 0 0 1px rgba(140, 75, 54, 0.08);
}

.glossary-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.glossary-card__title {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1;
  text-align: left;
}

.glossary-card__aliases {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.glossary-card__definition {
  margin-top: 14px;
  color: #31413c;
  line-height: 1.75;
}

.glossary-card__definition > :first-child {
  margin-top: 0;
}

.glossary-card__definition > :last-child {
  margin-bottom: 0;
}

.glossary-card__definition p,
.glossary-card__definition li,
.glossary-card__definition blockquote {
  max-width: none;
}

.glossary-card__definition .footnotes,
.glossary-card__definition .references {
  display: none;
}

.glossary-term {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0.08rem;
  padding: 0.12rem 0.56rem;
  border-radius: 999px;
  border: 1px solid rgba(140, 75, 54, 0.18);
  background: rgba(140, 75, 54, 0.08);
  color: var(--accent);
  font: inherit;
  font-size: 0.92em;
  line-height: 1.45;
  vertical-align: baseline;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.glossary-term:hover,
.glossary-term:focus-visible {
  background: rgba(140, 75, 54, 0.14);
  border-color: rgba(140, 75, 54, 0.32);
  transform: translateY(-1px);
}

.glossary-term--missing {
  border-style: dashed;
  background: rgba(29, 42, 38, 0.06);
  border-color: rgba(29, 42, 38, 0.18);
  color: var(--muted);
  cursor: help;
}

@media (max-width: 900px) {
  .glossary-card__top {
    flex-direction: column;
    align-items: flex-start;
  }
}

.reader-search {
  display: grid;
  gap: 14px;
}

.reader-search__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.reader-search__top h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1;
}

.reader-search__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.reader-search__hint code {
  font-family: var(--font-mono);
  padding: 0.14rem 0.34rem;
  border-radius: 6px;
  background: rgba(30, 40, 35, 0.08);
}

.reader-search__results {
  display: grid;
  gap: 10px;
}

.reader-search-result {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.reader-search-result:hover,
.reader-search-result:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(140, 75, 54, 0.24);
}

.reader-search-result.is-active {
  border-color: rgba(140, 75, 54, 0.32);
  background: rgba(140, 75, 54, 0.08);
}

.reader-search-result__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.reader-search-result__top strong {
  font-size: 1rem;
  line-height: 1.4;
}

.reader-search-result__snippet {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.reader-search-snippet-highlight,
.reader-search-highlight {
  padding: 0 0.08rem;
  border-radius: 4px;
  background: rgba(214, 187, 127, 0.38);
  color: var(--ink);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.reader-search-highlight[data-search-primary="true"] {
  background: rgba(140, 75, 54, 0.24);
}

@media (max-width: 900px) {
  .reader-search__top,
  .reader-search-result__top {
    flex-direction: column;
    align-items: stretch;
  }
}

.field--wide {
  grid-column: 1 / -1;
}

.book-card__scholar,
.featured-panel__scholar,
.studio-cover__scholar {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.book-card__scholar:empty,
.featured-panel__scholar:empty,
.studio-cover__scholar:empty {
  display: none;
}

.reader-book-details {
  display: grid;
  gap: 16px;
}

.reader-book-details h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

.reader-book-details__grid {
  display: grid;
  gap: 12px;
}

.reader-book-details__row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
}

.reader-book-details__label {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-book-details__value {
  min-width: 0;
  word-break: break-word;
}

.reader-book-details__value a {
  color: var(--accent);
  font-weight: 600;
}

.reader-book-details__chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reader-book-details__empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reader-book-details__citation {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(72, 105, 95, 0.08);
  border: 1px solid rgba(72, 105, 95, 0.16);
}

.reader-book-details__citation p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reader-book-details__citation .eyebrow {
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .reader-book-details__row {
    grid-template-columns: 1fr;
  }
}
.readiness-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.readiness-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.readiness-card small {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.readiness-card strong {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

.readiness-card--error {
  border-color: rgba(157, 45, 45, 0.22);
  background: rgba(157, 45, 45, 0.08);
}

.readiness-card--warning {
  border-color: rgba(140, 75, 54, 0.22);
  background: rgba(140, 75, 54, 0.08);
}

.readiness-card--success {
  border-color: rgba(72, 105, 95, 0.22);
  background: rgba(72, 105, 95, 0.08);
}

.readiness-card--info {
  border-color: rgba(35, 45, 41, 0.18);
  background: rgba(255, 255, 255, 0.58);
}

.readiness-list {
  display: grid;
  gap: 12px;
}

.readiness-item {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.readiness-item__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.readiness-item__top h4 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.04;
}

.readiness-item__meta,
.readiness-item__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.readiness-item__detail {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.readiness-item--error {
  border-color: rgba(157, 45, 45, 0.24);
  background: rgba(255, 245, 244, 0.9);
}

.readiness-item--warning {
  border-color: rgba(140, 75, 54, 0.2);
  background: rgba(255, 250, 245, 0.9);
}

.readiness-item--success {
  border-color: rgba(72, 105, 95, 0.2);
  background: rgba(245, 251, 248, 0.92);
}

.book-overview {
  display: grid;
  gap: 20px;
}

.book-overview__lead,
.book-overview__toc,
.book-overview__group {
  display: grid;
  gap: 16px;
}

.book-overview__stats,
.book-overview__chapter-meta,
.book-overview__resume-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.book-overview__resume {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(72, 105, 95, 0.18);
  background: linear-gradient(135deg, rgba(72, 105, 95, 0.12), rgba(255, 255, 255, 0.72));
}

.book-overview__resume-copy h3,
.book-overview__group-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

.book-overview__resume-copy p,
.book-overview__citation p,
.book-overview__chapter-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.book-overview__citation {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(72, 105, 95, 0.16);
  background: rgba(72, 105, 95, 0.08);
}

.book-overview__group {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.book-overview__group-list {
  display: grid;
  gap: 12px;
}

.book-overview__chapter {
  width: 100%;
  text-align: left;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.book-overview__chapter:hover,
.book-overview__chapter:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(140, 75, 54, 0.24);
  background: rgba(255, 250, 245, 0.92);
}

.book-overview__chapter-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.book-overview__chapter-meta {
  justify-content: flex-end;
}

.book-overview__chapter-title {
  display: block;
  font-size: 1.16rem;
  line-height: 1.45;
}

.book-overview__empty {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}

.chapter-navigation__home {
  background: linear-gradient(135deg, rgba(72, 105, 95, 0.14), rgba(255, 255, 255, 0.72));
}

.reader-book-details__contributors {
  display: grid;
  gap: 10px;
}

.reader-contributor {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.reader-contributor__name,
.reader-contributor__link {
  font-weight: 700;
}

.reader-contributor__link {
  color: var(--accent);
}

.reader-contributor__meta {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .readiness-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-overview__resume,
  .book-overview__chapter-top,
  .book-overview__chapter-meta,
  .readiness-item__top {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .readiness-overview {
    grid-template-columns: 1fr;
  }
}

:root {
  --shell-bg: #0f1518;
  --shell-bg-raised: #161f23;
  --shell-ink: #f3e7d6;
  --paper-solid: #f4ecdf;
  --paper-elevated: #fbf6ee;
  --paper-muted: #e4d8c4;
  --ink: #201914;
  --muted: #63574d;
  --line: rgba(67, 52, 39, 0.16);
  --line-strong: rgba(67, 52, 39, 0.28);
  --accent: #9d5437;
  --accent-soft: rgba(157, 84, 55, 0.14);
  --accent-green: #5c7167;
  --state-success: #4f7465;
  --state-warning: #b57e48;
  --font-display: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --font-ui: "Noto Sans SC", "Segoe UI", sans-serif;
  --font-body: var(--font-ui);
  --font-reading: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-display: 32px;
  --section-gap: clamp(36px, 5vw, 84px);
  --shadow: 0 28px 80px rgba(6, 10, 12, 0.2);
}

body {
  color: var(--ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at top left, rgba(157, 84, 55, 0.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(92, 113, 103, 0.16), transparent 24%),
    linear-gradient(180deg, #e6ddcf 0%, #d9cfbf 100%);
}

.background-noise {
  opacity: 0.18;
  background-size: 34px 34px;
}

.landing-page {
  background:
    radial-gradient(circle at top left, rgba(157, 84, 55, 0.22), transparent 26%),
    linear-gradient(180deg, #11181b 0%, #172126 24%, #d8cdbd 24%, #e9dfd1 100%);
}

.reader-page,
.studio-page {
  color: var(--shell-ink);
  background:
    radial-gradient(circle at top left, rgba(157, 84, 55, 0.18), transparent 20%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(180deg, #101517 0%, #172126 100%);
}

.paper-surface {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.88), rgba(244, 236, 223, 0.98));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(28, 20, 16, 0.08);
  backdrop-filter: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 6px 11px;
  border: 1px solid rgba(67, 52, 39, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 0.83rem;
  letter-spacing: 0.03em;
}

.button {
  min-height: 44px;
  padding: 11px 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.button--ghost {
  background: transparent;
  border-color: var(--line-strong);
}

.button--secondary {
  background: var(--accent-green);
}

.snippet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.9);
  color: var(--ink);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.snippet-button:hover,
.snippet-button:focus-visible,
.button:hover,
.button:focus-visible,
.filter-chip:hover,
.filter-chip:focus-visible,
.book-list__item:hover,
.book-list__item:focus-visible,
.chapter-list__item:hover,
.chapter-list__item:focus-visible,
.toc-button:hover,
.toc-button:focus-visible,
.reader-panel-tab:hover,
.reader-panel-tab:focus-visible,
.studio-editor-tab:hover,
.studio-editor-tab:focus-visible,
.studio-inspector-tab:hover,
.studio-inspector-tab:focus-visible {
  transform: translateY(-1px);
}

.snippet-button.is-active,
.studio-editor-tab.is-active,
.studio-inspector-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #f6eee3;
}

.field {
  display: grid;
  gap: 8px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffbf6;
  color: var(--ink);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(157, 84, 55, 0.42);
  box-shadow: 0 0 0 3px rgba(157, 84, 55, 0.12);
}

.site-header,
.site-footer {
  position: relative;
  z-index: 2;
}

.site-header--landing,
.site-footer,
.landing-main {
  width: min(1240px, calc(100vw - 40px));
  margin: 0 auto;
}

.site-header--reader,
.site-header--studio,
.reader-shell,
.studio-shell {
  width: min(1480px, calc(100vw - 40px));
  margin: 0 auto;
}

.landing-main,
.studio-shell {
  padding-bottom: 72px;
}

.brand-mark strong {
  letter-spacing: 0.12em;
}

.landing-page .site-header,
.landing-page .site-footer,
.landing-page .brand-mark,
.landing-page .site-nav a {
  color: #f5ead9;
}

.landing-page .brand-mark small,
.landing-page .site-footer p,
.landing-page .site-footer a,
.landing-page .site-nav a:not(.button),
.reader-page .brand-mark small,
.reader-page .site-nav a:not(.button),
.studio-page .brand-mark small,
.studio-page .site-nav a:not(.button) {
  color: rgba(243, 231, 214, 0.74);
}

.landing-page .button--ghost,
.reader-page .button--ghost,
.studio-page .button--ghost {
  color: var(--shell-ink);
  border-color: rgba(243, 231, 214, 0.18);
}

.landing-page .button--ghost {
  color: #f5ead9;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0 56px;
}

.landing-main {
  display: grid;
  gap: var(--section-gap);
}

.hero-section--poster {
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  gap: 52px;
  align-items: stretch;
  padding: 10px 0 0;
}

.hero-ledger {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 24px;
  align-content: start;
  min-height: 620px;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 36px;
  background:
    radial-gradient(circle at 18% 18%, rgba(157, 84, 55, 0.28), transparent 28%),
    linear-gradient(180deg, rgba(16, 22, 24, 0.95), rgba(22, 31, 35, 0.94));
  box-shadow: var(--shadow);
}

.hero-ledger .eyebrow,
.hero-ledger .hero-copy__lead,
.hero-ledger .hero-copy__kicker,
.hero-ledger .hero-fact dt {
  color: rgba(243, 231, 214, 0.72);
}

.hero-ledger h1 {
  margin: 0;
  max-width: 10ch;
  color: #fff6ea;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 7vw, 6.3rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.hero-copy__kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy__lead {
  max-width: 42rem;
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.92;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: auto 0 0;
}

.hero-fact {
  display: grid;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-fact dt {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-fact dd {
  margin: 0;
  color: #fff8ef;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1;
}

.hero-book__showcase {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  gap: 24px;
  min-height: 620px;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(19, 26, 29, 0.92), rgba(13, 18, 20, 0.9));
}

.hero-stage__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 28%, rgba(157, 84, 55, 0.3), transparent 26%),
    radial-gradient(circle at 46% 58%, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 55%);
}

.hero-book__render,
.hero-book__content {
  position: relative;
  z-index: 1;
}

.hero-book__render {
  display: grid;
  place-items: center;
  min-height: 380px;
}

.book-cover {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  aspect-ratio: 3 / 4.2;
  padding: 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.34)),
    linear-gradient(145deg, var(--cover-accent, #9d5437), #1b1513 82%);
  color: #fff6ea;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.26);
}

.book-cover--image {
  padding: 0;
  background: #201714;
}

.book-cover--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-cover__foil {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 246, 234, 0.24);
  border-radius: 18px;
}

.book-cover__label {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.book-cover__title {
  position: relative;
  z-index: 1;
  display: block;
  align-self: end;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 0.96;
}

.book-cover__subtitle {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 10px;
  color: rgba(255, 246, 234, 0.76);
  font-size: 0.92rem;
  line-height: 1.6;
}

.hero-book__render .book-cover {
  width: min(100%, 360px);
  transform: rotate(-6deg);
}

.hero-book__content {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(13, 18, 20, 0.84), rgba(13, 18, 20, 0.62));
  color: #f4e8d8;
}

.hero-book__meta h2 {
  margin: 0;
  color: #fff6ea;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.96;
}

.hero-book__caption {
  margin: 12px 0 0;
  color: rgba(244, 232, 216, 0.8);
  line-height: 1.8;
}

.featured-section,
.library-section,
.feature-section {
  display: grid;
  gap: 20px;
}

.section-heading {
  max-width: 52rem;
}

.section-heading h2 {
  margin: 0;
  color: #221a15;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.96;
}

.section-heading p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.82;
}

.featured-panel {
  display: grid;
  gap: 22px;
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(251, 246, 238, 0.98), rgba(241, 232, 216, 0.96));
  box-shadow: 0 20px 56px rgba(28, 20, 16, 0.08);
}

.featured-panel__hero {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.featured-panel__rail {
  display: grid;
  gap: 14px;
}

.featured-panel__rail .book-cover {
  width: min(100%, 300px);
}

.featured-panel__content h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3.1rem);
  line-height: 0.98;
}

.featured-panel__content p,
.featured-panel__scholar {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.82;
}

.featured-panel__chapters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.featured-panel__chapter {
  display: grid;
  gap: 8px;
  min-height: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.featured-panel__chapter small {
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.featured-panel__chapter strong {
  font-size: 1.06rem;
  line-height: 1.5;
}

.featured-panel__chapter span {
  color: var(--muted);
  line-height: 1.7;
}

.featured-panel--empty .featured-panel__empty {
  display: grid;
  gap: 16px;
}

.library-section__top {
  display: block;
}

.library-intro {
  max-width: 52rem;
}

.library-controls {
  padding: 24px;
}

.library-controls__top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
}

.library-search {
  display: grid;
  gap: 8px;
  width: min(100%, 480px);
}

.library-search__input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf4;
}

.library-tag-filter,
.book-card__meta,
.book-card__tag-row,
.featured-panel__meta,
.review-card__meta,
.review-card__actions,
.preview-summary,
.chapter-annotation-card__meta,
.revision-card__meta,
.asset-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.library-results-summary {
  margin: 18px 0 0;
  color: var(--muted);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #f6eee3;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.book-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  min-height: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(252, 247, 239, 0.98), rgba(244, 236, 223, 0.96));
  box-shadow: 0 16px 40px rgba(28, 20, 16, 0.08);
}

.book-card--featured {
  background: linear-gradient(180deg, #f9f2e7, #efe3d0);
  border-color: rgba(157, 84, 55, 0.24);
}

.book-card__cover-link .book-cover {
  width: 100%;
  transition: transform 180ms ease;
}

.book-card__cover-link:hover .book-cover,
.book-card__cover-link:focus-visible .book-cover {
  transform: translateY(-4px);
}

.book-card__topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.book-card__topline .eyebrow {
  margin-bottom: 0;
}

.book-card__stamp {
  color: var(--muted);
  font-size: 0.82rem;
}

.book-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 0.98;
}

.book-card__subtitle,
.book-card__scholar,
.book-card__summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.76;
}

.book-card__footer {
  display: grid;
  gap: 12px;
}

.book-card__link,
.feature-card a,
.featured-panel__chapter,
.featured-panel__content a {
  color: inherit;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  display: grid;
  gap: 12px;
  min-height: 100%;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(17, 24, 27, 0.96), rgba(20, 28, 31, 0.9));
  color: #f2e6d5;
}

.feature-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 0.98;
}

.feature-card p {
  margin: 0;
  color: rgba(242, 230, 213, 0.76);
  line-height: 1.8;
}

.reader-page .site-header,
.studio-page .site-header,
.reader-page .brand-mark,
.studio-page .brand-mark,
.reader-page .site-nav a,
.studio-page .site-nav a {
  color: var(--shell-ink);
}

.reader-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-bottom: 80px;
}

.reader-sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding-right: 4px;
}

.reader-sidebar__card {
  color: #efe3d2;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(24, 31, 35, 0.95), rgba(16, 22, 24, 0.92));
  box-shadow: none;
  padding: 20px;
}

.reader-sidebar__card h1,
.reader-sidebar__card h2,
.reader-sidebar__card h3,
.reader-sidebar__card strong {
  color: #fff7eb;
}

.reader-sidebar__card .eyebrow,
.reader-sidebar__card p,
.reader-sidebar__card small,
.reader-sidebar__card label,
.reader-sidebar__card .toc-panel__note,
.reader-sidebar__card .reader-toolbox__note {
  color: rgba(239, 227, 210, 0.74);
}

.reader-sidebar__card .pill,
.reader-page .chapter-topline .pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 245, 232, 0.8);
}

.reader-sidebar__card .toc-search {
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff5e8;
}

.reader-sidebar__card .toc-search::placeholder {
  color: rgba(255, 245, 232, 0.48);
}

.reader-book-card__divider {
  height: 1px;
  margin: 18px 0;
  background: rgba(255, 255, 255, 0.1);
}

.reader-panel-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.reader-panel-tab {
  min-height: 40px;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 245, 232, 0.72);
}

.reader-panel-tab.is-active {
  background: var(--accent);
  border-color: transparent;
  color: #fff5ec;
}

.reader-panel-stack,
.reader-panel,
.reader-tool__body {
  display: grid;
  gap: 14px;
}

.reader-panel {
  margin-top: 18px;
}

.reader-tool {
  padding: 0;
  overflow: hidden;
}

.reader-tool__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 600;
}

.reader-tool__summary::-webkit-details-marker {
  display: none;
}

.reader-tool[open] .reader-tool__summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.reader-tool__body {
  padding: 18px 20px 20px;
}

.reader-page .toc-button,
.reader-page .reader-search-result,
.reader-page .reader-context-chip,
.reader-page .glossary-card,
.reader-page .reader-context-card,
.reader-page .reader-annotation-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff5e8;
  box-shadow: none;
}

.reader-page .toc-button small,
.reader-page .reader-search-result__snippet,
.reader-page .glossary-card__aliases,
.reader-page .reader-annotation-card__excerpt,
.reader-page .reader-context-chip small,
.reader-page .reader-context-card__eyebrow,
.reader-page .reader-context-card__body,
.reader-page .reader-annotation-card__body {
  color: rgba(255, 245, 232, 0.72);
}

.reader-page .glossary-card__definition,
.reader-page .reader-context-card__body,
.reader-page .reader-annotation-card__body {
  color: #f7ecdf;
}

.reader-page .glossary-card__definition a,
.reader-page .reader-context-card__body a {
  color: #ffd8bf;
}

.reader-main {
  min-width: 0;
  display: grid;
  gap: 18px;
  justify-items: center;
}

.chapter-topline {
  width: min(100%, 940px);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.chapter-topline__copy {
  display: grid;
  gap: 10px;
}

.chapter-topline__copy .eyebrow {
  margin-bottom: 0;
  color: rgba(243, 231, 214, 0.68);
}

.chapter-topline__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reader-progress {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.reader-progress__track {
  width: 180px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.reader-progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #c77e57, #efc19f);
}

.reader-progress__label {
  color: rgba(243, 231, 214, 0.74);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.paper-surface--reader {
  width: min(100%, 940px);
  padding: clamp(28px, 5vw, 54px);
  border-radius: 34px;
  background: linear-gradient(180deg, #faf4ea, #f2eadc);
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: 0 28px 88px rgba(0, 0, 0, 0.22);
  color: var(--ink);
}

.chapter-header {
  display: grid;
  gap: 18px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(67, 52, 39, 0.12);
  margin-bottom: 28px;
}

.chapter-header__top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.chapter-header__kicker {
  margin-bottom: 0;
}

.chapter-header h1 {
  max-width: 12ch;
  color: var(--ink);
  font-size: clamp(2.8rem, 5vw, 5rem);
}

.chapter-summary {
  max-width: 46rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.82;
}

.rich-copy {
  color: var(--ink);
  font-family: var(--font-reading);
  font-size: calc(1.08rem * var(--reader-copy-scale, 1));
  line-height: 1.95;
}

.rich-copy h2,
.rich-copy h3,
.rich-copy h4 {
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.02;
}

.rich-copy h2 {
  margin-top: 2.1em;
  margin-bottom: 0.6em;
  font-size: clamp(2rem, 3vw, 3rem);
}

.rich-copy h3 {
  margin-top: 1.7em;
  margin-bottom: 0.5em;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
}

.rich-copy p,
.rich-copy ul,
.rich-copy ol {
  margin-top: 0;
  margin-bottom: 1.25em;
}

.rich-copy blockquote {
  margin: 1.8em 0;
  padding: 6px 0 6px 18px;
  border-left: 3px solid var(--accent);
  color: #4d433c;
}

.callout,
.academic-block,
.table-wrap,
.footnotes,
.references {
  margin: 28px 0;
  padding: 20px 22px;
  border: 1px solid rgba(67, 52, 39, 0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 236, 223, 0.96));
  box-shadow: none;
}

.academic-block {
  border-left: 4px solid var(--accent);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.96rem;
}

.table-wrap th,
.table-wrap td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(67, 52, 39, 0.12);
}

.chapter-navigation {
  width: min(100%, 940px);
}

.reader-page--focus .reader-shell {
  grid-template-columns: minmax(0, 1fr);
}

.reader-page--focus .reader-sidebar {
  display: none;
}

.reader-page--focus .paper-surface--reader,
.reader-page--focus .chapter-topline,
.reader-page--focus .chapter-navigation {
  width: min(100%, 820px);
}

.studio-shell {
  display: grid;
  gap: 20px;
}

.auth-view {
  width: min(560px, 100%);
  margin: 30px auto 80px;
  padding: 32px;
  color: var(--ink);
}

.auth-view h1 {
  color: var(--ink);
}

.dashboard-view {
  display: grid;
  gap: 18px;
}

.studio-masthead {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  padding: 24px 28px;
}

.studio-masthead h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4vw, 4rem);
  line-height: 0.96;
}

.studio-masthead p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.studio-masthead__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.studio-workbench {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.studio-rail,
.studio-editor-shell,
.studio-inspector {
  display: grid;
  gap: 16px;
}

.studio-rail,
.studio-inspector {
  position: sticky;
  top: 16px;
  align-self: start;
}

.studio-sidebar,
.studio-inspector,
.studio-editor-shell .paper-surface {
  box-shadow: 0 16px 40px rgba(28, 20, 16, 0.08);
}

.studio-sidebar {
  padding: 20px;
}

.studio-sidebar__top,
.status-bar--studio,
.form-section__header,
.preview-topline {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.status-bar--studio,
.studio-inspector,
.studio-sidebar,
.studio-editor-panels > [data-studio-panel-id] {
  padding: 20px;
}

.status-bar__secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.studio-editor-tabs,
.studio-inspector-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.studio-editor-tab,
.studio-inspector-tab {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-weight: 600;
}

.studio-editor-panels {
  display: grid;
  gap: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.field--wide,
.field--full {
  grid-column: 1 / -1;
}

.chapter-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

.chapter-editor,
.asset-upload,
.chapter-annotation-panel,
.review-board,
.readiness-panel,
.studio-inspector__preview {
  display: grid;
  gap: 14px;
}

.book-list,
.chapter-list,
.review-board-list,
.readiness-list,
.history-list,
.asset-grid {
  display: grid;
  gap: 12px;
}

.book-list__item,
.chapter-list__item,
.review-card,
.revision-card,
.asset-card,
.chapter-annotation-card,
.readiness-item,
.readiness-card {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
  box-shadow: none;
}

.book-list__item.is-active,
.chapter-list__item.is-active,
.review-card.is-active,
.chapter-annotation-card.is-active,
.asset-card.is-cover {
  border-color: rgba(157, 84, 55, 0.26);
  background: #fff7ec;
}

.book-list__item small,
.chapter-list__item small,
.asset-card__body p,
.readiness-item__detail,
.revision-card small,
.review-card__excerpt,
.review-card__note {
  color: var(--muted);
  line-height: 1.72;
}

.studio-inspector {
  grid-template-rows: auto auto minmax(0, auto);
}

.studio-inspector__preview {
  padding-bottom: 6px;
}

.studio-cover {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.studio-cover__book {
  min-height: 200px;
  border-radius: 20px;
  overflow: hidden;
}

.studio-cover__book img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.studio-cover__meta h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 0.98;
}

.studio-cover__meta p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.74;
}

.preview-summary {
  margin: 0;
}

#preview-body {
  max-height: 460px;
  overflow: auto;
  padding-right: 8px;
}

.asset-card {
  overflow: hidden;
  padding: 0;
}

.asset-card__thumb {
  aspect-ratio: 16 / 10;
  background: #e8dcc9;
}

.asset-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-card__body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.asset-card__body h4,
.revision-card h4,
.review-card h4,
.readiness-item h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 0.98;
}

.readiness-card strong {
  color: var(--ink);
}

.readiness-card--error,
.readiness-item--error {
  border-color: rgba(144, 51, 35, 0.26);
  background: rgba(255, 243, 239, 0.96);
}

.readiness-card--warning,
.readiness-item--warning {
  border-color: rgba(181, 126, 72, 0.24);
  background: rgba(255, 249, 241, 0.96);
}

.readiness-card--success,
.readiness-item--success {
  border-color: rgba(79, 116, 101, 0.2);
  background: rgba(246, 251, 248, 0.96);
}

@media (max-width: 1240px) {
  .hero-section--poster,
  .featured-panel__hero {
    grid-template-columns: 1fr;
  }

  .book-grid,
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-panel__chapters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reader-shell {
    grid-template-columns: 1fr;
  }

  .reader-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reader-sidebar__masthead,
  .reader-sidebar__workspace {
    grid-column: 1 / -1;
  }

  .studio-workbench {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .studio-inspector {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .site-footer,
  .studio-masthead,
  .status-bar--studio,
  .form-section__header,
  .library-controls__top,
  .chapter-topline,
  .studio-sidebar__top {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-facts,
  .book-grid,
  .feature-grid,
  .featured-panel__chapters,
  .field-grid,
  .reader-sidebar,
  .studio-workbench,
  .chapter-layout {
    grid-template-columns: 1fr;
  }

  .reader-panel-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .studio-rail {
    position: static;
  }

  .studio-cover {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header,
  .landing-main,
  .reader-shell,
  .studio-shell,
  .site-footer {
    width: min(100vw - 24px, 100%);
  }

  .site-nav,
  .button-row,
  .status-bar__actions,
  .review-card__actions,
  .asset-card__actions,
  .book-card__meta,
  .featured-panel__meta,
  .chapter-topline__meta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-ledger,
  .hero-book__showcase,
  .featured-panel,
  .paper-surface--reader {
    border-radius: 24px;
  }

  .hero-ledger h1,
  .chapter-header h1,
  .section-heading h2,
  .studio-masthead h1 {
    max-width: none;
  }
}


/* ExpressBook 2026 upgrade layer */

:root {
  --page-max-width: 1240px;
  --page-gutter: clamp(20px, 3vw, 32px);
  --section-gap: clamp(28px, 4vw, 56px);
  --section-radius: 28px;
  --surface-dark: #11181b;
  --surface-dark-2: #172126;
  --surface-paper: #f3eadc;
  --surface-paper-2: #fbf6ee;
  --ink-strong: #f6efe2;
  --ink-muted: rgba(246, 239, 226, 0.72);
  --ink-paper: #2a2622;
  --border-soft: rgba(243, 234, 220, 0.12);
  --shadow-deep: 0 24px 72px rgba(0, 0, 0, 0.2);
}

.site-shell {
  width: min(var(--page-max-width), calc(100vw - 2 * var(--page-gutter)));
  margin: 0 auto;
  display: grid;
  gap: var(--section-gap);
  padding-bottom: 96px;
}

.page-home {
  color: var(--ink-strong);
  background:
    radial-gradient(circle at top left, rgba(141, 74, 48, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(84, 104, 95, 0.16), transparent 30%),
    linear-gradient(180deg, #10171a 0%, #121b1f 58%, #172126 100%);
}

.page-home .landing-main {
  display: grid;
  gap: var(--section-gap);
}

.page-home .site-header,
.page-home .site-footer,
.page-admin .site-header,
.page-reader .site-header {
  width: min(var(--page-max-width), calc(100vw - 2 * var(--page-gutter)));
}

.page-home .brand-mark,
.page-home .site-nav a:not(.button),
.page-home .site-footer p,
.page-home .site-footer a {
  color: rgba(246, 239, 226, 0.88);
}

.page-home .brand-mark small,
.page-home .site-nav a:not(.button) {
  color: rgba(246, 239, 226, 0.68);
}

.theme-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.theme-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--theme-image-background, none);
  background-position: var(--theme-image-position, center);
  background-repeat: no-repeat;
  background-size: cover;
  mask-image: var(--theme-image-mask, none);
  -webkit-mask-image: var(--theme-image-mask, none);
  opacity: 0.96;
  transform: translate3d(0, 0, 0);
}

.theme-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%, rgba(0, 0, 0, 0.08) 100%);
  pointer-events: none;
}

.theme-panel > * {
  position: relative;
  z-index: 1;
}

.theme-panel[data-theme-text-tone="dark"],
.theme-panel[data-theme-text-tone="paper"] {
  color: var(--ink-paper);
}

.theme-panel[data-theme-text-tone="dark"] .eyebrow,
.theme-panel[data-theme-text-tone="paper"] .eyebrow {
  color: rgba(42, 38, 34, 0.62);
}

.theme-panel[data-theme-text-tone="dark"] .pill,
.theme-panel[data-theme-text-tone="paper"] .pill {
  color: rgba(42, 38, 34, 0.84);
  background: rgba(42, 38, 34, 0.08);
  border-color: rgba(42, 38, 34, 0.1);
}

.theme-panel[data-theme-motion="drift"]::before {
  animation: theme-drift 18s ease-in-out infinite alternate;
}

.theme-panel[data-theme-motion="float"]::before {
  animation: theme-float 14s ease-in-out infinite alternate;
}

.home-hero,
.value-strip,
.featured-section--home,
.home-library-preview,
.feature-section--method,
.closing-cta {
  border-radius: var(--section-radius);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-deep);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(24px, 3vw, 40px);
  min-height: 580px;
  padding: clamp(28px, 4vw, 56px);
  background:
    linear-gradient(135deg, rgba(13, 18, 22, 0.92), rgba(13, 18, 22, 0.58)),
    linear-gradient(180deg, #11181b, #172126);
}

.home-hero__copy,
.home-hero__feature {
  display: grid;
  align-content: start;
  gap: 20px;
}

.home-hero__copy {
  max-width: 44rem;
}

.home-hero__copy h1 {
  margin: 0;
  max-width: 9.5ch;
  font-family: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  font-size: clamp(3.6rem, 7vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.home-hero__copy .hero-copy__lead {
  margin: 0;
  max-width: 42rem;
  color: var(--ink-muted);
  font-size: 1.02rem;
  line-height: 1.82;
}

.hero-copy__kicker {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 239, 226, 0.68);
}

.home-hero__feature {
  align-content: center;
}

.hero-book__render,
.hero-book__content {
  border-radius: 24px;
}

.hero-book__render {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 28px;
  border: 1px solid rgba(243, 234, 220, 0.12);
  background:
    linear-gradient(180deg, rgba(251, 246, 238, 0.14), rgba(228, 216, 196, 0.08)),
    rgba(13, 18, 22, 0.42);
}

.hero-book__content {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(243, 234, 220, 0.12);
  background: rgba(13, 18, 22, 0.48);
}

.hero-book__content h2,
.closing-cta__content h2,
.value-strip h2 {
  margin: 0;
  font-family: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  letter-spacing: -0.02em;
}

.hero-book__content p,
.closing-cta__content p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.78;
}

.hero-book__cover,
.featured-book__cover,
.book-card__cover {
  width: min(100%, 240px);
  aspect-ratio: 0.72;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 20px;
  border: 1px solid rgba(243, 234, 220, 0.14);
  background:
    linear-gradient(160deg, var(--book-accent, #8c4b36), #24342f);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.hero-book__cover span,
.featured-book__cover span,
.book-card__cover span {
  font-family: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.92);
}

.hero-book__cover.has-image img,
.featured-book__cover.has-image img,
.book-card__cover.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.value-strip {
  display: grid;
  gap: 24px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(17, 24, 27, 0.92), rgba(17, 24, 27, 0.74)),
    #121b1f;
}

.section-heading--compact {
  margin-bottom: 0;
}

.value-strip__items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.value-strip__item {
  display: grid;
  gap: 10px;
  min-height: 140px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(243, 234, 220, 0.1);
  background: rgba(246, 239, 226, 0.06);
}

.value-strip__item h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
}

.featured-section--home,
.home-library-preview,
.feature-section--method,
.closing-cta {
  padding: clamp(28px, 4vw, 40px);
  background:
    linear-gradient(180deg, rgba(17, 24, 27, 0.92), rgba(17, 24, 27, 0.76)),
    #121b1f;
}

.home-library-preview__header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}

.book-grid--preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.feature-grid--method {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-grid--method .feature-card {
  min-height: 220px;
}

.closing-cta__content {
  max-width: 42rem;
  display: grid;
  gap: 18px;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.page-reader .theme-panel[data-theme-slot="shell"] {
  border-radius: 28px;
  border: 1px solid rgba(243, 234, 220, 0.08);
  background:
    linear-gradient(180deg, rgba(14, 18, 20, 0.86), rgba(14, 18, 20, 0.72)),
    #11181b;
}

.page-reader .theme-panel[data-theme-slot="surface"] {
  background-color: rgba(249, 244, 236, 0.94);
}

.page-reader .chapter-header.theme-panel {
  padding: 28px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(248, 243, 235, 0.7), rgba(248, 243, 235, 0.42)),
    #f8f3eb;
}

.page-admin .theme-panel[data-theme-slot="login"],
.page-admin .theme-panel[data-theme-slot="banner"] {
  border-radius: 28px;
  overflow: hidden;
}

.page-admin #site-theme-images[aria-invalid="true"] {
  border-color: rgba(199, 92, 92, 0.8);
  box-shadow: 0 0 0 1px rgba(199, 92, 92, 0.32);
}

@keyframes theme-drift {
  from {
    transform: scale(1.02) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.06) translate3d(1.6%, -1.2%, 0);
  }
}

@keyframes theme-float {
  from {
    transform: scale(1.01) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.04) translate3d(-1%, 1.4%, 0);
  }
}

@media (max-width: 1120px) {
  .home-hero,
  .book-grid--preview,
  .feature-grid--method,
  .value-strip__items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-library-preview__header {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .site-shell,
  .page-home .site-header,
  .page-home .site-footer,
  .page-admin .site-header,
  .page-reader .site-header {
    width: min(var(--page-max-width), calc(100vw - 24px));
  }

  .home-hero,
  .book-grid--preview,
  .feature-grid--method,
  .value-strip__items {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-hero {
    min-height: auto;
    padding: 24px;
  }

  .home-hero__copy h1 {
    max-width: 100%;
    font-size: clamp(3rem, 12vw, 4.4rem);
  }

  .hero-book__render,
  .hero-book__content,
  .featured-section--home,
  .home-library-preview,
  .feature-section--method,
  .closing-cta,
  .value-strip {
    padding: 22px;
  }
}

/* Patch Guide Detailed: typography + rhythm + scroll cadence */

:root {
  --patch-rhythm-section-xl: 128px;
  --patch-rhythm-section-lg: 96px;
  --patch-rhythm-section-md: 72px;
  --patch-rhythm-stack-lg: 32px;
  --patch-rhythm-stack-md: 24px;
  --patch-rhythm-stack-sm: 16px;
}

.landing-main.site-shell {
  gap: clamp(34px, 4.4vw, 58px);
}

.landing-main.site-shell > section {
  scroll-margin-top: 108px;
}

.site-header--landing {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 22px 0 16px;
  transition:
    background 280ms ease,
    backdrop-filter 280ms ease,
    border-color 280ms ease,
    transform 280ms ease,
    padding 280ms ease,
    box-shadow 280ms ease;
}

.site-header--landing.is-scrolled {
  padding: 16px 18px 14px;
  background: rgba(17, 24, 27, 0.78);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 248, 240, 0.08);
  border-top-color: transparent;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.page-home .home-hero {
  min-height: 548px;
  padding: clamp(30px, 4vw, 46px);
  gap: clamp(20px, 3vw, 34px);
}

.page-home .home-hero::before {
  animation: none !important;
  transform: scale(1.03) translateY(var(--hero-scroll-offset, 0px));
  transition: transform 160ms linear;
}

.page-home .home-hero__copy,
.page-home .home-hero__feature,
.page-home .closing-cta__content {
  gap: 18px;
}

.page-home .home-hero__copy h1 {
  max-width: 11ch;
  font-size: clamp(2.8rem, 5.2vw, 5rem);
  line-height: 1.01;
  letter-spacing: -0.02em;
}

.page-home .home-hero__copy .hero-copy__lead,
.page-home .section-heading p,
.page-home .home-library-preview__header p,
.page-home .hero-book__content p,
.page-home .featured-panel__content p,
.page-home .book-card p,
.page-home .feature-card p,
.page-home .closing-cta__content p {
  max-width: 58ch;
  font-size: clamp(0.97rem, 1vw, 1.04rem);
  line-height: 1.72;
}

.page-home .hero-copy__kicker,
.page-home .eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
}

.page-home .button-row {
  gap: 12px;
}

.page-home .hero-fact dt {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  line-height: 1.3;
}

.page-home .hero-fact dd {
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  line-height: 1.12;
}

.page-home .section-heading {
  margin-bottom: 24px;
}

.page-home .section-heading h2,
.page-home .home-library-preview__header h2 {
  font-size: clamp(1.82rem, 2.9vw, 2.78rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.page-home .hero-book__content h2,
.page-home .featured-panel__content h3 {
  font-size: clamp(1.56rem, 2.2vw, 2.16rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.page-home .book-card h3,
.page-home .feature-card h3,
.page-home .value-strip__item h3,
.page-home .featured-panel__chapter h4 {
  font-size: clamp(1.16rem, 1.4vw, 1.42rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.page-home .home-hero,
.page-home .featured-panel,
.page-home .value-strip,
.page-home .home-library-preview,
.page-home .feature-section--method,
.page-home .closing-cta {
  border-radius: 28px;
}

.page-home .hero-book__render,
.page-home .hero-book__content,
.page-home .book-card,
.page-home .feature-card,
.page-home .value-strip__item {
  border-radius: 22px;
}

.page-home .featured-panel {
  padding: 26px;
}

.page-home .value-strip,
.page-home .home-library-preview,
.page-home .feature-section--method,
.page-home .closing-cta {
  padding: clamp(24px, 3vw, 32px);
}

.page-home .value-strip {
  gap: 20px;
}

.page-home .value-strip__item,
.page-home .book-card,
.page-home .feature-card {
  min-height: 100%;
}

.page-home .book-grid--preview,
.page-home .feature-grid--method {
  align-items: stretch;
}

.page-home .book-card,
.page-home .feature-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.page-home .book-card__body,
.page-home .feature-card__body {
  display: grid;
  gap: 12px;
}

.page-home .book-card__footer,
.page-home .feature-card__footer {
  margin-top: auto;
}

.page-home .featured-section--home {
  background:
    linear-gradient(180deg, rgba(16, 22, 25, 0.92), rgba(16, 22, 25, 0.78)),
    #121b1f;
}

.page-home .home-library-preview {
  border-top: 1px solid rgba(243, 234, 220, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, rgba(19, 24, 27, 0.92), rgba(19, 24, 27, 0.78));
}

.page-home .feature-section--method {
  border-top: 1px solid rgba(243, 234, 220, 0.08);
  background:
    linear-gradient(180deg, rgba(27, 22, 19, 0.12), rgba(27, 22, 19, 0.2)),
    linear-gradient(180deg, rgba(17, 24, 27, 0.9), rgba(17, 24, 27, 0.76));
}

.page-home .closing-cta {
  background:
    linear-gradient(180deg, rgba(17, 24, 27, 0.9), rgba(17, 24, 27, 0.8)),
    #121b1f;
}

.page-home .landing-main > section[data-reveal],
.page-home [data-reveal] {
  animation: none !important;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.page-home [data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

.page-home [data-reveal].delay-1 {
  transition-delay: 80ms;
}

.page-home [data-reveal].delay-2 {
  transition-delay: 160ms;
}

.page-home [data-reveal].delay-3 {
  transition-delay: 240ms;
}

@media (max-width: 980px) {
  .page-home .home-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .page-home .home-hero__copy h1 {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .landing-main.site-shell > section {
    scroll-margin-top: 88px;
  }

  .site-header--landing {
    padding: 18px 0 14px;
  }

  .site-header--landing.is-scrolled {
    padding: 14px 14px 12px;
    border-radius: 0 0 18px 18px;
  }

  .page-home .home-hero__copy h1 {
    max-width: 11ch;
    font-size: clamp(2.2rem, 8vw, 3.3rem);
    line-height: 1.04;
  }

  .page-home .section-heading h2,
  .page-home .home-library-preview__header h2 {
    font-size: clamp(1.55rem, 6vw, 2.08rem);
    line-height: 1.12;
  }

  .page-home .hero-book__content h2,
  .page-home .featured-panel__content h3 {
    font-size: clamp(1.34rem, 5vw, 1.84rem);
  }

  .page-home .book-card h3,
  .page-home .feature-card h3,
  .page-home .value-strip__item h3,
  .page-home .featured-panel__chapter h4 {
    font-size: clamp(1.1rem, 4.6vw, 1.34rem);
  }

  .page-home .featured-panel,
  .page-home .value-strip,
  .page-home .home-library-preview,
  .page-home .feature-section--method,
  .page-home .closing-cta {
    padding: 22px;
  }
}
