/* Mobile first: base rules target a phone, media queries widen the layout. */

:root {
  /* Dark-only: the cover art is the colour, the interface stays out of its way. */
  --bg: #0b0b10;
  --surface: #15151d;
  --surface-2: #20202b;
  --text: #f3f1ec;
  --reading: #dcd7cd;
  --muted: #9c99a6;
  --border: #2a2a37;
  --accent: #f6b73c;
  --accent-soft: #2f2610;
  --on-accent: #17120a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 14px 32px -14px rgba(0, 0, 0, .9);
  --cover-shadow: 0 2px 4px rgba(0, 0, 0, .5), 0 16px 28px -12px rgba(0, 0, 0, .95);
  --veil: rgba(11, 11, 16, .3);
  --veil-solid: rgba(11, 11, 16, .96);
  --reader-size: 20px;
  --gutter: 18px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: Fraunces, "Iowan Old Style", Georgia, serif;
  --serif: Literata, Charter, "Iowan Old Style", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }
main { min-height: 100vh; overflow-x: clip; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter) 48px; }
.container--narrow { max-width: 720px; }
.page-title { margin: 28px 0 16px; font-family: var(--display); font-size: 32px; line-height: 1.12; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; font-family: var(--display); font-size: 23px; font-weight: 700; letter-spacing: -.01em; }
.section-title::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: var(--accent); }
.static-page p { font-size: 17px; line-height: 1.7; }
.static-page a { color: var(--accent); text-decoration: underline; }
.static-page { padding-bottom: 48px; }
.static-page h2 { margin: 34px 0 10px; font-family: var(--display); font-size: 22px; line-height: 1.25; }
.static-page ul { margin: 0 0 16px; padding-left: 22px; }
.static-page li, .static-page dd { font-size: 17px; line-height: 1.65; }
.static-page li { margin-bottom: 8px; }
.static-page .lead { font-size: 19px; color: var(--text); }
.static-page .updated { margin: -6px 0 18px; font-size: 13px; color: var(--muted); }
.static-page .topics dt { margin-top: 18px; font-weight: 700; color: var(--text); }
.static-page .topics dd { margin: 4px 0 0; color: var(--muted); }
.contact-card { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 20px 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.contact-card span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.contact-card a { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.static-page .btn-link { display: inline-block; margin-top: 8px; padding: 12px 22px; border-radius: 999px; background: var(--accent); color: #17130a; font-weight: 700; text-decoration: none; }
.library { padding-bottom: 48px; }
.library__intro { margin: 0 0 18px; font-size: 17px; line-height: 1.6; color: var(--muted); }
.library__jump { display: flex; flex-wrap: wrap; gap: 8px; }
.library__jump a { padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13.5px; font-weight: 600; }
.library__jump a span { margin-left: 4px; color: var(--muted); font-weight: 400; }
.library .section-title { scroll-margin-top: 72px; }
.library__more { margin: 14px 0 0; font-size: 15px; font-weight: 700; }
.library__more a { color: var(--accent); }

.chip { display: inline-block; padding: 3px 9px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.cover { aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px 9px 9px 4px; background: var(--surface-2); box-shadow: var(--cover-shadow); }

/* ------------------------------------------------------------------ header */
.site-header { position: sticky; top: 0; z-index: 45; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.site-header__inner { max-width: 1120px; height: 56px; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; }
.site-logo { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.site-logo__mark { width: 22px; height: 26px; border-radius: 3px 7px 7px 3px; background: linear-gradient(90deg, rgba(0, 0, 0, .25) 0 4px, transparent 4px), var(--accent); }
.site-nav { display: none; gap: 26px; font-size: 14px; font-weight: 500; color: var(--muted); }
.site-nav a:hover { color: var(--text); }
.menu-toggle { min-height: 44px; margin-right: -10px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font-size: 14px; font-weight: 600; cursor: pointer; }
.mobile-menu { position: absolute; left: 0; right: 0; top: 56px; display: flex; flex-direction: column; padding: 6px var(--gutter) 12px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.mobile-menu a { padding: 13px 0; font-size: 16px; font-weight: 500; border-top: 1px solid var(--border); }
.mobile-menu a:first-child { border-top: 0; }

/* -------------------------------------------------------------------- hero */
/* Phone: the cover art fills the screen like a poster and the text sits on its faded foot. */
.hero { position: relative; display: flex; align-items: flex-end; min-height: min(178vw, 760px); margin: 0 calc(-1 * var(--gutter)); overflow: hidden; background: #000; color: #fff; text-align: center; isolation: isolate; }
.hero__bg { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 0; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, rgba(11, 11, 16, .35) 0, rgba(11, 11, 16, 0) 22%, rgba(11, 11, 16, .1) 42%, rgba(11, 11, 16, .82) 66%, var(--bg) 90%); }
.hero__cover { display: none; }
.hero__body { width: 100%; padding: 0 22px 8px; }
.hero__eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.hero__title { margin: 10px 0 10px; font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.16; letter-spacing: -.01em; text-wrap: balance; text-shadow: 0 2px 18px rgba(0, 0, 0, .7); }
.hero__summary { margin: 0 0 18px; font-size: 15px; line-height: 1.55; color: rgba(255, 255, 255, .8); text-wrap: pretty; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero__cta { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 800; }
.hero__meta { display: block; margin-top: 12px; font-size: 12.5px; color: rgba(255, 255, 255, .6); }
/* No generated art yet: the drawn cover carries its own title, so show it as a book on a blurred backdrop. */
.hero--drawn { flex-direction: column; align-items: center; min-height: 0; padding-top: 30px; }
.hero--drawn .hero__bg { top: -15%; left: -15%; width: 130%; height: 130%; filter: blur(40px) saturate(1.3); opacity: .8; }
.hero--drawn::after { background: linear-gradient(180deg, rgba(11, 11, 16, .25), rgba(11, 11, 16, .8) 60%, var(--bg)); }
.hero--drawn .hero__cover { display: block; width: 150px; margin-bottom: 22px; border-radius: 5px 11px 11px 5px; }

/* ------------------------------------------------------------------- shelf */
.shelf__row { display: flex; gap: 14px; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 18px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-left: var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.shelf__row::-webkit-scrollbar { display: none; }
.tile { flex: none; width: 138px; display: flex; flex-direction: column; scroll-snap-align: start; }
.tile__cover { position: relative; display: block; }
.tile__cover .cover { width: 100%; }
.tile__rank { position: absolute; left: 6px; bottom: 0; font-family: var(--display); font-size: 64px; font-weight: 700; line-height: .9; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .9), 0 0 22px rgba(0, 0, 0, .8); }
.tile__cover::after { content: ""; position: absolute; inset: 50% 0 0; border-radius: 0 0 9px 4px; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .7)); pointer-events: none; }
.tile__rank { z-index: 1; }
.tile__title { margin-top: 12px; font-family: var(--display); font-size: 15px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile__meta { margin-top: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* -------------------------------------------------------------- story list */
.genres { display: flex; gap: 8px; margin: 0 calc(-1 * var(--gutter)) 16px; padding: 2px var(--gutter); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.genres::-webkit-scrollbar { display: none; }
.genres a { flex: none; display: flex; align-items: center; min-height: 38px; padding: 0 15px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; white-space: nowrap; }
.genres a.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.card { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 15px; align-items: start; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; font-family: var(--sans); line-height: 1.5; }
.card__cover { width: 100%; }
.card__body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 138px; }
.card__title { margin: 0; font-family: var(--display); font-size: 17px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__summary { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { margin: auto 0 0; padding-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }

.pager { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 28px; font-size: 14px; color: var(--muted); }
.pager a { display: flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; }

/* ----------------------------------------------------------------- chapter */
.read-progress { position: fixed; z-index: 70; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
.chapter { max-width: 680px; margin: 0 auto; }
.chapter > .story-strip { margin-top: 20px; }
/* Chapters appended on scroll are set apart by a rule and extra air. */
.chapter-part + .chapter-part { margin-top: 56px; padding-top: 8px; border-top: 1px solid var(--border); }
.chapter-loader { margin-top: 40px; text-align: center; font-size: 14px; color: var(--muted); }
.chapter-loader a { display: inline-flex; align-items: center; min-height: 50px; padding: 0 22px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-size: 15.5px; font-weight: 700; }
.chapter-loader.is-loading::before { content: ""; display: inline-block; width: 18px; height: 18px; margin-right: 10px; vertical-align: -4px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.story-strip { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 13px; align-items: center; padding: 10px 14px 10px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.story-strip__cover { width: 100%; border-radius: 2px 5px 5px 2px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.story-strip__text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.story-strip__title { font-family: var(--display); font-size: 15px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-strip__meta { font-size: 12px; color: var(--muted); }
.progress { display: block; height: 4px; margin-top: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress__bar { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.chapter__kicker { margin: 30px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); text-align: center; }
.chapter__title { margin: 0; font-family: var(--display); font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; text-align: center; text-wrap: balance; }
.chapter__meta { margin: 14px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.chapter__meta::after { content: ""; display: block; width: 44px; height: 2px; margin: 20px auto 0; border-radius: 2px; background: var(--border); }

.prose { color: var(--reading); font-family: var(--serif); font-size: var(--reader-size); line-height: 1.75; overflow-wrap: break-word; }
.prose > p { margin: 1.1em 0; }
.prose > p:first-of-type::first-letter { float: left; margin: .08em .1em 0 0; font-family: var(--display); font-size: 3.4em; line-height: .8; font-weight: 700; color: var(--accent); }


.the-end { display: flex; align-items: center; gap: 16px; margin: 44px 0 0; font-family: var(--display); font-style: italic; font-size: 20px; color: var(--muted); }
.the-end::before, .the-end::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.share { margin-top: 30px; }
.share__label { display: block; margin-bottom: 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.share__links { display: flex; gap: 8px; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); overflow-x: auto; scrollbar-width: none; }
.share__links::-webkit-scrollbar { display: none; }
.share__links a { flex: none; display: flex; align-items: center; min-height: 42px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; }

.more-stories { margin-top: 12px; }

/* Table of contents */
.toc-num { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--sans); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.toc-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; line-height: 1.3; }
.toc-desktop ol, .toc-modal ol { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.toc-desktop li a, .toc-modal li a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px; border-top: 1px solid var(--border); }
li[data-active] a { background: var(--accent-soft); color: var(--accent); }
li[data-active] .toc-num { background: var(--accent); color: var(--on-accent); }
li[data-active] .toc-title { font-weight: 700; }
.toc-desktop { display: none; }

.toc-modal { position: fixed; inset: 0; z-index: 90; }
.toc-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .2s; }
.toc-modal__sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; max-height: 82dvh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .3); transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.toc-modal.is-open .toc-modal__backdrop { opacity: 1; }
.toc-modal.is-open .toc-modal__sheet { transform: none; }
.toc-modal__grip { width: 40px; height: 4px; margin: 10px auto 0; border-radius: 999px; background: var(--border); }
.toc-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 8px 12px 16px; }
.toc-modal__head > div { min-width: 0; }
.toc-modal__story { margin: 0; font-family: var(--display); font-size: 17px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toc-modal__count { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.toc-modal__head button { flex: none; width: 44px; height: 44px; border: 0; background: none; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer; }
.toc-modal input { margin: 0 16px 12px; height: 46px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; }
.toc-modal ol { flex: 1; min-height: 0; overscroll-behavior: contain; }
.toc-modal__empty { padding: 24px; text-align: center; color: var(--muted); }

/* Bottom reader bar: previous / chapters / text size / next, within thumb reach. */
.reader-bar { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1.7fr auto 1fr; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--border); }
.reader-bar__btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 12px; border: 0; border-radius: 13px; background: var(--surface-2); font-size: 14.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.reader-bar__btn b { font-variant-numeric: tabular-nums; color: var(--accent); }
.reader-bar__btn small { font-size: .72em; margin-left: -5px; }
.reader-bar__btn--main { background: var(--accent-soft); }
.reader-bar__btn.is-disabled { opacity: .35; }

/* ------------------------------------------------------------------ footer */
.footer-ad { padding: 24px 0; border-top: 1px solid var(--border); background: var(--surface); }
.footer-ad .ad-container { margin: 0; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 22px; padding: 22px var(--gutter) calc(100px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); font-size: 13px; line-height: 1.4; color: var(--muted); text-align: center; }
/* Links share one row; the copyright sits on its own line beneath them. */
.site-footer a { padding: 8px 0; white-space: nowrap; }
.site-footer a:hover { color: var(--text); }
.site-footer span { order: 1; flex-basis: 100%; padding-top: 6px; font-size: 12px; opacity: .8; }
.scroll-top { position: fixed; z-index: 55; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); font-size: 18px; font-weight: 700; box-shadow: var(--shadow); cursor: pointer; }

/* --------------------------------------------------------------------- ads */
/* Full-bleed on phones so a 336px unit fits a 360px screen. */
.ad-container { margin: 30px calc(-1 * var(--gutter)); overflow: hidden; text-align: center; font-family: var(--sans); line-height: 1.3; }
.ad-container:empty { margin: 0; }
.ad-slot { min-width: 300px; }
.ad-slot::before { content: "Advertisement"; display: block; margin-bottom: 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ad-demo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; max-width: 100%; margin: 0 auto; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; }
.ad-demo small { font-weight: 400; }
.ad-demo-anchor { position: fixed; top: 0; left: 0; right: 0; z-index: 8000; height: 50px; display: flex; align-items: center; justify-content: center; gap: 12px; background: #20202b; border-bottom: 1px solid var(--border); color: #fff; font-size: 13px; font-weight: 600; }
.ad-demo-anchor button { border: 0; border-radius: 6px; padding: 6px 12px; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; }

.outstream { position: relative; width: 100%; max-width: 640px; margin: 0 auto; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.outstream video, .outstream__ads { position: absolute; inset: 0; width: 100%; height: 100%; }
.outstream.is-sticky { position: fixed; z-index: 8500; right: 10px; bottom: calc(74px + env(safe-area-inset-bottom)); width: min(400px, 58vw); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .4); }
.outstream__close { position: absolute; z-index: 2; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; display: none; }
.outstream.is-sticky .outstream__close { display: block; }

/* Chapter lock */
.prose.is-locked { position: relative; overflow: hidden; }
.prose.is-locked::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 180px; background: linear-gradient(180deg, rgba(11, 11, 16, 0), var(--bg) 85%); pointer-events: none; }
.cg-card--inline { margin: 4px 0 28px; padding: 18px; }
.cg-ico { flex: none; width: 46px; height: 46px; border-radius: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23161310' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / 22px no-repeat, linear-gradient(135deg, #f0a500, #e8762b); }
.chapter-loader.is-gated { display: none; }
.next-chapter { display: flex !important; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border-radius: 14px; background: var(--accent); color: #17130a !important; font-weight: 700; text-decoration: none !important; }
.cg-veil { position: absolute; left: 0; right: 0; z-index: 9000; background: var(--veil); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 90px); mask-image: linear-gradient(180deg, transparent 0, #000 90px); }
@supports not ((backdrop-filter: blur(7px)) or (-webkit-backdrop-filter: blur(7px))) {
  .cg-veil { background: var(--veil-solid); }
}
.cg-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9050; padding: 44px 12px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(22, 19, 16, 0), #161310 38%); transform: translateY(120%); transition: transform .45s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.cg-bar.is-shown { transform: none; pointer-events: auto; }
.cg-card { max-width: 560px; margin: 0 auto; padding: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: #161310; color: #f8f4ec; border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .55); }
.cg-text { flex: 1 1 200px; min-width: 0; }
.cg-title { margin: 0 0 2px; font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.cg-sub { margin: 0; font-size: 13px; line-height: 1.4; color: rgba(248, 244, 236, .65); }
.cg-btn { flex: 1 1 120px; min-height: 48px; border: 0; border-radius: 12px; padding: 0 20px; font-size: 15px; font-weight: 700; color: #161310; background: linear-gradient(135deg, #f0a500, #e8762b); white-space: nowrap; cursor: pointer; }
.cg-btn[disabled] { opacity: .55; cursor: progress; }
.cg-toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 9070; padding: 12px 18px; border-radius: 12px; background: #1c1b1a; color: #fff; font-size: 14px; font-weight: 500; white-space: nowrap; opacity: 0; transform: translate(-50%, 20px); transition: opacity .3s, transform .3s; pointer-events: none; }
.cg-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.cg-sim { position: fixed; inset: 0; z-index: 9080; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(12, 10, 8, .88); }
.cg-sim__box { width: 100%; max-width: 420px; background: #0e0c0a; color: #fff; border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px; overflow: hidden; text-align: center; }
.cg-sim__creative { aspect-ratio: 16 / 10; display: grid; place-items: center; background: #14110d; }
.cg-sim__creative h3 { margin: 0; font-size: 18px; }
.cg-sim__creative p { margin: 6px 0 0; font-size: 13px; color: rgba(255, 255, 255, .6); }
.cg-sim__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; font-size: 14px; }
.cg-sim__foot .cg-btn { flex: none; }

/* ------------------------------------------------------------- tablet (640) */
@media (min-width: 640px) {
  :root { --gutter: 28px; }
  .hero, .hero--drawn { flex-direction: row; align-items: center; gap: 36px; min-height: 0; margin: 24px 0 0; padding: 40px; border: 1px solid var(--border); border-radius: 24px; text-align: left; }
  .hero__bg { top: -20%; left: -10%; width: 120%; height: 140%; object-position: 50% 30%; filter: blur(34px) saturate(1.3); opacity: .75; }
  .hero::after { background: linear-gradient(90deg, rgba(11, 11, 16, .3), rgba(11, 11, 16, .88) 60%); }
  .hero__cover, .hero--drawn .hero__cover { display: block; flex: none; width: 200px; margin-bottom: 0; border-radius: 6px 12px 12px 6px; }
  .hero__body { padding: 0; }
  .hero__summary { -webkit-line-clamp: 4; }
  .hero__title { font-size: 32px; }
  .hero__summary { font-size: 16.5px; }
  .hero__cta { display: inline-flex; padding: 0 28px; }
  .hero__meta { display: inline; margin-left: 14px; }
  .grid { gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { grid-template-columns: 104px minmax(0, 1fr); transition: transform .15s, box-shadow .15s; }
  .card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .tile { width: 150px; }
  .ad-container { margin-left: 0; margin-right: 0; }
  .chapter__title { font-size: 46px; }
  .reader-bar { left: 50%; right: auto; bottom: 16px; width: 480px; transform: translateX(-50%); padding: 8px; border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
  .toc-modal__sheet { left: 50%; right: auto; width: 520px; margin-left: -260px; bottom: 16px; border-radius: 22px; }
}

/* ------------------------------------------------------------ desktop (960) */
@media (min-width: 960px) {
  .site-header__inner { height: 64px; }
  .site-nav { display: flex; }
  .menu-toggle, .mobile-menu { display: none; }
  .hero, .hero--drawn { padding: 52px 56px; gap: 48px; }
  .hero__cover, .hero--drawn .hero__cover { width: 240px; }
  .hero__title { font-size: 40px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile { width: 164px; }
  .chapter__title { font-size: 54px; }
}

@media (min-width: 1440px) {
  .toc-desktop { display: flex; flex-direction: column; position: fixed; z-index: 30; top: 140px; right: 24px; width: 300px; max-height: calc(100vh - 260px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
  .toc-desktop__story { padding: 14px 16px; font-family: var(--display); font-size: 16px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .toc-desktop__meta { display: flex; justify-content: space-between; padding: 8px 16px; border-top: 1px solid var(--border); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .toc-desktop .toc-title { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
