:root {
  color-scheme: light;
  --paper: #f4efe6;
  --ink: #1e1a16;
  --muted: #5c5348;
  --seal: #8f2d2d;
  --line: #ddd4c4;
  --card: #fffaf3;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

a { color: var(--seal); }

a:hover { text-decoration: none; }

.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
}

.skip:focus { top: 0.5rem; }

.site-header,
main,
.scope,
.site-footer {
  width: min(40rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.25rem 0;
}

.wordmark {
  color: var(--ink);
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", serif;
  font-size: 1.15rem;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

main { padding-bottom: 1rem; }

h1, h2 {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", serif;
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 6vw, 2.75rem); margin: 0 0 0.75rem; }

h2 { font-size: 1.35rem; }

.lead { font-size: 1.2rem; }

.banner {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  background: var(--seal);
  color: #fffaf3;
  font-weight: 700;
}

.request, .reading, .bio, .drafts {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem 1.2rem;
  margin: 1.5rem 0;
}

.request label, .request input, .request textarea, .request button {
  display: block;
  width: 100%;
}

.request label { margin: 0.85rem 0 0.3rem; }

.request input, .request textarea {
  font: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.request button {
  margin-top: 1rem;
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 1rem;
  background: var(--seal);
  color: #fffaf3;
  border: 0;
  cursor: pointer;
}

.request button:hover { background: #742424; }

.optional, .form-note, .placeholder, .pinyin, .tag { color: var(--muted); }

.form-status { margin-top: 0.85rem; font-weight: 600; }

.form-status.is-error { color: var(--seal); }

.form-status { margin-top: 0.85rem; font-weight: 600; }

.form-status.is-error { color: var(--seal); font-weight: 600; }

.request fieldset {
  border: 0;
  margin: 0.85rem 0 0;
  padding: 0;
}

.request fieldset legend { font-weight: 600; }

.request fieldset label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: auto;
  margin: 0.4rem 0;
}

.request fieldset input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}

.request label.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: auto;
  margin-top: 1rem;
}

.request label.check input {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex: 0 0 auto;
}

.hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.scripts {
  display: grid;
  gap: 1rem;
}

@media (min-width: 40rem) {
  .scripts { grid-template-columns: 1fr 1fr; }
}

.scripts h3 {
  margin: 0;
  font-size: 1rem;
}

.stencil { margin: 0.5rem 0 1rem; }

.stencil img {
  width: min(100%, 18rem);
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
}

.scripts .stencil img { width: min(100%, 16rem); }

.stencil figcaption, .stencil a { display: block; margin-top: 0.35rem; }

.credits { color: var(--muted); font-size: 0.95rem; }

.characters {
  font-family: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", PMingLiU, serif;
  font-size: 3rem;
  line-height: 1.2;
  margin: 0.2rem 0;
}

.pinyin { font-size: 1.1rem; margin-top: 0; }

.bio {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.portrait {
  width: 15rem;
  max-width: 42%;
  height: auto;
  border: 1px solid var(--line);
}

.portrait-small {
  width: 6.5rem;
  max-width: 34%;
}

.brush figure { margin: 1.25rem 0; }

.brush img {
  width: min(100%, 640px);
  height: auto;
  background: #fff;
}

.brush figcaption {
  margin-top: 0.4rem;
  color: var(--muted);
}

.bio-short { align-items: center; }

.bio-short p { margin: 0; }

.tag {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.scope {
  display: grid;
  gap: 1rem;
  padding: 0.5rem 0 1rem;
}

@media (min-width: 40rem) {
  .scope { grid-template-columns: 1fr 1fr; }
}

.site-footer {
  padding: 0 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.result {
  width: min(40rem, calc(100% - 2rem));
  margin: 2rem auto;
}
