/* ============================================================
   King of the World — Dark Fantasy Literary Theme
   Matches book cover: deep indigo, electric blue, gold
   ============================================================ */

:root {
  --bg: #0e0c14;
  --bg-alt: #16131f;
  --surface: #1c1828;
  --surface-2: #242033;
  --ink: #ece8f4;
  --ink-soft: #b8b0c8;
  --muted: #8a8298;
  --gold: #c9a227;
  --gold-light: #e8c84a;
  --blue: #4da6ff;
  --blue-glow: #7ec8ff;
  --purple: #6b4d9e;
  --border: #2e2940;
  --shadow: 0 12px 40px rgba(0,0,0,0.45);
  --radius: 8px;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Source Sans 3', system-ui, sans-serif;
  --max: 1140px;
  --content: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-glow); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-light); }
h1,h2,h3,h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.55em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin-bottom: 0.35em; }

.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.content-width { width: min(100% - 2.5rem, var(--content)); margin-inline: auto; }

/* Header */
.site-header {
  background: rgba(14,12,20,0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}
.site-logo img { height: 44px; width: auto; border-radius: 50%; }
.site-logo__text {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold-light);
}
.site-logo__tag {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.15rem 1.35rem;
}
.site-nav a {
  font-size: 0.9rem; font-weight: 500;
  color: var(--ink-soft); letter-spacing: 0.02em;
}
.site-nav a:hover,
.site-nav .current-menu-item a { color: var(--gold-light); }
.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ink);
}

/* Hero */
.hero {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(77,166,255,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(107,77,158,0.18) 0%, transparent 50%),
    var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0 3.25rem;
  text-align: center;
}
.hero__cover {
  max-width: 280px;
  margin: 0 auto 1.75rem;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55), 0 0 40px rgba(77,166,255,0.15);
  border: 1px solid rgba(201,162,39,0.25);
}
.hero__kicker {
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--blue-glow); margin-bottom: 0.6rem;
}
.hero__title {
  font-size: clamp(2.5rem, 6vw, 3.8rem);
  color: var(--gold-light);
  margin-bottom: 0.25rem;
  text-shadow: 0 0 30px rgba(201,162,39,0.25);
}
.hero__author {
  font-family: var(--font-serif);
  font-size: 1.2rem; font-style: italic;
  color: var(--ink-soft); margin-bottom: 1rem;
}
.hero__tagline {
  max-width: 520px; margin: 0 auto 1.75rem;
  font-size: 1.1rem; color: var(--ink-soft);
}
.hero__actions {
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.5rem; border-radius: var(--radius);
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.03em;
  border: 1.5px solid transparent; cursor: pointer;
  transition: all .15s; text-decoration: none;
}
.btn--solid {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: #1a1208; border-color: var(--gold);
}
.btn--solid:hover {
  filter: brightness(1.08);
  color: #1a1208;
}
.btn--blue {
  background: linear-gradient(135deg, #2a6bb8 0%, var(--blue) 100%);
  color: #fff; border-color: var(--blue);
  box-shadow: 0 0 20px rgba(77,166,255,0.25);
}
.btn--blue:hover {
  filter: brightness(1.1);
  color: #fff;
}
.btn--ghost {
  background: transparent; color: var(--ink);
  border-color: var(--border);
}
.btn--ghost:hover {
  border-color: var(--gold); color: var(--gold-light);
}

/* Royal Road spotlight */
.rr-spotlight {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: var(--shadow), 0 0 40px rgba(77,166,255,0.08);
  max-width: 640px;
  margin: 0 auto;
}
.rr-spotlight h2 {
  color: var(--gold-light);
  margin-bottom: 0.4rem;
}
.rr-spotlight p {
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
  font-size: 1.05rem;
}

/* Sections */
.section { padding: 3.25rem 0; }
.section--alt { background: var(--bg-alt); }
.section-head { text-align: center; margin-bottom: 2.25rem; }
.section-head .kicker {
  font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue-glow); margin-bottom: 0.35rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.35rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card h3 { color: var(--gold-light); margin-bottom: 0.45rem; }
.card p:last-child { margin-bottom: 0; color: var(--ink-soft); }

/* Chapter list */
.chapter-list { list-style: none; margin: 0; padding: 0; }
.chapter-list li { border-bottom: 1px solid var(--border); }
.chapter-list a {
  display: flex; gap: 1.15rem; align-items: baseline;
  padding: 1rem 0; color: var(--ink);
}
.chapter-list a:hover { color: var(--gold-light); }
.chapter-list__num {
  font-family: var(--font-serif);
  font-size: 1.1rem; font-weight: 600;
  color: var(--blue-glow); min-width: 2.2rem;
}
.chapter-list__title {
  font-family: var(--font-serif);
  font-size: 1.22rem; font-weight: 600;
}
.chapter-list__excerpt {
  display: block; font-size: 0.9rem;
  color: var(--muted); margin-top: 0.2rem;
}

/* Page layout */
.page-hero {
  padding: 2.75rem 0 1.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.25rem;
  background: radial-gradient(ellipse 70% 80% at 50% 0%, rgba(77,166,255,0.08) 0%, transparent 60%);
}
.page-hero .kicker {
  font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue-glow); margin-bottom: 0.35rem;
}
.page-hero h1 { color: var(--gold-light); }
.page-hero .lede {
  font-size: 1.15rem; color: var(--ink-soft); max-width: 36em;
}
.page-article { padding-bottom: 3.5rem; }
.entry-content { max-width: var(--content); }
.entry-content h2 {
  margin-top: 2em; padding-top: 0.5em;
  border-top: 1px solid var(--border);
  color: var(--gold-light);
}
.entry-content h2:first-child {
  margin-top: 0; border-top: none; padding-top: 0;
}
.entry-content figure { margin: 2rem 0; }
.entry-content figcaption {
  font-size: 0.85rem; color: var(--muted);
  text-align: center; margin-top: 0.55rem;
}
.entry-content img {
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Patreon */
.tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem; margin-top: 1.4rem;
}
.tier {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.35rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.tier--featured {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(201,162,39,0.15);
}
.tier__name {
  font-family: var(--font-serif);
  font-size: 1.35rem; font-weight: 700;
  color: var(--gold-light); margin-bottom: 0.2rem;
}
.tier__price {
  font-size: 1.7rem; font-weight: 600;
  color: var(--blue-glow); margin-bottom: 0.75rem;
}
.tier__price span { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.tier ul {
  list-style: none; padding: 0; margin: 0 0 1.3rem;
  text-align: left; font-size: 0.92rem;
}
.tier li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--ink-soft);
}
.tier li:last-child { border-bottom: none; }

/* Newsletter */
.newsletter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.25rem 1.75rem;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 540px; margin: 0 auto;
}
.newsletter h2 { color: var(--gold-light); margin-bottom: 0.35rem; }
.newsletter p { color: var(--ink-soft); margin-bottom: 1.3rem; }
.newsletter-form {
  display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: center;
}
.newsletter-form input[type="email"] {
  flex: 1 1 210px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem; font-family: inherit;
  background: var(--bg); color: var(--ink);
}
.newsletter-form input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

/* Download box */
.download-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  align-items: center;
  box-shadow: var(--shadow);
}
.download-box__cover {
  width: 140px; flex-shrink: 0;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.download-box__body { flex: 1 1 240px; }
.download-box__body h3 { color: var(--gold-light); margin-bottom: 0.35rem; }
.download-box__body p { color: var(--ink-soft); margin-bottom: 1rem; }

/* Footer */
.site-footer {
  background: #08060c;
  color: var(--muted);
  padding: 2.75rem 0 1.75rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--gold-light); }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.75rem; margin-bottom: 2rem;
}
.footer-grid h4 {
  font-family: var(--font-serif);
  color: var(--gold-light);
  font-size: 1.05rem; margin-bottom: 0.7rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 0.35rem; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  font-size: 0.85rem; text-align: center;
}

/* Chapter single */
.chapter-header {
  padding: 2.75rem 0 1.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
  text-align: center;
  background: radial-gradient(ellipse 70% 80% at 50% 0%, rgba(77,166,255,0.08) 0%, transparent 60%);
}
.chapter-header .kicker { color: var(--blue-glow); }
.chapter-header h1 { color: var(--gold-light); }
.chapter-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 2.5rem; padding-top: 1.4rem;
  border-top: 1px solid var(--border); font-size: 0.95rem;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; width: 100%;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem 1.25rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.55rem; }
  .site-header__inner { flex-wrap: wrap; }
  .hero { padding: 2.5rem 0 2.25rem; }
  .download-box { justify-content: center; text-align: center; }
}
