/* Layout concept: a reading app first, set like a printed book. Jost for everything you operate,
   the imprint's display face only for its name and book titles, the reader's chosen face for the story.
   Interaction follows the apps these readers already use: Kindle / Apple Books for the reader (tap the page
   to show or hide the bars, Aa sheet with a size stepper, page swatches), GoodNovel / Dreame / Galatea for the
   book page (sticky Read button, collapsible blurb) and the unlock block, Wattpad mobile web for the top bar.
   The look stays our own: square corners, no pills, no tracked caps, no floating shadow cards, few words.
   Fang & Crown lives in pine green and bone; Violets & Blades on near-white with muted violet ink. */

@font-face { font-family: 'Jost'; src: url(/fonts/jost.woff2) format('woff2'); font-weight: 300 800; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url(/fonts/cinzel.woff2) format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Literata'; src: url(/fonts/literata.woff2) format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Literata'; src: url(/fonts/literata-italic.woff2) format('woff2'); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Bodoni Moda'; src: url(/fonts/bodoni.woff2) format('woff2'); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Bodoni Moda'; src: url(/fonts/bodoni-italic.woff2) format('woff2'); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url(/fonts/newsreader.woff2) format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url(/fonts/newsreader-italic.woff2) format('woff2'); font-weight: 200 800; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg: #f6f5f2;
  --surface: #ecebe6;
  --ink: #1d1c1a;
  --muted: #6b6862;
  --line: #e0ddd6;
  --accent: #1d1c1a;
  --on-accent: #f6f5f2;
  --hi: #8a5a1c;           /* "New", links in running text */
  --screen: #0f1110;       /* behind video */

  /* Jost: a Futura revival, the sans of romance-cover author lines; small sizes get a touch more weight */
  --ui: 'Jost', 'Futura', 'Century Gothic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display: 'Literata', Georgia, serif;
  --display-style: normal;
  --display-weight: 600;
  --story: 'Literata', 'Iowan Old Style', Georgia, serif;

  --fs: 1.1875rem;
  --lh: 1.7;
  --col: 36rem;
  --rbar-h: 3.75rem;
  color-scheme: light;
}
:root[data-fs='s'] { --fs: 1.0625rem; }
:root[data-fs='l'] { --fs: 1.3125rem; }
:root[data-fs='xl'] { --fs: 1.5rem; }
:root[data-lh='loose'] { --lh: 1.95; }

[data-imprint='fang'] {
  --bg: #15241f; --surface: #1c2f29; --ink: #ece6d9; --muted: #a3b1a9; --line: #2a4038;
  --accent: #ece6d9; --on-accent: #15241f; --hi: #d9c58e;
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif; --display-style: normal; --display-weight: 600;
  --story: 'Literata', 'Iowan Old Style', Georgia, serif;
  color-scheme: dark;
}
[data-imprint='violet'] {
  --bg: #fbfbfa; --surface: #f0eff3; --ink: #201c26; --muted: #6c6874; --line: #e6e4e9;
  --accent: #54468a; --on-accent: #ffffff; --hi: #54468a;
  --display: 'Bodoni Moda', 'Didot', Georgia, serif; --display-style: italic; --display-weight: 500;
  --story: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  color-scheme: light;
}

/* Dark: follows the phone unless the reader picked a page color */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #161615; --surface: #20201e; --ink: #ecebe7; --muted: #a3a09a; --line: #2f2e2b;
    --accent: #ecebe7; --on-accent: #161615; --hi: #d9b57a; color-scheme: dark;
  }
  :root:not([data-theme]) [data-imprint='violet'] {
    --bg: #17151b; --surface: #211e26; --ink: #ece9ef; --muted: #a7a2ae; --line: #2e2a34;
    --accent: #c3b6e6; --on-accent: #1d1830; --hi: #c3b6e6; color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #161615; --surface: #20201e; --ink: #ecebe7; --muted: #a3a09a; --line: #2f2e2b;
  --accent: #ecebe7; --on-accent: #161615; --hi: #d9b57a; color-scheme: dark;
}
:root[data-theme='dark'] [data-imprint='violet'] {
  --bg: #17151b; --surface: #211e26; --ink: #ece9ef; --muted: #a7a2ae; --line: #2e2a34;
  --accent: #c3b6e6; --on-accent: #1d1830; --hi: #c3b6e6; color-scheme: dark;
}
:root[data-theme='light'] [data-imprint='fang'] {
  --bg: #f4f1e9; --surface: #e9e5da; --ink: #1b2a24; --muted: #5d6b64; --line: #ddd8cc;
  --accent: #24473b; --on-accent: #ffffff; --hi: #7d5f1c; color-scheme: light;
}
:root[data-theme='sepia'], :root[data-theme='sepia'] [data-imprint] {
  --bg: #f4ecd8; --surface: #ebe0c6; --ink: #3a2f23; --muted: #786853; --line: #e0d3b6;
  --accent: #5e4529; --on-accent: #fbf6e9; --hi: #8a5a1c; color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 430 1.0625rem/1.5 var(--ui); letter-spacing: 0.005em; -webkit-font-smoothing: antialiased; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
img, video { max-width: 100%; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 0.5rem; top: -3rem; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 0.5rem 0.75rem; }
.skip:focus { top: calc(0.5rem + env(safe-area-inset-top, 0px)); }
.page { max-width: var(--col); margin: 0 auto; padding-inline: 1rem; padding-block: 1.5rem 2.5rem; display: grid; gap: 2rem; }
.empty { color: var(--muted); }
.new { color: var(--hi); font-weight: 600; }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  font: 600 1rem/1.2 var(--ui); letter-spacing: 0.01em; color: var(--on-accent); background: var(--accent);
  border: 1px solid var(--accent); border-radius: 0; padding: 0.7rem 1.25rem; min-height: 3rem; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn-wide { width: 100%; }
.btn-line { background: transparent; color: var(--ink); border-color: color-mix(in srgb, var(--ink) 45%, transparent); }
.btn-line:hover { filter: none; border-color: var(--ink); }
.btn-sm { min-height: 2.5rem; padding: 0.45rem 0.9rem; font-size: 0.9375rem; }
.icon-btn { background: none; border: 0; color: inherit; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; cursor: pointer; flex: none; text-decoration: none; }
.icon-btn:hover { color: var(--hi); }
.link-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
.nowrap { white-space: nowrap; }
.arrow { display: inline-block; width: 0.85em; height: 0.6em; vertical-align: 0.05em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 12'%3E%3Cpath d='M0 6h15M10.5 1.5 15.5 6l-5 4.5' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 12'%3E%3Cpath d='M0 6h15M10.5 1.5 15.5 6l-5 4.5' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---------- Top bar (browsing pages): stays put, like Wattpad's mobile web header ---------- */
.rh { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 95%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.rh-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 46rem; margin: 0 auto; padding: 0 0.5rem 0 1rem; min-height: 3.25rem; }
.mark { display: inline-flex; align-items: center; gap: 0.45rem; text-decoration: none; min-width: 0; }
.mark span { font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: 1.0625rem; line-height: 1; white-space: nowrap; }
.mark-house { font: italic 600 1.2rem/1 'Bodoni Moda', Georgia, serif; }
.glyph { flex: none; color: var(--hi); }
.glyph-eye { fill: #e8cf86; }
.rh-nav { display: flex; font-size: 0.9375rem; font-weight: 500; }
.rh-nav a { text-decoration: none; color: var(--muted); padding: 0.85rem 0.6rem; }
.rh-nav a:hover { color: var(--ink); }
.rh-nav a[aria-current='page'] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px var(--ink); }
.rh-over { position: absolute; left: 0; right: 0; top: 0; border: 0; background: linear-gradient(rgb(0 0 0 / 0.55), transparent); backdrop-filter: none; -webkit-backdrop-filter: none; color: #fff; padding-bottom: 1.5rem; }
.rh-over .glyph { color: #fff; }
.rh-over .rh-nav a { color: rgb(255 255 255 / 0.75); }
.rh-over .rh-nav a[aria-current='page'] { color: #fff; box-shadow: inset 0 -2px #fff; }

/* ---------- Book cover: key art with the title set on it ---------- */
.bookcover { position: relative; display: block; flex: none; aspect-ratio: 2 / 3; overflow: hidden; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); }
.bookcover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bookcover-type { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 0.2em; padding: 18% 8% 9%; background: linear-gradient(transparent, rgb(0 0 0 / 0.78) 45%); color: #fff; text-align: center; }
.bookcover-title { font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); line-height: 1.05; }
.bookcover-author { font: 500 0.62em/1.2 var(--ui); opacity: 0.85; letter-spacing: 0.02em; }
.bookcover-sm { width: 4rem; font-size: 0.5625rem; }
.bookcover-md { width: 5.5rem; font-size: 0.75rem; }
.bookcover-lg { width: 8.75rem; font-size: 1.05rem; }

/* ---------- Home ---------- */
.home-head { max-width: 46rem; margin: 0 auto; padding: 1.1rem 1rem 0; }
.wordmark { font: italic 600 1.375rem/1 'Bodoni Moda', Georgia, serif; }
.home-main { max-width: 46rem; margin: 0 auto; padding: 2rem 1rem 3rem; display: grid; gap: 1rem; }
.home-main h1 { font: 600 clamp(1.75rem, 7vw, 2.4rem)/1.15 var(--display); letter-spacing: -0.01em; max-width: 20ch; }
.lede { color: var(--muted); font-size: 1.0625rem; max-width: 36ch; }
.shelves { display: grid; gap: 0; margin: 1rem -1rem 0; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.shelf-card { background: var(--bg); color: var(--ink); }
@media (min-width: 40rem) { .shelves { margin-inline: 0; gap: 1.5rem; } }
.shelf-card-main { display: grid; gap: 0.5rem; padding: 1.5rem 1.25rem 1rem; text-decoration: none; }
.shelf-card h2 { display: flex; align-items: center; gap: 0.5rem; font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: 1.5rem; line-height: 1.1; }
.shelf-card p { color: var(--muted); }
.shelf-covers { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.shelf-card-links { display: flex; gap: 0.5rem 1.25rem; flex-wrap: wrap; padding: 0 1.25rem 1.5rem; font-size: 0.9375rem; font-weight: 600; }
.shelf-card-links a { color: var(--ink); }
.shelf-continue { flex-basis: 100%; color: var(--hi) !important; }

/* ---------- Watch (feed) ---------- */
body.watch-page { background: var(--screen); }
html:has(body.watch-page) { scroll-snap-type: y mandatory; }
.reel { position: relative; height: 100svh; min-height: 30rem; scroll-snap-align: start; background: var(--screen); color: #fff; overflow: hidden; }
.reel-media, .reel-media .vp, .reel-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgb(0 0 0 / 0.86), rgb(0 0 0 / 0.45) 20%, transparent 36%); }
.reel-info { position: absolute; left: 1rem; right: 4rem; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); z-index: 2; display: grid; gap: 0.35rem; }
.reel-title { font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: 1.5rem; line-height: 1.1; }
.reel-hook { font-size: 0.9375rem; line-height: 1.4; color: rgb(255 255 255 / 0.85); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reel-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 0.4rem; }
.reel .btn { background: #fff; color: #111; border-color: #fff; }
.reel-alt { font-size: 0.9375rem; font-weight: 600; color: #fff; }
.reel .btn.pulse { animation: pulse 1.1s ease 2; }
@keyframes pulse { 50% { transform: scale(1.05); } }
.reel-end { min-height: 40svh; scroll-snap-align: end; display: grid; align-content: center; padding: 2rem 1rem; color: rgb(255 255 255 / 0.8); background: var(--screen); max-width: 30rem; margin: 0 auto; }
.reel-end a { color: #fff; font-weight: 600; }
@media (min-width: 56rem) {
  body.watch-page { background: var(--bg); }
  html:has(body.watch-page) { scroll-padding-top: 3.5rem; }
  .watch-page .rh-over { position: sticky; padding-bottom: 0; background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line); }
  .watch-page .rh-over .rh-nav a[aria-current='page'] { color: var(--ink); box-shadow: inset 0 -2px var(--ink); }
  .watch-page .rh-over .glyph { color: var(--hi); }
  .watch-page .rh-over .rh-nav a { color: var(--muted); }
  .watch-page .rh-over .rh-nav a[aria-current='page'] { color: var(--ink); }
  .reel { height: calc(100svh - 3.5rem); display: grid; grid-template-columns: auto minmax(0, 22rem); justify-content: center; align-items: end; gap: 2.5rem; padding: 1rem 2rem 2rem; background: var(--bg); color: var(--ink); }
  .reel::after { display: none; }
  .reel-media { position: relative; inset: auto; height: 100%; aspect-ratio: 9 / 16; width: auto; overflow: hidden; }
  .reel-info { position: static; padding-bottom: 0.5rem; }
  .reel-title { font-size: 2rem; }
  .reel-hook { color: var(--muted); -webkit-line-clamp: unset; font-size: 1.0625rem; }
  .reel .btn { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .reel-alt { color: var(--ink); }
  .reel-end { background: var(--bg); color: var(--muted); }
  .reel-end a { color: var(--ink); }
}

/* ---------- Video player ---------- */
.vp { position: relative; overflow: hidden; background: var(--screen); }
.vp video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.vp-play { position: absolute; left: 50%; top: 45%; translate: -50% -50%; z-index: 2; width: 4.5rem; height: 4.5rem; border: 0; background: none; color: #fff; filter: drop-shadow(0 1px 6px rgb(0 0 0 / 0.6)); display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.vp-play svg { width: 2.75rem; height: 2.75rem; margin-left: 4px; }
.vp.paused-by-user .vp-play, .vp.no-autoplay:not(.playing) .vp-play { opacity: 1; pointer-events: auto; }
.vp-sound { position: absolute; right: 0.75rem; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); z-index: 3; width: 2.75rem; height: 2.75rem; border: 0; cursor: pointer; background: none; color: #fff; filter: drop-shadow(0 1px 4px rgb(0 0 0 / 0.7)); display: grid; place-items: center; }
.vp-sound .ico-sound, .vp-sound[aria-pressed='true'] .ico-muted { display: none; }
.vp-sound[aria-pressed='true'] .ico-sound { display: block; }
.vp-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 3; background: rgb(255 255 255 / 0.2); }
.vp-bar span { display: block; height: 100%; width: 0; background: #fff; }

.watch { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; }
.watch::backdrop { background: rgb(0 0 0 / 0.9); }
.watch[open] { display: grid; place-items: center; }
.watch video { height: min(86svh, 52rem); aspect-ratio: 9 / 16; max-width: 100vw; object-fit: contain; background: #000; }
.watch-close { position: fixed; right: 0.75rem; top: calc(0.75rem + env(safe-area-inset-top, 0px)); width: 2.75rem; height: 2.75rem; border: 0; background: none; color: #fff; display: grid; place-items: center; cursor: pointer; }

/* ---------- Library ---------- */
.page-head { display: grid; gap: 0.5rem; }
.page-head h1 { font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: 2rem; line-height: 1.1; }
.page-head p { color: var(--muted); max-width: 40ch; }
.page h2 { font: 600 1.125rem/1.3 var(--ui); margin-bottom: 0.25rem; }
.reading-list { list-style: none; margin: 0; padding: 0; }
.reading-list li + li { border-top: 1px solid var(--line); }
.reading-row { display: grid; grid-template-columns: 2.5rem 1fr auto; gap: 0.85rem; align-items: center; padding-block: 0.6rem; text-decoration: none; }
.reading-row::after { content: ''; width: 1.1rem; height: 1.1rem; background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 5l7 7-7 7' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 5l7 7-7 7' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat; }
.reading-row img { width: 2.5rem; aspect-ratio: 2 / 3; object-fit: cover; background: var(--line); }
.reading-row-t { display: grid; gap: 0.1rem; min-width: 0; }
.reading-row-t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reading-row-t span { font-size: 0.875rem; color: var(--muted); }
.book-list { list-style: none; margin: 0; padding: 0; }
.book-list li + li { border-top: 1px solid var(--line); }
.book-row { display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; padding-block: 0.9rem; text-decoration: none; align-items: start; }
.book-row-text { display: grid; gap: 0.2rem; min-width: 0; }
.book-row-title { font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: 1.25rem; line-height: 1.15; }
.book-row-author { font-size: 0.875rem; color: var(--muted); }
.book-row-hook { font-size: 0.9375rem; line-height: 1.4; margin-top: 0.2rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-row-meta { font-size: 0.875rem; color: var(--muted); margin-top: 0.25rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.book-row:hover .book-row-title { text-decoration: underline; text-decoration-thickness: 1px; }

/* ---------- Book: cover block, collapsible blurb, contents, and a Read button that stays on screen ---------- */
body.has-cta { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
.book-head { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: end; }
.book-head-text { display: grid; gap: 0.35rem; min-width: 0; }
.book-head h1 { font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: clamp(1.6rem, 7vw, 2.25rem); line-height: 1.08; }
.byline { font-size: 0.9375rem; color: var(--muted); }
.book-stats { font-size: 0.875rem; color: var(--muted); }
.about-book { display: grid; gap: 1rem; }
.book-hook { font: 500 1.125rem/1.45 var(--story); }
.blurb .prose { font-size: 1.0625rem; line-height: 1.65; }
.blurb.clamped { max-height: 10.5rem; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.more-btn { justify-self: start; margin-top: -0.75rem; background: none; border: 0; padding: 0.5rem 0; font: 600 0.9375rem/1.2 var(--ui); color: var(--hi); cursor: pointer; }
.facts { font-size: 0.875rem; color: var(--muted); }
.notes summary { cursor: pointer; font-size: 0.875rem; color: var(--muted); font-weight: 600; padding-block: 0.4rem; }
.notes p { margin-top: 0.4rem; color: var(--muted); font-size: 0.875rem; }
.billing { font-family: var(--display); font-weight: 500; font-size: 0.9375rem; color: var(--muted); }
.duel { display: grid; grid-template-columns: 1fr minmax(2rem, 3.5rem) 1fr; align-items: center; gap: 0.5rem; font: italic 500 clamp(0.95rem, 4vw, 1.05rem)/1.2 'Bodoni Moda', Georgia, serif; color: var(--ink); }
.duel-side { display: inline-flex; align-items: center; gap: 0.45rem; min-width: 0; }
.duel-side:last-child { justify-content: flex-end; text-align: right; }
.duel-strip { height: 9px; color: var(--muted); background:
  linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat,
  linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat,
  linear-gradient(currentColor, currentColor) 20% 50% / 1px 60% no-repeat,
  linear-gradient(currentColor, currentColor) 80% 50% / 1px 60% no-repeat; }
.lamp { width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: none; }
.lamp-red { background: #d9433f; }
.lamp-green { background: #23a36a; }
.chapters { display: grid; gap: 0.25rem; }
.contents-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--line); }
.contents-head h2 { margin: 0; }
.contents-head span { font-size: 0.875rem; color: var(--muted); }
.book-notify { margin-top: 1.75rem; }
.book-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 0.6rem; padding: 0.6rem max(1rem, calc(50% - 22rem)) calc(0.6rem + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.book-cta .btn:first-child { flex: 1; }

/* Contents: number, title, dot leader, date; rows tall enough to tap */
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list a { display: grid; grid-template-columns: 1.75rem auto minmax(1.25rem, 1fr) auto; column-gap: 0.4rem; align-items: baseline; padding-block: 0.75rem; text-decoration: none; }
.toc-list li + li { border-top: 1px solid var(--line); }
.toc-n { font: 400 0.9375rem/1 var(--story); color: var(--muted); }
.toc-t { font: 400 1.125rem/1.35 var(--story); min-width: 0; }
.toc-lead { align-self: baseline; height: 0; border-bottom: 2px dotted color-mix(in srgb, var(--muted) 55%, transparent); transform: translateY(-0.25em); }
.toc-d { font: 400 0.875rem/1 var(--ui); color: var(--muted); white-space: nowrap; }
.toc-list a.read .toc-t { color: var(--muted); }
.toc-list a[aria-current='page'] .toc-t { color: var(--hi); font-weight: 600; }
.toc-list a[aria-current='page'] .toc-n { color: var(--hi); }
.toc-list a:hover .toc-t { text-decoration: underline; text-decoration-thickness: 1px; }
.toc-coming { font: italic 400 1rem/1.5 var(--story); color: var(--muted); padding-top: 0.75rem; border-top: 1px solid var(--line); }

/* ---------- Email form: one bordered bar, field + button ---------- */
.notify { display: grid; gap: 0.6rem; position: relative; }
.notify-lead { font-size: 0.9375rem; line-height: 1.5; color: var(--ink); }
.notify-row { display: flex; }
.notify input[type='email'] { flex: 1 1 auto; min-width: 0; min-height: 3rem; font: 400 1rem/1.2 var(--ui); color: var(--ink); background: var(--bg); border: 1px solid color-mix(in srgb, var(--ink) 45%, transparent); border-right: 0; border-radius: 0; padding: 0.7rem 0.85rem; }
.notify input[type='email']::placeholder { color: var(--muted); opacity: 0.85; }
.notify input[type='email']:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.notify .btn { flex: none; }
.notify .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.notify-msg { font-size: 0.875rem; color: var(--muted); }
.notify-msg:empty { display: none; }
.notify-msg.err { color: #c2362f; }

/* ---------- Reader: like Kindle / Apple Books, tap the page to show or hide the bars ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 40; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--hi); }
.rtop { position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex; align-items: center; gap: 0.25rem; min-height: 3.25rem; padding: env(safe-area-inset-top, 0px) 0.25rem 0; background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); transition: transform 0.22s ease; }
.rtop-t { flex: 1; min-width: 0; display: grid; text-align: center; line-height: 1.25; }
.rtop-t b { font-weight: 600; font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rtop-t > span { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bars-off .rtop { transform: translateY(-105%); }
.reader { max-width: var(--col); margin: 0 auto; padding: calc(3.25rem + 1.75rem) 1.25rem 1rem; }
.ch-head { display: grid; gap: 0.35rem; margin-bottom: 1.75rem; }
.ch-label { font-size: 0.9375rem; color: var(--muted); font-weight: 500; }
.ch-title { font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: clamp(1.75rem, 7.5vw, 2.25rem); line-height: 1.1; }

/* where the video stopped: the line, then a button to watch it again */
.epigraph { margin: 0 0 2rem 1.5rem; display: grid; gap: 0.5rem; justify-items: start; }
.epigraph-line { font: italic 400 1.125rem/1.45 var(--story); }
.epigraph-line::before { content: '\201C'; }
.epigraph-line::after { content: '\201D'; }
.epigraph-src { display: grid; gap: 0.6rem; justify-items: start; font-size: 0.875rem; line-height: 1.45; color: var(--muted); }

.prose { font-family: var(--story); font-size: var(--fs); line-height: var(--lh); overflow-wrap: break-word; hanging-punctuation: first; }
:root[data-ff='sans'] .reader .prose { font-family: var(--ui); }
.prose p { margin: 0 0 1em; }
.prose em { font-style: italic; }
.prose a { color: var(--hi); }
.prose blockquote { margin: 1.25em 0; padding-left: 1em; border-left: 2px solid var(--line); color: var(--muted); }
.prose hr { border: 0; margin: 1.8em auto; height: 0.75rem; }
[data-imprint='fang'] .prose hr {
  width: 3.5rem; background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 12'%3E%3Cpath d='M8 1a5 5 0 1 0 0 10a3.6 3.6 0 0 1 0-10z'/%3E%3Ccircle cx='30' cy='6' r='5'/%3E%3Cpath d='M52 1a5 5 0 1 1 0 10a3.6 3.6 0 0 0 0-10z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 12'%3E%3Cpath d='M8 1a5 5 0 1 0 0 10a3.6 3.6 0 0 1 0-10z'/%3E%3Ccircle cx='30' cy='6' r='5'/%3E%3Cpath d='M52 1a5 5 0 1 1 0 10a3.6 3.6 0 0 0 0-10z'/%3E%3C/svg%3E") center / contain no-repeat;
}
[data-imprint='violet'] .prose hr, body:not([data-imprint]) .prose hr {
  width: 5rem; color: var(--muted);
  background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat, linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat, linear-gradient(currentColor, currentColor) 0 50% / 1px 70% no-repeat, linear-gradient(currentColor, currentColor) 100% 50% / 1px 70% no-repeat;
}

/* unlock block, as in GoodNovel / Galatea: the text fades, then one clear block */
.gated .next, .gated #chapter-end, .gated .author-note, .gated .ad-slot { display: none; }
.gated #prose { max-height: 15em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 35%, transparent); mask-image: linear-gradient(#000 35%, transparent); }
.gate { display: grid; gap: 0.6rem; margin: 0 0 2.5rem; padding: 1.25rem 1.1rem; border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); }
.gate h2 { font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: 1.5rem; line-height: 1.15; }
.gate > p { font-size: 0.9375rem; line-height: 1.5; color: var(--muted); }
.gate .notify { margin-top: 0.25rem; }

/* the author's note sits under a short rule, like a footnote, and is signed */
.author-note { margin: 2.5rem 0 0; display: grid; gap: 0.4rem; }
.author-note::before { content: ''; width: 4rem; border-top: 1px solid var(--muted); margin-bottom: 0.6rem; }
.author-note-text { font: italic 400 1.0625rem/1.6 var(--story); }
.author-note-sig { font: 400 1rem/1.4 var(--story); text-align: right; }

.next { margin-top: 2.5rem; }
.btn-next { width: 100%; justify-content: space-between; min-height: 4rem; padding: 0.75rem 1rem 0.75rem 1.25rem; text-align: left; }
.btn-next-t { display: grid; gap: 0.15rem; min-width: 0; }
.btn-next-t b { font-weight: 650; font-size: 1.0625rem; }
.btn-next-t span { font-weight: 400; font-size: 0.9375rem; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-wait, .next-end { display: grid; gap: 0.75rem; }
.next-wait h2 { font: 600 1.125rem/1.35 var(--ui); }
.the-end { font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: 1.75rem; line-height: 1.2; }
.ad-slot { min-height: 280px; margin: 2rem 0; background: var(--surface); }

/* bottom bar: icon over a word, the way every reading app does it */
body.reading { padding-bottom: calc(var(--rbar-h) + 1rem + env(safe-area-inset-bottom, 0px)); }
.rbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--rbar-h) + env(safe-area-inset-bottom, 0px)); padding: 0 max(0px, calc(50% - 18rem)) env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); transition: transform 0.22s ease;
}
.bars-off .rbar { transform: translateY(105%); }
.rbar-btn { display: grid; justify-items: center; align-content: center; gap: 0.1rem; background: none; border: 0; color: var(--ink); font: 500 0.8125rem/1.2 var(--ui); text-decoration: none; cursor: pointer; }
.rbar-btn[aria-disabled='true'] { opacity: 0.3; cursor: default; }
.rbar-btn .aa { font: 600 1.125rem/22px var(--story); height: 22px; }
.rbar-next { color: var(--hi); font-weight: 600; }
.rbar [hidden] { display: grid !important; visibility: hidden; }

/* "Back where you stopped": a short notice over the bottom bar, with a way back to the top */
.resume { position: fixed; left: 50%; translate: -50% 0; bottom: calc(var(--rbar-h) + 0.75rem + env(safe-area-inset-bottom, 0px)); z-index: 31; display: flex; align-items: center; gap: 1rem; white-space: nowrap; padding: 0.7rem 1rem; background: var(--ink); color: var(--bg); font-size: 0.9375rem; }
.resume .link-btn { font-weight: 600; }
.bars-off .resume { bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }

/* sheets: contents and text settings */
.panel-dlg { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 34rem; max-height: 85svh; overflow: auto; padding: 0 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px)); border: 0; border-top: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.panel-dlg::backdrop { background: rgb(0 0 0 / 0.45); }
.panel-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0 0.5rem; margin-right: -0.6rem; background: var(--bg); z-index: 1; }
.panel-head h2 { font: 600 1.0625rem/1.3 var(--ui); margin: 0; }
.panel-foot { display: inline-block; margin-top: 0.75rem; padding-block: 0.5rem; font-weight: 600; font-size: 0.9375rem; color: var(--hi); text-decoration: none; }
.set-row { display: grid; gap: 0.45rem; margin-top: 1rem; }
.set-label { font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.stepper { display: grid; grid-template-columns: 3.5rem 1fr 3.5rem; border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); }
.step { min-height: 3rem; background: none; border: 0; color: var(--ink); cursor: pointer; font: 400 1.125rem/1 var(--story); }
.step-up { font-size: 1.5rem; border-left: 1px solid var(--line); }
.step-down { border-right: 1px solid var(--line); }
.step span { font: 500 0.875rem/1 var(--ui); margin-left: 0.1rem; vertical-align: super; }
.step:disabled { opacity: 0.3; cursor: default; }
.step-val { display: grid; place-items: center; font: 500 0.9375rem/1 var(--ui); }
.faces { display: grid; border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); }
.face { display: flex; align-items: center; justify-content: space-between; min-height: 3rem; padding: 0 0.6rem 0 0.9rem; background: none; border: 0; color: var(--ink); cursor: pointer; text-align: left; }
.face + .face { border-top: 1px solid var(--line); }
.face span { font-size: 1.125rem; }
.face-book span { font-family: var(--story); }
.face-plain span { font-family: var(--ui); }
.face svg { color: var(--hi); visibility: hidden; }
.face[aria-pressed='true'] svg { visibility: visible; }
.face[aria-pressed='true'] span { font-weight: 600; }
.papers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.paper-opt { display: grid; justify-items: center; gap: 0.35rem; padding: 0.35rem 0 0.25rem; background: none; border: 0; color: var(--muted); cursor: pointer; font: 500 0.8125rem/1 var(--ui); }
.paper { width: 100%; height: 2.5rem; border: 1px solid var(--line); outline: 2px solid transparent; outline-offset: 2px; }
.paper-opt[aria-pressed='true'] { color: var(--ink); font-weight: 600; }
.paper-opt[aria-pressed='true'] .paper { outline-color: var(--accent); }
.paper-auto { background: linear-gradient(135deg, #fbfbfa 50%, #161615 50%); }
.paper-light { background: #fbfbfa; }
.paper-sepia { background: #f4ecd8; }
.paper-dark { background: #161615; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; font: 500 0.9375rem/1 var(--ui); color: var(--ink); background: transparent; border: 0; min-height: 3rem; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--bg); font-weight: 600; }
.lines { display: grid; gap: 3px; width: 1.1rem; }
.lines-loose { gap: 6px; }
.lines i { display: block; height: 1.5px; background: currentColor; }
.lines i:last-child { width: 60%; }

/* ---------- /go grid ---------- */
.go-head { max-width: 46rem; margin: 0 auto; padding: 0.5rem 1rem 1rem; display: grid; gap: 0.25rem; }
.go-head h1 { font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: 1.5rem; line-height: 1.2; }
.go-head p { color: var(--muted); }
.grid { list-style: none; margin: 0 auto; padding: 0; max-width: 46rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.tile { position: relative; display: block; aspect-ratio: 9 / 16; overflow: hidden; background: var(--screen); color: #fff; text-decoration: none; }
.tile-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / 0.7), transparent 40%); }
.tile-title { position: absolute; left: 0.4rem; right: 0.4rem; bottom: 1.55rem; z-index: 2; font-size: 0.75rem; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-dur { position: absolute; left: 0.4rem; bottom: 0.4rem; z-index: 2; display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.go-all { max-width: 46rem; margin: 1.25rem auto 2rem; padding-inline: 1rem; color: var(--muted); font-size: 0.9375rem; }
.go-all a { color: var(--ink); font-weight: 600; }

/* ---------- Messages, legal, footer, consent ---------- */
.message { gap: 1rem; padding-top: 2rem; }
.message h1 { font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: 2rem; line-height: 1.15; }
.message .lede { font-size: 1.0625rem; }
.message form { display: grid; gap: 1rem; justify-items: start; }
.legal { font: 400 1.0625rem/1.65 var(--story); }
.legal h2 { font: 600 1.0625rem/1.3 var(--ui); font-style: normal; margin: 1.75em 0 0.5em; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 0.5em; }
.legal p + p { margin-top: 0.8em; }
.updated { color: var(--muted); font: 400 0.875rem/1 var(--ui); }
.contact-mail { font: 600 1.125rem/1.4 var(--ui); user-select: all; }
.site-footer { max-width: var(--col); margin: 0 auto; padding: 1.75rem 1rem 2rem; display: grid; gap: 0.6rem; color: var(--muted); font-size: 0.875rem; border-top: 1px solid var(--line); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; font-size: 1rem; font-weight: 500; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; gap: 0.6rem; padding: 0.8rem max(1rem, calc(50% - 17rem)) calc(0.8rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.consent-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.has-cta .consent { bottom: calc(4.3rem + env(safe-area-inset-bottom, 0px)); padding-bottom: 0.8rem; }
.reading .consent { bottom: calc(var(--rbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: 0.8rem; }
.consent p { font-size: 0.875rem; line-height: 1.55; }
.consent a { font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(var(--rbar-h) + 1rem + env(safe-area-inset-bottom, 0px)); translate: -50% 0; z-index: 70; background: var(--ink); color: var(--bg); font-size: 0.875rem; padding: 0.7rem 1rem; max-width: calc(100% - 2rem); text-align: center; }

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