:root {
  color-scheme: light;
  background: #fbfaf7;
  color: #222;
  font: 18px/1.55 Georgia, serif;
}

body {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 4.5rem) 1.25rem 1.25rem;
}

p { margin: 0 0 0.85em; }
#scene {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
  gap: 1.5rem;
}
#choices { margin-top: 1.25rem; }
#scene.without-art { grid-template-columns: 1fr; max-width: 34rem; }
#art[hidden] { display: none; }

button {
  display: block;
  min-height: 44px;
  padding: 0.35em 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  cursor: pointer;
}

button:hover, summary:hover { color: #666; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
#passage:focus { outline: none; }
#art {
  display: block;
  width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: no-preference) {
  #passage > p { animation: fade-in 380ms ease-out var(--reveal-delay) both; }
  #choices > button { animation: reveal-choice 380ms ease-out var(--reveal-delay) both; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes reveal-choice {
  from { opacity: 0; visibility: hidden; }
  to { opacity: 1; visibility: visible; }
}

details { margin-top: 1.5rem; }
summary { cursor: pointer; }
#history { margin: 0.75rem 0 0 0.3rem; padding-left: 0.85rem; border-left: 1px solid #aaa; }
.echo { font-style: italic; }
.echo::before { content: "› "; }
footer { margin-top: auto; padding-top: 2rem; color: #666; font-size: 0.78rem; }
footer a { color: inherit; margin-left: 1rem; }

@media (max-width: 32rem) {
  #scene { grid-template-columns: 1fr; }
  #art { width: min(100%, 15rem); }
}
