@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #0c0c0c;
  --bg-raised: #1a1a1a;
  --ink: #f3f2f0;
  --ink-dim: #9a9a9a;
  --gold: #9c1c30;
  --maroon: #5c1420;
  --border: #2b2b2b;
  --max-w: 780px;
  --radius: 4px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.4em;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(19, 17, 16, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.site-nav .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  row-gap: 8px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.site-nav .brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  color: var(--ink);
  font-weight: 600;
}
.site-nav .brand:hover { text-decoration: none; color: var(--gold); }
.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.site-nav a.nav-link {
  color: var(--ink-dim);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.site-nav a.nav-link:hover, .site-nav a.nav-link.active {
  color: var(--gold);
  text-decoration: none;
}
.nav-toggle { display: none; }

@media (max-width: 640px) {
  .site-nav ul { gap: 12px 16px; justify-content: flex-end; }
  .site-nav a.nav-link { font-size: 0.78rem; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 90px 0 70px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero .eyebrow {
  color: var(--maroon);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-style: italic;
  color: var(--ink);
}
.hero .tagline {
  color: var(--ink-dim);
  font-size: 1.15rem;
  max-width: 560px;
  margin: 18px auto 34px;
}
.hero .cover {
  width: 340px;
  max-width: 80%;
  margin: 0 auto 40px;
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px rgba(0,0,0,0.45);
}

.btn-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--gold);
  transition: background 0.2s, color 0.2s;
}
.btn-primary { background: var(--gold); color: #131110; }
.btn-primary:hover { background: #ddb677; text-decoration: none; }
.btn-secondary { color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }

/* ---------- Sections ---------- */
.section { padding: 70px 0; }
.section-title {
  font-size: 2rem;
  font-style: italic;
  margin-bottom: 12px;
}
.section-sub {
  color: var(--ink-dim);
  margin-bottom: 40px;
  max-width: 640px;
}
.blurb {
  max-width: var(--max-w);
  margin: 0 auto;
  color: var(--ink-dim);
  font-size: 1.05rem;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: break-word;
}

/* ---------- Read page ---------- */
.read-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: 24px 0 60px;
}
.toc {
  position: sticky;
  top: 84px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg-raised);
}
.toc h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  margin-bottom: 14px;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin-bottom: 6px; }
.toc a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--ink-dim);
  font-size: 0.95rem;
}
.toc a:hover { background: rgba(200,161,92,0.08); color: var(--gold); text-decoration: none; }
.toc a.active { background: rgba(200,161,92,0.14); color: var(--gold); }

.reader-col {
  min-width: 0;
}
.reader {
  max-width: var(--max-w);
}
.reader h1 {
  font-style: italic;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}
.chapter-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  color: var(--ink-dim);
  font-size: 0.9rem;
}
.like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  color: var(--ink-dim);
  font-size: 0.9rem;
  cursor: pointer;
}
.like-btn:hover { border-color: var(--gold); }
.like-btn.liked { border-color: var(--gold); color: var(--ink); }

.reactions-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 36px 0;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.reaction-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--ink-dim);
  font-size: 0.95rem;
  cursor: pointer;
}
.reaction-emoji { font-size: 1.1rem; }
.reaction-btn:hover { border-color: var(--gold); }
.reaction-btn.active { border-color: var(--gold); color: var(--ink); background: rgba(156,28,48,0.12); }
.reader p {
  margin: 0 0 1.15em;
  font-size: var(--reader-font-size, 1.08rem);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.8;
  overflow-wrap: break-word;
}

/* Compact sticky toolbar: chapter jump (mobile) + text size, out of the
   way of the actual story text instead of stacked above it. */
.reader-toolbar {
  position: sticky;
  top: 60px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 8px 0;
  background: var(--bg);
}
.chapter-select {
  display: none;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  background: var(--bg-raised);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.85rem;
}
.font-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.font-controls button {
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--ink);
  border-radius: var(--radius);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
}
.font-controls button:hover { border-color: var(--gold); color: var(--gold); }

.reader-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}
.reader-controls span {
  min-width: 0;
  flex: 1 1 auto;
}
.reader-controls span:last-child { text-align: right; }

/* ---------- Comments ---------- */
.comments {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.comments-title {
  font-size: 1.4rem;
  font-style: italic;
  margin-bottom: 20px;
}
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}
.comment-form .hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.comment-form input[type="text"],
.comment-form textarea {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}
.comment-form textarea { min-height: 90px; }
.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.comment-form-row { display: flex; gap: 10px; }

.gif-preview {
  position: relative;
  display: inline-block;
  width: fit-content;
}
.gif-preview img { max-width: 160px; border-radius: var(--radius); display: block; }
.gif-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}
.gif-remove:hover { border-color: var(--maroon); color: var(--maroon); }

.gif-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--bg-raised);
}
.gif-picker input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: inherit;
  margin-bottom: 10px;
}
.gif-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}
.gif-result {
  width: 100%;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
}
.gif-result:hover { border-color: var(--gold); }

.comment-gif { max-width: 220px; border-radius: var(--radius); margin-top: 8px; }

.comment-list { display: flex; flex-direction: column; gap: 18px; }
.comment-status { color: var(--ink-dim); font-size: 0.92rem; }
.comment {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--bg-raised);
}
.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.comment-meta strong { color: var(--gold); font-weight: 600; }
.comment-date { color: var(--ink-dim); font-size: 0.8rem; }
.comment-body {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.comment-actions {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}
.comment-like-btn, .comment-reply-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 0;
}
.comment-like-btn:hover, .comment-reply-btn:hover { color: var(--gold); }
.comment-like-btn.liked { color: var(--ink); }

.reply-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.reply-form input[type="text"],
.reply-form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.9rem;
}
.reply-form textarea { min-height: 60px; }
.reply-form button { align-self: flex-start; }

.comment-replies {
  margin: 12px 0 0 24px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.comment-replies .comment { background: var(--bg); }

@media (max-width: 820px) {
  .read-layout { grid-template-columns: minmax(0, 1fr); padding-top: 12px; }
  .toc { display: none; }
  .chapter-select { display: block; }
  .reader { max-width: 100%; }
  .container { padding: 0 16px; }
  .reader p { line-height: 1.75; }
  .reader-controls span { flex: 1 1 100%; text-align: left; }
}

/* ---------- Character slideshow ---------- */
.char-slideshow {
  position: relative;
  height: calc(100vh - 62px);
  min-height: 480px;
  overflow: hidden;
  background: var(--bg);
}
.cs-slides { position: relative; width: 100%; height: 100%; }
.cs-slide {
  position: absolute;
  inset: 0;
  transform: translateX(100%);
  transition: transform 0.7s ease;
  z-index: 1;
}
.cs-slide.active { transform: translateX(0); z-index: 2; }
.cs-slide.enter-right { transform: translateX(100%); }
.cs-slide.enter-left { transform: translateX(-100%); }
.cs-slide.exit-left { transform: translateX(-100%); }
.cs-slide.exit-right { transform: translateX(100%); }

.cs-portrait { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.55) 35%, rgba(0,0,0,0.1) 65%, transparent 100%);
}
.cs-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 32px 60px 40px;
  max-width: 720px;
  color: var(--ink);
}
.cs-overlay .role { color: var(--maroon); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.1em; }
.cs-name {
  font-size: clamp(2rem, 5vw, 3rem);
  font-style: italic;
  margin: 0;
  opacity: 0;
  transform: translateY(24px);
  transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}
.cs-name.show { opacity: 1; transform: translateY(0); }
.cs-tagline { color: var(--ink-dim); font-style: italic; margin-bottom: 10px; }
.cs-desc { color: var(--ink-dim); font-size: 0.95rem; max-width: 560px; margin-bottom: 14px; }

.cs-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  color: var(--ink);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
}
.cs-arrow:hover { border-color: var(--gold); color: var(--gold); }
.cs-prev { left: 20px; }
.cs-next { right: 20px; }

.cs-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.cs-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--ink-dim);
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.cs-dot.active { background: var(--gold); border-color: var(--gold); }

@media (max-width: 720px) {
  .cs-overlay { padding: 24px 24px 32px; }
  .cs-arrow { width: 36px; height: 36px; font-size: 1rem; }
  .cs-prev { left: 8px; }
  .cs-next { right: 8px; }
  .cs-desc { display: none; }
}

/* ---------- Character grid ---------- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px;
}
.char-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.char-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.char-card img { aspect-ratio: 3/4; object-fit: cover; width: 100%; }
.char-card .char-info { padding: 16px; }
.char-card h3 { font-size: 1.25rem; margin-bottom: 2px; }
.char-card .role {
  color: var(--maroon);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Character detail (modal) ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,9,8,0.82);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 200px 1fr;
}
.modal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: slideInPortrait 0.55s ease-out;
}
@keyframes slideInPortrait {
  from { transform: translateX(-50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeInDialogue {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.dialogue-box {
  background: var(--bg);
  border-left: 3px solid var(--gold);
  padding: 12px 16px;
  margin: 4px 0 18px;
  font-style: italic;
  animation: fadeInDialogue 0.5s ease-out 0.25s both;
}
.dialogue-box .dname {
  display: block;
  font-style: normal;
  font-family: 'Cormorant Garamond', serif;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.95rem;
}
.modal-body { padding: 28px; position: relative; }
.modal-close {
  position: absolute; top: 12px; right: 16px;
  color: var(--ink-dim); font-size: 1.4rem; cursor: pointer; background: none; border: none;
}
.modal-close:hover { color: var(--gold); }
.modal .role { color: var(--maroon); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.08em; }
.modal .tagline { color: var(--ink-dim); font-style: italic; margin: 10px 0 16px; }
.traits { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.trait-pill {
  border: 1px solid var(--border);
  color: var(--ink-dim);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
}
@media (max-width: 560px) {
  .modal { grid-template-columns: 1fr; }
  .modal img { aspect-ratio: 3/2; }
}

/* ---------- Ad slot ---------- */
.ad-slot {
  max-width: var(--max-w);
  margin: 40px auto;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.85rem;
}
.site-footer a { color: var(--ink-dim); }
.site-footer a:hover { color: var(--gold); }

/* ---------- Misc ---------- */
.center { text-align: center; }
.coming-soon-box {
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 60px 40px;
  background: var(--bg-raised);
}
