:root {
  color-scheme: light;
  --paper: #f7f1e6;
  --white: #fffaf2;
  --ink: #2c2823;
  --quiet: #65594d;
  --line: #cbbdad;
  --accent: #873c31;
  --serif: "Noto Serif SC", "Songti SC", STSong, SimSun, serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --latin: "Cormorant Garamond", Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.7 var(--sans); }
[hidden] { display: none !important; }
button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
h1, h2, h3, p, figure, ul, blockquote { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1:focus { outline: none; }
.mast { max-width: 1152px; margin: auto; min-height: 74px; padding: 0 24px; display: flex;
  justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.brand { background: none; border: 0; padding: 5px 8px 5px 0; font: 750 16px/1.4 var(--serif); }
.home-intro h1 span { color: var(--accent); }
main { max-width: 1152px; margin: auto; min-height: min(70vh, 580px); }
.screen { padding: 36px 24px 55px; }
.reading { width: min(100%, 692px); margin: auto; }
.home-intro { display: grid; gap: 16px; grid-template-columns: .9fr 1.1fr; grid-template-rows: auto auto 1fr;
  align-items: start; padding: 68px 28px 48px; }
.home-intro h1 { font: 900 clamp(40px, 5.9vw, 68px)/1.18 var(--serif); letter-spacing: -.07em; }
.intro { max-width: 24em; color: var(--quiet); line-height: 1.9; }
.cover-cards { grid-column: 2; grid-row: 1/4; display: flex; align-items: center; align-self: center; min-width: 0;
  justify-content: center; padding: 20px 6px 20px 18px; }
.cover-cards figure { min-width: 0; width: 34%; background: var(--white); padding: 7px 7px 10px; border: 1px solid #daccb9;
  transform: rotate(-8deg); flex-shrink: 0; box-shadow: 0 9px 22px #34221d17; }
.cover-cards figure + figure { margin-left: -3%; }
.cover-cards figure:nth-child(2) { z-index: 1; transform: translateY(-12px) rotate(2deg); }
.cover-cards figure:nth-child(3) { transform: rotate(9deg); }
.cover-cards img { aspect-ratio: 4/5; width: 100%; display: block; object-fit: cover; }
.cover-cards figcaption { font: 750 clamp(11px, 1.5vw, 18px)/1.6 var(--serif); padding: 5px 3px 0; }
.cover-cards figure:last-child figcaption { text-align: right; }
.home-actions { display: grid; justify-items: start; gap: 4px; margin-top: 14px; }
button.link { border: 0; padding: 5px 0; min-height: 44px; background: none; text-decoration: underline;
  text-underline-offset: .3em; text-decoration-color: #a7917f; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; border: 1px solid var(--accent);
  padding: 11px 17px; min-height: 46px; text-decoration: none; font-weight: 600; }
.primary { color: #fffaf2; background: var(--accent); }
.primary:hover { filter: brightness(1.14); }
.action-meta { color: var(--quiet); font-size: 12px; }
.progress-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
progress { width: 100%; height: 5px; appearance: none; color: var(--accent); }
progress::-webkit-progress-bar { background: #e2d7c6; }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
#counter { font: 600 17px/1 var(--latin); color: var(--quiet); }
.question-label { margin-top: 34px; color: var(--accent); font-size: 14px; }
.question { margin: 12px 0 25px; font: 750 clamp(25px, 4.5vw, 38px)/1.55 var(--serif); }
.option { display: flex; width: 100%; text-align: left; min-height: 60px; align-items: center; padding: 11px 14px;
  gap: 15px; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.option:first-child { border-top: 1px solid var(--line); }
.option span:first-child { font: 600 21px/1 var(--latin); color: var(--accent); flex: 0 0 18px; }
.option:hover, .option[aria-pressed=true] { background: #eaded0; }
details { border-left: 2px solid var(--line); padding: 0 13px; color: var(--quiet); }
summary { cursor: pointer; padding: 7px 0; }
details p { padding-bottom: 9px; }
textarea { width: 100%; padding: 12px; margin-top: 14px; resize: vertical; line-height: 1.8;
  background: var(--white); border: 1px solid var(--line); }
.next-row { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#count { color: var(--quiet); font-size: 13px; }
#error, .share-error { margin-top: 13px; color: #873c31; }
#loading-screen { padding-top: 90px; padding-bottom: 120px; }
#loading-screen h1 { font: 750 34px/1.5 var(--serif); margin: 12px 0; }
.loading-rule { border-top: 2px solid var(--accent); width: 38px; }
.result-cover { display: grid; grid-template-columns: 1fr 1fr; min-height: 390px; background: var(--accent); color: #fffaf2; }
.result-copy { padding: clamp(24px, 5vw, 65px); align-self: center; }
.result-cover h1 { font: 900 clamp(40px, 6.8vw, 74px)/1.25 var(--serif); margin: 8px 0 10px; }
.result-label { font-size: 13px; letter-spacing: .06em; }
#result-headline { font: 650 clamp(17px, 2.7vw, 25px)/1.55 var(--serif); }
#result-tags { gap: 7px 11px; display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 18px 0; }
#result-tags li { padding: 2px 8px; border: 1px solid #fffaf27f; font-size: 12px; }
.result-cover .button { background: #fffaf2; color: var(--ink); border-color: #fffaf2; }
.result-cover img { display: block; width: 100%; height: 100%; max-height: 515px; min-height: 0; object-fit: cover; }
.report { padding: 22px 0 0; }
.chapters { display: flex; flex-wrap: wrap; gap: 7px 16px; padding: 10px 0 16px; border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--quiet); }
.chapters a { text-underline-offset: .24em; }
.report section { padding: 27px 0 24px; border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.report h2 { font: 750 clamp(21px, 3.4vw, 29px)/1.5 var(--serif); margin-bottom: 12px; }
.report section p { font-size: 16px; line-height: 1.95; letter-spacing: .015em; overflow-wrap: anywhere; }
.report section p + p { margin-top: 12px; }
.report details { margin-top: 16px; }
.report blockquote { padding: 6px 0 9px; overflow-wrap: anywhere; }
.report blockquote small { display: block; }
.report-end { margin-top: 24px; display: flex; align-items: flex-start; flex-wrap: wrap; gap: 7px 16px; }
#copy-status { color: var(--quiet); width: 100%; }
footer { max-width: 1152px; margin: auto; border-top: 1px solid var(--line); padding: 16px 24px 28px; color: var(--quiet); font-size: 12px; }
footer { text-align: right; }
dialog { color: var(--ink); background: var(--paper); border: 1px solid var(--line); width: min(100% - 20px, 475px);
  max-height: calc(100dvh - 22px); padding: 16px; overflow: auto; }
dialog::backdrop { background: #211a17aa; }
.dialog-top, .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dialog-top h2 { font: 750 22px/1.5 var(--serif); }
.share-options { display: flex; gap: 8px; margin: 7px 0 12px; }
.share-options button { background: transparent; border: 1px solid var(--line); min-height: 41px; padding: 4px 10px; }
.share-options [aria-pressed=true] { background: #e9ddcd; border-color: var(--accent); }
#quote-select { display: grid; gap: 4px; font-size: 13px; margin-bottom: 10px; }
select { width: 100%; background: var(--white); border: 1px solid var(--line); padding: 6px; }
#poster { object-fit: contain; display: block; width: 100%; height: min(54dvh, 520px); margin: 0 auto 12px; }
.dialog-actions span { color: var(--quiet); font-size: 12px; }
#download:not([href]) { opacity: .55; pointer-events: none; }
@media(max-width: 660px) {
  .mast { min-height: 59px; padding: 0 18px; }
  .screen { padding: 24px 18px 35px; }
  .home-intro { grid-template-columns: 1fr; grid-template-rows: auto; gap: 12px; padding: 12px 0 7px; }
  .home-intro h1 { font-size: clamp(40px, 11.2vw, 62px); }
  .cover-cards { grid-column: 1; grid-row: auto; padding: 20px 11px 9px; }
  .cover-cards img { aspect-ratio: 4/4.1; }
  .home-actions { margin-top: 9px; }
  .home-actions .primary { width: 100%; }
  .result-cover { grid-template-columns: 1fr; min-height: 0; }
  .result-copy { padding: 23px 20px 20px; }
  .result-cover img { height: clamp(195px, 55vw, 350px); }
  .report section { padding: 23px 0 20px; }
  .report section p { font-size: 15px; }
  footer { padding-inline: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
