/* ————————————————————————————————————————————
   Gui Ruiyan — personal site
   A letterpress diptych: ivory paper, ink, cinnabar.
   No external resources. System serif stacks only —
   the poems themselves are exact vector facsimiles.
   ———————————————————————————————————————————— */

:root {
  --paper: #f5f0e6;
  --paper-deep: #ece5d6;
  --ink: #211d18;
  --ink-soft: #4a443b;
  --faint: #8d8574;
  --hairline: #d8cfbc;
  --vermillion: #c3272b;
  --vermillion-deep: #9e1f23;
  --serif-en: "Baskerville", "Palatino", "Times New Roman", Georgia, serif;
  --serif-zh: "Songti SC", "STSong", "Muyu Serif", "Noto Serif CJK SC", "SimSun", serif;
  --serif: var(--serif-en), var(--serif-zh);
}

/* Self-hosted Chinese serif subset (Noto Serif SC) — iOS Safari and Android
   ship no usable CJK serif, and would otherwise set the poems in sans.
   Desktop macOS hits native Songti SC first and never downloads this. */
@font-face {
  font-family: "Muyu Serif";
  src: url("../fonts/muyu-serif.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

/* night mode: lamplit ink-room */
:root[data-theme="dark"] {
  --paper: #1a1712;
  --paper-deep: #13110d;
  --ink: #e7dfcc;
  --ink-soft: #c2b89f;
  --faint: #857c66;
  --hairline: #383226;
  --vermillion: #cf4a41;
  --vermillion-deep: #e2685c;
}

:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

body, .drawer, .bar {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Baskerville", "Palatino", "Songti SC", "STSong", "Muyu Serif", "Times New Roman", Georgia, serif;
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
}

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

::selection { background: var(--vermillion); color: var(--paper); }

/* ————— seal ————— */
.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1em;
  height: 2.1em;
  background: var(--vermillion);
  color: var(--paper);
  font-family: var(--serif-zh);
  font-size: 0.95em;
  line-height: 1;
  transform: rotate(-2.5deg);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.12);
  letter-spacing: 0;
  user-select: none;
}

/* ————— shared chrome ————— */
.wordmark {
  font-variant: small-caps;
  letter-spacing: 0.22em;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.rule {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 0;
}

.small {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.iconbtn {
  font-size: 0.95rem;
  color: var(--faint);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  width: 2rem; height: 2rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.25s ease;
}
.iconbtn:hover { color: var(--vermillion-deep); border-color: var(--vermillion); }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
