:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-muted: #f3efe9;
  --text: #18181b;
  --text-muted: #52525b;
  --border: #e5e0d8;
  --accent: #b91c1c;
  --accent-hover: #991b1b;
  --accent-soft: #fef2f2;
  --reader-size: 1.16rem;
}
html[data-theme="dark"] {
  --bg: #111113;
  --surface: #18181c;
  --surface-muted: #222228;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --border: #2e2e36;
  --accent: #ef4444;
  --accent-hover: #f87171;
  --accent-soft: #2a1618;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent); z-index: 100; transition: width 0.1s linear;
}
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 0.78rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  font-weight: 700; font-size: 1.45rem; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.brand-dot {
  width: 9px; height: 9px; border-radius: 999px; background: var(--accent); display: inline-block;
}
.nav-actions { display: flex; align-items: center; gap: 0.45rem; }
.btn-tool {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 0.38rem 0.68rem; border-radius: 8px; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.btn-tool:hover { background: var(--surface-muted); }
.container { max-width: 1080px; margin: 0 auto; padding: 2rem 1.25rem 3.5rem; }
.reader-wrap { max-width: 700px; margin: 0 auto; padding: 1.85rem 1.25rem 4rem; }

/* Homepage Editorial Grid */
.hero-banner {
  border-bottom: 2px solid var(--text); padding-bottom: 1.25rem; margin-bottom: 2rem;
}
.hero-banner h1 {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  margin: 0 0 0.35rem; font-size: clamp(1.9rem, 4vw, 2.75rem); line-height: 1.14;
}
.hero-banner p { margin: 0; color: var(--text-muted); font-size: 1rem; }
.story-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.6rem;
}
.story-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.story-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,0.07); }
.card-cover { aspect-ratio: 1200 / 630; width: 100%; object-fit: cover; background: var(--surface-muted); }
.card-body { padding: 1.3rem; display: flex; flex-direction: column; flex: 1; }
.badge {
  display: inline-block; width: fit-content; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent);
  background: var(--accent-soft); padding: 0.22rem 0.58rem; border-radius: 6px; margin-bottom: 0.65rem;
}
.card-title {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  margin: 0 0 0.6rem; font-size: 1.28rem; line-height: 1.3; font-weight: 700;
}
.card-desc {
  margin: 0 0 1.1rem; color: var(--text-muted); font-size: 0.94rem; line-height: 1.6; flex: 1;
}
.card-meta {
  font-size: 0.8rem; color: var(--text-muted); border-top: 1px solid var(--border);
  padding-top: 0.78rem; display: flex; justify-content: space-between; align-items: center;
}

/* Reader Article */
.story-kicker {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem;
  font-size: 0.84rem; color: var(--text-muted);
}
.article-title {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  margin: 0 0 0.8rem; font-size: clamp(1.65rem, 3.8vw, 2.35rem); line-height: 1.22; font-weight: 700;
}
.chapter-pill-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; margin: 1.1rem 0 1.5rem; font-size: 0.92rem;
}
.chapter-current { font-weight: 700; color: var(--accent); }
.article-cover {
  width: 100%; aspect-ratio: 1200 / 630; object-fit: cover;
  border-radius: 12px; margin-bottom: 1.5rem; border: 1px solid var(--border);
}
.reader-content {
  font-family: Georgia, 'Newsreader', 'Times New Roman', serif;
  font-size: var(--reader-size);
  line-height: 1.85;
}
.reader-content p { margin: 0 0 1.35em; }
.reader-content h2, .reader-content h3 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 1.8em 0 0.6em; line-height: 1.32;
}
.scene-break { border: 0; border-top: 1px dashed var(--border); margin: 2rem auto; width: 45%; }

/* Ads & Placeholders */
.ad-slot { margin: 1.75rem 0; text-align: center; overflow: hidden; }
.ad-placeholder {
  font-family: 'Inter', -apple-system, sans-serif;
  margin: 1.75rem 0; padding: 1.05rem; border: 1.5px dashed var(--border);
  background: var(--surface-muted); border-radius: 10px; text-align: center;
  color: var(--text-muted); font-size: 0.82rem; display: flex; flex-direction: column; gap: 0.28rem;
}
.ad-badge {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; color: var(--accent);
}

/* Chapter Navigation CTA */
.chapter-nav-box {
  margin-top: 2.5rem; padding: 1.5rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; text-align: center;
}
.btn-next-chapter {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; max-width: 440px; padding: 0.95rem 1.5rem;
  background: var(--accent); color: #ffffff; font-weight: 700; font-size: 1.02rem;
  border-radius: 10px; box-shadow: 0 6px 18px rgba(185, 28, 28, 0.25);
  transition: background 0.15s, transform 0.12s;
}
.btn-next-chapter:hover { background: var(--accent-hover); transform: translateY(-1px); }
.chapter-subnav {
  margin-top: 1rem; display: flex; justify-content: center; gap: 1.35rem; font-size: 0.88rem; color: var(--text-muted);
}
.chapter-subnav a:hover { color: var(--accent); text-decoration: underline; }

/* Chapter Drawer Modal */
.toc-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 80; display: none;
}
.toc-backdrop.open { display: block; }
.toc-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 88vw);
  background: var(--surface); border-left: 1px solid var(--border); z-index: 90;
  padding: 1.25rem; overflow-y: auto; transform: translateX(100%); transition: transform 0.2s ease;
}
.toc-drawer.open { transform: translateX(0); }
.toc-list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: 0.5rem; }
.toc-link {
  display: block; padding: 0.7rem 0.9rem; border-radius: 8px; border: 1px solid var(--border);
  font-size: 0.9rem; font-weight: 600;
}
.toc-link.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--border); padding: 2.2rem 1.25rem; margin-top: 3rem;
  text-align: center; font-size: 0.84rem; color: var(--text-muted);
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.35rem; margin-bottom: 0.75rem; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 640px) {
  .header-inner { padding: 0.65rem 1rem; }
  .reader-wrap { padding: 1.25rem 1rem 3rem; }
  .chapter-pill-bar { flex-direction: column; align-items: flex-start; }
}