/* ═══════════════════════════════════════════════════════════════
   BROTHER ZHONG KUI · 钟馗哥
   Built on Ink Line (墨韵).

   The book turns on one object: a four-yuan woodblock print of the
   demon-queller, pasted on a shop door every Duanwu and worn pale at
   the height of a child's hand. The mask is cut from paper, the print
   is cut from a block, and the market keeps its accounts in columns
   in a small square hand.

   So this page is a printed sheet: hairlines, square corners, one
   cinnabar seal — and a table of contents that is the ledger the
   family actually kept. One line per night, and every line is the
   sentence that night opens on. Nothing here is decoration.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --zk-verm: #BE3A34;               /* the print's cinnabar, the seal */
  --zk-hair: color-mix(in srgb, currentColor 22%, transparent);
}

/* ─── Hero ─────────────────────────────────────────────────── */

.zk-title {
  font-family: "Noto Serif SC", "Songti SC", Georgia, serif;
  font-size: clamp(2.5rem, 6.6vw, 4.6rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.01em;
  margin: .9rem 0 .6rem;
  text-wrap: balance;
}

.zk-sub {
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: clamp(.82rem, 1.2vw, 1.02rem);
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 1.8rem;
}

.zk-lede {
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: 1.1rem;
  line-height: 1.72;
  color: var(--ink-muted);
  max-width: 46ch;
  margin: 0 0 2.2rem;
}

/* the account, in the ledger's own three columns */
.zk-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 2.6rem;
  margin: 0 0 2.2rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--zk-hair);
  border-bottom: 1px solid var(--zk-hair);
}
.zk-facts div { display: flex; flex-direction: column; gap: .35rem; }
.zk-facts dt {
  font-size: .64rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.zk-facts dd {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

/* the cover, as a plate pinned to the sheet */
.zk-cover {
  display: inline-block;
  margin: 0;
  padding: .5rem;
  border: 1px solid currentColor;
}
.zk-cover img {
  display: block;
  width: clamp(11rem, 15vw, 15rem);
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  box-shadow: 8px 8px 0 0 rgba(32, 33, 36, .14);
}
[data-theme="dark"] .zk-cover img { box-shadow: 8px 8px 0 0 rgba(0, 0, 0, .55); }

@media (max-width: 900px) { .zk-cover { margin-top: 2rem; } }

/* ─── The nights, as the ledger ───────────────────────────────
   The pipeline emits .night rows — number, opening line, length.
   Here they are ruled as an account: hairline rules, tabular
   figures, and the row rests flat until it is touched. */

.zk-ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid currentColor;
}

.zk-ledger .night {
  border-bottom: 1px solid var(--zk-hair);
}

.zk-ledger .night__link {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto;
  gap: 1.4rem;
  align-items: baseline;
  padding: 1.05rem 1rem 1.05rem .2rem;
  text-decoration: none;
  color: inherit;
  transition: background-color .16s ease, padding-left .16s ease;
}

.zk-ledger .night__link:hover,
.zk-ledger .night__link:focus-visible {
  background: color-mix(in srgb, var(--zk-verm) 6%, transparent);
  padding-left: .7rem;
}

.zk-ledger .night__no {
  font-family: "Noto Serif SC", serif;
  font-size: .8rem;
  letter-spacing: .08em;
  color: var(--ink-subtle);
  font-variant-numeric: tabular-nums;
}
.zk-ledger .night__link:hover .night__no { color: var(--zk-verm); }

.zk-ledger .night__text {
  font-size: .98rem;
  line-height: 1.68;
  color: var(--ink-muted);
  max-width: 74ch;
}

.zk-ledger .night__words {
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--ink-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .zk-ledger .night__link {
    grid-template-columns: 2.6rem minmax(0, 1fr);
    grid-template-areas: "no text" ". words";
    gap: .3rem 1rem;
    padding: 1rem .2rem;
  }
  .zk-ledger .night__no { grid-area: no; }
  .zk-ledger .night__text { grid-area: text; }
  .zk-ledger .night__words { grid-area: words; padding-top: .2rem; }
  .zk-ledger .night__link:hover { padding-left: .2rem; }
}

/* the note under the account — a cinnabar annotation, as in a ledger */
.zk-ledger-note {
  margin: 1.6rem 0 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--zk-verm);
  font-size: .92rem;
  line-height: 1.75;
  color: var(--ink-muted);
  max-width: 62ch;
}

/* ─── The door ─────────────────────────────────────────────── */

.zk-door {
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 880px) { .zk-door { grid-template-columns: 1fr; } }

.zk-plate {
  margin: 0;
  display: inline-block;
  padding: 1rem;
  border: 1px solid var(--zk-hair);
  background: var(--ink-card);
}
.zk-print {
  display: block;
  width: clamp(12rem, 21vw, 17rem);
  height: auto;
  color: var(--ink-fg);
}
.zk-plate figcaption {
  margin-top: 1rem;
  font-size: .78rem;
  line-height: 1.7;
  color: var(--ink-subtle);
  max-width: 30ch;
}

.zk-prose p {
  font-size: 1.02rem;
  line-height: 1.82;
  margin: 0 0 1.2rem;
  max-width: 58ch;
}

/* the five bats — a chalk row on the lid of a delivery box */
.zk-bats {
  display: block;
  width: min(19rem, 100%);
  height: auto;
  color: var(--ink-fg);
  opacity: .8;
  margin: 1.6rem 0 .6rem;
}
.zk-bats-note {
  font-size: .74rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin: 0;
}

/* ─── The city ─────────────────────────────────────────────── */

.zk-city {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 880px) { .zk-city { grid-template-columns: 1fr; } }

.zk-figs {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  border-top: 2px solid currentColor;
  padding-top: 1.2rem;
}
.zk-fig__value {
  font-family: "Noto Serif SC", serif;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  margin: 0 0 .3rem;
}
.zk-fig__label {
  font-size: .84rem;
  line-height: 1.65;
  color: var(--ink-muted);
  margin: 0;
  max-width: 34ch;
}

/* ─── Footer ───────────────────────────────────────────────── */

.ink-footer__brand p { opacity: .72; }

@media (prefers-reduced-motion: reduce) {
  .zk-ledger .night__link { transition: none; }
}
