:root {
  color-scheme: dark;
  --ink: #f6efe4;
  --muted: #b8ab9a;
  --dim: #817567;
  --line: rgba(246, 239, 228, .12);
  --soft-line: rgba(246, 239, 228, .08);
  --bg: #0e0d0b;
  --panel: #171410;
  --panel-2: #201b15;
  --paper: #fff7e8;
  --paper-ink: #201a14;
  --green: #2fae91;
  --red: #c95642;
  --gold: #d6a24d;
  --blue: #78b4d8;
  --shadow: 0 22px 70px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

main, section, article, div, aside, nav {
  min-width: 0;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 247, 232, .035), transparent 380px),
    radial-gradient(circle at 20% 0, rgba(201, 86, 66, .12), transparent 360px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.reader-light {
  color: var(--paper-ink);
  background: var(--paper);
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

button, input, select { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 28px;
  background: rgba(14, 13, 11, .84);
  border-bottom: 1px solid var(--soft-line);
  backdrop-filter: blur(18px);
}

.reader-light .site-header {
  background: rgba(255, 247, 232, .9);
  border-bottom-color: rgba(32, 26, 20, .12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 850;
  font-size: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #10100e;
  background: linear-gradient(140deg, var(--gold), #f2dbc0);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.nav-links a:hover, .text-link:hover { color: var(--ink); }

.header-action {
  padding: 10px 13px;
  color: var(--paper-ink);
  background: var(--gold);
  border-radius: 8px;
}

.mobile-tabbar {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 30;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 7px;
  background: rgba(14, 13, 11, .9);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(16px);
}

.mobile-tabbar a {
  display: grid;
  min-height: 42px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hero {
  min-height: calc(100svh - 68px);
  padding: 56px 28px 46px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr);
  gap: 44px;
  align-items: center;
  max-width: 1320px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 850;
}

h1, h2, h3, p { margin-top: 0; }

h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: 78px;
  line-height: .95;
}

h2 {
  margin-bottom: 12px;
  font-size: 42px;
  line-height: 1.03;
}

h3 {
  margin-bottom: 8px;
  font-size: 21px;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.lead {
  max-width: 700px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.62;
  overflow-wrap: break-word;
}

.hero-actions, .action-row, .finder-row, .reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
  cursor: pointer;
}

.button.primary {
  color: #10100e;
  background: var(--gold);
  border-color: var(--gold);
}

.button.ghost { color: var(--muted); }

.button:focus-visible, input:focus-visible, .reader-tool:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.hero-covers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.book-tile {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #181512;
}

.book-tile:nth-child(2) { min-height: 510px; }

.book-tile img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  opacity: .88;
  transform: scale(1.02);
}

.book-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(0, 0, 0, .82));
}

.book-tile-copy {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 1;
}

.book-tile-copy span, .tagline {
  display: block;
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
}

.book-tile-copy strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1;
}

.book-tile-copy small {
  display: block;
  margin-top: 10px;
  color: rgba(246, 239, 228, .78);
  line-height: 1.45;
}

.section {
  padding: 64px 28px;
  border-top: 1px solid var(--soft-line);
}

.section-inner {
  max-width: 1240px;
  margin: 0 auto;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 26px;
}

.section-head p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.58;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.story-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  min-height: 230px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.story-card.featured {
  grid-column: span 2;
  grid-template-columns: 180px minmax(0, 1fr);
}

.story-cover {
  position: relative;
  min-height: 168px;
  overflow: hidden;
  border-radius: 6px;
  background: #241f19;
}

.story-card.featured .story-cover { min-height: 260px; }

.story-cover img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.story-card p:not(.tagline) {
  color: var(--muted);
  line-height: 1.55;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}

.pill {
  padding: 7px 10px;
  color: #dcefe9;
  background: rgba(47, 174, 145, .12);
  border: 1px solid rgba(47, 174, 145, .16);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.text-link {
  color: var(--gold);
  font-weight: 850;
}

.finder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.finder label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-weight: 800;
}

.finder input {
  flex: 1 1 280px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #0f0e0c;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.finder-results {
  display: grid;
  gap: 10px;
}

.result-line {
  padding: 13px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.result-line span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 54px 28px 72px;
}

.book-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.book-cover-large {
  position: sticky;
  top: 92px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.book-cover-large img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.book-copy .lead { font-size: 18px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 24px 0;
}

.stat {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat strong {
  display: block;
  font-size: 18px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.chapter-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.chapter-list a {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.chapter-list small { color: var(--muted); font-weight: 700; }

.reader-shell {
  display: grid;
  grid-template-columns: minmax(0, 780px) 270px;
  gap: 34px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 28px 80px;
}

.reader-main {
  min-width: 0;
}

.reader-main h1 {
  font-size: 48px;
  line-height: 1.03;
}

.reader-main article {
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--reader-size, 22px);
  line-height: 1.76;
  overflow-wrap: break-word;
}

.reader-main article p { margin-bottom: 1.1em; }

.reader-panel {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.reader-panel h2 {
  margin: 0;
  font-size: 22px;
}

.reader-tool {
  min-height: 42px;
  color: var(--ink);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
}

.reader-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.pricing-grid, .feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.price-card, .feature-card, .rank-card {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.price {
  margin: 16px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
}

.fine {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.rank-list {
  display: grid;
  gap: 12px;
}

.rank-card {
  display: grid;
  grid-template-columns: 54px 82px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.rank-number {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
}

.rank-cover img {
  width: 82px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  padding: 36px 18px 92px;
  color: var(--muted);
  border-top: 1px solid var(--soft-line);
}

.dialog {
  position: fixed;
  inset: auto 20px 20px auto;
  z-index: 50;
  width: min(420px, calc(100vw - 40px));
  padding: 18px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dialog[hidden] { display: none; }

.dialog input {
  width: 100%;
  min-height: 44px;
  margin: 10px 0;
  padding: 0 12px;
  color: var(--ink);
  background: #0f0e0c;
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 1050px) {
  h1 { font-size: 58px; }
  .hero-inner, .finder, .book-layout, .reader-shell { grid-template-columns: 1fr; }
  .book-cover-large, .reader-panel { position: static; }
  .story-grid, .pricing-grid, .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .site-header { padding: 0 16px; }
  .nav-links { display: none; }
  .mobile-tabbar { display: grid; }
  .hero { padding: 34px 16px 28px; }
  .section, .page, .reader-shell { padding-right: 16px; padding-left: 16px; }
  h1 { font-size: 32px; line-height: 1.08; }
  h2 { font-size: 32px; }
  .lead { font-size: 17px; }
  .book-copy { order: -1; }
  .book-cover-large img { aspect-ratio: 16 / 11; }
  .reader-main h1 { font-size: 30px; line-height: 1.1; }
  .reader-main article { font-size: var(--reader-size, 18px); line-height: 1.7; }
  .hero-covers { grid-template-columns: 1fr; }
  .book-tile, .book-tile:nth-child(2) { min-height: 260px; }
  .story-grid, .pricing-grid, .feature-grid { grid-template-columns: 1fr; }
  .story-card, .story-card.featured { grid-template-columns: 96px minmax(0, 1fr); }
  .story-card.featured .story-cover, .story-cover { min-height: 144px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .chapter-list a { flex-direction: column; }
  .rank-card { grid-template-columns: 36px 68px minmax(0, 1fr); }
  .rank-card .button { grid-column: 1 / -1; }
  .rank-cover img { width: 68px; height: 100px; }
}
