/* Richard Raab — fiction site. "Reading Room" layout.
   Warm paper ground, Georgia serif, rust accent. */

:root {
  --paper: #f4f2ec;
  --card: #fdfcf9;
  --nav: #faf9f5;
  --ink: #2b2925;
  --muted: #5c574c;
  --faint: #98917f;
  --line: #ddd8cc;
  --card-line: #e4dfd2;
  --accent: #7a3b2e;
  --spine: #2f4a56;
  --spine-ink: #f4f2ec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #201e1a;
    --card: #292620;
    --nav: #262420;
    --ink: #e6e2d8;
    --muted: #b0a996;
    --faint: #837c6b;
    --line: #3a362d;
    --card-line: #3a362d;
    --accent: #d08b6f;
    --spine: #3d5a68;
    --spine-ink: #e6e2d8;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
}

a { color: inherit; }

/* ---------- nav ---------- */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1.3rem clamp(1.25rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: var(--nav);
}
.site-name {
  font-size: 1.2rem;
  text-decoration: none;
}
.site-nav nav {
  display: flex;
  gap: 1.5rem;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-nav nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 0.2rem;
}
.site-nav nav a:hover { color: var(--accent); }

/* ---------- home ---------- */
.home {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem) 4rem;
}
.home .intro {
  font-size: 1.1rem;
  max-width: 34rem;
  margin: 2.2rem 0 1rem;
  text-wrap: balance;
}
.home h2 {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--faint);
  margin: 2.6rem 0 1rem;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  padding: 1.15rem 1.3rem 1.05rem;
  display: flex;
  flex-direction: column;
}
.card .cat {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.card h3 {
  font-size: 1.15rem;
  font-weight: 400;
  margin: 0 0 0.45rem;
}
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.88rem;
  flex: 1;
}
.card .go {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.76rem;
  color: var(--accent);
  text-decoration: none;
}
.card .go:hover { text-decoration: underline; }

/* novel shelf rows */
.shelf { display: grid; gap: 1rem; }
.shelf .card {
  flex-direction: row;
  gap: 1.4rem;
  align-items: center;
}
.spine {
  flex: none;
  width: 3.6rem;
  height: 5.4rem;
  background: var(--spine);
  color: var(--spine-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.35;
  padding: 0.35rem;
}
.shelf .card > div { display: flex; flex-direction: column; }
@media (max-width: 30rem) {
  .shelf .card { flex-direction: column; align-items: flex-start; }
}

/* ---------- reading page ---------- */
.reading {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem clamp(1.25rem, 5vw, 2rem) 4rem;
}
.crumb {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.76rem;
  color: var(--faint);
  margin: 0 0 1.6rem;
}
.crumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.reading h1 {
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.2;
  margin: 0 0 0.35rem;
  text-wrap: balance;
}
.meta {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.78rem;
  color: var(--faint);
  margin: 0 0 2.2rem;
}

.prose {
  font-size: 1.06rem;
  line-height: 1.8;
}
/* block paragraphs: space between, no indent — easier on screen than book indents */
.prose p {
  margin: 0 0 1.4em;
}
.prose .dateline {
  color: var(--muted);
  margin-bottom: 1.8rem;
}
/* scene break */
.prose hr {
  border: none;
  text-align: center;
  margin: 2.4rem 0;
}
.prose hr::after {
  content: "⁂";
  color: var(--faint);
  font-size: 0.9rem;
}

.placeholder-note {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  color: var(--accent);
  border: 1px dashed var(--accent);
  padding: 0.6rem 0.9rem;
  margin-bottom: 1.8rem;
}

.endnote {
  border-top: 1px solid var(--line);
  margin-top: 2.4rem;
  padding-top: 1.1rem;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.endnote a { color: var(--accent); text-decoration: none; }
.endnote a:hover { text-decoration: underline; }

/* ---------- about ---------- */
.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem clamp(1.25rem, 5vw, 2rem) 4rem;
}
.page h1 { font-weight: 400; font-size: 1.8rem; }

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 1.4rem clamp(1.25rem, 5vw, 3rem) 2.5rem;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.75rem;
  color: var(--faint);
}
.site-foot p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
