/* The Weight of Sound — the weighing page.
   The book is instrumented: every chapter is headed with a date and the
   weight of the erhu at its start, 0 g to 1,360 g and back to 0. The page
   is the scale and the ledger — the instrument weighed once a chapter as
   a bar per weighing, the interludes the gaps (they are the words, not
   the instrument, and they are not weighed). */

:root {
  /* the red soundbox — the instrument the last chapter leaves, at 0 g */
  --snd-red: #B03A2B;
}

/* ── nav — the seal is inverted ink; the glyph must invert with it.
   Mono leaves .mo-nav__brand-mark an EMPTY ink square: it sets
   `background: var(--mo-ink)` and no colour at all. A glyph left to
   inherit --mo-fg sits on the same value and vanishes — dark-on-dark
   in light mode, white-on-white in dark. Same fix as the Yellow
   Immortal's and The Palindrome's. */
.mo-nav__brand-mark {
  display: grid;
  place-items: center;
  font-family: "Noto Serif SC", "Noto Serif CJK SC", serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  color: var(--mo-bg);
}

/* ── hero ──────────────────────────────────────────────────────────── */

.snd-hero__text { min-width: 0; }

.snd-hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6.5rem) 1.5rem clamp(2.5rem, 6vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.snd-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 1.2rem;
}

.snd-lede {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--mo-fg-muted);
  max-width: 56ch;
  margin: 0 0 1.6rem;
}

.snd-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2.2rem;
  margin: 0 0 1.8rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--mo-line);
  border-bottom: 1px solid var(--mo-line);
}
.snd-facts div { display: flex; gap: .5rem; align-items: baseline; }
.snd-facts dt {
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mo-fg-muted);
}
.snd-facts dd { margin: 0; font-size: .85rem; font-weight: 500; }

.snd-take { display: flex; flex-wrap: wrap; gap: .6rem; }

.snd-plate {
  margin: 0;
  padding: .5rem;
  border: 1px solid var(--mo-line);
  background: var(--mo-surface);
  box-shadow: var(--mo-shadow-card);
}
.snd-plate img {
  display: block;
  width: 15rem;
  max-width: 100%;
  height: auto;
}

/* ── section headers ───────────────────────────────────────────────── */

.snd-head { max-width: 56rem; margin-bottom: 2.2rem; }
.snd-h2 {
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: .4rem 0 .9rem;
}
.snd-head__note {
  font-size: .95rem;
  line-height: 1.7;
  color: var(--mo-fg-muted);
  margin: 0;
}

/* ── the scale — the instrument, weighed once a chapter ────────────── */

.snd-scale-wrap {
  margin: 0 0 2.4rem;
  padding: 1.6rem 1.4rem 1.2rem;
  border: 1px solid var(--mo-line);
  background: var(--mo-surface);
  overflow-x: auto;
}
.snd-scale { display: block; min-width: 560px; width: 100%; height: auto; }

.snd-axis { stroke: var(--mo-border-strong); stroke-width: 1; }
.snd-bar { fill: var(--mo-fg); opacity: .82; }
.snd-bar--peak { fill: var(--snd-red); opacity: 1; }
/* a zero weighing has no bar — it is a notch on the axis: the instrument
   weighed, and found weightless */
.snd-bar--zero { fill: var(--mo-fg); stroke: var(--mo-fg-muted); stroke-width: 2; }
.snd-wl, .snd-wp {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.snd-wl { fill: var(--mo-fg-muted); }
.snd-wp { fill: var(--snd-red); }

.snd-scale-cap {
  margin: 1rem 0 0;
  font-size: .78rem;
  line-height: 1.6;
  color: var(--mo-fg-muted);
}

/* ── the ledger — contents ─────────────────────────────────────────── */

.snd-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--mo-line-strong);
}

.snd-list .entry { border-bottom: 1px solid var(--mo-line); }

.snd-list .entry__link {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  grid-template-areas:
    "no title words"
    "no open  words";
  column-gap: 1rem;
  align-items: baseline;
  padding: .78rem .6rem;
  text-decoration: none;
  color: var(--mo-fg);
  transition: background-color .15s ease;
}
.snd-list .entry__link:hover { background: var(--mo-subtle); }

/* every row's number in a bordered cell, like a scale's notches */
.snd-list .entry__no {
  grid-area: no;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-top: .1rem;
  border: 1px solid var(--mo-border-strong);
  font-size: .7rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: var(--mo-fg-muted);
}

/* the interludes are the words, not the instrument — not weighed.
   Their cells are left empty. (href suffix match: interlude slugs are
   i1..i4; chapter slugs are numeric.) */
.snd-list .entry__link[href*="/read/i"] .entry__no { visibility: hidden; }
.snd-list .entry__link[href*="/read/i"] .entry__title { font-style: italic; }

.snd-list .entry__title {
  grid-area: title;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.snd-list .entry__open {
  grid-area: open;
  font-size: .85rem;
  line-height: 1.55;
  color: var(--mo-fg-muted);
  margin-top: .15rem;
}
.snd-list .entry__words {
  grid-area: words;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  color: var(--mo-fg-muted);
  justify-self: end;
}

/* ── gao jianli — provenance ───────────────────────────────────────── */

.snd-place { border-top: 1px solid var(--mo-line); }
.snd-place__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.snd-prose {
  font-size: .98rem;
  line-height: 1.75;
  color: var(--mo-fg);
  margin: 0 0 1.4rem;
}

.snd-quote-note {
  font-family: "Noto Serif SC", serif;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--snd-red);
  margin: 1.6rem 0 .3rem;
}
.snd-quote-gloss {
  font-size: .85rem;
  line-height: 1.6;
  color: var(--mo-fg-muted);
  margin: 0;
}

/* the book's own numbers */
.snd-figures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--mo-line);
  border: 1px solid var(--mo-line);
}
.snd-figure {
  background: var(--mo-bg);
  padding: 1.2rem 1rem 1.1rem;
}
.snd-figure__value {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 .4rem;
  font-variant-numeric: tabular-nums;
}
.snd-figure__label {
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mo-fg-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── footer extras ─────────────────────────────────────────────────── */

.snd-foot {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
.snd-foot__name {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 .3rem;
}
.snd-foot__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

/* ── small screens ─────────────────────────────────────────────────── */

@media (max-width: 880px) {
  .snd-hero { grid-template-columns: 1fr; }
  .snd-plate { width: max-content; }
  .snd-place__grid { grid-template-columns: 1fr; }
  .snd-foot { grid-template-columns: 1fr; gap: 1.4rem; }
}

@media (max-width: 560px) {
  .snd-list .entry__link {
    grid-template-columns: 2.3rem minmax(0, 1fr);
    grid-template-areas:
      "no title"
      "no open"
      "no words";
  }
  .snd-list .entry__words { justify-self: start; }
  .snd-figures { grid-template-columns: 1fr; }
}
