/* ==========================================================================
   Honecho ??The Grace Anomaly
   Version 2: ?he Quiet Temple??   Night-green, ink, and gold leaf.
   ========================================================================== */

:root {
  color-scheme: dark;

  --paper: #171716;
  --paper-2: #1c1c1a;
  --paper-3: #222220;
  --card: #191918;

  --ink: #ece7dc;
  --ink-soft: #cbc5b9;
  --muted: #a6a196;
  --faint: #928d84;

  --gold: #c3a473;
  --gold-ink: #d6b77f;
  --gold-light: #e2c99a;
  --jade: #a3a89d;

  --line: rgba(226, 218, 202, 0.12);
  --line-strong: rgba(226, 218, 202, 0.26);

  --night: #111110;
  --night-2: #0c0c0b;
  --night-ink: #e9e3d7;
  --night-muted: #a49f94;
  --night-line: rgba(233, 227, 215, 0.14);

  --sky-1: #222220;
  --sky-2: #1b1b19;
  --sky-3: #141413;

  --sage: #6e6f6a;
  --sage-wash: #1a1a18;

  --lamp-warm: rgba(212, 182, 128, 0.1);
  --lamp-cool: rgba(126, 126, 122, 0.09);

  --shadow-soft: 0 30px 80px -40px rgba(0, 0, 0, 0.75);
  --shadow-card: 0 18px 46px -26px rgba(0, 0, 0, 0.7);

  --font-display: "Cormorant Garamond", "Noto Serif TC", Georgia, serif;
  --font-body: "Spectral", "Noto Serif TC", Georgia, serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shell: min(1180px, 90vw);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.72;
  text-wrap: pretty;
  transition: background-color 0.7s ease, color 0.7s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

img {
  max-width: 100%;
}

::selection {
  background: rgba(195, 164, 115, 0.26);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 4px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p,
figure,
blockquote,
dl,
dd,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* Paper grain ------------------------------------------------------------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.18'/%3E%3C/svg%3E");
}

/* Reading progress -------------------------------------------------------- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  height: 2px;
  pointer-events: none;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(195, 164, 115, 0.2), var(--gold));
}

/* Shared ------------------------------------------------------------------ */

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.section {
  padding: clamp(4.5rem, 8vw, 8.5rem) 0;
  position: relative;
}

#book,
#eight,
#qimen,
#world,
#glossary,
#notebook,
#questions,
#connect {
  scroll-margin-top: 6.5rem;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.kicker:not(.kicker--center)::before {
  content: "";
  flex: none;
  width: 1.7rem;
  height: 1px;
  background: var(--gold);
  opacity: 0.55;
}

.kicker--center {
  justify-content: center;
}

.kicker--light {
  color: var(--night-muted);
}

.kicker--light:not(.kicker--center)::before {
  background: var(--gold-light);
  opacity: 0.6;
}

.display {
  margin-top: 1.4rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 4.9vw, 4.35rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

.display em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold-ink);
}

.display--light {
  color: var(--night-ink);
}

.display--light em {
  color: var(--gold-light);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
}

.section-head--narrow {
  align-items: start;
}

.section-head__aside {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 30rem;
  padding-bottom: 0.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.05rem 1.9rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease),
    border-color 0.45s var(--ease), transform 0.45s var(--ease);
}

.button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button--solid {
  background: var(--ink);
  color: var(--paper);
}

.button--solid:hover {
  background: var(--gold-ink);
  color: #1a1509;
  transform: translateY(-1px);
}

.button--line {
  border-color: var(--line-strong);
  color: var(--ink);
}

.button--line:hover {
  border-color: var(--gold);
  color: var(--gold-ink);
}

.button--gold {
  background: var(--gold-light);
  color: #171815;
}

.button--gold:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(195, 164, 115, 0.5);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-ink);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.text-link svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.text-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Header ------------------------------------------------------------------ */

.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 70;
  transition: background-color 0.5s ease, border-color 0.5s ease,
    box-shadow 0.5s ease;
  border-bottom: 1px solid transparent;
}

.header.is-scrolled {
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}

.header__inner {
  width: var(--shell);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.brand__seal {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: var(--gold-ink);
  stroke-width: 1.1;
  stroke-linecap: round;
}

.brand__type {
  display: block;
  line-height: 1;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 500;
  letter-spacing: 0.17em;
  color: var(--ink);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 2.4vw, 2.4rem);
}

.nav a {
  position: relative;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 0.3rem 0;
  transition: color 0.3s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.nav a:hover,
.nav a.is-active {
  color: var(--gold-ink);
}

.nav a:hover::after,
.nav a.is-active::after {
  transform: scaleX(1);
}

.header__tools {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}



.header__read {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 0.3rem;
  transition: color 0.3s ease;
}

.header__read:hover {
  color: var(--gold-ink);
}

.menu {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
}

.menu span {
  position: absolute;
  left: 9px;
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}

.menu span:first-child {
  top: 16px;
}

.menu span:last-child {
  top: 23px;
}

.menu[aria-expanded="true"] span:first-child {
  top: 20px;
  transform: rotate(45deg);
}

.menu[aria-expanded="true"] span:last-child {
  top: 20px;
  transform: rotate(-45deg);
}

/* Threshold --------------------------------------------------------------- */

.threshold {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 8rem 0 5rem;
  overflow: hidden;
  background: radial-gradient(
    120% 100% at 72% 8%,
    var(--sky-1) 0%,
    var(--sky-2) 48%,
    var(--sky-3) 100%
  );
}

.threshold__wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      50% 40% at 76% 40%,
      rgba(192, 160, 106, 0.14),
      transparent 70%
    ),
    radial-gradient(60% 50% at 10% 92%, rgba(108, 112, 104, 0.16), transparent 70%);
  pointer-events: none;
}

.threshold__rings {
  position: absolute;
  top: 50%;
  right: -6vw;
  width: min(74vw, 900px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  color: var(--gold);
  opacity: 0.28;
  pointer-events: none;
}

.threshold__rings svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 0.7;
}

.threshold__rings svg,
.niche__arch,
.seal__rings {
  vector-effect: non-scaling-stroke;
}

.threshold__inner {
  position: relative;
  z-index: 1;
  width: var(--shell);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow__rule {
  display: inline-block;
  width: 2.4rem;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}

.hero-title {
  display: flex;
  flex-direction: column;
  margin-top: 1.7rem;
  font-family: var(--font-display);
  font-weight: 300;
  color: var(--ink);
  line-height: 0.88;
}

.hero-title__the {
  font-size: clamp(0.82rem, 1vw, 1rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: 0.55rem;
  padding-left: 0.3rem;
}

.hero-title__line {
  display: block;
  font-size: clamp(4.1rem, 7.7vw, 7.3rem);
  letter-spacing: -0.02em;
  line-height: 0.94;
}

.hero-title__line--accent {
  font-style: italic;
  font-weight: 300;
  color: var(--gold-ink);
  padding-left: 0.06em;
}

.hero-epigraph {
  margin-top: clamp(1.8rem, 3vw, 2.6rem);
  padding-left: 1.15rem;
  border-left: 1px solid rgba(195, 164, 115, 0.5);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.5vw, 1.32rem);
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink-soft);
}

.hero-epigraph em {
  font-style: italic;
  color: var(--gold-ink);
}

.hero-lede {
  max-width: 34rem;
  margin-top: 1.5rem;
  font-size: 1rem;
  line-height: 1.78;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 2.4rem;
  font-size: 0.63rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.hero-meta__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.7;
}

/* The niche and cover */

.threshold__visual {
  display: flex;
  justify-content: center;
}

.niche {
  position: relative;
  width: min(29rem, calc((100svh - 12rem) / 1.62), 94%);
  padding: 2.6rem 0 0;
}

.niche__glow {
  position: absolute;
  inset: 6% -18% 2% -18%;
  background: radial-gradient(
    50% 45% at 50% 40%,
    rgba(192, 160, 106, 0.26),
    rgba(192, 160, 106, 0) 72%
  );
  filter: blur(10px);
  pointer-events: none;
}

.niche__arch {
  position: absolute;
  inset: -2.4rem -15.5% -2.6rem;
  width: 131%;
  height: calc(100% + 5rem);
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  opacity: 0.55;
  pointer-events: none;
}

.niche__arch-inner {
  opacity: 0.45;
  stroke-width: 0.6;
}

.niche__jewel {
  position: absolute;
  top: -1.55rem;
  left: 50%;
  width: 7px;
  height: 7px;
  transform: translateX(-50%) rotate(45deg);
  border: 1px solid var(--gold);
  background: var(--sky-1);
  opacity: 0.85;
}

.cover {
  position: relative;
  transform: rotate(-1.1deg);
  will-change: transform;
}

.cover__frame {
  position: relative;
  padding: 13px;
  background: linear-gradient(160deg, #24241f 0%, var(--card) 52%, #131312 100%);
  border: 1px solid rgba(195, 164, 115, 0.38);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 -1px 0 rgba(0, 0, 0, 0.55) inset,
    0 38px 74px -30px rgba(0, 0, 0, 0.82),
    0 12px 26px -14px rgba(0, 0, 0, 0.6);
}

.cover__frame::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(195, 164, 115, 0.16);
  pointer-events: none;
}

.cover__frame::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 10px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 88%);
  pointer-events: none;
}

.cover__frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.cover__caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 1.7rem;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.cover__caption-rule {
  width: 1.9rem;
  height: 1px;
  background: var(--line-strong);
}

/* Invocation -------------------------------------------------------------- */

.invocation {
  background:
    radial-gradient(58% 130% at 50% 50%, rgba(192, 160, 106, 0.05), transparent 72%),
    var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(3.5rem, 6vw, 5.5rem) 0;
}

.invocation__inner {
  text-align: center;
}

.invocation__line {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.4vw, 2.9rem);
  font-weight: 300;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.invocation__line--accent {
  font-style: italic;
  color: var(--gold-ink);
}

.invocation__aside {
  margin-top: 1.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The book ---------------------------------------------------------------- */

.book__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(2.6rem, 6vw, 5.5rem);
  align-items: start;
}

.book__lead {
  margin-top: 1.7rem;
  max-width: 34rem;
  font-family: var(--font-display);
  font-size: clamp(1.32rem, 2vw, 1.65rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  color: var(--gold-ink);
}

.book__body {
  margin-top: 1.8rem;
  max-width: 38rem;
  color: var(--ink-soft);
}

.book__body p {
  margin-bottom: 1.15rem;
  font-size: 1rem;
  line-height: 1.8;
}

.book__body em {
  font-style: italic;
  color: var(--ink);
}

.colophon {
  position: relative;
  padding: clamp(2rem, 3.5vw, 2.8rem);
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.colophon__mark {
  position: relative;
  writing-mode: vertical-rl;
  font-family: "Noto Serif TC", serif;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  color: var(--gold-ink);
  opacity: 0.9;
  margin-left: auto;
  height: 6.4rem;
}

.colophon__list {
  position: relative;
  margin-top: 1.4rem;
}

.colophon__list div {
  display: grid;
  grid-template-columns: 6.6rem 1fr;
  gap: 1rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
}

.colophon__list div:last-child {
  border-bottom: 1px solid var(--line);
}

.colophon__list dt {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.2rem;
}

.colophon__list dd {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
}

.colophon__note {
  margin-top: 1.6rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-style: italic;
  color: var(--gold-ink);
}

/* Excerpt */

.excerpt {
  display: grid;
  grid-template-columns: minmax(11rem, 17rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: clamp(4rem, 7vw, 6.5rem);
  padding-top: clamp(2.5rem, 4vw, 3.5rem);
  border-top: 1px solid var(--line);
}

.excerpt__head {
  position: sticky;
  top: 6.5rem;
  align-self: start;
}

.excerpt__note {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--muted);
  font-style: italic;
}

.excerpt__prose {
  max-width: 40rem;
}

.excerpt__prose p {
  margin-bottom: 1.35rem;
  font-size: 1.1rem;
  line-height: 1.86;
  color: var(--ink-soft);
}

.excerpt__prose .dropcap::first-letter {
  float: left;
  margin: 0.14em 0.14em 0 0;
  font-family: var(--font-display);
  font-size: 4.6em;
  font-weight: 400;
  line-height: 0.72;
  color: var(--gold-ink);
}

.excerpt__single {
  font-family: var(--font-display) !important;
  font-size: 1.62rem !important;
  font-style: italic;
  line-height: 1.4 !important;
  color: var(--gold-ink) !important;
  padding: 0.6rem 0 0.2rem;
}

.excerpt__prose .text-link {
  margin-top: 1rem;
}

/* Pause ------------------------------------------------------------------- */

.pause {
  position: relative;
  padding: clamp(7rem, 12vw, 11rem) 0;
  background: var(--night);
  color: var(--night-ink);
  text-align: center;
  overflow: hidden;
}

.pause__breath {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(78vw, 560px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pause__watermark {
  display: none;
}

.pause__ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(192, 160, 106, 0.32);
  border-radius: 50%;
  animation: breathe 10s ease-in-out infinite;
}

.pause__ring--2 {
  inset: 13%;
  animation-delay: -3.3s;
  opacity: 0.7;
}

.pause__ring--3 {
  inset: 27%;
  animation-delay: -6.6s;
  opacity: 0.45;
}

.pause__seed {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  height: 260px;
  margin: -130px 0 0 -130px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(226, 201, 154, 0.12),
    rgba(226, 201, 154, 0) 70%
  );
  animation: seedGlow 10s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.03);
    opacity: 0.85;
  }
}

@keyframes seedGlow {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.pause__inner {
  position: relative;
  z-index: 1;
}

.pause__line {
  margin: 1.6rem auto 0;
  max-width: 22ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--night-ink);
  text-wrap: balance;
}

.pause__line em {
  font-style: italic;
  color: var(--gold-light);
}

.pause__aside {
  margin: 1.8rem auto 0;
  max-width: 30rem;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--night-muted);
}

/* The Eight --------------------------------------------------------------- */

.eight {
  background:
    radial-gradient(70% 42% at 50% 0%, rgba(192, 160, 106, 0.075), transparent 68%),
    radial-gradient(90% 60% at 50% 108%, rgba(116, 116, 112, 0.13), transparent 70%),
    var(--night-2);
  color: var(--night-ink);
  padding-bottom: clamp(3.5rem, 6vw, 5rem);
  border-top: 1px solid rgba(232, 223, 207, 0.08);
}

.portraits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.1rem, 2.4vw, 2rem);
  margin-top: clamp(2.5rem, 4vw, 3.6rem);
}

.portrait {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: transform 0.6s var(--ease);
}

.portrait__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.62rem;
}

.portrait__head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(192, 160, 106, 0.3), rgba(192, 160, 106, 0));
}

.portrait__num {
  font-family: var(--font-body);
  font-size: 0.55rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  transition: color 0.5s var(--ease);
}

.portrait__frame {
  position: relative;
  display: block;
  padding: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(234, 226, 210, 0.05), rgba(234, 226, 210, 0.012));
  box-shadow: 0 30px 60px -48px rgba(0, 0, 0, 0.95);
  transition: border-color 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

.portrait__frame::before {
  content: "";
  position: absolute;
  inset: 9px;
  background: linear-gradient(180deg, rgba(226, 196, 146, 0.12), transparent 38%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.portrait__frame::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(234, 226, 210, 0.08);
  box-shadow: inset 0 0 56px rgba(4, 10, 7, 0.5);
  pointer-events: none;
  transition: border-color 0.6s var(--ease);
}

.portrait__frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
  filter: saturate(0.74) brightness(0.92) contrast(1.05);
  transition: filter 0.9s var(--ease), transform 1.4s var(--ease);
}

.portrait:hover,
.portrait:focus-visible {
  transform: translateY(-4px);
}

.portrait:hover .portrait__frame,
.portrait:focus-visible .portrait__frame {
  border-color: rgba(192, 160, 106, 0.45);
  box-shadow: 0 34px 80px -48px rgba(0, 0, 0, 1),
    0 0 44px -20px rgba(192, 160, 106, 0.28);
}

.portrait:hover .portrait__frame::after,
.portrait:focus-visible .portrait__frame::after {
  border-color: rgba(192, 160, 106, 0.2);
}

.portrait:hover img,
.portrait:focus-visible img {
  filter: saturate(0.92) brightness(1) contrast(1.02);
  transform: scale(1.03);
}

.portrait:hover .portrait__num,
.portrait:focus-visible .portrait__num {
  color: var(--gold-light);
}

.portrait__role {
  display: block;
  margin-top: 1.05rem;
  font-size: 0.55rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

.portrait__name {
  display: block;
  margin-top: 0.34rem;
  font-family: var(--font-display);
  font-size: clamp(1.22rem, 1.65vw, 1.5rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  transition: color 0.35s ease;
}

.portrait:hover .portrait__name {
  color: var(--gold-light);
}

.eight__credit {
  margin-top: 3rem;
  text-align: right;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232, 223, 207, 0.4);
}

.eight .section-head__aside {
  color: var(--night-muted);
}

/* The World --------------------------------------------------------------- */

.world {
  background: linear-gradient(180deg, var(--paper) 0%, var(--sage-wash) 100%);
}

.themes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.6rem, 3.4vw, 3rem);
  margin-top: clamp(2.8rem, 4.5vw, 4rem);
}

.theme {
  padding-top: 1.7rem;
  border-top: 1px solid var(--line-strong);
}

.theme__num {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: var(--gold-ink);
}

.theme__mark {
  display: block;
  width: 42px;
  height: 42px;
  margin: 1.5rem 0 1.4rem;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  stroke-linecap: round;
}

.theme h3 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}

.theme p {
  margin-top: 0.9rem;
  font-size: 0.97rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.theme__tag {
  display: inline-block;
  margin-top: 1.3rem;
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.question {
  margin-top: clamp(3rem, 5vw, 4.5rem);
  padding: clamp(2rem, 4vw, 3.4rem);
  background: rgba(116, 116, 112, 0.13);
  border: 1px solid rgba(166, 166, 158, 0.22);
  text-align: center;
}

.question__label {
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.question__text {
  margin: 1.1rem auto 0;
  max-width: 44rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.8vw, 2.15rem);
  font-weight: 300;
  line-height: 1.35;
  color: var(--ink);
  text-wrap: balance;
}

.question__foot {
  margin: 1.4rem auto 0;
  max-width: 34rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
  font-style: italic;
}

.places {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.6rem);
  margin-top: clamp(2.6rem, 4vw, 3.6rem);
}

.place {
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
}

.place__label {
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}

.place h3 {
  margin-top: 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.9vw, 1.6rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}

.place h3 span {
  margin-left: 0.5rem;
  font-family: "Noto Serif TC", serif;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--gold-ink);
}

.place p:last-child {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--muted);
}

/* Passages ---------------------------------------------------------------- */

.passages {
  background: var(--paper-3);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.passages__inner {
  max-width: 62rem;
}

.passages__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.passages__note {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--muted);
}

.passage {
  position: relative;
  padding: clamp(2.8rem, 5vw, 4.4rem) 0 clamp(1.6rem, 3vw, 2.4rem);
}

.passage__mark {
  position: absolute;
  top: 0.6rem;
  left: 0;
  font-family: var(--font-display);
  font-size: clamp(6rem, 12vw, 10rem);
  line-height: 1;
  color: var(--gold);
  opacity: 0.22;
  pointer-events: none;
}

.passage__quote {
  position: relative;
  max-width: 48rem;
}

.passage__quote p {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.1vw, 3.15rem);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}

.passage__source {
  margin-top: 1.4rem;
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.passage.is-changing .passage__quote,
.passage.is-changing .passage__source {
  opacity: 0;
  transform: translateY(8px);
}

.passage__quote,
.passage__source {
  transition: opacity 0.5s ease, transform 0.5s var(--ease);
}

.passage__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.2rem;
}

.passage__dots {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.dot {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.dot::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0.55;
  transition: opacity 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}

.dot:hover::before {
  opacity: 1;
}

.dot.is-active::before {
  background: var(--gold);
  opacity: 1;
  transform: scale(1.35);
}

.passage__count {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.passage__arrows {
  display: flex;
  gap: 0.6rem;
  margin-left: auto;
}

.arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease,
    color 0.3s ease;
}

.arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow:hover {
  border-color: var(--gold);
  color: var(--gold-ink);
  background: rgba(195, 164, 115, 0.07);
}

/* Author ------------------------------------------------------------------ */

.author {
  padding: clamp(4.5rem, 8vw, 8rem) 0;
  background: linear-gradient(155deg, #1a1a18 0%, #1e1e1c 58%, #232321 100%);
  border-top: 1px solid var(--line);
}

.author__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.author__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
}

.seal {
  position: relative;
  width: min(280px, 74%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(195, 164, 115, 0.34);
  border-radius: 50%;
  background: radial-gradient(
    circle at 40% 32%,
    rgba(192, 160, 106, 0.12),
    rgba(192, 160, 106, 0) 65%
  );
}

.seal__rings {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  fill: none;
  stroke: var(--gold);
  stroke-width: 0.6;
  opacity: 0.55;
}

.seal__letter {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(5rem, 11vw, 8rem);
  font-weight: 300;
  line-height: 1;
  color: var(--gold-ink);
  opacity: 0.85;
  transform: translateY(-2%);
}

.seal__vertical {
  position: absolute;
  bottom: 11%;
  font-family: "Noto Serif TC", serif;
  font-size: 0.62rem;
  letter-spacing: 0.35em;
  color: var(--gold-ink);
  opacity: 0.8;
}

.author__place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.8rem;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.author__place span:last-child {
  letter-spacing: 0.12em;
  opacity: 0.8;
}

.author__lead {
  margin-top: 1.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-style: italic;
  line-height: 1.5;
  color: var(--gold-ink);
  max-width: 36rem;
}

.author__bio {
  margin-top: 1.6rem;
  max-width: 42rem;
  color: var(--ink-soft);
}

.author__bio p {
  margin-bottom: 1rem;
  font-size: 0.98rem;
  line-height: 1.82;
}

.author__bio em {
  font-style: italic;
  color: var(--ink);
}

.author__credentials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.4rem;
  margin-top: 1.8rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.author__credentials li {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.author__credentials li + li::before {
  content: "繚";
  color: var(--gold);
}

.author__quote {
  margin-top: 2rem;
  padding-left: 1.4rem;
  border-left: 1px solid var(--gold);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
}

/* Glossary ---------------------------------------------------------------- */

.glossary__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: clamp(2.4rem, 4vw, 3.4rem);
}

.term {
  border-top: 1px solid var(--line);
}

.term summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 0;
  cursor: pointer;
  list-style: none;
}

.term summary::-webkit-details-marker {
  display: none;
}

.term__name {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 400;
  color: var(--ink);
  transition: color 0.3s ease;
}

.term__zh {
  font-family: "Noto Serif TC", serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.term__toggle {
  position: relative;
  width: 14px;
  height: 14px;
}

.term__toggle::before,
.term__toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 1px;
  background: var(--gold);
  transition: transform 0.35s var(--ease);
}

.term__toggle::after {
  transform: rotate(90deg);
}

.term[open] .term__toggle::after {
  transform: rotate(0deg);
}

.term[open] .term__name,
.term summary:hover .term__name {
  color: var(--gold-ink);
}

.term p {
  padding: 0 2.5rem 1.5rem 0;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--muted);
}

.glossary__note {
  margin-top: 2.6rem;
  text-align: center;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--faint);
}

/* Qi Men Dun Jia ---------------------------------------------------------- */

.qimen {
  background:
    radial-gradient(55% 45% at 90% 8%, rgba(195, 164, 115, 0.085), transparent 68%),
    radial-gradient(70% 60% at 0% 100%, rgba(116, 116, 112, 0.12), transparent 70%),
    var(--paper-2);
  border-top: 1px solid var(--line);
}

.qimen__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.qimen__lede {
  margin-top: 1.5rem;
  max-width: 33rem;
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--ink-soft);
}

.qimen__cols {
  display: grid;
  gap: 1.8rem;
  margin-top: 2.3rem;
  max-width: 33rem;
}

.qimen__label {
  font-family: var(--font-body);
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.qimen__cols p {
  margin-top: 0.65rem;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--muted);
}

.qimen__chart {
  margin: 0;
}

.chart {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  width: min(100%, 24rem);
  margin-inline: auto;
  aspect-ratio: 1;
  background: rgba(195, 164, 115, 0.18);
}

.palace {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem;
  border: 0;
  border-radius: 0;
  font: inherit;
  color: inherit;
  text-align: center;
  background: var(--paper);
  cursor: pointer;
  transition: background 0.5s var(--ease);
}

.palace:hover {
  background: var(--paper-3);
}

.palace:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: -3px;
}

.palace__num {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  opacity: 0.8;
}

.palace__zh {
  font-family: "Noto Serif TC", serif;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  line-height: 1;
  color: var(--ink);
}

.palace__name {
  font-size: 0.54rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.palace--centre {
  background:
    radial-gradient(circle at 50% 50%, rgba(195, 164, 115, 0.16), transparent 70%),
    var(--paper);
}

.palace--centre .palace__zh {
  color: var(--gold-light);
}

.chart__caption {
  width: min(100%, 24rem);
  margin: 1.1rem auto 0;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.7;
  font-style: italic;
  color: var(--faint);
}

.chart__read {
  width: min(100%, 24rem);
  min-height: 4.2em;
  margin: 0.9rem auto 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

/* Yin Pan charts ---------------------------------------------------------- */

.yupan {
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(195, 164, 115, 0.05), transparent 70%),
    var(--paper-2);
  border-top: 1px solid var(--line);
}

.yupan__head {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: end;
}

.yupan__aside {
  max-width: 32rem;
  padding-bottom: 0.4rem;
}

.yupan__aside p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.yupan__aside-note {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(195, 164, 115, 0.4);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.75;
  color: var(--faint);
}

.cases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.4rem, 2.6vw, 2.2rem);
  margin-top: clamp(2.8rem, 4.5vw, 3.8rem);
  align-items: start;
}

.case {
  display: flex;
  flex-direction: column;
  gap: clamp(1.3rem, 2vw, 1.7rem);
  padding: clamp(1.2rem, 2.1vw, 1.9rem);
  border: 1px solid rgba(195, 164, 115, 0.2);
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(195, 164, 115, 0.07), transparent 62%),
    var(--night);
  box-shadow: var(--shadow-card);
}

.case__no {
  font-size: 0.58rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.case__op {
  margin-top: 0.7rem;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--night-ink);
}

.case__target {
  margin-top: 0.55rem;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.7;
  color: var(--night-muted);
}

.case__meta {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--night-line);
  font-size: 0.66rem;
  line-height: 1.95;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.pan {
  border: 1px solid rgba(195, 164, 115, 0.16);
  background: linear-gradient(180deg, rgba(19, 19, 18, 0.94), rgba(11, 11, 10, 0.98));
}

.pan__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.66rem 0.85rem 0.6rem;
  border-bottom: 1px solid rgba(195, 164, 115, 0.16);
  font-size: 0.46rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(158, 152, 143, 0.95);
}

.pan__ju {
  font-family: "Noto Serif TC", serif;
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: none;
  color: var(--gold-light);
}

.pan__pillars {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.16em;
}

.pan__tag {
  font-family: "Noto Serif TC", serif;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: none;
  color: rgba(195, 164, 115, 0.72);
}

.pan__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 1px;
  list-style: none;
  background: rgba(195, 164, 115, 0.16);
}

.p {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.1rem;
  aspect-ratio: 1 / 1;
  padding: 0.62rem 0.55rem 0.5rem;
  overflow: hidden;
  background: #0f0f0e;
}

.p__tri {
  position: absolute;
  right: -0.05rem;
  bottom: -0.7rem;
  font-family: "Noto Serif TC", serif;
  font-size: clamp(2.4rem, 4.4vw, 3.1rem);
  line-height: 1;
  color: rgba(233, 227, 215, 0.05);
  pointer-events: none;
}

.p__num {
  position: absolute;
  top: 0.42rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.42rem;
  letter-spacing: 0.1em;
  color: rgba(158, 152, 143, 0.42);
}

.p__row {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem;
  min-height: 0.8rem;
}

.p__god,
.p__star,
.p__door {
  font-family: "Noto Serif TC", serif;
  font-size: clamp(0.6rem, 1.05vw, 0.72rem);
  line-height: 1;
  letter-spacing: 0.02em;
}

.p__god {
  color: rgba(195, 164, 115, 0.82);
}

.p__star {
  color: rgba(226, 221, 210, 0.7);
  text-align: right;
}

.p__door {
  color: rgba(226, 221, 210, 0.88);
  letter-spacing: 0.04em;
}

.p__void {
  padding: 0.02rem 0.28rem;
  border: 1px solid rgba(158, 152, 143, 0.35);
  border-radius: 999px;
  background: #0f0f0e;
  font-family: "Noto Serif TC", serif;
  font-size: 0.54rem;
  line-height: 1.5;
  color: rgba(158, 152, 143, 0.9);
}

.p__mid {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.1rem 0;
}

.p__tian {
  font-family: "Noto Serif TC", serif;
  font-size: clamp(1.05rem, 1.9vw, 1.42rem);
  line-height: 1;
  color: rgba(233, 227, 215, 0.9);
}

.p__di {
  font-family: "Noto Serif TC", serif;
  font-size: clamp(0.62rem, 1.05vw, 0.74rem);
  line-height: 1;
  color: rgba(195, 164, 115, 0.6);
}

.p--live {
  background:
    linear-gradient(165deg, rgba(195, 164, 115, 0.14), rgba(195, 164, 115, 0.03) 60%, transparent),
    #101010;
  box-shadow: inset 0 0 0 1px rgba(195, 164, 115, 0.34);
}

.p--live .p__tian {
  color: var(--gold-light);
}

.p--live .p__star,
.p--live .p__door {
  color: var(--ink);
}

.p--live .p__num {
  color: rgba(195, 164, 115, 0.7);
}

.p--centre .p__tian {
  color: rgba(195, 164, 115, 0.62);
}

.p--centre .p__di {
  color: rgba(195, 164, 115, 0.38);
}

.pan__note {
  margin: 0;
  padding: 0.55rem 0.85rem 0.6rem;
  border-top: 1px solid rgba(195, 164, 115, 0.14);
  font-size: 0.52rem;
  line-height: 1.7;
  letter-spacing: 0.08em;
  color: rgba(158, 152, 143, 0.85);
}

.case__read {
  margin: 0;
}

.read {
  padding: 0.8rem 0;
  border-top: 1px solid var(--night-line);
}

.read dt {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.read dd {
  margin: 0.4rem 0 0;
  font-size: 0.84rem;
  line-height: 1.75;
  color: var(--night-muted);
}

.case__verdict {
  padding-top: 1rem;
  border-top: 1px solid var(--night-line);
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-soft);
}

.yupan__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.6rem, 3vw, 2.8rem);
  margin-top: clamp(2.6rem, 4vw, 3.4rem);
  padding-top: clamp(2rem, 3vw, 2.6rem);
  border-top: 1px solid var(--line);
}

.yupan__cols p {
  margin-top: 0.7rem;
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--muted);
}

@media (max-width: 900px) {
  .yupan__head {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
  }

  .yupan__aside {
    max-width: none;
  }

  .cases {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
  }

  .yupan__cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.8rem;
  }
}

@media (max-width: 430px) {
  .p {
    padding: 0.5rem 0.42rem 0.42rem;
  }

  .p__god,
  .p__star,
  .p__door {
    font-size: 0.56rem;
  }

  .p__tian {
    font-size: 1rem;
  }

  .p__di {
    font-size: 0.6rem;
  }

  .pan__head {
    font-size: 0.42rem;
    letter-spacing: 0.16em;
    padding: 0.55rem 0.6rem 0.5rem;
  }

  .pan__note {
    padding: 0.5rem 0.6rem;
    font-size: 0.48rem;
  }
}

/* Questions --------------------------------------------------------------- */

.qa {
  background: linear-gradient(180deg, var(--paper-2) 0%, var(--paper) 100%);
}

.qa__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: clamp(2.4rem, 4vw, 3.4rem);
}

.qa__item {
  border-top: 1px solid var(--line);
}

.qa__item summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 1.2rem;
  padding: 1.4rem 0;
  cursor: pointer;
  list-style: none;
}

.qa__item summary::-webkit-details-marker {
  display: none;
}

.qa__q {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  text-wrap: balance;
  transition: color 0.3s ease;
}

.qa__item[open] .qa__q,
.qa__item summary:hover .qa__q {
  color: var(--gold-ink);
}

.qa__item .term__toggle {
  margin-top: 0.4rem;
}

.qa__a {
  padding: 0 1.8rem 1.6rem 0;
}

.qa__a p {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--muted);
}

.qa__placeholder {
  border-left: 1px solid rgba(195, 164, 115, 0.4);
  padding-left: 0.9rem;
  font-style: italic;
  color: var(--faint);
}

.qa__note {
  margin-top: 2.4rem;
  text-align: center;
  font-size: 0.76rem;
  font-style: italic;
  color: var(--faint);
}

@media (max-width: 900px) {
  .qimen__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.6rem;
  }
}

@media (max-width: 720px) {
  .qa__list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Notebook ---------------------------------------------------------------- */

.notebook {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}

.notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-top: clamp(2.5rem, 4vw, 3.5rem);
}

.note {
  display: flex;
  flex-direction: column;
  min-height: 19rem;
  padding: clamp(1.6rem, 2.4vw, 2rem);
  background: var(--card);
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  transition: transform 0.5s var(--ease), border-color 0.5s ease,
    box-shadow 0.5s ease;
}

.note:hover {
  transform: translateY(-4px);
  border-color: rgba(195, 164, 115, 0.44);
  box-shadow: var(--shadow-card);
}

.note__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.note__category {
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.note__index {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--faint);
}

.note__title {
  display: block;
  margin: 1.4rem 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.9vw, 1.55rem);
  font-weight: 400;
  line-height: 1.22;
  color: var(--ink);
}

.note__excerpt {
  display: block;
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--muted);
}

.note__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.note__arrow {
  font-size: 1rem;
  color: var(--gold-ink);
  transition: transform 0.4s var(--ease);
}

.note:hover .note__arrow {
  transform: translateX(4px);
}

/* Connect ----------------------------------------------------------------- */

.connect__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}

.connect__lede {
  margin-top: 1.5rem;
  max-width: 28rem;
  font-size: 0.98rem;
  line-height: 1.8;
  color: var(--muted);
}

.social {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}

.social:last-child {
  border-bottom: 1px solid var(--line);
}

.social__name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--ink);
  transition: color 0.3s ease;
}

.social__line {
  flex: 1;
  height: 1px;
  background: var(--line);
  transition: background-color 0.4s ease;
}

.social__arrow {
  font-size: 0.95rem;
  color: var(--gold-ink);
  transition: transform 0.4s var(--ease);
}

.social:hover .social__name {
  color: var(--gold-ink);
}

.social:hover .social__line {
  background: rgba(195, 164, 115, 0.4);
}

.social:hover .social__arrow {
  transform: translate(3px, -3px);
}

/* Begin ------------------------------------------------------------------- */

.begin {
  position: relative;
  padding: clamp(6rem, 10vw, 9rem) 0;
  background: var(--night);
  color: var(--night-ink);
  text-align: center;
  overflow: hidden;
}

.begin__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(90vw, 780px);
  aspect-ratio: 1;
  transform: translate(-50%, -52%);
  background: radial-gradient(
    circle,
    rgba(192, 160, 106, 0.16),
    rgba(192, 160, 106, 0) 66%
  );
  pointer-events: none;
}

.begin__inner {
  position: relative;
  z-index: 1;
}

.begin__title {
  margin-top: 1.4rem;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.4vw, 4.2rem);
  font-weight: 300;
  line-height: 1.05;
  color: var(--night-ink);
}

.begin__title em {
  font-style: italic;
  color: var(--gold-light);
}

.begin__line {
  margin: 1.3rem auto 2.4rem;
  max-width: 30rem;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--night-muted);
}

.begin__edition {
  margin-top: 1.4rem;
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(232, 223, 207, 0.45);
}

/* Footer ------------------------------------------------------------------ */

.footer {
  padding: 3.5rem 0 2rem;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}

.footer__top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.footer__line {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
}

.footer__top-link {
  justify-self: end;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s ease;
}

.footer__top-link:hover {
  color: var(--gold-ink);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.footer__blessing {
  font-style: italic;
}

.footer__domain {
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Dialogs ----------------------------------------------------------------- */

.viewer,
.reader {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: none;
  max-height: none;
  color: var(--ink);
}

.viewer::backdrop,
.reader::backdrop {
  background: rgba(20, 17, 13, 0.72);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.viewer__panel {
  position: relative;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  width: min(1000px, 92vw);
  max-height: 88vh;
  margin: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.viewer__media {
  position: relative;
  min-height: 100%;
  background: var(--night-2);
}

.viewer__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 88vh;
  object-fit: cover;
}

.viewer__copy {
  padding: clamp(2rem, 4vw, 3.4rem);
  align-self: center;
}

.viewer__role {
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.viewer__name {
  margin-top: 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--ink);
}

.viewer__body {
  margin-top: 1.3rem;
  font-size: 0.98rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.viewer__meta {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.viewer__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  cursor: pointer;
  transition: border-color 0.3s ease, transform 0.3s var(--ease);
}

.viewer__close:hover {
  border-color: var(--gold);
  transform: rotate(90deg);
}

.viewer__close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 1px;
  background: var(--ink);
}

.viewer__close span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.viewer__close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.reader__panel {
  position: relative;
  width: min(760px, 92vw);
  max-height: 88vh;
  margin: auto;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.reader__scroll {
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(2rem, 5vw, 3.8rem);
  padding-top: clamp(3.4rem, 6vw, 4.4rem);
}

.reader__close {
  position: absolute;
  z-index: 3;
}

.reader__category {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.reader__title {
  margin-top: 0.8rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 300;
  line-height: 1.14;
  color: var(--ink);
}

.reader__meta {
  margin-top: 0.9rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.reader__body {
  margin-top: 1.6rem;
}

.reader__body p {
  margin-bottom: 1.1rem;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--ink-soft);
}

.reader__body em {
  font-style: italic;
  color: var(--ink);
}

.reader__signature {
  margin-top: 1.8rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--gold-ink);
}

/* Reveal ------------------------------------------------------------------ */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.js [data-reveal-delay="1"] {
  transition-delay: 0.1s;
}

.js [data-reveal-delay="2"] {
  transition-delay: 0.2s;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1080px) {
  .nav {
    gap: 1.2rem;
  }

  .nav a {
    font-size: 0.74rem;
  }

  .threshold__rings {
    right: -18vw;
  }

  .book__grid {
    grid-template-columns: 1fr;
  }

  .colophon {
    max-width: 30rem;
  }

  .author__grid {
    grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr);
  }

  .seal {
    width: min(230px, 80%);
  }
}

@media (max-width: 900px) {
  .header__inner {
    position: relative;
    z-index: 2;
    height: 4.4rem;
  }

  .brand,
  .header__tools {
    position: relative;
    z-index: 3;
  }

  .nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100svh;
    z-index: 1;
    flex-direction: column;
    justify-content: center;
    gap: 1.6rem;
    padding: 6rem 2rem;
    background: var(--paper);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-3%);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease),
      visibility 0.5s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav a {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 0;
    color: var(--ink);
  }

  .nav a::after {
    display: none;
  }

  .menu {
    display: block;
  }

  .header__read {
    display: none;
  }

  .threshold {
    padding-top: 6.5rem;
  }

  .threshold__inner {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  .threshold__visual {
    order: -1;
  }

  .niche {
    width: min(340px, 76%);
  }

  .hero-title__line {
    font-size: clamp(3.6rem, 11vw, 5.6rem);
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .section-head__aside {
    max-width: 34rem;
  }

  .excerpt {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .excerpt__head {
    position: static;
  }

  .excerpt__note {
    max-width: 30rem;
  }

  .portraits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .themes {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .places {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .theme {
    display: grid;
    grid-template-columns: 3rem 1fr;
    column-gap: 1.4rem;
  }

  .theme__num {
    grid-row: 1;
  }

  .theme__mark {
    grid-column: 1;
    margin: 0.6rem 0 0;
  }

  .theme h3,
  .theme p,
  .theme__tag {
    grid-column: 2;
  }

  .theme h3 {
    margin-top: 0.6rem;
  }

  .author__grid {
    grid-template-columns: 1fr;
  }

  .author__visual {
    align-items: flex-start;
  }

  .seal {
    width: min(210px, 40vw);
  }

  .author__place {
    align-items: flex-start;
  }

  .glossary__grid {
    grid-template-columns: 1fr;
  }

  .connect__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer__top {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .footer__top-link {
    justify-self: start;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 1rem;
  }

  .display {
    font-size: clamp(2.2rem, 8vw, 3rem);
  }

  .hero-title__line {
    font-size: clamp(3.2rem, 14vw, 4.6rem);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    justify-content: center;
  }

  .hero-meta {
    gap: 0.55rem;
  }

  .niche {
    width: min(300px, 82%);
  }

  .niche__arch {
    inset: -1.6rem -2.2rem -2.4rem;
    width: calc(100% + 4.4rem);
    height: calc(100% + 4rem);
  }

  .notes {
    grid-template-columns: 1fr;
  }

  .note {
    min-height: 0;
  }

  .portraits {
    gap: 1rem 0.9rem;
  }

  .portrait__frame {
    border-radius: 4px;
  }

  .portrait__role {
    margin-top: 0.8rem;
    font-size: 0.5rem;
    letter-spacing: 0.16em;
  }

  .portrait__name {
    font-size: 1.12rem;
  }

  .portrait__num {
    top: 0.7rem;
    left: 0.7rem;
    font-size: 0.48rem;
  }

  .viewer__panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: 90vh;
  }

  .viewer__media img {
    max-height: 42vh;
    aspect-ratio: 1 / 1;
    object-position: center 28%;
  }

  .viewer__copy {
    padding: 1.6rem 1.5rem 2rem;
    overflow-y: auto;
    align-self: stretch;
  }

  .passage__mark {
    left: -0.3rem;
    font-size: 5rem;
  }

  .passage__controls {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .passages__head {
    flex-direction: column;
    gap: 0.6rem;
  }

  .footer__line {
    font-size: 0.9rem;
  }
}

@media (max-width: 430px) {
  .brand__name {
    font-size: 1.02rem;
    letter-spacing: 0.15em;
  }

  .hero-title__line {
    font-size: clamp(2.9rem, 15vw, 3.9rem);
  }

  .eyebrow {
    font-size: 0.58rem;
    letter-spacing: 0.18em;
  }

  .hero-meta {
    font-size: 0.55rem;
    letter-spacing: 0.14em;
  }

  .cover__caption {
    flex-direction: column;
    gap: 0.4rem;
  }

  .cover__caption-rule {
    display: none;
  }

  .portrait__frame img {
    aspect-ratio: 4 / 5;
  }

  .theme {
    grid-template-columns: 1fr;
  }

  .theme__mark {
    margin-top: 1rem;
  }

  .theme h3,
  .theme p,
  .theme__tag {
    grid-column: 1;
  }
}

@media (max-width: 360px) {
  .portraits {
    grid-template-columns: 1fr;
  }

  .portrait__frame img {
    aspect-ratio: 1 / 1;
  }
}

/* Print grain ------------------------------------------------------------- */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* Reduced motion ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
