/* Reading pages for the stories (build/make-story.py). Sits on /site.css. */

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --measure: 36rem;
  --display-green: #8dffb8;
}

/* ---- the story ---- */

.story { padding: 0 6vw; }

.story-head {
  max-width: var(--measure);
  margin: 4.5rem auto 3.5rem;
}

.story-head h1 {
  font-size: clamp(2.8rem, 9vw, 5.2rem);
  margin: 0.2rem 0 0.9rem;
}

.setting {
  margin: 0;
  color: var(--dim);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
}

.chapter { margin: 0 0 4.5rem; }

.plate {
  max-width: 1100px;
  margin: 0 auto 2rem;
}

.plate img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

/* A picture captioned apart from its chapter's title (The Chair). */
.plate figcaption {
  margin-top: 0.7rem;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: var(--wide);
  text-transform: uppercase;
  color: var(--dim);
}

.chapter h2,
.chapter p,
.chapter .record,
.imprint,
.chapter .scene-break,
.end,
.lingo {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.chapter h2 {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 2rem;
  color: var(--ink);
  font-size: 0.95rem;
}

.chapter h2 .numeral {
  color: var(--amber);
  font-family: var(--serif);
  font-size: 1.7rem;
  letter-spacing: 0.06em;
}

.chapter p {
  margin-top: 0;
  margin-bottom: 0.95em;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--ink);
  hanging-punctuation: first;
}

.chapter p.opening {
  font-size: 1.55rem;
  line-height: 1.45;
  margin-bottom: 1.4rem;
}

.chapter em { font-style: italic; color: #f3eee3; }

/* Lines quoted from a record: a typed document, not a live screen. */
.chapter .record {
  margin-top: 1.6rem;
  margin-bottom: 1.6rem;
  padding: 0.9rem 1.2rem;
  border-left: 2px solid var(--amber);
  background: var(--panel);
}

.chapter .record p {
  margin: 0.35rem 0;
  font: 600 0.9rem/1.5 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* The edition's note, after the story. */
.imprint {
  margin-top: -2.5rem;
  margin-bottom: 4rem;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--dim);
}

/* The machines' own words: green lettering on a municipal display. */
.chapter p.display {
  margin-top: 1.6rem;
  margin-bottom: 1.6rem;
  text-align: center;
}

.chapter p.display span {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  font: 600 0.95rem/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.18em;
  color: var(--display-green);
  text-shadow: 0 0 10px rgba(141, 255, 184, 0.45);
  background:
    repeating-linear-gradient(to bottom, rgba(141, 255, 184, 0.05) 0 2px, transparent 2px 4px),
    #0a1411;
  border: 1px solid #1f3a2d;
  border-radius: 3px;
}

.scene-break {
  border: 0;
  margin-top: 2.4rem;
  margin-bottom: 2.4rem;
  text-align: center;
  color: var(--dim);
  height: auto;
}

.scene-break::before { content: "•\00a0\00a0\00a0•\00a0\00a0\00a0•"; letter-spacing: 0.2em; }

.end {
  text-align: center;
  color: var(--amber);
  margin-top: 0;
  margin-bottom: 4rem;
}

/* First use of a Latchmere word. */
a.term, a.term:visited {
  color: inherit;
  text-decoration: underline dotted var(--amber);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a.term:hover, a.term:focus-visible { text-decoration-style: solid; color: var(--amber); }

/* ---- the glossary ---- */

.lingo {
  margin-bottom: 5rem;
  padding: 2rem 2.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.lingo h2 {
  color: var(--ink);
  font-family: var(--serif);
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 1.4rem;
}

.lingo dl { margin: 0; display: grid; gap: 1.1rem; }

.lingo dl > div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.2rem;
  padding: 0.3rem 0.6rem;
  margin: 0 -0.6rem;
  border-radius: 4px;
  scroll-margin-top: 30vh;
}

.lingo dl > div:target { background: rgba(255, 179, 71, 0.12); outline: 1px solid rgba(255, 179, 71, 0.4); }

.lingo dt { font-family: var(--serif); font-weight: 600; color: var(--amber); font-size: 1.1rem; }

.lingo dd { margin: 0; font-family: var(--serif); color: var(--dim); font-size: 1.05rem; line-height: 1.6; }

@media (max-width: 560px) {
  .chapter p { font-size: 1.1rem; }
  .chapter p.opening { font-size: 1.35rem; }
  .lingo { padding: 1.4rem 1.2rem; }
  .lingo dl > div { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ---- the stories index ---- */

.stories-index { max-width: 1100px; margin: 0 auto; padding: 3.5rem 6vw 5rem; }
.stories-index h1 { font-size: clamp(2.4rem, 7vw, 4rem); margin: 0.2rem 0 2.4rem; }
