/* ═══════════════════════════════════════════════════════════════
   CITY OF SOULS — YICHEN
   Built on Ghost Ink (幽墨).

   The telling is a render log: a boy who has not left his room in
   a year, working at night on a fog the city breathes, and the
   seventeen days the fire gives him and takes back. So the page
   is the log — a dark viewport, Day One framed as an application
   window with its dead pixel in the corner, the days listed as
   log lines, and the grandmother's poem of names as the record.

   The log is not decoration. It IS the table of contents: the
   same seventeen days his mother, his father and his sister are
   living in the other three volumes — one story, four tellings.

   Ghost Ink has no dawn in it, so this page has no theme toggle.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --yc-ink: var(--ym2);
  --yc-soft: var(--ym3);
  --yc-faint: var(--ym5);
  --yc-glow: var(--ym4);
}

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

.yc-hero { position: relative; }

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

.yc-title {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  margin: 0 0 .4rem;
  flex-wrap: wrap;
}
.yc-title__glyph {
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1;
  color: var(--yc-glow);
  opacity: .9;
}
.yc-title__en {
  font-family: "Noto Serif SC", serif;
  font-weight: 600;
  font-size: clamp(1.8rem, 4.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: .01em;
  color: var(--yc-ink);
}

/* ─── The cover plate ──────────────────────────────────────── */

.yc-plate {
  margin: 0;
  position: relative;
  border: 1px solid var(--ym-border-strong);
  background: var(--ym8);
  padding: .55rem;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 18px 60px rgba(0,0,0,.55);
}
.yc-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;
}
.yc-plate figcaption {
  padding: .55rem .2rem .1rem;
  font-family: "Noto Serif SC", serif;
  font-size: .68rem;
  letter-spacing: .14em;
  color: var(--yc-faint);
  text-align: center;
}

/* ─── Section title EN spans ───────────────────────────────── */

.yc-sec-en {
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  opacity: .55;
}

/* ─── The first frame — an application window ──────────────── */

.yc-frame {
  max-width: 46rem;
  margin: 0 auto;
  border: 1px solid var(--ym-border-strong);
  background: var(--ym8);
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 18px 60px rgba(0,0,0,.55);
  position: relative;
}
/* the dead pixel, bottom right — one black point, perfectly round,
   the one thing on this page that keeps its promises */
.yc-frame::after {
  content: "";
  position: absolute;
  right: 1.4rem; bottom: 1.4rem;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06);
}

.yc-frame__bar {
  display: flex;
  align-items: center;
  gap: .38rem;
  padding: .55rem .9rem;
  border-bottom: 1px solid var(--ym-border-strong);
  background: rgba(0,0,0,.35);
}
.yc-frame__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ym-border-strong);
}
.yc-frame__dot:nth-child(1) { background: #7a3b3b; }
.yc-frame__dot:nth-child(2) { background: #7a6c3b; }
.yc-frame__dot:nth-child(3) { background: #3b6b4f; }
.yc-frame__file {
  margin-left: .7rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .66rem;
  letter-spacing: .08em;
  color: var(--yc-faint);
}

.yc-frame__body { padding: clamp(1.4rem, 4vw, 2.4rem); }

.yc-frame__quote {
  margin: 0 0 1.6rem;
  padding: 0;
  border: 0;
  font-family: "Noto Serif SC", serif;
  font-weight: 500;
  font-size: clamp(1.25rem, 2.8vw, 1.7rem);
  line-height: 1.4;
  color: var(--yc-ink);
}

.yc-frame__text p {
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--yc-soft);
  margin: 0 0 1rem;
}

.yc-frame__src {
  margin: 1.6rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--ym-border-strong);
  font-family: "Noto Serif SC", serif;
  font-size: .66rem;
  letter-spacing: .2em;
  color: var(--yc-faint);
}

/* ─── The render log ───────────────────────────────────────── */

.yc-log {
  list-style: none;
  margin: 2.4rem auto 0;
  padding: 0;
  max-width: 46rem;
  border-top: 1px solid var(--ym-border-strong);
}

.entry {
  border-bottom: 1px solid color-mix(in srgb, var(--ym-border-strong) 55%, transparent);
}
.entry:last-child { border-bottom: 0; }

.entry__link {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  column-gap: 1.1rem;
  row-gap: .2rem;
  align-items: baseline;
  padding: .85rem .6rem;
  margin: 0 -.6rem;
  text-decoration: none;
  transition: background-color .2s ease;
}
.entry__link:hover { background: rgba(255,255,255,.035); }

.entry__no {
  grid-area: 1 / 1;
  font-family: "Noto Serif SC", serif;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  color: var(--yc-faint);
  transition: color .2s ease;
}
.entry__link:hover .entry__no { color: var(--yc-glow); }

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

.entry__words {
  grid-area: 1 / 3;
  font-family: "Noto Serif SC", serif;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  color: var(--yc-faint);
  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: .88rem;
  line-height: 1.6;
  color: var(--yc-soft);
}

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

.yc-log__total {
  max-width: 46rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem .6rem 0;
  font-family: "Noto Serif SC", serif;
  font-size: .68rem;
  letter-spacing: .18em;
  color: var(--yc-faint);
}
.yc-log__total-n {
  font-size: .92rem;
  letter-spacing: .06em;
  color: var(--yc-ink);
  font-variant-numeric: tabular-nums;
}

/* ─── The poem of names ────────────────────────────────────── */

.yc-roster {
  max-width: 46rem;
  margin: 2.6rem auto 0;
  border-top: 1px solid var(--ym-border-strong);
}

.yc-roster__item {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.2rem;
  padding: .8rem .4rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ym-border-strong) 55%, transparent);
}
.yc-roster__item dt {
  font-family: "Noto Serif SC", serif;
  font-weight: 500;
  font-size: 1rem;
  color: var(--yc-ink);
}
.yc-roster__item--hun dt { color: var(--yc-glow); }
.yc-roster__item dd {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: .92rem;
  line-height: 1.7;
  color: var(--yc-soft);
}
@media (max-width: 560px) {
  .yc-roster__item { grid-template-columns: 6.4rem minmax(0, 1fr); }
}

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

.yc-prose {
  max-width: 44rem;
  margin: 2.6rem auto 0;
}
.yc-prose p {
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--yc-soft);
  margin: 0 0 1.15rem;
}
.yc-prose strong { font-weight: 500; color: var(--yc-ink); }

.yc-note {
  max-width: 44rem;
  margin: 2.2rem auto 0;
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--ym-border-strong);
  background: rgba(0,0,0,.3);
}
.yc-note p {
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: .88rem;
  line-height: 1.75;
  color: var(--yc-soft);
  margin: 0 0 .9rem;
}
.yc-note p:last-child { margin-bottom: 0; }
.yc-note strong { font-weight: 500; color: var(--yc-ink); }

/* ─── Hero grid: text and plate ────────────────────────────── */

@media (min-width: 880px) {
  .yc-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
  }
  .yc-plate { max-width: 17rem; justify-self: end; }
}
@media (max-width: 879.9px) {
  .yc-plate { max-width: 15rem; margin: 2.4rem auto 0; }
}

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