:root {
  --cream: #fdf8f5;
  --plum: #3d2b3a;
  --plum-soft: #6b5468;
  --blush: #e8b4bc;
  --blush-deep: #d98fa0;
  --lavender: #c9b6d9;
  --border: #ecdfe2;
  --max-width: 46rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--plum);
  font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  line-height: 1.7;
}

a {
  color: var(--blush-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---- Header on story pages ---- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0.75rem;
  font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.site-title {
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--plum);
  letter-spacing: 0.02em;
}

.back-link {
  font-size: 0.9rem;
  color: var(--plum-soft);
}

/* ---- Hero (home page) ---- */

.hero {
  width: 100%;
  text-align: center;
  padding: 2.5rem 1.25rem 0.5rem;
}

.hero-image {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  border-radius: 0.75rem;
}

.hero-caption {
  text-align: center;
  padding: 1.5rem 1rem 0.5rem;
}

.hero-caption h1 {
  color: var(--plum);
  font-size: clamp(2rem, 6vw, 3.25rem);
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
}

.hero-caption .tagline {
  color: var(--plum-soft);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-style: italic;
  margin: 0;
}

/* ---- Index page ---- */

.index-page {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.section-title {
  font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 1.3rem;
  color: var(--plum);
  border-bottom: 2px solid var(--blush);
  padding-bottom: 0.4rem;
  margin: 2.5rem 0 1rem;
}

.index-page section:first-of-type .section-title {
  margin-top: 0;
}

/* ---- Latest story ---- */

.latest-section {
  margin: 0 0 2rem;
}

.latest-tag {
  display: inline-block;
  font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--blush-deep);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.latest-section .story-list {
  grid-template-columns: 1fr;
}

.latest-section .story-card a {
  border-color: var(--blush-deep);
  border-width: 2px;
}

.story-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem 1rem;
}

@media (max-width: 600px) {
  .story-list {
    grid-template-columns: 1fr;
  }
}

.story-card a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--plum);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.story-card a:hover {
  border-color: var(--blush-deep);
  text-decoration: none;
  transform: translateX(2px);
}

.story-card-title {
  font-size: 1.05rem;
}

.story-card-meta {
  font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--plum-soft);
  white-space: nowrap;
}

/* ---- Story page ---- */

.story-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem 1.25rem 2rem;
}

.story-page h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  margin: 0.5rem 0 0.25rem;
  color: var(--plum);
}

.story-meta {
  font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--plum-soft);
  margin: 0 0 2rem;
}

.story-body p {
  margin: 0 0 1.1rem;
  font-size: 1.08rem;
}

.story-body h2.chapter {
  font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 1.15rem;
  color: var(--blush-deep);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 2.5rem 0 1.25rem;
}

.story-body h3.section-heading {
  font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--plum-soft);
  text-align: center;
  margin: 2rem 0 1.25rem;
}

.story-body hr.scene-break {
  border: none;
  text-align: center;
  margin: 2rem auto;
  width: 6rem;
  height: 1px;
  background: var(--lavender);
}

.back-link-bottom {
  margin-top: 2.5rem;
  font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* ---- Footer ---- */

.site-footer {
  text-align: center;
  font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--plum-soft);
  padding: 2rem 1rem 3rem;
}

/* ---- Dark mode ---- */

@media (prefers-color-scheme: dark) {
  :root {
    --cream: #241a22;
    --plum: #f3e8ee;
    --plum-soft: #cbb9c4;
    --border: #3a2c37;
  }

  .story-card a {
    background: #2d2130;
  }

  .hero-caption {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.65));
  }
}

@media (max-width: 480px) {
  .story-card a {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
}
