/* Xiao Yao San — a printed-monograph design.
   Palette: porcelain ground, ink text, jade accent, cinnabar micro-marks only. */

:root {
  --porcelain: #faf9f6;
  --ink: #1c1e21;
  --jade: #34675c;
  --jade-deep: #27524a;
  --cinnabar: #bf3f2c;
  --stone: #6b7069;
  --mist: #e8ede9;
  --wash: #f1f0ea;
  --serif: 'Spectral', Georgia, serif;
  --hanzi: 'Noto Serif SC', 'Spectral', serif;
  --measure: 40rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--porcelain);
  color: var(--ink);
  font: 400 1.0625rem/1.75 var(--serif);
  -webkit-font-smoothing: antialiased;
}

[lang="zh"] { font-family: var(--hanzi); }

a { color: var(--jade); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--jade-deep); }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 3px; border-radius: 1px; }

h1, h2, h3 { font-weight: 300; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); margin: 0.4rem 0; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin: 3rem 0 0.75rem; }
h3 { font-size: 1.2rem; font-weight: 500; margin: 2rem 0 0.5rem; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0;
}

/* ---------- masthead ---------- */

.masthead {
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.4rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--mist);
}
.wordmark { font-weight: 500; font-size: 1.05rem; color: var(--ink); text-decoration: none; }
.wordmark-hanzi { color: var(--jade); margin-right: 0.35rem; }
.masthead nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.masthead nav a { font-size: 0.9rem; color: var(--stone); text-decoration: none; }
.masthead nav a:hover, .masthead nav a[aria-current] { color: var(--jade-deep); }
.masthead nav a[aria-current] { border-bottom: 2px solid var(--jade); }

main { padding: 0 1.25rem 4rem; }

/* ---------- hero plate ---------- */

.hero { max-width: 52rem; margin: 3rem auto 0; text-align: center; }
.hero-tagline { color: var(--stone); font-style: italic; margin: 0 0 2rem; }

.hero-plate {
  position: relative;
  margin: 0 auto;
  max-width: 46rem;
  background: #fff;
  border: 1px solid var(--mist);
  padding: 1rem 3.4rem 1rem 1rem;
}
.hero-plate img { display: block; width: 100%; height: auto; }
.hero-hanzi {
  position: absolute;
  top: 1.4rem;
  right: 0.55rem;
  writing-mode: vertical-rl;
  font-size: 1.9rem;
  letter-spacing: 0.55em;
  color: var(--stone);
  opacity: 0.65;
}

.hero-lede {
  max-width: var(--measure);
  margin: 2rem auto 0;
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.65;
  text-align: left;
}

.fact-row {
  list-style: none;
  padding: 0;
  margin: 2rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 2.4rem;
  font-size: 0.92rem;
  color: var(--stone);
}
.fact-row strong { color: var(--ink); font-weight: 600; }

/* ---------- ingredient cabinet ---------- */

.cabinet { max-width: 62rem; margin: 4.5rem auto 0; text-align: center; }
.cabinet > p { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.cabinet .ing-grid { text-align: left; }

.ing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--mist);
  border: 1px solid var(--mist);
  margin-top: 1.5rem;
}
@media (max-width: 720px) {
  .ing-grid { grid-template-columns: repeat(2, 1fr); }
}
.ing-card {
  background: #fff;
  padding: 1.1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease;
}
.ing-card:hover { background: var(--wash); }
.card-art { display: grid; place-items: center; aspect-ratio: 1; margin-bottom: 0.4rem; }
.card-art img { max-width: 100%; height: auto; }
.card-glyph { font-size: 3.2rem; line-height: 1; color: var(--jade); opacity: 0.8; }
.card-role {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
}
.card-role-chief { color: var(--cinnabar); }
.card-pinyin { font-weight: 500; }
.card-pinyin [lang="zh"] { color: var(--stone); font-weight: 400; margin-left: 0.2rem; }
.card-name { font-size: 0.88rem; color: var(--stone); }
.cabinet-note { font-size: 0.95rem; color: var(--stone); margin-top: 1.25rem; }

/* ---------- prose / monograph ---------- */

.prose { max-width: var(--measure); margin: 2.5rem auto 0; }
.prose img { max-width: 100%; height: auto; }
.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--jade);
  font-style: italic;
  color: var(--stone);
}

sup.cite a {
  color: var(--cinnabar);
  text-decoration: none;
  font-size: 0.72em;
  font-weight: 600;
}

.references {
  margin-top: 3.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--mist);
  font-size: 0.9rem;
  color: var(--stone);
}
.references h2 { font-size: 1.1rem; font-weight: 500; margin-top: 0.5rem; }
.references ol { padding-left: 1.25rem; }
.references li { margin-bottom: 0.5rem; }
.references a.backref { text-decoration: none; color: var(--cinnabar); }

.monograph { max-width: 46rem; }
.monograph-head {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  margin: 3rem 0 1rem;
}
.monograph-art {
  flex: 0 0 8.5rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--mist);
}
.monograph-art img { max-width: 100%; height: auto; }
.plate-glyph { font-size: 4rem; color: var(--jade); opacity: 0.8; }
.head-hanzi { font-weight: 400; color: var(--stone); font-size: 0.7em; margin-left: 0.3rem; }
.monograph-names { color: var(--stone); font-size: 0.95rem; margin-top: 0.25rem; }

.siblings { margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--mist); }
.siblings h2 { font-size: 1.1rem; font-weight: 500; }
.siblings p { font-size: 0.95rem; line-height: 2; }

/* ---------- colophon ---------- */

.colophon {
  border-top: 1px solid var(--mist);
  margin-top: 2rem;
  padding: 2.5rem 1.25rem 3rem;
}
.disclaimer, .colophon-meta {
  max-width: var(--measure);
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--stone);
}
.colophon-meta { margin-top: 1rem; }
.colophon-nav {
  max-width: var(--measure);
  margin: 1rem auto 0;
  font-size: 0.85rem;
}
.colophon-nav a { color: var(--stone); }

@media (max-width: 600px) {
  .monograph-head { flex-direction: column; align-items: flex-start; }
  .hero-plate { padding-right: 2.6rem; }
}

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