:root {
  color-scheme: light;
  --ink: #202b29;
  --paper: #f4efe6;
  --accent: #a14b2f;
  --muted: #535f56;
  --rule: #c8c9be;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Yu Gothic", Meiryo, sans-serif; }
button { font: inherit; cursor: pointer; }
a { color: #2f584b; text-underline-offset: .22em; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid #2f584b; outline-offset: 3px; }
h1:focus, h2:focus { outline: none; }
.shell { max-width: 1100px; margin: auto; padding: 0 32px; }
header { height: 82px; display: flex; align-items: center; border-bottom: 1px solid var(--rule); }
.brand { font-size: 13px; letter-spacing: .1em; font-weight: 800; color: inherit; text-decoration: none; }

.hero {
  min-height: 580px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 45px;
}
h1, h2 { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-weight: 600; line-height: 1.45; }
.hero h1 { font-size: clamp(39px, 5.2vw, 65px); margin: 0 0 20px; }
.lead { font-size: 15px; line-height: 2; color: var(--muted); margin: 0 0 25px; }
.hero-art {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #c8c3b5;
  background:
    radial-gradient(circle at 50% 50%, #e6bc8c 0 20%, transparent 20.3%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 44px, #cfc7b8 45px 46px, transparent 47px 72px),
    #e9e3d7;
}
.hero-art::before { content: '✳'; font-size: clamp(64px, 10vw, 110px); color: #536e62; }
.primary, .secondary, .option { padding: 14px 22px; min-height: 46px; }
.primary { border: 1px solid transparent; background: #263f38; color: white; font-weight: 700; }
.primary:hover { background: #3a5d51; }
.secondary { background: transparent; border: 1px solid #909d92; color: var(--ink); }
.secondary:hover { background: #e7e8df; }

.quiz, .result { max-width: 790px; margin: 65px auto 90px; }
.progress { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
progress { display: block; width: 100%; height: 4px; border: 0; margin: 12px 0 38px; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #dedbd0; }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
h2 { font-size: clamp(25px, 4vw, 38px); }
.options { display: grid; gap: 11px; margin: 29px 0 23px; }
.option { text-align: left; background: #faf8f3; border: 1px solid #c8c8bd; color: var(--ink); line-height: 1.6; }
.option:hover, .option:focus-visible { border-color: #446a5a; background: white; }
.back { border: 0; background: none; color: var(--muted); min-height: 44px; padding: 8px 0; text-decoration: underline; text-underline-offset: .25em; }

.result-top { border-top: 2px solid var(--ink); padding-top: 26px; }
.eyebrow { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .09em; }
.result h2 { font-size: clamp(31px, 5vw, 56px); margin: 14px 0 4px; }
.subtitle { color: var(--muted); line-height: 1.7; margin: 0; }
.result-line {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(19px, 3.2vw, 28px);
  line-height: 1.65;
  margin: 8px 0 0;
}
.result-scene { margin-top: 27px; padding: 20px 24px; background: #f9f5eb; border-inline-start: 3px solid var(--accent); }
.result-scene h3, .result-feedback h3 { margin: 0 0 8px; font-size: 15px; }
.result-scene p { margin: 0; font-size: 15px; line-height: 1.95; }
.result-scene p + p { margin-top: 10px; }
.result-feedback { margin-top: 24px; }
.result-feedback .actions { margin-top: 10px; }
.result-feedback [role="status"]:empty { display: none; }
.measurement {
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.measurement label { display: inline-flex; align-items: center; min-height: 32px; gap: 6px; }
.measurement details { display: inline-block; margin-inline-start: 10px; }
.measurement summary { cursor: pointer; }
.measurement p { margin: 4px 0; }
#era-export { min-height: 36px; padding: 5px 10px; }
.identity {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  margin: 26px 0 0;
  border: 1px solid var(--rule);
  background: #faf8f2;
}
.identity div { padding: 15px 17px; }
.identity div + div { border-inline-start: 1px solid var(--rule); }
.identity dt { color: var(--accent); font-weight: 700; font-size: 12px; }
.identity dd { font-size: 14px; line-height: 1.65; margin: 7px 0 0; overflow-wrap: anywhere; }
.story { border-top: 1px solid var(--rule); margin-top: 35px; }
.chapter {
  display: grid;
  grid-template-columns: 9.2rem 1fr;
  gap: 18px;
  border-bottom: 1px solid var(--rule);
  padding: 21px 0;
}
.chapter h3 { font-size: 14px; line-height: 2; color: var(--accent); margin: 0; }
.chapter p, .backdrop p { margin: 0; font-size: 15px; line-height: 2; }
.backdrop { margin-top: 28px; padding: 21px 24px; background: #e9e9df; }
.backdrop h3 { font-size: 15px; margin: 0 0 8px; }
.sources { padding-left: 1.2em; margin: 12px 0 0; font-size: 13px; line-height: 1.9; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.note { font-size: 12px; color: var(--muted); line-height: 1.8; }
.sharetext { width: 100%; min-height: 115px; padding: 12px; border: 1px solid #909d92; background: white; font: inherit; }
#share-area .secondary { margin-top: 6px; }
footer { padding: 24px 0 30px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 12px; line-height: 1.8; }

@media (max-width: 650px) {
  .shell { padding: 0 18px; }
  header { height: 60px; }
  .hero { min-height: auto; display: flex; flex-direction: column-reverse; gap: 24px; padding: 24px 0 47px; align-items: stretch; }
  .hero-art { aspect-ratio: 2; }
  .hero h1 { margin: 0 0 13px; }
  .quiz, .result { margin: 32px auto 55px; }
  .identity { grid-template-columns: 1fr; }
  .identity div { display: grid; grid-template-columns: 5.2rem 1fr; gap: 8px; align-items: baseline; padding: 10px 12px; }
  .identity div + div { border-inline-start: 0; border-top: 1px solid var(--rule); }
  .identity dd { margin: 0; }
  .chapter { grid-template-columns: 1fr; gap: 5px; padding: 16px 0; }
  .backdrop { padding: 16px; }
  .result-scene { padding: 15px; }
  .actions button { flex: 1 1 10rem; padding-inline: 10px; }
}
