/* ═══════════════════════════════════════════════════════════════
   THE SOUP OF ALMOST FORGETTING — 几乎遗忘的汤
   Built on Mono (单色) — hairline, square, typographic, colourless.

   The novel's governing fact is a queue: forty people at dusk in
   June 2020, waiting for an old woman to ladle them two kuai of
   forgetting, and a plank painted 奈何桥 propped on two plastic
   crates. The book's form is a street ledger — a date on every
   chapter, an item, a price that never moved, a column of words.

   So the page is a QUEUE TICKET and a LEDGER, in that order:
   a numbered stub with the one stamp on it, then the bill of all
   sixty-seven entries as ledger rows, then the place, then the two
   ledgers the stall and the district kept.

   Colour: Mono is grayscale by definition and every structural
   element here keeps that discipline — rules, rows, figures, the
   hover invert are all ink. One note of vermilion (#b93a32, the
   cover's own accent) is admitted, and only inside the ticket,
   where a stamp belongs: the seal 忘 and the price 2.00. Nothing
   else on the page is anything but ink and paper.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ln-red: #b93a32;                                   /* the one note */
  --ln-sans: "Archivo", "Inter", system-ui, sans-serif;
  --ln-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ln-cn: "Noto Serif SC", "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
  --ln-rule: var(--mo-border);
  --ln-rule-strong: var(--mo-border-strong);
}

/* Mono's base face is Inter; this volume names its own. Archivo is the
   same neutral grotesque family of voices — it is only less anonymous,
   and it holds up at the signage sizes the ticket asks for. Everything
   numeric and evidentiary is IBM Plex Mono. */
.mo-body {
  font-family: var(--ln-sans);
}

/* ─── Nav ──────────────────────────────────────────────────────
   Mono leaves .mo-nav__brand-mark an EMPTY ink square: it sets
   `background: var(--mo-ink)` and no colour. Put a glyph in it
   without setting one and the glyph inherits --mo-fg — the same
   value as its own background — so 忘 would be invisible in light
   mode and a white square with white text in dark. The mark is
   inverted ink, so the glyph inverts with it. */
.mo-nav__brand-mark {
  display: grid;
  place-items: center;
  font-family: var(--ln-cn);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  color: var(--mo-bg);
}

.mo-nav__brand-name {
  font-size: 1.05rem;
  letter-spacing: -.012em;
}

/* Twenty-seven characters of title against four centred links: before
   the mobile menu takes over at 768px, tighten the run. */
@media (min-width: 769px) and (max-width: 1080px) {
  .mo-nav__links { gap: 1.4rem; font-size: .68rem; }
}

/* ─── The ticket (hero) ──────────────────────────────────────── */

.ln-hero {
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(2.6rem, 6vw, 5rem) clamp(1.25rem, 4vw, 3rem) clamp(2.6rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(16rem, .62fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

/* The ledger's margin rule — the hero content hangs off a single line,
   the way an entry hangs off the ruled edge of a page. */
.ln-hero__main {
  border-left: 1px solid var(--ln-rule);
  padding-left: clamp(1rem, 2.6vw, 2rem);
}

@media (max-width: 900px) {
  .ln-hero { grid-template-columns: 1fr; }
  .ln-stub { max-width: 25rem; }
}

.ln-title {
  font-family: var(--ln-sans);
  font-size: clamp(2rem, 5.4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.035em;
  color: var(--mo-ink);
  margin: .9rem 0 1.1rem;
  text-wrap: balance;
}

.ln-cn {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .9rem;
  margin: 0 0 1.7rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--ln-rule);
  max-width: 34rem;
}
.ln-cn__zh {
  font-family: var(--ln-cn);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--mo-ink);
}
.ln-cn__pinyin {
  font-family: var(--ln-mono);
  font-size: .68rem;
  letter-spacing: .05em;
  color: var(--mo-ash);
}

.ln-lede {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.68;
  color: var(--mo-ash);
  max-width: 46ch;
  margin: 0 0 2.2rem;
}

/* a specification table, not a marketing list */
.ln-facts {
  margin: 0 0 2.2rem;
  border-top: 1px solid var(--ln-rule);
  max-width: 42rem;
}
.ln-facts > div {
  display: grid;
  grid-template-columns: 6.6rem minmax(0, 1fr);
  gap: 1rem;
  padding: .58rem 0;
  border-bottom: 1px solid var(--ln-rule);
}
.ln-facts dt {
  font-family: var(--ln-mono);
  font-size: .58rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mo-ash);
  padding-top: .3rem;
}
.ln-facts dd {
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--mo-ink);
}

.ln-take { display: flex; flex-wrap: wrap; gap: .55rem; }
.ln-take .mo-btn { padding: .85rem 1.45rem; letter-spacing: .12em; }

/* ─── The stub ───────────────────────────────────────────────── */

.ln-stub {
  position: relative;
  border: 1px solid var(--ln-rule);
  background: var(--mo-surface);
  padding: 1.3rem 1.35rem 1.5rem;
}

/* the tear-off edge of the ticket: a perforation, not a drawn line */
.ln-stub::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background-image: repeating-linear-gradient(90deg,
    var(--ln-rule-strong) 0 4px, transparent 4px 9px);
}

.ln-stub__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.15rem;
}
.ln-stub__lane {
  font-family: var(--ln-mono);
  font-size: .58rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mo-ash);
}

/* the seal — the page's one note of vermilion, struck slightly off-square
   the way a hand-stamped ticket is */
.ln-seal {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--ln-red);
  color: var(--ln-red);
  font-family: var(--ln-cn);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
  transform: rotate(-4deg);
}

.ln-stub__plate {
  margin: 0 0 1.2rem;
  border: 1px solid var(--ln-rule);
  padding: .4rem;
  background: var(--mo-bg);
}
.ln-stub__plate img {
  width: 100%;
  /* the width/height ATTRIBUTES are definite, which makes the browser
     ignore aspect-ratio and hand object-fit a wrong box. height:auto
     gives the ratio back. */
  height: auto;
  max-width: none;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.ln-stub__no {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin: 0 0 1.15rem;
  padding: .85rem 0 .9rem;
  border-top: 1px solid var(--ln-rule);
  border-bottom: 1px solid var(--ln-rule);
}
.ln-stub__n {
  font-family: var(--ln-sans);
  font-size: clamp(2.5rem, 6.5vw, 3.2rem);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: var(--mo-ink);
}
.ln-stub__nlabel {
  font-family: var(--ln-mono);
  font-size: .58rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mo-ash);
}

.ln-stub__rows { margin: 0; }
.ln-stub__rows > div {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: .8rem;
  padding: .38rem 0;
}
.ln-stub__rows dt {
  font-family: var(--ln-mono);
  font-size: .56rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mo-ash);
  padding-top: .28rem;
}
.ln-stub__rows dd {
  margin: 0;
  font-size: .92rem;
  line-height: 1.5;
  color: var(--mo-ink);
}

.ln-price {
  font-family: var(--ln-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ln-red);
}

/* ─── Section furniture ──────────────────────────────────────── */

.ln-sec {
  border-top: 1px solid var(--ln-rule);
  scroll-margin-top: 5rem;
}

.ln-head { margin-bottom: 2.4rem; max-width: 48rem; }
.ln-h2 {
  font-family: var(--ln-sans);
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.028em;
  color: var(--mo-ink);
  margin: .7rem 0 .9rem;
  text-wrap: balance;
}
.ln-head__note {
  font-size: .98rem;
  line-height: 1.75;
  color: var(--mo-ash);
  margin: 0;
  max-width: 62ch;
}

.ln-prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--mo-ash);
  max-width: 58ch;
  margin: 0 0 1.15rem;
}
.ln-prose em { font-style: italic; color: var(--mo-ink); }

/* ─── The bill ───────────────────────────────────────────────────
   The pipeline emits a <li class="night"> per chapter into BUILD:bill.
   Those five class names are the contract between the build and this
   sheet; this is where they become ledger rows. */

.ln-cols,
.night__link {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr) 4.6rem;
  gap: 1.1rem;
}

.ln-cols {
  font-family: var(--ln-mono);
  font-size: .56rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mo-ash-soft);
  margin: 0;
  padding: .5rem .8rem .55rem;
  border-bottom: 1px solid var(--ln-rule-strong);
}
.ln-cols span:last-child { text-align: right; }

.ln-bill {
  list-style: none;
  margin: 0;
  padding: 0;
}

.night { border-bottom: 1px solid var(--ln-rule); }

/* a row of the ledger; on contact it inverts to solid ink, which is
   the whole of the page's interaction vocabulary. The .8rem inset is the
   row's gutter, and it is the same inset the column headings use, so a
   row's ink block lands exactly inside its two hairlines. */
.night__link {
  align-items: baseline;
  padding: .72rem .8rem;
  text-decoration: none;
  color: var(--mo-ink);
  transition: background-color .18s ease, color .18s ease;
}

/* the row's number is a queue stub — a square ticket corner, one per
   entry, struck from the same square the seal is struck on */
.night__no {
  align-self: start;
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid var(--ln-rule-strong);
  font-family: var(--ln-mono);
  font-size: .6rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--mo-ash);
  transition: border-color .18s ease, color .18s ease;
}
.night__text {
  font-size: .97rem;
  line-height: 1.6;
}
.night__words {
  font-family: var(--ln-mono);
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
  color: var(--mo-ash-soft);
  text-align: right;
}

.night__link:hover,
.night__link:focus-visible { background: var(--mo-ink); color: var(--mo-bg); }
.night__link:hover .night__no,
.night__link:focus-visible .night__no { border-color: var(--mo-bg); color: var(--mo-bg); }
.night__link:hover .night__words,
.night__link:focus-visible .night__words { color: inherit; opacity: .72; }

@media (max-width: 620px) {
  .ln-cols,
  .night__link { grid-template-columns: 2.2rem minmax(0, 1fr) 3.4rem; gap: .65rem; }
  .night__no { width: 1.65rem; height: 1.65rem; font-size: .56rem; }
  .night__text { font-size: .92rem; }
}

/* ─── The lane ───────────────────────────────────────────────── */

.ln-lane__grid,
.ln-ledger__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 900px) {
  .ln-lane__grid,
  .ln-ledger__grid { grid-template-columns: 1fr; }
}

/* Mono styles .mo-stat-block as a full-bleed inverted band — 6rem of
   padding, ink ground. Here the figures are a hairline grid of paper
   cells, which is what a ledger's totals look like. */
.ln-figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--ln-rule);
  border: 1px solid var(--ln-rule);
}
.ln-figures .mo-stat-block {
  background: var(--mo-bg);
  color: var(--mo-fg);
  padding: 1.35rem 1.25rem;
}
.ln-figures .mo-stat__value {
  font-family: var(--ln-sans);
  font-size: clamp(1.5rem, 2.8vw, 1.95rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  color: var(--mo-ink);
  margin: 0 0 .5rem;
}
.ln-figures .mo-stat__label {
  font-family: var(--ln-mono);
  font-size: .56rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--mo-ash);
  margin: 0;
}

/* ─── The plank ──────────────────────────────────────────────────
   One board, hand-painted 奈何桥, propped on two plastic crates: the
   only object the novel gives an address to, so it gets the only
   vertical text and the only texture on the page. */

.ln-plank-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: center;
  margin: 3.4rem 0 0;
  padding: clamp(1.6rem, 4vw, 2.4rem) 0 0;
  border-top: 1px solid var(--ln-rule);
}
@media (max-width: 700px) { .ln-plank-band { grid-template-columns: 1fr; } }

.ln-plank {
  position: relative;
  border: 1px solid var(--ln-rule-strong);
  background: var(--mo-surface);
  padding: 1rem 1.1rem;
}
/* grain, such as it is: 7px of board, drawn in .mo-overlay ink */
.ln-plank::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(180deg,
    var(--mo-overlay) 0 1px, transparent 1px 7px);
  opacity: .55;
  pointer-events: none;
}
.ln-plank__sign {
  position: relative;
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  height: clamp(9rem, 24vw, 11rem);
  font-family: var(--ln-cn);
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: .32em;
  text-align: center;
  color: var(--mo-ink);
}

.ln-plank__caption { margin: 0; }
.ln-plank__cap {
  font-family: var(--ln-mono);
  font-size: .56rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mo-ash);
}
.ln-plank__say {
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.55;
  letter-spacing: -.012em;
  color: var(--mo-ink);
  margin: .85rem 0 .7rem;
  max-width: 46ch;
  text-wrap: balance;
}
.ln-plank__attr {
  font-family: var(--ln-mono);
  font-size: .64rem;
  letter-spacing: .04em;
  color: var(--mo-ash);
  margin: 0;
}

/* ─── The ledger ─────────────────────────────────────────────── */

.ln-specimen {
  margin: 0;
  border: 1px solid var(--ln-rule);
  background: var(--mo-surface);
  padding: 1.5rem 1.5rem 1.4rem;
}
.ln-specimen__rule {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: 0 0 1.4rem;
  font-family: var(--ln-mono);
  font-size: .56rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mo-ash);
}
.ln-specimen__rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ln-rule);
}
.ln-specimen__quote { margin: 0; }
.ln-specimen__zh {
  font-family: var(--ln-cn);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: .16em;
  color: var(--mo-ink);
  margin: 0 0 .9rem;
}
.ln-specimen__pinyin {
  font-family: var(--ln-mono);
  font-size: .68rem;
  letter-spacing: .04em;
  color: var(--mo-ash);
  margin: 0 0 .6rem;
}
.ln-specimen__en {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--mo-ink);
  margin: 0 0 1.1rem;
}
.ln-specimen__attr {
  font-family: var(--ln-mono);
  font-size: .6rem;
  letter-spacing: .06em;
  color: var(--mo-ash);
  margin: 0;
  padding-top: .9rem;
  border-top: 1px solid var(--ln-rule);
}

.ln-register { margin-top: 3.2rem; }

.ln-table {
  width: 100%;
  margin-top: 1.4rem;
  border-collapse: collapse;
}
.ln-table caption { text-align: left; }
.ln-table thead th {
  font-family: var(--ln-mono);
  font-size: .56rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mo-ash-soft);
  text-align: left;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--ln-rule-strong);
}
.ln-table tbody th,
.ln-table tbody td {
  padding: .62rem .8rem;
  border-bottom: 1px solid var(--ln-rule);
  vertical-align: baseline;
  font-size: .95rem;
  font-weight: 400;
  line-height: 1.55;
  text-align: left;
  color: var(--mo-ink);
}
.ln-table tbody th {
  font-family: var(--ln-mono);
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ln-table tbody td:last-child {
  font-family: var(--ln-mono);
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mo-ash);
  text-align: right;
  white-space: nowrap;
}
.ln-table tbody tr:hover th,
.ln-table tbody tr:hover td { background: var(--mo-subtle); }

@media (max-width: 620px) {
  .ln-table tbody th,
  .ln-table tbody td,
  .ln-table thead th { padding: .55rem .45rem; }
  .ln-table tbody td:last-child { text-align: left; }
}

/* ─── The series ─────────────────────────────────────────────── */

.ln-series {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ln-rule);
}
.ln-series__row { border-bottom: 1px solid var(--ln-rule); }

.ln-series__link {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  gap: 1.1rem;
  align-items: baseline;
  padding: .95rem .8rem;
  text-decoration: none;
  color: var(--mo-ink);
  transition: background-color .18s ease, color .18s ease;
}
a.ln-series__link:hover,
a.ln-series__link:focus-visible { background: var(--mo-ink); color: var(--mo-bg); }

.ln-series__no {
  font-family: var(--ln-mono);
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
  color: var(--mo-ash);
}
.ln-series__title {
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -.012em;
  line-height: 1.4;
}
.ln-series__meta {
  font-family: var(--ln-mono);
  font-size: .64rem;
  letter-spacing: .04em;
  color: var(--mo-ash);
  text-align: right;
}
/* this volume is not a link, and says so in ink rather than in colour */
.ln-series__row.is-here {
  background: var(--mo-subtle);
  box-shadow: inset 3px 0 0 var(--mo-ink);
}
.ln-series__mark {
  display: inline-block;
  margin-right: .6rem;
  padding: .22rem .45rem .26rem;
  background: var(--mo-ink);
  color: var(--mo-bg);
  font-size: .54rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  vertical-align: 1px;
}

a.ln-series__link:hover .ln-series__no,
a.ln-series__link:hover .ln-series__meta { color: inherit; opacity: .72; }

@media (max-width: 620px) {
  .ln-series__link { grid-template-columns: 2.5rem minmax(0, 1fr); gap: .7rem; }
  .ln-series__meta { grid-column: 2; text-align: left; }
}

/* ─── Support, licence, footer ───────────────────────────────── */

.ln-support {
  font-size: .86rem;
  line-height: 1.75;
  color: var(--mo-ash);
  max-width: 56ch;
  margin: 3.4rem 0 0;
}
.ln-support a {
  color: var(--mo-ink);
  text-decoration: underline;
  text-underline-offset: .18em;
  text-decoration-thickness: 1px;
}

.ln-foot {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
  gap: 2rem;
  padding-bottom: 2.4rem;
}
@media (max-width: 720px) { .ln-foot { grid-template-columns: 1fr; } }

.ln-foot__name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--mo-ink);
  margin: 0 0 .4rem;
}
.ln-foot__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .45rem;
}
.ln-foot__links .mo-btn {
  padding: .62rem 1rem;
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: none;
}

/* ─── Reduced motion ─────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .night__link,
  .ln-series__link { transition: none; }
}
