/* Welcoming Zigu — the vigil page.
   The page is built from the book's own form: a front and a back. The front
   of the shrine is the town's — it rides the Fancy tokens, light and dark.
   The back courtyard is the women's — it is night in both themes, and the
   red thread runs down it with a knot for every question. */

:root {
  /* the thread — the red thread He Mei ties, one knot to a name */
  --wz-thread: #B03A2B;
  --wz-thread-lit: #D4553F;
  /* the back courtyard — fixed night, in both themes */
  --wz-night: #141119;
  --wz-night-2: #1C1620;
  --wz-pale: #E8E2D4;
  --wz-pale-muted: #A89F93;
  --wz-pale-faint: #6F6860;
  --wz-straw: #D4A96A;
}

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

.wz-hero { position: relative; }

.wz-hero__main { max-width: 62ch; }

.wz-hero__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: end;
}

.wz-title { letter-spacing: -0.01em; }

.wz-meta {
  font-family: "Inter", sans-serif;
  font-size: .82rem;
  letter-spacing: .04em;
  color: var(--fc-text-muted);
  margin: 1.4rem 0 1.8rem;
}
.wz-sep { margin: 0 .55rem; color: var(--fc-accent); }

.wz-take { display: flex; flex-wrap: wrap; gap: .7rem; }

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

/* the book in its own numbers — 33 questions, 41 knots, the fifteenth,
   and the shrine that does not exist */
.wz-figures {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  max-width: 1080px;
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
  border: 1px solid var(--fc-border);
  background: var(--fc-border);
}
.wz-figure {
  background: var(--fc-bg);
  padding: 1.1rem 1rem 1rem;
  text-align: center;
}
.wz-figure__n {
  display: block;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: 1.55rem;
  line-height: 1.1;
  color: var(--fc-fire);
}
.wz-figure__w {
  display: block;
  margin-top: .35rem;
  font-family: "Inter", sans-serif;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fc-text-muted);
}

/* ── buttons — the knot's two states: tied, and not yet ────────────── */

.wz-btn {
  display: inline-flex;
  align-items: baseline;
  gap: .55rem;
  padding: .62rem 1.15rem;
  border: 1px solid var(--fc-border);
  background: transparent;
  color: inherit;
  font-family: "Inter", sans-serif;
  font-size: .82rem;
  letter-spacing: .03em;
  text-decoration: none;
  transition: border-color .2s var(--fc-ease-quiet), background-color .2s var(--fc-ease-quiet), color .2s var(--fc-ease-quiet);
}
.wz-btn:hover { border-color: var(--wz-thread); }
.wz-btn .fmt {
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fc-text-muted);
}
.wz-btn--primary {
  background: var(--wz-thread);
  border-color: var(--wz-thread);
  color: #F3EDE2;
}
.wz-btn--primary:hover { background: var(--wz-thread-lit); border-color: var(--wz-thread-lit); }
.wz-btn--primary .fmt { color: rgba(243, 237, 226, .75); }

/* ── the back courtyard — night in both themes ─────────────────────── */

.wz-back {
  background:
    radial-gradient(120% 90% at 50% 0%, var(--wz-night-2) 0%, var(--wz-night) 70%);
  color: var(--wz-pale);
  padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem);
}

.wz-back-head { max-width: 46rem; }
.wz-back-eyebrow {
  font-family: "Inter", sans-serif;
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--wz-straw);
  margin: 0 0 .9rem;
}
.wz-back-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 1rem;
}
.wz-back-sub {
  font-size: .98rem;
  line-height: 1.75;
  color: var(--wz-pale-muted);
  margin: 0;
}

.wz-thread-wrap {
  position: relative;
  margin-top: clamp(2.2rem, 5vw, 3.4rem);
  padding-left: clamp(2.4rem, 5vw, 3.4rem);
}

/* the welcome, said before any question — vertical, at the wall */
.wz-welcome {
  position: absolute;
  top: 0;
  left: 0;
  writing-mode: vertical-rl;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: .95rem;
  letter-spacing: .35em;
  color: var(--wz-pale-faint);
  user-select: none;
}

/* the thread itself: one line running the height of the list */
.wz-questions {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.wz-questions::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.05rem;
  width: 1px;
  background: linear-gradient(to bottom,
      transparent 0, var(--wz-thread) 2.2rem,
      var(--wz-thread) calc(100% - 2.2rem), transparent 100%);
  opacity: .85;
}

/* each question hangs off the thread as a knot */
.wz-questions .entry { position: relative; }
.wz-questions .entry::before {
  content: "";
  position: absolute;
  left: calc(1.05rem - 5px);
  top: 1.35rem;
  width: 11px;
  height: 11px;
  border: 1px solid var(--wz-thread);
  border-radius: 50%;
  background: var(--wz-night);
  transform: rotate(45deg);            /* a knot is a crossing */
  transition: background-color .2s var(--fc-ease-quiet), transform .2s var(--fc-ease-quiet);
}
.wz-questions .entry:hover::before {
  background: var(--wz-thread);
  transform: rotate(45deg) scale(1.25);
}

.wz-questions .entry__link {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  grid-template-areas:
    "no title"
    "no open"
    "no words";
  gap: .15rem .9rem;
  padding: .95rem .4rem .95rem .6rem;
  text-decoration: none;
  color: var(--wz-pale);
}
.wz-questions .entry__no {
  grid-area: no;
  font-family: "Inter", sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--wz-pale-faint);
  padding-top: .3rem;
}
.wz-questions .entry__title {
  grid-area: title;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.3;
}
.wz-questions .entry__open {
  grid-area: open;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--wz-pale-muted);
}
.wz-questions .entry__words {
  grid-area: words;
  font-family: "Inter", sans-serif;
  font-size: .68rem;
  letter-spacing: .06em;
  color: var(--wz-pale-faint);
  font-variant-numeric: tabular-nums;
}
.wz-questions .entry:hover .entry__title { color: var(--wz-straw); }

/* the thread's end — the last knot, tied off */
.wz-thread-end {
  margin: 1.6rem 0 0 calc(1.05rem - 7px);
  color: var(--wz-thread);
  font-size: 1rem;
  line-height: 1;
  user-select: none;
}

/* ── the goddess ───────────────────────────────────────────────────── */

.wz-quote .fc-quote__text-cn { color: var(--fc-fire); }

.wz-quote__py {
  font-family: "Inter", sans-serif;
  font-size: .8rem;
  letter-spacing: .05em;
  color: var(--fc-text-muted);
  margin: .6rem 0 0;
}

.wz-prose { max-width: 46rem; }
.wz-prose p { line-height: 1.8; }

.wz-note {
  border-left: 2px solid var(--wz-thread);
  padding-left: 1rem;
  font-size: .92rem;
  font-style: italic;
  color: var(--fc-text-muted);
}

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

.wz-foot-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1.2rem 0 0;
  padding: 0;
}

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

@media (max-width: 860px) {
  .wz-hero__content { grid-template-columns: 1fr; align-items: start; }
  .wz-plate { width: max-content; }
  .wz-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .wz-thread-wrap { padding-left: 1.9rem; }
  .wz-welcome { display: none; }
  .wz-questions::before { left: .55rem; }
  .wz-questions .entry::before { left: calc(.55rem - 5px); }
  .wz-questions .entry__link {
    grid-template-columns: 1fr;
    grid-template-areas: "no" "title" "open" "words";
  }
  .wz-thread-end { margin-left: calc(.55rem - 7px); }
}
