:root {
  --bg: #070b14;
  --bg-elevated: #0e1422;
  --text: #f4efe6;
  --text-muted: #a89f8f;
  --accent: #e07a3d;
  --accent-soft: #c45d2a;
  --border: #1c2436;
  --serif: "Libre Baskerville", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--serif); line-height: 1.7; }
body { min-height: 100vh; }

/* Gate / Landing */
.gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background: radial-gradient(ellipse at center, #121a2e 0%, var(--bg) 70%);
}
.gate img.cover {
  width: 220px;
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  margin-bottom: 2rem;
}
.gate h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.4rem;
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
}
.gate h1 span { color: var(--accent); font-style: italic; }
.gate .author { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 2rem; }
.gate p.intro { max-width: 520px; color: var(--text-muted); margin-bottom: 2rem; font-size: 1.05rem; }
.gate-form { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; justify-content: center; }
.gate-form input {
  padding: 0.85rem 1.1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 6px;
  width: 220px;
  font-family: var(--sans);
}
.gate-form button, .btn {
  padding: 0.85rem 1.4rem;
  background: var(--accent);
  color: #0a0f1a;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.gate-form button:hover, .btn:hover { background: var(--accent-soft); }
.gate .error { color: #e07a3d; min-height: 1.2em; font-size: 0.9rem; }
.gate .buy-note { margin-top: 2rem; font-size: 0.9rem; color: var(--text-muted); }
.gate .buy-note a { color: var(--accent); text-decoration: none; }

/* Reader */
.reader { display: none; max-width: 720px; margin: 0 auto; padding: 2rem 1.5rem 6rem; }
.reader.unlocked { display: block; }
.reader-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 0.85rem;
}
.reader-header .title { font-weight: 600; }
.reader-header button { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 0.4rem 0.8rem; border-radius: 4px; cursor: pointer; font-size: 0.8rem; }
.progress {
  position: fixed;
  top: 0; left: 0; height: 3px;
  background: var(--accent);
  width: 0%;
  z-index: 100;
  transition: width 0.2s;
}
.content h1 { font-size: 2rem; font-weight: 400; margin: 2.5rem 0 1rem; letter-spacing: -0.02em; }
.content h2 { font-size: 1.45rem; font-weight: 400; margin: 2rem 0 0.8rem; color: var(--accent); }
.content p { margin: 0 0 1.1rem; font-size: 1.05rem; }
.content em { font-style: italic; }
.content strong { font-weight: 600; }
.content .gap { height: 1.4em; }
.toc {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--sans);
  font-size: 0.9rem;
}
.toc h3 { margin: 0 0 0.8rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.toc a { color: var(--text); text-decoration: none; display: block; padding: 0.3rem 0; border-bottom: 1px solid transparent; }
.toc a:hover { color: var(--accent); }
.section-art { width: 100%; max-width: 280px; margin: 2rem auto; display: block; opacity: 0.85; }
footer.reader-footer { margin-top: 4rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; font-family: var(--sans); }
