/* ═══════════════════════════════════════════════════════════════
   NOHRUKH — the nine fires.

   The book is a song-cycle of a conquered civilization: nine days,
   nine heads, nine fires, and the collected Noh-Zohr that survived
   the burning by being carried in the mouth. So the page is a
   hearth-row: nine cells on warm paper, eight standing cold in ash
   and ochre, the ninth lit — the one flame that stayed behind the
   brick until the ninth day. The colon is Zoroastrian; the warmth
   is carpet wool; the one colour in the room is the fire.

   House pattern: this page carries the colour; the prose does not.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --nk-bg: #f7f3ea;
  --nk-panel: #efe8d8;
  --nk-ink: #24201a;
  --nk-soft: #6b6152;
  --nk-faint: #998f7d;
  --nk-rule: #ddd2bc;
  --nk-huang: #9a6b2f;      /* ochre — the hearth */
  --nk-huang-ink: #7d5522;
  --nk-ember: #b03a2b;      /* the one lit flame */
  --nk-cold: #b3a88f;       /* the eight cold hearths */
  --nk-press: rgba(36, 32, 26, .12);
}

html[data-theme="dark"] {
  --nk-bg: #171310;
  --nk-panel: #201a14;
  --nk-ink: #ece2cf;
  --nk-soft: #b3a68d;
  --nk-faint: #857761;
  --nk-rule: #3b3226;
  --nk-huang: #c98d3f;
  --nk-huang-ink: #d8a35a;
  --nk-ember: #c8503d;
  --nk-cold: #55493a;
  --nk-press: rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--nk-bg);
  color: var(--nk-ink);
  font-family: "EB Garamond", Georgia, "Noto Serif SC", serif;
  line-height: 1.7;
}

.nk-wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 5vw, 2rem);
}

/* ── the seal 火 ─────────────────────────────────────────────────── */

.nk-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  background: var(--nk-huang);
  color: #f7f3ea;
  font-family: "Noto Serif SC", serif;
  font-size: 1.2rem;
  line-height: 1;
  box-shadow: 2px 2px 0 var(--nk-press);
}

/* ── nav ─────────────────────────────────────────────────────────── */

.nk-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .85rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--nk-rule);
}

.nk-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--nk-ink);
  text-decoration: none;
  font-weight: 600;
}

.nk-nav__name { font-size: .95rem; letter-spacing: .01em; }

.nk-nav__links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.nk-nav__links a {
  color: var(--nk-soft);
  text-decoration: none;
  font-size: .88rem;
}

.nk-nav__links a:hover { color: var(--nk-huang-ink); }

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

.nk-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: center;
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) clamp(1.1rem, 5vw, 2rem) 3.2rem;
}

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

.nk-eyebrow {
  margin: 0 0 .8rem;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--nk-huang-ink);
}

.nk-title {
  margin: 0 0 .5rem;
  font-family: "Playfair Display", "EB Garamond", Georgia, serif;
  font-size: clamp(2.4rem, 6.5vw, 3.8rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.015em;
}

.nk-subtitle {
  margin: 0 0 1.1rem;
  font-size: .95rem;
  font-style: italic;
  color: var(--nk-soft);
}

.nk-lede {
  margin: 0 0 1rem;
  max-width: 46ch;
  font-size: 1.08rem;
  color: var(--nk-soft);
}

.nk-meta {
  margin: 0 0 1.8rem;
  font-size: .86rem;
  color: var(--nk-faint);
}

.nk-meta__sep { margin: 0 .5rem; }

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

.nk-btn {
  display: inline-flex;
  align-items: baseline;
  gap: .1rem;
  padding: .6rem 1.05rem;
  border: 1px solid var(--nk-rule);
  background: var(--nk-panel);
  color: var(--nk-ink);
  text-decoration: none;
  font-size: .9rem;
  box-shadow: 3px 3px 0 var(--nk-press);
  transition: border-color .18s ease, color .18s ease, transform .18s ease;
}

.nk-btn:hover {
  border-color: var(--nk-huang);
  color: var(--nk-huang-ink);
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--nk-press);
}

.nk-btn--primary {
  border-color: var(--nk-huang);
  color: var(--nk-huang-ink);
}

.nk-plate { margin: 0; }

.nk-plate img {
  display: block;
  width: 15.5rem;
  max-width: 38vw;
  height: auto;
  border: 1px solid var(--nk-rule);
  box-shadow: 5px 5px 0 var(--nk-press);
}

/* ── sections ────────────────────────────────────────────────────── */

.nk-section {
  padding: clamp(2.6rem, 7vw, 4.2rem) 0;
  border-top: 1px solid var(--nk-rule);
}

.nk-section--alt { background: var(--nk-panel); }

.nk-head { margin-bottom: 2.2rem; }

.nk-head__run {
  margin: 0 0 .5rem;
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--nk-huang-ink);
}

.nk-head__title {
  margin: 0;
  font-family: "Playfair Display", "EB Garamond", Georgia, serif;
  font-size: clamp(1.35rem, 3.6vw, 1.8rem);
  font-weight: 600;
  line-height: 1.2;
}

/* ── the nine fires ──────────────────────────────────────────────── */

.nk-fires {
  list-style: none;
  margin: 0 0 1.6rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
}

.nk-fire {
  display: grid;
  gap: .3rem;
  justify-items: center;
  padding: 1.1rem .6rem .9rem;
  border: 1px solid var(--nk-rule);
  background: var(--nk-panel);
  box-shadow: 3px 3px 0 var(--nk-press);
  text-align: center;
}

/* the hearth itself: a small vessel with cold ash in it */
.nk-fire::before {
  content: "";
  display: block;
  width: 34px;
  height: 26px;
  margin-bottom: .5rem;
  border: 2px solid var(--nk-cold);
  border-radius: 0 0 12px 12px / 0 0 14px 14px;
  border-top: 0;
}

.nk-fire__no {
  font-family: "Noto Serif SC", serif;
  font-size: 1.05rem;
  color: var(--nk-soft);
}

.nk-fire__name {
  font-size: .85rem;
  line-height: 1.3;
  color: var(--nk-soft);
}

/* the ninth: lit */
.nk-fire--lit {
  border-color: var(--nk-huang);
  background: var(--nk-bg);
}

.nk-fire--lit::before {
  border-color: var(--nk-ember);
  background: radial-gradient(circle at 50% 85%,
    var(--nk-ember) 0 26%, transparent 27%);
}

.nk-fire--lit .nk-fire__no { color: var(--nk-ember); }
.nk-fire--lit .nk-fire__name { color: var(--nk-huang-ink); }

.nk-note {
  margin: 1.6rem auto 0;
  max-width: 52ch;
  text-align: center;
  font-size: .92rem;
  font-style: italic;
  color: var(--nk-soft);
}

/* ── contents ────────────────────────────────────────────────────── */

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

.entry { border-bottom: 1px solid color-mix(in srgb, var(--nk-rule) 62%, transparent); }

.entry__link {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: .72rem .3rem;
  text-decoration: none;
  color: var(--nk-ink);
}

.entry__link:hover { background: var(--nk-press); }

.entry__no {
  font-size: .74rem;
  color: var(--nk-huang-ink);
  font-variant-numeric: tabular-nums;
}

.entry__title { font-size: 1rem; font-weight: 500; }

.entry__open {
  grid-column: 2 / 3;
  font-size: .88rem;
  color: var(--nk-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry__words {
  grid-column: 3 / 4;
  grid-row: 1 / 3;
  align-self: center;
  font-size: .74rem;
  color: var(--nk-faint);
  font-variant-numeric: tabular-nums;
}

/* ── provenance ──────────────────────────────────────────────────── */

.nk-quote {
  max-width: 34rem;
  margin: 0 auto 2.2rem;
  padding: 1.6rem clamp(1.2rem, 4vw, 2rem);
  border: 1px solid var(--nk-rule);
  border-left: 4px solid var(--nk-huang);
  background: var(--nk-bg);
  box-shadow: 4px 4px 0 var(--nk-press);
  text-align: center;
}

.nk-quote__zh {
  margin: 0 0 .5rem;
  font-family: "Noto Serif SC", serif;
  font-size: 1.3rem;
  letter-spacing: .05em;
  line-height: 1.8;
}

.nk-quote__py {
  margin: 0 0 .6rem;
  font-size: .8rem;
  color: var(--nk-faint);
}

.nk-quote__en {
  margin: 0 0 .8rem;
  font-size: 1.05rem;
  font-style: italic;
}

.nk-quote__attr {
  margin: 0;
  font-size: .78rem;
  color: var(--nk-soft);
}

.nk-prose { max-width: 44rem; margin: 0 auto; }

.nk-prose > p { margin: 0 0 1.2rem; font-size: 1.04rem; }

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

.nk-foot {
  margin-top: 2.4rem;
  border-top: 1px solid var(--nk-rule);
}

.nk-foot__inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  padding-top: 2.4rem;
  padding-bottom: 2rem;
}

.nk-foot__brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 600;
}

.nk-foot__tag {
  margin: .7rem 0 0;
  font-size: .82rem;
  color: var(--nk-faint);
}

.nk-foot__col h4 {
  margin: 0 0 .6rem;
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--nk-faint);
  font-weight: 500;
}

.nk-foot__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .35rem;
}

.nk-foot__col a {
  color: var(--nk-soft);
  text-decoration: none;
  font-size: .88rem;
}

.nk-foot__col a:hover { color: var(--nk-huang-ink); }

.nk-foot__bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 5vw, 2rem) 2rem;
  font-size: .78rem;
  color: var(--nk-faint);
}

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

@media (max-width: 700px) {
  .nk-hero { grid-template-columns: 1fr; }
  .nk-plate { order: -1; }
  .nk-plate img { width: 11rem; max-width: 45vw; }
  .nk-fires { grid-template-columns: repeat(2, 1fr); }
  .nk-foot__inner { grid-template-columns: 1fr; gap: 1.6rem; }
}
