/* ═══════════════════════════════════════════════════════════════
   CITY OF SOULS — THE SISTER
   Built on Ink Line (墨韵).

   The telling is a notebook with a lock: a child who draws the
   family as it actually is, reads her brother's moods as colors,
   and keeps the pages nobody has ever seen — until the interview
   report. So the page is the notebook: ruled pages, a key on a
   string over the heart, the color legend, and the pages listed
   one to a line.

   The pages are not decoration. They ARE the table of contents:
   the same seventeen days as the other three volumes, plus
   Monday and Tuesday, which are hers alone.

   Element: Vermilion 赤 — the volume's colour on the shelf.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --sn-fire-1: #E8853B;   /* orange            */
  --sn-fire-2: #2E6FD8;   /* electric blue     */
  --sn-gray:   #A8A296;   /* eraser dust       */
  --sn-rain:   #9FB0BE;   /* sky before rain   */
}

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

.sn-title {
  font-family: "Noto Serif SC", serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 4.6vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: .01em;
  margin: 0 0 .6rem;
  color: var(--ink-fg, inherit);
}

.sn-soft { opacity: .55; font-weight: 400; }

/* the cover, pinned to the page */
.sn-plate {
  border: 1px solid var(--ink-border);
  background: var(--ink-card, transparent);
  padding: .55rem;
  box-shadow: 6px 6px 0 0 color-mix(in srgb, var(--ink-fg, #000) 12%, transparent);
}
.sn-plate img {
  display: block;
  width: 100%;
  /* the width/height ATTRIBUTES on <img> are definite, which makes
     the browser ignore aspect-ratio entirely and hand object-fit a
     tall box to crop into. height:auto gives the ratio back. */
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

/* ─── The notebook page (excerpt) ──────────────────────────── */

.sn-notebook {
  position: relative;
  max-width: 44rem;
  margin: 0 auto;
  border: 1px solid var(--ink-border);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(1.9em - 1px),
      color-mix(in srgb, var(--ink-border) 55%, transparent) calc(1.9em - 1px),
      color-mix(in srgb, var(--ink-border) 55%, transparent) 1.9em
    );
  padding: clamp(1.6rem, 4vw, 2.6rem);
  padding-top: 3.2rem;
}

/* the key on the string, worn under the shirt, over the heart */
.sn-notebook__key {
  position: absolute;
  top: 1.1rem;
  right: 1.4rem;
  display: flex;
  align-items: center;
}
.sn-notebook__ring {
  width: .8rem; height: 1.1rem;
  border: 2px solid var(--ink-accent, #b93a32);
  border-radius: 50% 50% 45% 45%;
  position: relative;
}
.sn-notebook__ring::before {
  content: "";
  position: absolute;
  left: 50%; bottom: -5px;
  width: 4px; height: 4px;
  transform: translateX(-50%);
  background: var(--ink-accent, #b93a32);
}
.sn-notebook__string {
  width: 3.2rem;
  height: 2px;
  background: linear-gradient(to right,
    var(--ink-accent, #b93a32) 0 70%, transparent 70%);
}
.sn-notebook__keybit {
  width: 1.5rem; height: 6px;
  background: var(--ink-accent, #b93a32);
  position: relative;
}
.sn-notebook__keybit::before {
  content: "";
  position: absolute;
  right: 3px; top: 6px;
  width: 3px; height: 7px;
  background: var(--ink-accent, #b93a32);
}

.sn-notebook__quote {
  margin: 0 0 1.7rem;
  padding: 0;
  border: 0;
  font-family: "Noto Serif SC", serif;
  font-weight: 500;
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  line-height: 1.45;
}

.sn-notebook__body p {
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
  line-height: 1.9;
  margin: 0 0 1rem;
}

.sn-notebook__src {
  margin: 1.7rem 0 0;
  padding-top: .9rem;
  border-top: 1px solid var(--ink-border);
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: .78rem;
  letter-spacing: .14em;
  opacity: .62;
}

/* ─── The notebook pages (contents) ────────────────────────── */

.sn-pages {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 44rem;
  border-top: 2px solid var(--ink-accent, #b93a32);
}

.entry {
  border-bottom: 1px solid var(--ink-border);
  position: relative;
}
.entry:last-child { border-bottom: 0; }

.entry__link {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto;
  column-gap: 1.1rem;
  row-gap: .2rem;
  align-items: baseline;
  padding: .8rem .6rem;
  margin: 0 -.6rem;
  text-decoration: none;
  transition: background-color .2s ease;
}
.entry__link:hover {
  background: color-mix(in srgb, var(--ink-accent, #b93a32) 6%, transparent);
}

.entry__no {
  grid-area: 1 / 1;
  font-family: "Noto Serif SC", serif;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  opacity: .55;
  transition: opacity .2s ease, color .2s ease;
}
.entry__link:hover .entry__no {
  opacity: 1;
  color: var(--ink-accent, #b93a32);
}

.entry__title {
  grid-area: 1 / 2;
  font-family: "Noto Serif SC", serif;
  font-weight: 500;
  font-size: .98rem;
  letter-spacing: .1em;
}

.entry__words {
  grid-area: 1 / 3;
  font-family: "Noto Serif SC", serif;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  opacity: .55;
  white-space: nowrap;
  justify-self: end;
}

.entry__open {
  grid-area: 2 / 2 / 3 / 4;
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: .9rem;
  line-height: 1.62;
  opacity: .78;
}

@media (max-width: 560px) {
  .entry__link { grid-template-columns: 2.4rem minmax(0, 1fr) auto; }
}

.sn-pages__total {
  max-width: 44rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem .6rem 0;
  font-family: "Noto Serif SC", serif;
  font-size: .72rem;
  letter-spacing: .16em;
  opacity: .62;
}
.sn-pages__total-n {
  font-size: .95rem;
  letter-spacing: .06em;
  opacity: 1;
  font-variant-numeric: tabular-nums;
}

/* ─── The color legend ─────────────────────────────────────── */

.sn-colors {
  max-width: 44rem;
  margin: 0 auto;
  border: 1px solid var(--ink-border);
  padding: clamp(1.2rem, 3vw, 1.8rem);
}

.sn-colors__row {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
  padding: 1rem 0;
}
.sn-colors__row + .sn-colors__row {
  border-top: 1px dashed color-mix(in srgb, var(--ink-border) 70%, transparent);
}

.sn-colors__swatch {
  display: block;
  height: 3.2rem;
  margin-top: .2rem;
  border: 1px solid color-mix(in srgb, var(--ink-fg, #000) 25%, transparent);
}
.sn-colors__swatch--fire {
  background: linear-gradient(105deg,
    var(--sn-fire-1) 0 55%, var(--sn-fire-2) 55% 100%);
}
.sn-colors__swatch--gray { background: var(--sn-gray); }
.sn-colors__swatch--rain { background: var(--sn-rain); }

.sn-colors__name {
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: 1.15rem;
  margin: 0 0 .3rem;
}
.sn-colors__gloss {
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: .92rem;
  line-height: 1.7;
  opacity: .8;
  margin: 0;
}

/* ─── Prose and note ───────────────────────────────────────── */

.sn-prose {
  max-width: 44rem;
  margin: 2.4rem auto 0;
}
.sn-prose p {
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
  line-height: 1.85;
  margin: 0 0 1.1rem;
}
.sn-prose strong { font-weight: 600; }

.sn-note {
  max-width: 44rem;
  margin: 2rem auto 0;
  padding: 1.3rem 1.5rem;
  border: 1px solid var(--ink-border);
  background: color-mix(in srgb, var(--ink-accent, #b93a32) 4%, transparent);
}
.sn-note p {
  font-family: "Noto Serif SC", serif;
  font-size: .88rem;
  line-height: 1.75;
  margin: 0 0 .9rem;
}
.sn-note p:last-child { margin-bottom: 0; }
.sn-note strong { font-weight: 600; }

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

/* grid children: the parent's grid positions them; min-width:0 keeps a
   long word from forcing the column wider than its share. */
.sn-colors__text { min-width: 0; }
