:root {
  --bg: #fbf9f5;
  --text: #24211d;
  --muted: #6b645a;
  --rule: #ddd6ca;
  --link: #7a3b1e;
  --link-hover: #a24f28;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 36rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18;
    --text: #e6e1d8;
    --muted: #a39b8f;
    --rule: #3a3631;
    --link: #e0a47f;
    --link-hover: #f2c3a4;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--link-hover);
}

/* Layout: one centered reading column with a 16px gutter on small screens. */
.site-header,
main,
.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.site-name {
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--text);
}

.site-footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
}

h1,
h2 {
  font-weight: normal;
  line-height: 1.25;
}

h1 {
  font-size: 2rem;
  margin: 0 0 1.5rem;
}

h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 1rem;
}

/* Writing list */
.writing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.writing-list li {
  margin: 0 0 1.1rem;
}

.writing-list a {
  font-size: 1.2rem;
}

.meta,
.story-form,
.story-subtitle,
.story-credit,
.story-footer {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}

.writing-list .meta {
  display: block;
}

/* Story pages */
.story-header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.story-header h1 {
  margin-bottom: 0.25rem;
}

.story-header p {
  margin: 0.25rem 0;
}

.story-form,
.story-subtitle {
  font-style: italic;
  font-family: var(--serif);
  font-size: 1rem;
}

.story-credit {
  margin-top: 1rem !important;
}

.prose p {
  margin: 0 0 1em;
  hyphens: auto;
}

/* Scene breaks ("* * *" in the Markdown) render as a centered asterism. */
.prose hr {
  border: 0;
  margin: 2em 0;
  text-align: center;
}

.prose hr::after {
  content: "*  *  *";
  white-space: pre;
  color: var(--muted);
}

/* Chapter numbers in the novel excerpts. */
.prose h2 {
  text-align: center;
  font-size: 1.1rem;
  margin: 3rem 0 1.5rem;
}

.story-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.story-footer p {
  margin: 0.4rem 0;
}
