/* PAPER MACHE — a serial novel by Richard C. Williamson
   Look: a yellowed 1979 paperback typed on a manual machine.
   Palette drawn from aged paper and the cover's rust/concrete collage. */

:root {
  --paper:      #ece2cb;   /* yellowed page                */
  --paper-deep: #ded1b2;   /* foxed edges, panels          */
  --ink:        #2e2822;   /* warm typewriter black        */
  --faded:      #6f6353;   /* faded ink / secondary text   */
  --rust:       #8a4632;   /* brick red from the cover     */
  --rule:       #c4b596;   /* hairlines                    */

  --typed: "Special Elite", "Courier New", monospace;   /* display  */
  --body:  "Courier Prime", "Courier New", monospace;   /* reading  */
}

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

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

body {
  background:
    radial-gradient(ellipse at 15% 8%,  rgba(138, 70, 50, 0.05), transparent 45%),
    radial-gradient(ellipse at 90% 95%, rgba(110, 90, 50, 0.10), transparent 50%),
    radial-gradient(ellipse at 50% 45%, var(--paper) 55%, var(--paper-deep) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.25rem 4rem;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: color 120ms ease;
}
a:hover { color: var(--rust); text-decoration-color: var(--rust); }
a:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; }

/* ------------------------------------------------------------ site nav -- */

.site-nav {
  width: min(42rem, 100%);
  padding: 1.5rem 0 0;
  font-family: var(--typed);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--faded);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.site-nav a { text-decoration: none; color: var(--faded); }
.site-nav a:hover { color: var(--rust); }

/* ------------------------------------------------------------ masthead -- */

.masthead, .chapter-head {
  width: min(42rem, 100%);
  padding: 4.5rem 0 1rem;
  text-align: center;
}

.eyebrow {
  font-family: var(--typed);
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-transform: lowercase;
  color: var(--faded);
}
.eyebrow a { text-decoration: none; color: var(--faded); }

.masthead h1 {
  font-family: var(--typed);
  font-weight: 400;
  font-size: clamp(2.6rem, 10vw, 4.75rem);
  letter-spacing: 0.12em;
  line-height: 1.05;
  margin: 1rem 0 0.75rem;
  color: var(--ink);
  text-shadow: 1px 1px 0 rgba(46, 40, 34, 0.15); /* double-strike */
}

.byline {
  font-family: var(--typed);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.tagline {
  font-style: italic;
  color: var(--faded);
  margin-top: 0.35rem;
}

.typed-rule {
  font-family: var(--body);
  color: var(--rule);
  letter-spacing: 0.05em;
  overflow: hidden;
  white-space: nowrap;
  margin-top: 1.25rem;
  user-select: none;
}

/* --------------------------------------------------------------- index -- */

main { width: min(42rem, 100%); }

.about-blurb {
  padding: 2rem 0;
  color: var(--faded);
  text-align: center;
  font-style: italic;
}

.contents { padding: 1.5rem 0 0; }

.contents-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: start;
}

.section-label {
  font-family: var(--typed);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faded);
  margin-bottom: 1.25rem;
}

.chapter-list { list-style: none; }

.chapter-row {
  display: grid;
  grid-template-columns: 2.75rem 1fr auto;
  gap: 0.85rem;
  align-items: baseline;
  padding: 0.9rem 0.25rem;
  border-bottom: 1px dashed var(--rule);
  text-decoration: none;
  font-family: var(--typed);
}
.chapter-row .num { color: var(--rust); }
.chapter-row .chapter-title { font-size: 1.15rem; letter-spacing: 0.04em; }
.chapter-row .date { font-size: 0.8rem; color: var(--faded); }
.chapter-row:hover .chapter-title { color: var(--rust); }

/* The paperback on the desk. */
.cover img {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
  transform: rotate(-2deg);
  border: 1px solid var(--rule);
  box-shadow: 4px 6px 0 rgba(46, 40, 34, 0.18);
}

/* ------------------------------------------------------------- chapter -- */

.chapter-head h1 {
  font-family: var(--typed);
  font-weight: 400;
  font-size: clamp(1.9rem, 7vw, 3rem);
  letter-spacing: 0.14em;
  margin-top: 0.9rem;
  text-shadow: 1px 1px 0 rgba(46, 40, 34, 0.15);
}

.prose {
  width: min(38rem, 100%);
  padding-top: 1.75rem;
}

.prose p { margin-bottom: 1.4rem; }

.prose.static { text-align: left; }

.typed-note {
  font-size: 0.85rem;
  color: var(--faded);
  border-left: 3px solid var(--rule);
  padding-left: 0.9rem;
}
.typed-note code { font-family: var(--body); color: var(--rust); }

.scene-break {
  text-align: center;
  font-family: var(--body);
  color: var(--faded);
  letter-spacing: 0.4em;
  padding: 1.25rem 0 2.4rem;
}

.about-cover { margin-top: 2rem; }

.chapter-nav {
  width: min(38rem, 100%);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px dashed var(--rule);
  margin-top: 3rem;
  padding-top: 1.5rem;
  font-family: var(--typed);
  font-size: 0.9rem;
}
.chapter-nav a { text-decoration: none; }

/* -------------------------------------------------------------- footer -- */

.site-footer {
  width: min(42rem, 100%);
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--typed);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--faded);
}

@media (max-width: 620px) {
  .contents-grid { grid-template-columns: 1fr; }
  .cover { justify-self: center; }
  .chapter-row { grid-template-columns: 2.5rem 1fr; }
  .chapter-row .date { grid-column: 2; }
}
