/* ==========================================================================
   Chitalka — Book-Margin Editorial Landing Page
   Palette: Paper #FAF9F7, Leaf #F1ECE3, Ink #1F1D1A, Graphite #6B665F,
            Plum Cloth #5B4F82, Ribbon Gold #E7B54A.
   Type: Literata (display & book prose) + System UI Sans (body & controls).
   ========================================================================== */

@font-face {
  font-family: "Literata";
  src: url("./assets/fonts/literata/greek-400-normal.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}

@font-face {
  font-family: "Literata";
  src: url("./assets/fonts/literata/greek-400-italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}

@font-face {
  font-family: "Literata";
  src: url("./assets/fonts/literata/latin-400-normal.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("./assets/fonts/literata/latin-400-italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("./assets/fonts/literata/latin-700-normal.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("./assets/fonts/literata/latin-700-italic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --font-serif: "Literata", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Core 6-color palette */
  --paper: #FAF9F7;
  --leaf: #F1ECE3;
  --surface: #FFFFFF;
  --ink: #1F1D1A;
  --ink-hover: #38342F;
  --graphite: #6B665F;
  --rule: #DFD9CE;
  --rule-strong: #C8C0B4;
  --plum: #5B4F82;
  --plum-wash: rgba(91, 79, 130, 0.10);
  --plum-line: rgba(91, 79, 130, 0.36);
  --ribbon: #E7B54A;
  --live: #23834D;

  --book-shadow: 0 18px 42px rgba(31, 29, 26, 0.08), 0 1px 2px rgba(31, 29, 26, 0.05);
}

[data-theme="dark"] {
  --paper: #161514;
  --leaf: #1E1C1A;
  --surface: #252320;
  --ink: #ECEAE6;
  --ink-hover: #FFFFFF;
  --graphite: #A19C94;
  --rule: #322F2B;
  --rule-strong: #4F4A43;
  --plum: #B0A7CE;
  --plum-wash: rgba(176, 167, 206, 0.14);
  --plum-line: rgba(176, 167, 206, 0.42);
  --ribbon: #D9A740;
  --live: #58CE8B;

  --book-shadow: 0 22px 52px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161514;
    --leaf: #1E1C1A;
    --surface: #252320;
    --ink: #ECEAE6;
    --ink-hover: #FFFFFF;
    --graphite: #A19C94;
    --rule: #322F2B;
    --rule-strong: #4F4A43;
    --plum: #B0A7CE;
    --plum-wash: rgba(176, 167, 206, 0.14);
    --plum-line: rgba(176, 167, 206, 0.42);
    --ribbon: #D9A740;
    --live: #58CE8B;

    --book-shadow: 0 22px 52px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.35);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink);
  background-color: var(--paper);
}

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

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 0.08em 0.34em;
  border-radius: 3px;
  background: var(--leaf);
  border: 1px solid var(--rule);
}

:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 2px;
}

.frame {
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 62px;
}

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

.brand-icon {
  border-radius: 7px;
}

.brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  font-size: 14px;
  color: var(--graphite);
}

.site-nav a:hover {
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--graphite);
}

.theme-btn:hover {
  color: var(--ink);
  border-color: var(--rule-strong);
}

.icon-sun {
  display: none;
}
.icon-moon {
  display: block;
}

[data-theme="dark"] .icon-sun {
  display: block;
}
[data-theme="dark"] .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }
}

/* Buttons — crisp, restrained, Chitalka's small corner radius */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn-lg {
  font-size: 15px;
  padding: 13px 20px;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--ink-hover);
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-quiet:hover {
  background: var(--leaf);
}

/* ==========================================================================
   Hero — Asymmetric Left Statement + Live Book Page
   ========================================================================== */

.hero {
  padding: 32px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 44px;
  align-items: start;
}

.hero-copy {
  padding-top: 12px;
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.15rem, 3.5vw, 2.95rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  text-wrap: balance;
}

.hero-lead {
  font-size: 16.5px;
  line-height: 1.66;
  color: var(--graphite);
  margin: 0 0 24px;
  max-width: 50ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.hero-platforms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  color: var(--graphite);
}

.availability-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.availability-item--live {
  color: var(--ink);
  font-weight: 500;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
}

/* ==========================================================================
   Hero Live Book Stage (The ONE signature focal piece)
   ========================================================================== */

.book-stage {
  --r-bg: #FFFFFF;
  --r-text: #1A1A1A;
  --r-bar: #F8F6F2;
  --r-border: #E2DDD4;
  --r-muted: #7C7770;
  --r-highlight: rgba(231, 181, 74, 0.30);
  --r-highlight-on: rgba(231, 181, 74, 0.52);
  --r-entity-ul: rgba(91, 79, 130, 0.65);
  --r-entity-on: rgba(91, 79, 130, 0.13);
  --r-pill-fg: #5B4F82;
  --r-pill-bg: rgba(91, 79, 130, 0.10);

  position: relative;
  background: var(--r-bg);
  color: var(--r-text);
  border: 1px solid var(--r-border);
  border-radius: 4px 10px 10px 4px;
  box-shadow: var(--book-shadow);
}

/* Subtle left spine edge */
.book-stage::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  background: linear-gradient(to right, rgba(31, 29, 26, 0.08), transparent);
  pointer-events: none;
  border-radius: 4px 0 0 4px;
}

/* Tactile silk ribbon bookmark from Chitalka's app icon */
.ribbon-bookmark {
  position: absolute;
  top: -1px;
  right: 26px;
  width: 14px;
  height: 36px;
  background: var(--ribbon);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  z-index: 3;
  box-shadow: 0 2px 6px rgba(31, 29, 26, 0.16);
}

.book-stage[data-reader-palette="sepia"] {
  --r-bg: #F6EFE0;
  --r-text: #4A3F32;
  --r-bar: #EFE5D1;
  --r-border: #DFD2B8;
  --r-muted: #8A7A62;
  --r-highlight: rgba(196, 137, 64, 0.24);
  --r-highlight-on: rgba(196, 137, 64, 0.40);
  --r-entity-ul: rgba(120, 88, 148, 0.68);
  --r-entity-on: rgba(120, 88, 148, 0.13);
}

.book-stage[data-reader-palette="sage"] {
  --r-bg: #E9EFE6;
  --r-text: #2B3A2E;
  --r-bar: #DFE7DC;
  --r-border: #CBD7C6;
  --r-muted: #5C6F60;
  --r-highlight: rgba(212, 174, 68, 0.28);
  --r-highlight-on: rgba(212, 174, 68, 0.45);
  --r-entity-ul: rgba(91, 79, 130, 0.68);
  --r-entity-on: rgba(91, 79, 130, 0.13);
}

.book-stage[data-reader-palette="dark"] {
  --r-bg: #1C1C1E;
  --r-text: #CFCFD2;
  --r-bar: #242427;
  --r-border: #36363A;
  --r-muted: #8B8B90;
  --r-highlight: rgba(231, 181, 74, 0.22);
  --r-highlight-on: rgba(231, 181, 74, 0.36);
  --r-entity-ul: rgba(176, 167, 206, 0.72);
  --r-entity-on: rgba(176, 167, 206, 0.18);
  --r-pill-fg: #C5BDE0;
  --r-pill-bg: rgba(176, 167, 206, 0.16);
}

.book-stage[data-reader-palette="black"] {
  --r-bg: #000000;
  --r-text: #B6B6B9;
  --r-bar: #101012;
  --r-border: #28282B;
  --r-muted: #77777C;
  --r-highlight: rgba(231, 181, 74, 0.20);
  --r-highlight-on: rgba(231, 181, 74, 0.34);
  --r-entity-ul: rgba(176, 167, 206, 0.72);
  --r-entity-on: rgba(176, 167, 206, 0.18);
  --r-pill-fg: #C5BDE0;
  --r-pill-bg: rgba(176, 167, 206, 0.16);
}

.book-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 54px 13px 26px;
  background: var(--r-bar);
  border-bottom: 1px solid var(--r-border);
  border-radius: 4px 10px 0 0;
}

.book-bar-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.book-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
  color: var(--r-text);
  white-space: nowrap;
}

.book-chapter {
  font-size: 12.5px;
  color: var(--r-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette-bar {
  display: flex;
  align-items: center;
  gap: 5px;
}

.swatch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid transparent;
  background: transparent;
}

.swatch-btn.is-active {
  border-color: var(--plum);
}

.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid transparent;
}

.book-sheet {
  padding: 22px 24px 18px 26px;
}

.book-prose {
  font-family: var(--font-serif);
  font-size: 15.8px;
  line-height: 1.8;
  margin: 0 0 14px;
}

.entity-link {
  padding: 1px 2px;
  border-radius: 2px;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1.6px;
  text-underline-offset: 4px;
  text-decoration-color: var(--r-entity-ul);
  transition: background-color 120ms ease;
}

.entity-link:hover,
.entity-link.is-selected {
  background: var(--r-entity-on);
}

.passage-highlight {
  padding: 1px 3px;
  border-radius: 2px;
  background: var(--r-highlight);
  transition: background-color 120ms ease;
}

.passage-highlight:hover,
.passage-highlight.is-selected {
  background: var(--r-highlight-on);
}

/* Anchored Chitalka Popup inside the page */
.inline-popup-wrap {
  margin-top: 20px;
}

.chitalka-popup {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 18px 20px;
}

.popup-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.popup-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
  margin: 0;
}

.popup-meta {
  font-size: 12px;
  color: var(--plum);
  font-weight: 600;
  white-space: nowrap;
}

.popup-aliases {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--graphite);
}

.alias-pill {
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--leaf);
  color: var(--ink);
  font-size: 12px;
}

.popup-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--graphite);
  padding-left: 11px;
  border-left: 2px solid var(--plum);
  margin: 0 0 10px;
}

.popup-prose {
  font-size: 14px;
  line-height: 1.58;
  margin: 0 0 12px;
  color: var(--ink);
}

.popup-facts {
  list-style: none;
  padding: 10px 0 0;
  margin: 0 0 12px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popup-facts li {
  font-size: 13px;
  line-height: 1.48;
  color: var(--graphite);
  padding-left: 14px;
  position: relative;
}

.popup-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--plum);
}

/* Expandable real-world context drawer (matches Chitalka's RealWorldSection) */
.realworld-drawer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.realworld-drawer--compact {
  margin-top: 10px;
  margin-bottom: 12px;
  padding-top: 10px;
}

.realworld-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin: -6px -8px;
  width: calc(100% + 16px);
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  transition: background-color 140ms ease;
}

.realworld-toggle:hover {
  background: var(--leaf);
}

.realworld-globe {
  color: var(--plum);
  flex-shrink: 0;
}

.realworld-heading {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
}

.realworld-label {
  color: var(--graphite);
  font-weight: 500;
}

.realworld-name {
  color: var(--ink);
  font-weight: 600;
}

.realworld-desc {
  color: var(--graphite);
  font-weight: 400;
}

.realworld-chevron {
  color: var(--graphite);
  flex-shrink: 0;
  transition: transform 160ms ease;
}

.realworld-drawer.is-open .realworld-chevron {
  transform: rotate(180deg);
  color: var(--plum);
}

.realworld-body {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 5px;
  background: var(--leaf);
  font-size: 13.5px;
  line-height: 1.56;
  color: var(--ink);
}

.realworld-body p {
  margin: 0;
}

.realworld-foot {
  margin-top: 6px !important;
  font-size: 11.8px;
  line-height: 1.45;
  color: var(--graphite);
}

.popup-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
  color: var(--graphite);
}

.popup-lock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.popup-next {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--plum);
}

.popup-next:hover {
  text-decoration: underline;
}

.popup-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.switcher-hint {
  font-size: 12px;
  color: var(--r-muted);
}

.switcher-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.switch-pill {
  border: 1px solid var(--r-border);
  background: var(--r-bar);
  color: var(--r-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 5px;
}

.switch-pill:hover {
  color: var(--r-text);
}

.switch-pill.is-active {
  background: var(--r-pill-bg);
  border-color: var(--r-pill-fg);
  color: var(--r-pill-fg);
  font-weight: 600;
}

.book-folio {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid var(--r-border);
  font-size: 12px;
  color: var(--r-muted);
}

.folio-rule {
  flex: 1;
  height: 2px;
  background: var(--r-border);
  overflow: hidden;
}

.folio-progress {
  display: block;
  height: 100%;
  background: var(--plum);
}

/* ==========================================================================
   Page Bands & Asymmetric Book-Margin Grid
   ========================================================================== */

.band {
  padding: 48px 0;
  border-top: 1px solid var(--rule);
}

.band--leaf {
  background: var(--leaf);
}

.margin-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.76fr) minmax(0, 1.24fr);
  gap: 48px;
  align-items: start;
}

.section-heading {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.65rem, 2.7vw, 2.25rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  text-wrap: balance;
}

.section-copy {
  font-size: 15.5px;
  line-height: 1.66;
  color: var(--graphite);
  margin: 0 0 14px;
  max-width: 56ch;
}

.section-copy:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Spoiler-Free Bookmark Timeline
   ========================================================================== */

.timeline-panel {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 22px 24px;
}

.timeline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.timeline-subject {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 3px;
}

.timeline-instruction {
  font-size: 13.5px;
  color: var(--graphite);
  margin: 0;
}

.bookmark-tag {
  font-size: 13px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 5px;
  background: var(--plum-wash);
  color: var(--plum);
  white-space: nowrap;
}

.bookmark-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.bookmark-stop {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--paper);
  text-align: left;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.bookmark-stop:hover {
  border-color: var(--rule-strong);
}

.bookmark-stop.is-active {
  background: var(--plum-wash);
  border-color: var(--plum);
}

.stop-chapter {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.stop-page {
  font-size: 12px;
  color: var(--graphite);
}

.bookmark-stop.is-active .stop-page {
  color: var(--plum);
}

.alias-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--graphite);
}

.timeline-summary {
  font-size: 14.5px;
  line-height: 1.62;
  margin: 0 0 16px;
  color: var(--ink);
}

.fact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  border-top: 1px solid var(--rule);
}

.fact-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13.8px;
  line-height: 1.5;
}

.cite-btn {
  border: 1px solid var(--plum-line);
  background: var(--plum-wash);
  color: var(--plum);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.cite-btn:hover,
.cite-btn.is-active {
  background: var(--plum);
  color: var(--paper);
  border-color: var(--plum);
}

.quote-reveal {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-left: 3px solid var(--plum);
  background: var(--leaf);
}

.quote-reveal blockquote {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}

.spoiler-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  font-size: 13px;
  color: var(--graphite);
}

/* ==========================================================================
   Bookplate Portrait & Place Showcase (Dual Plates)
   ========================================================================== */

.portrait-section {
  display: grid;
  grid-template-columns: minmax(0, 0.76fr) minmax(0, 1.24fr);
  gap: 48px;
  align-items: start;
}

.portrait-intro strong {
  color: var(--ink);
}

.bookplate-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.bookplate {
  margin: 0;
}

.bookplate-mat {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
}

.bookplate-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.bookplate-caption {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.caption-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.caption-meta {
  font-size: 13px;
  line-height: 1.5;
  color: var(--graphite);
}

/* ==========================================================================
   Community & In-Book Comments Panel
   ========================================================================== */

.comments-panel {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 20px 22px;
}

.comments-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 16px;
}

.comments-book {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 19px;
  margin: 0 0 2px;
}

.comments-sub {
  font-size: 13px;
  color: var(--graphite);
  margin: 0;
}

.segmented--compact {
  margin: 0;
  flex-shrink: 0;
}

.comments-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.comment-entry {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

.comment-entry:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.comment-anchor {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--graphite);
  padding-left: 10px;
  border-left: 2px solid var(--plum);
  margin: 0 0 8px;
}

.comment-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.comment-author {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.comment-where {
  font-size: 12px;
  color: var(--graphite);
}

.comment-body {
  font-size: 14px;
  line-height: 1.56;
  color: var(--ink);
  margin: 0;
}

.inline-spoiler {
  display: inline;
  padding: 1px 6px;
  border: 0;
  border-radius: 4px;
  background: var(--ink);
  color: transparent;
  user-select: none;
  transition: background-color 140ms ease, color 140ms ease;
}

.inline-spoiler:hover {
  background: var(--ink-hover);
}

.inline-spoiler.is-revealed {
  background: var(--plum-wash);
  color: var(--ink);
  user-select: text;
}

.comments-foot {
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
  color: var(--graphite);
}

/* ==========================================================================
   Passage Study (Explain & Translate — hairline split, no floating cards)
   ========================================================================== */

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

.study-col {
  display: flex;
  flex-direction: column;
}

.study-heading {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.24;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.study-copy {
  font-size: 14.8px;
  line-height: 1.62;
  color: var(--graphite);
  margin: 0 0 18px;
}

.segmented {
  display: inline-flex;
  align-self: flex-start;
  margin-top: auto;
  padding: 3px;
  border-radius: 6px;
  background: var(--paper);
  border: 1px solid var(--rule);
  margin-bottom: 14px;
}

.seg-btn {
  border: 0;
  background: transparent;
  padding: 6px 13px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--graphite);
}

.seg-btn.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.study-sample {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  min-height: 156px;
}

.study-sample--explain {
  margin-top: auto;
}

.sample-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 10px;
}

.sample-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--graphite);
  margin: 0;
}

.sample-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  line-height: 1.52;
  color: var(--plum);
}

/* ==========================================================================
   Typographic Feature Index (replaces 6-card SaaS grid)
   ========================================================================== */

.index-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  border-top: 1px solid var(--rule);
}

.index-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}

.index-row dt {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 16.5px;
  margin: 0 0 6px;
  color: var(--ink);
}

.index-row dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--graphite);
}

/* ==========================================================================
   Web & Mobile Availability Band
   ========================================================================== */

.availability-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: start;
}

.availability-web .btn {
  margin-top: 22px;
}

.availability-mobile {
  border-top: 1px solid var(--rule-strong);
}

.mobile-row {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule-strong);
}

.mobile-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.mobile-row-head h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 17px;
  margin: 0;
}

.status-note {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--graphite);
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--paper);
  border: 1px solid var(--rule);
}

.mobile-row p {
  margin: 0;
  font-size: 14px;
  line-height: 1.58;
  color: var(--graphite);
}

/* ==========================================================================
   FAQ
   ========================================================================== */

.faq-list {
  border-top: 1px solid var(--rule);
}

.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}

.faq-item summary {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 16.5px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 19px;
  font-weight: 400;
  color: var(--graphite);
}

.faq-item[open] summary::after {
  content: "\2212";
  color: var(--plum);
}

.faq-item p {
  margin: 10px 0 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--graphite);
  max-width: 64ch;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 22px 0 28px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.footer-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 13.5px;
  color: var(--graphite);
}

.footer-links a:hover {
  color: var(--ink);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .hero-grid,
  .margin-layout,
  .portrait-section,
  .study-grid,
  .availability-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero-copy {
    padding-top: 0;
  }
}

@media (max-width: 680px) {
  .frame {
    padding: 0 16px;
  }

  .site-nav {
    display: none;
  }

  .hero {
    padding: 24px 0 40px;
  }

  .band {
    padding: 40px 0;
  }

  .book-bar {
    padding: 12px 48px 12px 18px;
    flex-wrap: wrap;
  }

  .book-sheet {
    padding: 20px 18px 18px 22px;
  }

  .timeline-panel,
  .comments-panel {
    padding: 20px 18px;
  }

  .comments-head {
    flex-direction: column;
  }

  .bookplate-pair,
  .bookmark-track,
  .index-list {
    grid-template-columns: 1fr;
  }
}
