@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400;1,6..72,500&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #faf9f6;
  --border: rgba(0, 0, 0, 0.07);
  --text: #1a1a1a;
  --text-muted: #999;
  --text-secondary: #555;
  --heading: #111;
  --accent: #1a1a1a;
  --separator: #bbb;
  --content-max: 640px;
  --font: 'Newsreader', Georgia, 'Times New Roman', serif;
}

[data-theme="dark"] {
  --bg: #151412;
  --border: rgba(255, 255, 255, 0.07);
  --text: #d4cfc7;
  --text-muted: #666;
  --text-secondary: #999;
  --heading: #ede8de;
  --accent: #d4cfc7;
  --separator: #444;
}

html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  transition: background 0.3s, color 0.3s;
}

/* ─── Progress bar ─────────────────────────────────────────── */

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  z-index: 1000;
}

/* ─── Theme toggle ──────────────────────────────────────────── */

#theme-toggle {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 200;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  padding: 4px;
  transition: color 0.2s;
  line-height: 1;
}

#theme-toggle:hover {
  color: var(--text);
}

/* ─── Hero ──────────────────────────────────────────────────── */

.hero {
  background: var(--bg);
  padding: 3.5rem 1.5rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--heading);
  margin-bottom: 12px;
}

.hero-subtitle {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── Story content ─────────────────────────────────────────── */

.story-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

/* ─── Chapters ──────────────────────────────────────────────── */

.chapter + .chapter {
  margin-top: 2.5rem;
}

.chapter-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1rem;
}

.chapter-title {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--heading);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  text-align: center;
}

.chapter p {
  margin-bottom: 1.25rem;
}

.chapter p:last-child {
  margin-bottom: 0;
}

.chapter em {
  font-style: italic;
}

/* ─── Section separators ────────────────────────────────────── */

.separator {
  position: relative;
  height: 1px;
  font-size: 0;
  line-height: 0;
  margin: 2.5rem 0;
  user-select: none;
}

.separator::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--separator);
  margin: 0 auto;
}

/* ─── Responsive ────────────────────────────────────────────── */

@media (max-width: 520px) {
  html {
    font-size: 17px;
  }

  .hero {
    padding: 2rem 1.25rem 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .story-content {
    padding: 2rem 1.25rem 4rem;
  }
}
