:root {
  color-scheme: light;
  --ink: #27231c;
  --muted: #615447;
  --paper: #f5ecda;
  --wine: #672e3b;
  --gold: #c3a66c;
  --line: #cdbb97;
  --serif: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  scroll-behavior: smooth;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .72; }
:focus-visible { outline: 3px solid #a47537; outline-offset: 4px; }
.masthead {
  min-height: 74px; padding: 0 max(5vw, 24px); display: flex;
  justify-content: space-between; align-items: center; gap: 18px;
  background: #242119; color: #f7ead2; border-bottom: 1px solid #66573c;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: bold 23px var(--serif); letter-spacing: .08em; }
.seal { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid var(--gold); border-radius: 50% 50% 44% 44%; color: var(--gold); font-size: 21px; }
.nav-link { text-decoration: none; font-size: 14px; letter-spacing: .08em; }
.nav-link span { color: var(--gold); padding-left: 5px; }
.hero {
  position: relative; display: grid; grid-template-columns: .9fr 1.1fr;
  align-items: center; gap: clamp(28px, 6vw, 100px);
  padding: clamp(44px, 6vw, 100px) max(8vw, 24px);
  color: #fff3dc; background: radial-gradient(ellipse at 64% 30%, #4e3b2c, #242119 67%);
  border-bottom: 4px double var(--gold);
}
.hero-copy { max-width: 500px; }
.eyebrow { color: #e0c795; letter-spacing: .18em; font-size: 13px; }
.eyebrow span { margin-right: 9px; }
.hero h1 { font: 700 clamp(36px, 5.6vw, 78px)/1.13 var(--serif); margin: .23em 0; letter-spacing: .04em; }
.hero h1 b { color: #cda06a; font-weight: inherit; }
.hero p { max-width: 29em; color: #e9d8bc; line-height: 1.95; margin: 0 0 27px; font-size: 16px; }
.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 16px;
  padding: 12px 20px; min-height: 46px; border: 1px solid var(--gold);
  text-decoration: none; color: #fff5e5; background: var(--wine);
  box-shadow: inset 0 0 0 3px var(--wine), inset 0 0 0 4px #a47071;
  font-weight: 600;
}
.primary:hover { background: #793b49; }
.painting {
  position: relative; aspect-ratio: 1.2; margin: 0; border-radius: 48% 48% 0 0 / 34% 34% 0 0;
  padding: 10px; border: 4px ridge #aa8a52; background: #6e532d; box-shadow: 0 18px 46px #110e09a8;
}
.painting-image {
  width: 100%; height: 100%; border-radius: inherit; border: 1px solid #e7c98a;
  background: #352b23 url('/hero.jpg') center 46% / cover no-repeat;
}
.painting span { position: absolute; bottom: -9px; color: #dec28b; font: 39px/1 serif; text-shadow: 0 3px 3px #281c10; }
.painting span:first-child { left: -9px; }
.painting span:last-child { right: -9px; transform: scaleX(-1); }
.entrances { margin: auto; max-width: 1300px; padding: 40px max(5vw, 24px) 58px; text-align: center; }
.ornament { color: #866334; font: 28px/1 serif; }
.entrances h2, .scene h1 { font: 700 clamp(34px, 4vw, 52px)/1.2 var(--serif); margin: 8px 0 26px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.portal {
  position: relative; text-align: left; display: grid; gap: 8px; min-height: 153px;
  padding: 18px 22px; background: #fbf4e6; color: var(--ink);
  border: 1px solid var(--line); box-shadow: inset 0 0 0 4px #fbf4e6, inset 0 0 0 5px #e7dac0;
  transition: background .16s, transform .16s;
}
.portal:hover { background: #efe0c2; transform: translateY(-3px); }
.portal strong { font: 700 25px var(--serif); }
.portal span:not(.emblem,.arrow) { font-size: 14px; color: var(--muted); }
.emblem { color: var(--wine); font-size: 24px; line-height: 1; }
.arrow { position: absolute; top: 17px; right: 20px; color: var(--wine); }
.scene-wrap { max-width: 810px; padding: 24px max(4vw, 18px) 52px; margin: auto; }
.back { color: var(--wine); background: transparent; border: 0; padding: 12px 0; margin-bottom: 10px; font-weight: 650; }
.scene { border: 4px double #aa8d55; background: #fbf4e6; padding: clamp(22px, 6vw, 52px); box-shadow: 0 12px 36px #654e2620; }
.scene h1 { margin-bottom: 14px; }
#scene-intro, #response-copy, #ai-status { line-height: 1.85; overflow-wrap: anywhere; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.choices button { color: #542532; padding: 10px 14px; min-height: 46px; border: 1px solid #aa8d77; background: #fff9ed; }
.choices button:hover, .choices button[aria-pressed=true] { background: var(--wine); color: #fff4e4; }
.response { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 14px; }
.response-label { color: var(--wine); font-weight: 700; }
#ai-status:empty { display: none; }
.large-type .scene { font-size: clamp(19px, 3vw, 23px); }
footer { display: flex; flex-wrap: wrap; gap: 9px 24px; justify-content: space-between; align-items: center; background: #27231c; color: #e9d8bc; padding: 20px max(5vw, 24px); font-size: 13px; }
footer span { font: 700 18px var(--serif); }
footer p { margin: 0; }
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr 1fr; padding-inline: 5vw; gap: 24px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .masthead { min-height: 60px; }
  .hero { grid-template-columns: 1fr; padding: 33px 24px 34px; gap: 28px; }
  .painting { width: 100%; max-width: 400px; justify-self: center; aspect-ratio: 1.55; }
  .hero h1 { font-size: clamp(36px, 11vw, 62px); }
  .entrances { padding: 32px 16px 38px; }
  .grid { gap: 10px; }
  .portal { padding: 16px; min-height: 137px; }
  .choices { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  * { transition: none !important; }
}

.site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 20px; }
.chat-notice { font-size: .92rem; color: var(--muted); line-height: 1.8; }
.chat-log { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; max-height: 52vh; overflow: auto; padding: 12px 6px; }
.bubble { margin: 0; align-self: flex-start; padding: 10px 14px; border: 1px solid var(--line); max-width: 88%; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; background: #fff9ed; }
.bubble.user { align-self: flex-end; background: var(--wine); color: #fff5e5; border-color: var(--wine); }
.chat-form { display: grid; gap: 8px; }
.chat-form label { font-weight: 650; }
.chat-form textarea { font: inherit; padding: 10px; border: 1px solid #aa8d77; background: #fff9ed; color: var(--ink); resize: vertical; }
.chat-actions { display: flex; gap: 20px; align-items: center; }
.chat-actions .back { margin: 0; }
#chat-status:empty { display: none; }
@media (max-width: 380px) { .site-nav { gap: 8px; } .masthead .brand { font-size: 19px; } }

.topic-chat { margin-top: 8px; }

.chat-actions { flex-wrap: wrap; column-gap: 14px; row-gap: 4px; }
.copy-reply { align-self: flex-start; margin-top: -8px; border: 0; padding: 5px 4px; background: transparent; color: var(--wine); text-decoration: underline; font-size: .84rem; }

.chat-form > input, #review-filter { font: inherit; padding: 10px; border: 1px solid #aa8d77; background: #fff9ed; }
.chat-form .chat-consent { font-size: .9rem; font-weight: 500; line-height: 1.6; }
.review-card { border-block-start: 1px solid var(--line); margin-top: 16px; padding-top: 10px; }
.review-card p { white-space: pre-wrap; overflow-wrap: anywhere; }
