/* Novissima: books.laurentiu-niculescu.co.uk
   Hand-written, no framework. Fonts are self-hosted (no third-party requests).
   Palette: obsidian, parchment, antique gold. */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-normal.d80df8ff.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-italic.4fb55a7a.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/inter-var.3100e775.woff2") format("woff2");
}

:root {
  --bg: #0d0e11;
  --bg-raise: #14161b;
  --bg-sunk: #090a0c;
  --ink: #f4f1ea;
  --ink-dim: #b9b4a8;
  --ink-faint: #8e8a80;
  --stone: #2b2d34;
  --stone-2: #3d4049;
  --gold: #d4af37;
  --gold-2: #c89d54;
  --gold-ink: #0d0e11;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --header-h: 0rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.lock { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: #ecc965; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--gold); color: var(--gold-ink); padding: 0.6rem 1rem; z-index: 100; font-weight: 600; text-decoration: none; }
.skip:focus { top: 0.75rem; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: 0.01em; font-variant-numeric: lining-nums; }
.c-price, .p-big, .ch-no { font-variant-numeric: lining-nums; }
.eyebrow { font: 500 0.75rem/1 var(--sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-2); margin: 0 0 1.1rem; }
.rule-gold { width: 3.5rem; height: 1px; background: var(--gold-2); border: 0; margin: 1.5rem 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: 600 1rem/1 var(--sans); letter-spacing: 0.02em;
  padding: 1.05rem 1.6rem; border-radius: 2px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s, transform .2s;
  min-height: 3.25rem;
}
.cta-row .btn { white-space: nowrap; }
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: #e6c35a; color: var(--gold-ink); }
.btn-gold:active { transform: translateY(1px); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--stone-2); }
.btn-line:hover { border-color: var(--gold-2); color: var(--gold); }
.btn-sm { padding: 0.7rem 1.1rem; min-height: 2.75rem; font-size: 0.9rem; }
.btn-block { display: flex; width: 100%; }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 40; background: rgba(13, 14, 17, 0.92); border-bottom: 1px solid var(--stone); backdrop-filter: blur(10px); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: var(--header-h); flex-wrap: wrap; padding-block: 0.5rem; }
.wordmark { display: inline-flex; align-items: baseline; gap: 0.7rem; padding-block: 0.6rem; text-decoration: none; color: var(--ink); white-space: nowrap; }
.wordmark b { font: 600 1.3rem/1 var(--serif); letter-spacing: 0.04em; }
.wordmark i { font: 500 0.7rem/1 var(--sans); font-style: normal; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-2); padding-left: 0.7rem; border-left: 1px solid var(--stone-2); }
.site-nav { display: flex; gap: 1.6rem; order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; padding-block: 0.25rem; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { color: var(--ink-dim); text-decoration: none; font-size: 0.88rem; letter-spacing: 0.04em; white-space: nowrap; padding: 0.75rem 0; }
.site-nav a:hover { color: var(--ink); }
.head-cta { margin-left: auto; }
@media (max-width: 520px) {
  .site-header .wrap { gap: 0.4rem 1rem; }
  .wordmark { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .wordmark b { font-size: 1.15rem; }
  .wordmark i { font-size: 0.6rem; border-left: 0; padding-left: 0; }
  .head-cta { padding: 0.6rem 0.85rem; font-size: 0.85rem; min-height: 2.75rem; }
}
@media (min-width: 1100px) {
  :root { --header-h: 4.5rem; }
  .site-header { position: sticky; top: 0; }
  .site-nav { order: 0; width: auto; margin-inline: auto; overflow: visible; }
  .head-cta { margin-left: 0; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(1.5rem, 4vw, 3.25rem) clamp(2.5rem, 6vw, 5rem);
  background:
    radial-gradient(58% 48% at 22% 42%, rgba(52, 86, 135, 0.30), transparent 70%),
    radial-gradient(40% 40% at 88% 8%, rgba(212, 175, 55, 0.07), transparent 70%),
    var(--bg);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 4rem); align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }

.stage { display: grid; place-items: center; perspective: 1400px; padding: 1rem 0 2rem; }

/* 3D book. Dimensions follow the real 6 x 9 trim; spine ~12.6% of width. */
.book { --w: min(64vw, 300px); --h: calc(var(--w) * 1.5); --t: calc(var(--w) * 0.126);
  position: relative; width: var(--w); height: var(--h); transform-style: preserve-3d;
  transform: rotateY(-26deg) rotateX(3deg); transition: transform .8s cubic-bezier(.2, .7, .2, 1);
  margin-right: calc(var(--t) * 0.6); }
.stage:hover .book, .book:focus-within { transform: rotateY(-12deg) rotateX(2deg); }
@media (min-width: 900px) { .book { --w: min(30vw, 360px); } }
.face { position: absolute; backface-visibility: hidden; }
.front { inset: 0; transform: translateZ(calc(var(--t) / 2)); border-radius: 1px 4px 4px 1px; overflow: hidden; background: #0a1220; box-shadow: inset 4px 0 6px -2px rgba(255, 255, 255, 0.12), inset -1px 0 0 rgba(255, 255, 255, 0.05); }
.front picture, .front img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 22%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.28) 100%); pointer-events: none; }
.spine { width: var(--t); height: 100%; left: 0; top: 0; transform-origin: left center; transform: rotateY(-90deg) translateX(calc(var(--t) * -1)) ; background: linear-gradient(90deg, #070c16, #101a2c 50%, #070c16); display: grid; place-items: center; overflow: hidden; }
.spine span { writing-mode: vertical-rl; transform: rotate(180deg); font: 600 calc(var(--w) * 0.06)/1 var(--serif); letter-spacing: 0.3em; color: var(--gold); white-space: nowrap; }
.pages { width: var(--t); height: calc(100% - 6px); top: 3px; right: 0; transform-origin: right center; transform: rotateY(90deg) translateX(var(--t)); background: repeating-linear-gradient(0deg, #efe6d2 0 2px, #d9cfb8 2px 3px); }
.back { inset: 0; transform: rotateY(180deg) translateZ(calc(var(--t) / 2)); background: #0a1220; border-radius: 4px 1px 1px 4px; }
.floor { position: absolute; left: 50%; bottom: -1.6rem; width: 80%; height: 1.4rem; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(0, 0, 0, 0.7), transparent); filter: blur(4px); }
@media (prefers-reduced-motion: reduce) { .book { transition: none; } }

/* Typographic fallback cover, shown under the image so a missing file still looks designed */
.type-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; padding: 12% 8% 9%; background: radial-gradient(80% 60% at 50% 40%, #1b2d4a, #0a1220 75%); }
.type-cover .tc-title { font: 600 calc(var(--w) * 0.115)/1 var(--serif); letter-spacing: 0.16em; color: var(--gold); padding-left: 0.16em; }
.type-cover .tc-hook { font: 500 calc(var(--w) * 0.05)/1.5 var(--serif); letter-spacing: 0.14em; text-transform: uppercase; color: #c8b27a; }
.type-cover .tc-author { font: 500 calc(var(--w) * 0.05)/1 var(--serif); letter-spacing: 0.2em; text-transform: uppercase; color: #e9dfc7; }

.hero-copy .kicker { margin-bottom: 0.7rem; }
.hero-copy { container-type: inline-size; }
.hero h1 { font-size: clamp(2rem, 12.2cqi, 5.4rem); letter-spacing: 0.1em; margin-bottom: 0.3rem; color: var(--gold); }
.hero .tagline { font: 500 0.8rem/1.3 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-dim); margin: 0 0 1.2rem; }
.hook { font: italic 500 clamp(1.45rem, 3.2vw, 1.95rem)/1.25 var(--serif); margin: 0 0 0.9rem; padding-left: 1.2rem; border-left: 2px solid var(--gold-2); color: var(--ink); }
.lede { font: 500 1.18rem/1.5 var(--serif); color: var(--ink-dim); max-width: 34rem; margin: 0 0 1.3rem; }

/* ---------- Edition selector (works with no JS: it is a radio group) ---------- */
.edition { max-width: 36rem; }
.edition-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: 0.9rem; }
.edition label.card { display: block; cursor: pointer; border: 1px solid var(--stone); background: var(--bg-raise); padding: 0.7rem 0.8rem 0.7rem; border-radius: 2px; transition: border-color .2s, background-color .2s; height: 100%; }
.edition label.card:hover { border-color: var(--stone-2); }
.card .c-name { display: block; font: 600 0.82rem/1.2 var(--sans); color: var(--ink); }
.card .c-price { display: block; font: 600 1.5rem/1.2 var(--serif); color: var(--gold); margin-top: 0.3rem; }
.card .c-sub { display: block; font: 400 0.72rem/1.35 var(--sans); color: var(--ink-faint); margin-top: 0.15rem; }
.edition-panels > div { display: none; }
.edition input { position: absolute; opacity: 0; width: 1px; height: 1px; }
#fmt-paperback:checked ~ .edition-cards label[for="fmt-paperback"] { border-color: var(--gold); background: #191b21; box-shadow: inset 0 0 0 1px var(--gold); }
#fmt-paperback:checked ~ .edition-panels #panel-paperback { display: block; }
#fmt-paperback:focus-visible ~ .edition-cards label[for="fmt-paperback"] { outline: 2px solid var(--gold); outline-offset: 3px; }
#fmt-hardcover:checked ~ .edition-cards label[for="fmt-hardcover"] { border-color: var(--gold); background: #191b21; box-shadow: inset 0 0 0 1px var(--gold); }
#fmt-hardcover:checked ~ .edition-panels #panel-hardcover { display: block; }
#fmt-hardcover:focus-visible ~ .edition-cards label[for="fmt-hardcover"] { outline: 2px solid var(--gold); outline-offset: 3px; }
#fmt-ebook:checked ~ .edition-cards label[for="fmt-ebook"] { border-color: var(--gold); background: #191b21; box-shadow: inset 0 0 0 1px var(--gold); }
#fmt-ebook:checked ~ .edition-panels #panel-ebook { display: block; }
#fmt-ebook:focus-visible ~ .edition-cards label[for="fmt-ebook"] { outline: 2px solid var(--gold); outline-offset: 3px; }
.price-line { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; margin: 0 0 0.35rem; }
.price-line .p-big { font: 600 2.1rem/1 var(--serif); color: var(--ink); }
.price-line .p-ku { font: 500 0.9rem/1.3 var(--sans); color: var(--gold-2); }
.panel-note { color: var(--ink-dim); font-size: 0.9rem; margin: 0 0 0.9rem; }
.cta-row { display: grid; gap: 0.7rem; margin-bottom: 0.9rem; }
@media (min-width: 520px) { .cta-row { grid-template-columns: 1fr auto; } }

.store-switch { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-dim); margin: 0 0 1.1rem; }
.store-switch select { appearance: none; background: var(--bg-raise) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23c89d54' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 0.9rem center; color: var(--ink); border: 1px solid var(--stone-2); border-radius: 999px; padding: 0.75rem 2.3rem 0.75rem 1rem; font: 500 0.85rem/1.2 var(--sans); cursor: pointer; }
.store-switch select:hover { border-color: var(--gold-2); }

.badges { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; list-style: none; margin: 0; padding: 0.9rem 0 0; border-top: 1px solid var(--stone); font-size: 0.8rem; color: var(--ink-dim); }
.badges li { display: inline-flex; align-items: center; gap: 0.5rem; }
.badges li::before { content: ""; width: 0.38rem; height: 0.38rem; background: var(--gold-2); transform: rotate(45deg); flex: none; }

/* ---------- Themes strip ---------- */
.strip { background: var(--bg-sunk); border-block: 1px solid var(--stone); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.strip-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem 3rem; }
@media (min-width: 860px) { .strip-grid { grid-template-columns: repeat(3, 1fr); } .strip-item + .strip-item { border-left: 1px solid var(--stone); padding-left: 3rem; } }
.strip-item .eyebrow { margin-bottom: 0.9rem; }
.strip-item blockquote p { margin: 0; }
.strip-item blockquote { margin: 0 0 0.9rem; font: italic 500 clamp(1.6rem, 3vw, 2.05rem)/1.2 var(--serif); }
.strip-item .src { font: 500 0.72rem/1.4 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 0.8rem; }
.strip-item p.note { margin: 0; color: var(--ink-dim); font-size: 0.95rem; max-width: 22rem; }
.strip-label { font: 500 0.72rem/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 2rem; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 9vw, 7rem); }
.section-head { margin-bottom: 2.2rem; }
.section-head h2, .inside h2 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.narrow { max-width: 40rem; }

/* Synopsis with drop cap */
.synopsis-text p { font: 500 clamp(1.3rem, 2.2vw, 1.5rem)/1.65 var(--serif); margin: 0 0 1.35rem; color: #e8e4da; }
.synopsis-text p:first-child::first-letter { float: left; font: 600 5.4rem/0.78 var(--serif); padding: 0.4rem 0.7rem 0 0; color: var(--gold); }
.synopsis-text p.last { font-style: italic; color: var(--ink); }
.pull { margin: 2.2rem 0 0; padding-top: 1.6rem; border-top: 1px solid var(--stone); font: italic 500 1.55rem/1.3 var(--serif); color: var(--gold-2); }
.synopsis-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
@media (min-width: 900px) { .synopsis-grid { grid-template-columns: 4fr 8fr; gap: 5rem; } .synopsis-grid .section-head { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; } }

/* Look inside teaser */
.inside { background: linear-gradient(180deg, var(--bg-sunk), var(--bg)); border-block: 1px solid var(--stone); }
.inside-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .inside-grid { grid-template-columns: 5fr 6fr; gap: 5rem; } }
.excerpt { position: relative; max-height: 15.5rem; overflow: hidden; font: 500 1.3rem/1.65 var(--serif); color: #e6e1d5; }
.excerpt p { margin: 0 0 1.1rem; }
.excerpt .lead { font-variant: small-caps; letter-spacing: 0.08em; font-weight: 600; }
.excerpt::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7rem; background: linear-gradient(transparent, var(--bg-sunk)); }
.inside-meta { color: var(--ink-faint); font-size: 0.82rem; margin: 1.2rem 0 1.6rem; }
.inside .cta-row { grid-template-columns: auto auto; justify-content: start; }
@media (max-width: 519px) { .inside .cta-row { grid-template-columns: 1fr; } }

/* Spec table */
.spec { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.spec th, .spec td { text-align: left; padding: 1rem 0; border-bottom: 1px solid var(--stone); vertical-align: top; }
.spec th { width: 38%; font: 500 0.74rem/1.5 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); padding-right: 1.2rem; padding-top: 1.15rem; }
.spec td { color: var(--ink); }
.spec td small { color: var(--ink-faint); }
.spec tr:first-child th, .spec tr:first-child td { border-top: 1px solid var(--stone); }
.spec-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
@media (min-width: 900px) { .spec-grid { grid-template-columns: 4fr 8fr; gap: 5rem; } }
@media (max-width: 560px) { .spec th, .spec td { display: block; width: 100%; } .spec th { padding-bottom: 0; border-bottom: 0; } .spec td { padding-top: 0.3rem; } }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }

/* Author */
.author { background: var(--bg-sunk); border-top: 1px solid var(--stone); }
.author-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
@media (min-width: 900px) { .author-grid { grid-template-columns: 4fr 8fr; gap: 5rem; } }
.author-body p { font: 500 1.35rem/1.65 var(--serif); margin: 0 0 1.2rem; color: #e6e1d5; max-width: 40rem; }
.author-body blockquote { margin: 2rem 0; padding-left: 1.2rem; border-left: 2px solid var(--gold-2); max-width: 36rem; }
.author-body blockquote p { font-style: italic; font-size: 1.5rem; color: var(--ink); margin-bottom: 0.4rem; }
.author-body blockquote cite { font: 500 0.72rem/1.4 var(--sans); font-style: normal; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }

/* Footer */
.site-footer { border-top: 1px solid var(--stone); padding-block: 3rem 2.5rem; font-size: 0.9rem; color: var(--ink-dim); background: var(--bg); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { font: 500 0.72rem/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.site-footer a { color: var(--ink-dim); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.foot-brand b { font: 600 1.4rem/1 var(--serif); color: var(--ink); letter-spacing: 0.04em; display: block; margin-bottom: 0.6rem; }
.foot-fine { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--stone); font-size: 0.8rem; color: var(--ink-faint); display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }

/* Sticky buy bar (phones only, appears once the hero CTA scrolls away) */
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 0.7rem var(--gutter) calc(0.7rem + env(safe-area-inset-bottom)); background: rgba(13, 14, 17, 0.96); border-top: 1px solid var(--stone-2); transform: translateY(110%); transition: transform .3s; display: none; }
.buybar.show { transform: none; }
@media (max-width: 719px) { .buybar { display: block; } }
@media (prefers-reduced-motion: reduce) { .buybar { transition: none; } }

/* ---------- Reader (modal and /sample.html) ---------- */
.reader { --r-bg: #0d0e11; --r-ink: #e9e4d8; --r-dim: #a9a498; --r-line: #2b2d34; --r-size: 1.3rem; background: var(--r-bg); color: var(--r-ink); }
.reader[data-reader-theme="sepia"] { --r-bg: #f0e3c6; --r-ink: #43361f; --r-dim: #6d5c3e; --r-line: #d6c5a0; }
.reader[data-reader-theme="paper"] { --r-bg: #fbfaf6; --r-ink: #1c1c1a; --r-dim: #5d5b55; --r-line: #dcd9cf; }
.reader[data-size="0"] { --r-size: 1.05rem; } .reader[data-size="1"] { --r-size: 1.15rem; } .reader[data-size="2"] { --r-size: 1.3rem; }
.reader[data-size="3"] { --r-size: 1.45rem; } .reader[data-size="4"] { --r-size: 1.62rem; } .reader[data-size="5"] { --r-size: 1.8rem; } .reader[data-size="6"] { --r-size: 2rem; }

.reader-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: space-between; padding: 0.7rem var(--gutter); border-bottom: 1px solid var(--r-line); background: var(--r-bg); font-family: var(--sans); }
.reader-bar .rb-title { font: 600 1rem/1 var(--serif); letter-spacing: 0.06em; color: var(--r-ink); }
.rb-tools { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.rb-group { display: inline-flex; border: 1px solid var(--r-line); border-radius: 3px; overflow: hidden; }
.rb-group button { appearance: none; background: transparent; color: var(--r-ink); border: 0; padding: 0.55rem 0.8rem; min-height: 2.5rem; min-width: 2.75rem; font: 500 0.82rem/1 var(--sans); cursor: pointer; }
.rb-group button + button { border-left: 1px solid var(--r-line); }
.rb-group button:hover { background: rgba(127, 127, 127, 0.14); }
.rb-group button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); }
.rb-group button:focus-visible { outline-offset: -3px; }
.rb-size button:first-child { font-size: 0.8rem; } .rb-size button:last-child { font-size: 1.05rem; }
.rd-sheet .reader-bar { position: relative; padding-right: calc(var(--gutter) + 3.4rem); }
.rd-sheet .rb-close { position: absolute; top: 0.7rem; right: var(--gutter); }
.rb-close { appearance: none; background: transparent; border: 1px solid var(--r-line); color: var(--r-ink); width: 2.5rem; height: 2.5rem; border-radius: 3px; cursor: pointer; font: 400 1.4rem/1 var(--sans); }
.rb-close:hover { background: rgba(127, 127, 127, 0.14); }

.read-body { padding: clamp(1.8rem, 5vw, 3.5rem) var(--gutter) 3rem; }
.read-text { max-width: 34rem; margin-inline: auto; font-family: var(--serif); font-size: var(--r-size); line-height: 1.7; font-weight: 500; color: var(--r-ink); hyphens: auto; -webkit-hyphens: auto; }
.read-text p { margin: 0; text-indent: 1.6em; }
.read-text p.first, .read-text p.dateline, .read-text hr + p, .read-text h2 + hr + p { text-indent: 0; }
.read-text p.dateline { margin: 0 0 2rem; text-align: center; color: var(--r-dim); font-size: 0.9em; line-height: 1.5; letter-spacing: 0.03em; }
.read-text .lead { font-variant: small-caps; letter-spacing: 0.08em; font-weight: 600; }
.read-text .ch-title { font: 600 1.7em/1.1 var(--serif); letter-spacing: 0.22em; text-transform: uppercase; text-align: center; margin: 3.5rem 0 1rem; color: var(--r-ink); padding-left: 0.22em; }
.read-text .chapter-block:first-child .ch-title { margin-top: 0.5rem; }
.read-text .ch-kicker { display: block; font: 500 0.4em/1 var(--sans); letter-spacing: 0.3em; color: var(--r-dim); margin-bottom: 0.8rem; }
.read-text .ch-no { font-size: 1.5em; letter-spacing: 0; }
.read-text hr.rule { width: 2.5rem; border: 0; border-top: 1px solid var(--gold-2); margin: 1.2rem auto 2rem; }
.read-text .chapter-block + .chapter-block { margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--r-line); }
.read-status { text-align: center; color: var(--r-dim); font: 400 0.9rem/1.5 var(--sans); padding: 3rem 0; }

.read-end { max-width: 34rem; margin: 4rem auto 0; padding: 2.2rem clamp(1.2rem, 4vw, 2.2rem); text-align: center; background: #0d0e11; color: #f4f1ea; border: 1px solid #3d4049; border-top: 3px solid var(--gold); border-radius: 2px; font-family: var(--sans); }
.read-end .eyebrow { margin-bottom: 0.9rem; }
.read-end h2, .read-end h3 { font: 600 clamp(1.7rem, 4vw, 2.2rem)/1.15 var(--serif); margin-bottom: 0.8rem; color: #f4f1ea; }
.read-end p { color: #b9b4a8; margin: 0 0 1.4rem; font-size: 0.95rem; text-indent: 0; font-family: var(--sans); line-height: 1.6; }
.read-end .alt { margin: 1rem 0 0; font-size: 0.85rem; }
.read-end .store-switch { justify-content: center; margin: 1.1rem 0 0; }

dialog.reader-dialog { padding: 0; border: 0; width: 100%; max-width: none; height: 100%; max-height: none; background: transparent; color: inherit; }
dialog.reader-dialog::backdrop { background: rgba(5, 6, 8, 0.82); backdrop-filter: blur(4px); }
dialog.reader-dialog[open] { display: flex; justify-content: center; align-items: stretch; }
.rd-sheet { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; }
@media (min-width: 900px) { .rd-sheet { max-width: 56rem; height: calc(100% - 3rem); margin-block: 1.5rem; border: 1px solid #3d4049; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); } dialog.reader-dialog[open] { align-items: center; } }
.rd-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }

.sample-hero { padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem; background: radial-gradient(60% 80% at 20% 0%, rgba(52, 86, 135, 0.22), transparent 70%), var(--bg); border-bottom: 1px solid var(--stone); }
.sample-hero h1 { font-size: clamp(2rem, 6vw, 3.6rem); margin-bottom: 0.8rem; }
.sample-hero p { color: var(--ink-dim); max-width: 38rem; font: 500 1.2rem/1.55 var(--serif); margin: 0 0 1rem; }
.crumbs { font-size: 0.8rem; color: var(--ink-faint); margin-bottom: 1.4rem; }
.crumbs a { color: var(--ink-dim); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
.reader-page .reader-bar { position: sticky; top: var(--header-h); z-index: 20; }
.back-link { display: block; text-align: center; margin: 2rem 0 0; font-size: 0.9rem; }

.not-found { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 4rem 1rem; }
.not-found h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin-bottom: 1rem; }
.not-found p { color: var(--ink-dim); margin: 0 0 1.8rem; font: 500 1.25rem/1.5 var(--serif); }

@media print { .site-header, .buybar, .reader-bar, .read-end, .site-footer { display: none; } body, .reader { background: #fff; color: #000; } }
