/* Small visual and interaction refinements layered over the core stylesheet. */
::selection { background: rgba(200,167,174,.55); color: #2E2529; }
body { -webkit-font-smoothing: antialiased; }
.site-header { isolation: isolate; }
.site-header::after { content: ""; position: absolute; inset: auto 0 -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(140,90,107,.2), transparent); pointer-events: none; }
.brand strong { transition: color .18s ease; }
.brand:hover strong { color: var(--brand); }
.primary-nav a { position: relative; transition: background-color .18s ease, color .18s ease; }
.primary-nav a::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 5px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: center; transition: transform .18s ease; opacity: .35; }
.primary-nav a:hover::after, .primary-nav a.is-active::after { transform: scaleX(1); }
.hero-copy { position: relative; }
.hero-copy::before { content: "“"; position: absolute; left: -34px; top: -42px; color: rgba(200,167,174,.28); font-size: 8rem; line-height: 1; font-family: Georgia,serif; pointer-events: none; }
.hero-facts div { border: 1px solid rgba(140,90,107,.08); transition: transform .2s ease, background-color .2s ease; }
.hero-facts div:hover { transform: translateY(-2px); background: rgba(241,232,232,.95); }
.hero-art img { transition: transform .28s ease, box-shadow .28s ease; }
.hero-art:hover img { transform: translateY(-3px); box-shadow: 0 24px 70px rgba(73,45,56,.16); }
.chapter-list li { position: relative; }
.chapter-list li::before { content: ""; position: absolute; left: -24px; top: 20%; bottom: 20%; width: 2px; background: var(--brand-soft); transform: scaleY(0); transform-origin: center; transition: transform .18s ease; }
.chapter-list li:hover::before { transform: scaleY(1); }
.chapter-list a { transition: padding-left .18s ease; }
.chapter-list a:hover { padding-left: 8px; }
.chapter-list small { max-width: 58ch; }
.topic-card { position: relative; overflow: hidden; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.topic-card::after { content: "→"; position: absolute; right: 20px; bottom: 16px; color: var(--brand-soft); font-size: 1.2rem; transition: transform .2s ease, color .2s ease; }
.topic-card:hover { transform: translateY(-3px); border-color: rgba(140,90,107,.3); box-shadow: 0 14px 38px rgba(73,45,56,.08); }
.topic-card:hover::after { transform: translateX(4px); color: var(--brand); }
.split-notes > div { transition: border-color .2s ease, transform .2s ease; }
.split-notes > div:hover { border-color: rgba(140,90,107,.32); transform: translateY(-2px); }
.comic-entry { position: relative; overflow: hidden; }
.comic-entry::before { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; right: -80px; top: -80px; background: rgba(200,167,174,.12); pointer-events: none; }
.comic-entry figure { overflow: hidden; border-radius: 20px; }
.comic-entry img { transition: transform .35s ease; }
.comic-entry:hover img { transform: scale(1.015); }
.version-grid article { position: relative; padding-top: 34px; }
.version-grid article::before { content: ""; position: absolute; left: 26px; top: 20px; width: 34px; height: 3px; border-radius: 999px; background: var(--brand-soft); }
.audio-list article { position: relative; transition: background-color .18s ease; }
.audio-list article:hover { background: rgba(241,232,232,.38); }
.audio-number { font-variant-numeric: tabular-nums; }
.reader { transition: background-color .2s ease, width .2s ease; }
.reader-body { text-wrap: pretty; }
.reader-body p:first-child::first-letter { float: left; margin: .13em .14em 0 0; color: var(--brand); font-size: 3.15em; line-height: .8; font-weight: 600; }
.reader-body p + p { text-indent: 1.5em; }
.chapter-summary { text-wrap: balance; }
.chapter-nav a { display: inline-flex; max-width: 100%; align-items: center; gap: 5px; text-decoration: none; }
.chapter-nav a:hover { text-decoration: underline; }
.search-form { box-shadow: inset 0 1px 0 rgba(255,255,255,.45); }
.search-row input::placeholder { color: #9a8d91; }
.result-list article { position: relative; }
.result-list article::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -1px; height: 1px; background: var(--brand); transition: right .24s ease; }
.result-list article:hover::after { right: 0; }
.result-list h3 { text-wrap: balance; }
.empty-state { position: relative; overflow: hidden; }
.empty-state::before { content: "?"; position: absolute; right: 24px; top: -24px; color: rgba(200,167,174,.18); font-size: 8rem; line-height: 1; font-family: Georgia,serif; }
.button { transition: transform .16s ease, background-color .16s ease, border-color .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.text-link { text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.site-footer strong { color: var(--ink-strong); }
.footer-grid nav a { text-decoration: none; }
.footer-grid nav a:hover { text-decoration: underline; }

@supports (text-wrap: balance) {
  h1, h2, .lead { text-wrap: balance; }
}

@supports selector(:focus-visible) {
  a:focus:not(:focus-visible), button:focus:not(:focus-visible), input:focus:not(:focus-visible) { outline: none; }
}

@media (hover: none) {
  .hero-art:hover img,
  .topic-card:hover,
  .split-notes > div:hover,
  .chapter-list a:hover { transform: none; }
  .chapter-list a:hover { padding-left: 2px; }
}

@media (max-width: 900px) {
  .hero-copy::before { left: -10px; top: -34px; font-size: 6rem; }
  .primary-nav a::after { left: 13px; right: auto; width: 28px; transform-origin: left; }
  .topic-card { min-height: 140px; }
  .reader-body p:first-child::first-letter { font-size: 2.8em; }
}

@media (max-width: 620px) {
  .hero-copy::before { display: none; }
  .hero-art::before { inset: 5% -2% -3% 5%; }
  .topic-card::after { right: 16px; bottom: 13px; }
  .chapter-list li::before { left: -18px; }
  .reader-body p + p { text-indent: 1em; }
  .reader-body p:first-child::first-letter { font-size: 2.5em; }
  .version-grid article::before { left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand strong,
  .primary-nav a,
  .primary-nav a::after,
  .hero-facts div,
  .hero-art img,
  .chapter-list li::before,
  .chapter-list a,
  .topic-card,
  .topic-card::after,
  .split-notes > div,
  .comic-entry img,
  .audio-list article,
  .reader,
  .result-list article::after,
  .button { transition: none !important; }
}

/* Form, long-link and fallback details shared by search and reading pages. */
input[type="search"] { appearance: none; -webkit-appearance: none; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; opacity: .55; }
.search-row input:disabled, .reading-control:disabled { cursor: not-allowed; opacity: .58; }
.chapter-list a, .topic-card, .result-list a, .chapter-nav a { overflow-wrap: anywhere; }
.page-intro > :last-child { margin-bottom: 0; }
.section-heading > :last-child { margin-bottom: 0; }
.prose-section a { font-weight: 650; }
.prose-section p + p { margin-top: 1.1em; }
.comic-entry .button { margin-top: 8px; }
.version-path .button, .audio-link .button { margin-top: 8px; }
.audio-list article:last-child { border-bottom: 0; }
.result-list article:last-child { border-bottom-color: transparent; }
.reader-body strong { color: var(--ink-strong); }
.reader-body em { color: #5f5055; }
.reader-body hr { width: 44%; margin: 2.6em auto; border: 0; border-top: 1px solid var(--line); }
.reader-body blockquote { margin: 1.8em 0; padding: .2em 0 .2em 1.2em; border-left: 3px solid var(--brand-soft); color: var(--muted); }
.reader-body ul, .reader-body ol { padding-left: 1.5em; }
.reader-body li + li { margin-top: .45em; }
.reader-body code { padding: .08em .35em; border-radius: 5px; background: var(--paper-2); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88em; }
@media (max-width: 620px) {
  .page-intro { padding-top: 46px; }
  .reader-main { padding-top: 28px; }
  .reader { padding-inline: 22px; }
  .chapter-panel.large { padding-inline: 20px; }
  .comic-entry { padding: 20px; }
  .split-notes > div, .version-grid article { padding: 22px; }
}
