/* The Handbill Ledger — the shop window at /demo/.
 *
 * Loaded only by templates/demo.html, on top of game/style.css, whose custom
 * properties are the palette here too. Nothing in this file redefines a token
 * declared there; the locals below are namespaced `--demo-*` — the same rule
 * auth.css follows — so a later edit to style.css can never silently change
 * their meaning.
 *
 * The conceit is the wall the game's handbills hang on. The page is planed
 * boards; every beat of the playthrough is one sheet of paper tacked to them,
 * read three ways. Section headings are painted straight onto the wood.
 *
 * Fonts are the project's own stacks, per the no-CDN rule: the display face is
 * the poster stack auth.css uses for its masthead, restated here because that
 * sheet is not loaded on this page.
 */

:root {
  /* Wood one step lighter than --wood-dark, for a card that has to read as
   * raised off the wall rather than cut into it. */
  --demo-wood-raised: #2e2216;
  --demo-wood-edge: #1a120c;
  /* Type on wood. --parchment at full strength is a sheet of paper, which is
   * too loud for a paragraph; these are the two steps down from it. */
  --demo-wood-text: #c9b48d;
  --demo-wood-text-dim: #8f7a58;
  /* Ink relaxed to a note in the margin, and the wash a <code> span sits in. */
  --demo-ink-soft: #4a3a26;
  --demo-ink-wash: rgb(43 29 16 / 9%);
  /* Telegraph flimsy — paler and yellower than --parchment, so the one aside
   * on the page reads as a different piece of stock. */
  --demo-flimsy: #efe6cf;

  --demo-display:
    "Playbill", "Rockwell", "Bookman Old Style", "Bodoni 72", Didot, Georgia,
    "Times New Roman", serif;
  /* Set as struck characters, matching the typed entries on the auth screens:
   * captions, labels and figures are the machine's voice, not the narrator's. */
  --demo-mono: "Courier New", Courier, "Nimbus Mono PS", monospace;
}

/* --- The wall ------------------------------------------------------------ */

/* game/style.css hides body overflow for the game shell, which is a canvas
 * exactly the size of the viewport. This page is a long document, so it takes
 * its scrolling back. The class raises specificity above the bare `body` rule
 * there, so it holds whatever order the two files load in. */
body.demo {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
  color: var(--demo-wood-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  /* Planed boards, drawn rather than shipped — no image request on a page
   * whose whole argument is what the server does not have to do. */
  background-color: var(--wood-dark);
  background-image:
    repeating-linear-gradient(90deg, transparent 0 118px, rgb(0 0 0 / 18%) 118px 122px),
    linear-gradient(180deg, rgb(0 0 0 / 25%), transparent 400px);
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.col {
  max-width: 54rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Masthead ------------------------------------------------------------ */

.demo-head {
  padding: clamp(2.5rem, 8vw, 4rem) 1.25rem 2.5rem;
  text-align: center;
}

/* Thick over thin, the poster's rule — and its mirror at the foot. */
.mast-rule {
  height: 3px;
  margin: 0 0 1.125rem;
  border: 0;
  border-top: 4px solid var(--brass);
  border-bottom: 1px solid var(--brass);
}

.mast-rule--thin {
  margin: 1.125rem 0 0;
  border-top-width: 1px;
  border-bottom-width: 4px;
}

.demo-head h1 {
  margin: 0;
  font-family: var(--demo-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(2.1rem, 6.5vw, 4rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--parchment);
  text-wrap: balance;
  text-shadow: 0 3px 0 rgb(0 0 0 / 50%);
}

.mast-sub {
  margin-top: 0.875rem;
  font-family: var(--demo-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--brass);
}

.lede {
  max-width: 40rem;
  margin: 1.625rem auto 0;
  font-size: 1.06rem;
}

.lede em {
  color: var(--parchment);
  font-style: italic;
}

/* --- The hero ------------------------------------------------------------ */

/* The game moving, before a word of explanation. Framed like a still on the
 * wall rather than bled to the edge — it is evidence, not decoration. */
.hero {
  margin: 2.25rem auto 0;
  max-width: 45rem;
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
  border: 3px solid var(--ink);
  border-radius: 1px;
  background: #000;
  box-shadow: 0 10px 30px rgb(0 0 0 / 60%);
  /* The capture is 720px wide and shown larger; keep the tiles square-edged. */
  image-rendering: pixelated;
}

.hero figcaption {
  margin-top: 0.6rem;
  font-family: var(--demo-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--demo-wood-text-dim);
}

/* --- Stats strip --------------------------------------------------------- */

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  justify-content: center;
  margin: 2.125rem 0 0.5rem;
  padding: 0;
  list-style: none;
}

.stat {
  padding: 0.625rem 1rem;
  text-align: center;
  background: var(--demo-wood-raised);
  border: 1px solid var(--demo-wood-edge);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 4%);
}

.stat b {
  display: block;
  font-family: var(--demo-mono);
  font-size: 1.35rem;
  color: var(--brass);
  font-variant-numeric: tabular-nums;
}

.stat span {
  font-family: var(--demo-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--demo-wood-text-dim);
}

/* --- Section heads, painted on the wood ---------------------------------- */

.wall-head {
  margin: clamp(3rem, 8vw, 4.5rem) 0 0.5rem;
  text-align: center;
}

.wall-head h2 {
  margin: 0;
  font-family: var(--slab);
  font-weight: 400;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  letter-spacing: 0.04em;
  color: var(--parchment);
  text-wrap: balance;
}

.wall-head .act {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--demo-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
}

.wall-head p {
  max-width: 38rem;
  margin: 0.75rem auto 0;
}

/* --- One handbill per beat ----------------------------------------------- */

.bill {
  position: relative;
  margin: 2.625rem auto;
  padding: 1.625rem 1.75rem 1.5rem;
  color: var(--ink);
  background-color: var(--parchment);
  background-image:
    radial-gradient(ellipse at 30% 20%, rgb(255 255 255 / 35%), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgb(140 110 60 / 18%), transparent 55%);
  border: 1px solid var(--parchment-edge);
  border-radius: 2px;
  box-shadow:
    0 6px 18px rgb(0 0 0 / 55%),
    0 1px 0 rgb(255 255 255 / 6%);
}

/* Tacked up, not floating — the same two brass heads as the auth handbill. */
.bill::before,
.bill::after {
  content: "";
  position: absolute;
  top: 0.625rem;
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f0d98a, var(--brass) 55%, #6b4d12);
  box-shadow: 0 1px 2px rgb(0 0 0 / 50%);
}

.bill::before {
  left: 0.75rem;
}

.bill::after {
  right: 0.75rem;
}

.bill-kicker {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ink);
}

.bill-kicker .no {
  font-family: var(--demo-display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--blood);
}

.bill-kicker h3 {
  margin: 0;
  font-family: var(--slab);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

.shot {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
  border: 3px solid var(--ink);
  border-radius: 1px;
}

.shot-note {
  margin: 0.375rem 0 1rem;
  font-family: var(--demo-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--demo-ink-soft);
}

/* --- The three registers ------------------------------------------------- */

/* A <dl> of <div>-wrapped pairs: the wrapper is what lets one term and its
 * description share a grid row, and it is the markup the HTML spec added for
 * exactly this. */
.registers {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.reg {
  display: grid;
  grid-template-columns: 8.125rem 1fr;
  gap: 0.75rem;
  align-items: start;
}

.reg dt {
  padding-top: 0.25rem;
  font-family: var(--demo-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blood);
}

.reg--movie dt {
  color: var(--demo-ink-soft);
}

.reg--django dt {
  color: #5b4a12;
}

.reg dd {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.55;
}

/* The label stacks over its text on a phone, where a 130px gutter would leave
 * the prose four words wide. */
@media (max-width: 35rem) {
  .reg {
    grid-template-columns: 1fr;
    gap: 0.125rem;
  }
}

.reg dd code,
.ledger code,
.fix code {
  font-family: var(--demo-mono);
  font-size: 0.82em;
  padding: 1px 5px;
  background: var(--demo-ink-wash);
  border-radius: 2px;
  /* An identifier broken across a line is an identifier misread — but `nowrap`
   * here is the wrong way to say that. Not every code span is an identifier:
   * one of them is a line of command output ("telegraph: 1 re-hung, 0 expired,
   * 0 posted"), and held on one line it measured 317px inside a 246px column on
   * a 390px phone, which pushed the whole document sideways.
   *
   * `normal` says the intended thing instead. An identifier contains no spaces,
   * so it offers no break opportunity and stays whole on its own; only spans
   * that already have spaces in them wrap, and they wrap where a reader would.
   * `break-word` is the last resort under that — it breaks a token only when no
   * container can hold it, which beats a horizontal scrollbar on the page. */
  white-space: normal;
  overflow-wrap: break-word;
}

/* --- The reckoning table ------------------------------------------------- */

/* Three columns of prose will not fit a phone at any type size worth reading,
 * so the table keeps its width and scrolls inside its own box rather than
 * pushing the document sideways. */
.ledger-wrap {
  overflow-x: auto;
}

.ledger {
  width: 100%;
  min-width: 35rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ledger th {
  padding: 0.5rem 0.75rem 0.5rem 0;
  font-family: var(--demo-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  color: var(--blood);
  border-bottom: 2px solid var(--ink);
}

.ledger td {
  padding: 0.5625rem 0.75rem 0.5625rem 0;
  border-bottom: 1px solid rgb(36 26 16 / 25%);
  vertical-align: top;
  line-height: 1.45;
}

.ledger td:first-child {
  font-style: italic;
}

/* --- Telegraph flimsy (the bug story) ------------------------------------ */

.fix {
  margin: 1.25rem 0 0;
  padding: 1.25rem 1.5rem;
  color: var(--ink);
  font-size: 0.95rem;
  background: var(--demo-flimsy);
  border: 1px dashed var(--demo-ink-soft);
}

.fix h4 {
  margin: 0 0 0.625rem;
  font-family: var(--demo-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--blood);
}

.fix p {
  margin: 0 0 0.625rem;
}

.fix p:last-child {
  margin-bottom: 0;
}

/* --- Take up the trade --------------------------------------------------- */

/* The one thing the page is asking for, so it is the one card on the wall that
 * is not paper: brass on raised wood, at the end of the read. */
.call {
  margin: clamp(3rem, 8vw, 4.5rem) auto 0;
  padding: 2rem 1.5rem 2.25rem;
  text-align: center;
  background: var(--demo-wood-raised);
  border: 1px solid var(--demo-wood-edge);
  border-top: 3px solid var(--brass);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 4%);
}

.call h2 {
  margin: 0 0 0.5rem;
  font-family: var(--demo-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  letter-spacing: 0.03em;
  color: var(--parchment);
}

.call p {
  max-width: 34rem;
  margin: 0 auto 1.5rem;
}

/* The shell's .btn is a <button>; this is an <a> wearing it, so it needs the
 * line-height and the decoration reset a button gets for free. */
.call .btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  font-size: 0.95rem;
  line-height: 1.4;
  text-decoration: none;
}

.call .btn:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.call__aside {
  margin: 1.25rem auto 0;
  font-size: 0.85rem;
  color: var(--demo-wood-text-dim);
}

/* --- Foot ---------------------------------------------------------------- */

.demo-foot {
  padding: 2.5rem 1.25rem 4.375rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--demo-wood-text-dim);
}

.demo-foot .mast-rule {
  margin-bottom: 1.5rem;
}

.demo-foot p {
  max-width: 35rem;
  margin: 0 auto 0.625rem;
}

.demo-foot code {
  padding: 2px 6px;
  font-family: var(--demo-mono);
  font-size: 0.82em;
  color: var(--demo-wood-text);
  background: var(--demo-wood-raised);
  border-radius: 2px;
}

a {
  color: var(--brass);
}

.bill a {
  color: var(--blood);
}
