:root {
  color-scheme: light;
  --paper: #f4f3ed;
  --ink: #182e2b;
  --muted: #69756e;
  --line: #d8ddd3;
  --accent: #d8eeaa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button { font: inherit; cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible,
summary:focus-visible {
  outline: 3px solid #7a9744;
  outline-offset: 5px;
}

/* Layout */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 54px 5% 35px;
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(340px, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "aside reader" "map reader";
  column-gap: 8%;
  row-gap: 0;
}
aside, .reader { min-width: 0; }
aside { grid-area: aside; }
.reader { grid-area: reader; }
#map-box { grid-area: map; }
.reader { padding-top: 6px; }

/* Typography */
h1 {
  font-family: Georgia, serif;
  font-size: clamp(54px, 6vw, 86px);
  font-weight: 400;
  letter-spacing: -4px;
  line-height: 1.02;
  margin: 20px 0;
}
h1 em { font-weight: 400; color: #718264; }
h2 {
  font-family: Georgia, serif;
  font-size: 35px;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -.8px;
  margin: 12px 0 24px;
}
.prose {
  font-family: Georgia, serif;
  font-size: 17px;
  line-height: 1.85;
  color: #46554d;
}
.prose p { margin: 0 0 16px; }

/* Art panel */
.art {
  position: relative;
  overflow: hidden;
  background: #193b37;
  border-radius: 160px 160px 6px 6px;
  height: 300px;
  margin-top: 30px;
  isolation: isolate;
}
.art svg { height: 100%; width: 100%; display: block; }
.art-caption {
  position: absolute;
  bottom: 20px;
  left: 24px;
  color: #c4d4c4;
  font-size: 9px;
  letter-spacing: 2px;
}

/* Meta / chapter / toolbar */
.meta {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 1.5px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-bottom: 34px;
}
.text-button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 8px 0;
  font-size: 12px;
}
.text-button:hover { color: var(--ink); }
.text-button:disabled:hover { color: var(--muted); }
.tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0 20px; }

/* Scene */
.scene { animation: arrive .35s ease; scroll-margin-top: 20px; }
.decision {
  margin: 30px 0 14px;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}
.decision.finale {
  font-family: Georgia, serif;
  font-size: 46px;
  letter-spacing: -1.5px;
  color: var(--ink);
  text-transform: none;
  margin: 40px 0 26px;
}

/* Choices */
.choices { display: grid; gap: 10px; }
.choice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 17px;
  background: #fafbf6;
  color: var(--ink);
  transition: background .18s, transform .18s, border-color .18s;
}
.choice:hover {
  background: #eaf0db;
  border-color: #acbd91;
  transform: translateX(3px);
}
.choice.primary { background: var(--accent); border-color: var(--accent); }
.choice.visited { background: var(--accent); border-color: var(--accent); }
.choice.visited .choice-number { border-color: #a9c47a; color: #4f6b2e; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.choice-number {
  display: grid;
  place-items: center;
  border: 1px solid #d9dfce;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  font-size: 11px;
  color: #7b8967;
}
.choice strong { font-size: 13px; font-weight: 500; display: block; line-height: 1.5; }
.choice small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 4px; }
.arrow { margin-left: auto; font-size: 19px; }

/* Ticket callout */
.ticket {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 3px solid #789447;
  border-radius: 6px;
  background: #fafbf6;
  font-size: 13px;
  line-height: 1.7;
}
.ticket p { margin: 0 0 8px; }
.ticket p:last-child { margin: 16px 0 0; }

/* Below / journey */
.below {
  margin-top: 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.save { font-size: 10px; color: var(--muted); }
details {
  margin-top: 25px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
summary { cursor: pointer; }
ol { padding-left: 20px; line-height: 1.9; }
#found-list, #dead-list { list-style: none; padding-left: 0; margin: 0; line-height: 1.9; }
#found-list li, #dead-list li { color: var(--ink); }
#found-list li::before, #dead-list li::before { content: "\2713"; color: #789447; margin-right: 9px; }
.still-hidden { margin: 6px 0 0; color: var(--muted); }
footer {
  max-width: 1400px;
  margin: 10px auto 0;
  padding: 24px 5% 30px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
footer a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
footer a:hover { color: var(--ink); text-decoration-color: currentColor; }
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0 0;
}
#map-box { margin-top: 18px; }
#dead-box { border-top: 0; margin-top: 10px; padding-top: 0; }
.map-svg { width: 100%; height: auto; display: block; margin: 4px 0 10px; overflow: visible; }
.map-edge { stroke: #c3ccbb; stroke-width: 1; }
.map-edge.map-dim { stroke: #dde2d6; stroke-dasharray: 2 3; }
.map-node { fill: #6d7d70; }
.map-node.map-finale { fill: #6f9b2d; }
.map-node.map-dead { fill: var(--paper); stroke: #8b9a84; stroke-width: 1.5; }
.map-node.map-unseen { fill: #ccd4c5; }
.map-node.map-here { fill: var(--ink); stroke: var(--ink); stroke-width: 4; stroke-opacity: .16; }
.map-hit { fill: transparent; cursor: pointer; }
.map-hit:focus-visible { outline: 3px solid #7a9744; outline-offset: 2px; }
.map-key { margin: 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.journey-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  cursor: pointer;
}
.journey-link:hover { color: var(--ink); text-decoration-color: currentColor; }
li[aria-current="step"] { color: var(--ink); font-weight: 600; }
noscript { display: block; padding: 30px; }

/* Motion */
@keyframes arrive {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Scene vignettes (phone only, pilot scenes): small looping drawings that
   stand in for the title and cover art once the player is past scene 1. */
@keyframes type-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}
.vignette .hand-left  { animation: type-bounce .9s ease-in-out infinite; transform-origin: center; }
.vignette .hand-right { animation: type-bounce .9s ease-in-out infinite .45s; transform-origin: center; }
@keyframes key-pulse {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}
.vignette .key-glow { animation: key-pulse 1.6s ease-in-out infinite; }
@keyframes spin {
  to { transform: rotate(360deg); }
}
.vignette .restart-icon { animation: spin 2.4s linear infinite; transform-origin: 235px 88px; }
@keyframes scan {
  0%, 100% { transform: scaleX(0); }
  50%      { transform: scaleX(1); }
}
.vignette .loadbar { animation: scan 2.2s ease-in-out infinite; transform-origin: left; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.vignette .float { animation: float 2.4s ease-in-out infinite; }
@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: .15; }
}
.vignette .blink { animation: blink 1.6s step-end infinite; }
@keyframes wave {
  0%, 100% { transform: rotate(-6deg); }
  50%      { transform: rotate(6deg); }
}
.vignette .wave { animation: wave 2s ease-in-out infinite; transform-origin: bottom center; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  75%      { transform: translateX(3px); }
}
.vignette .shake { animation: shake .5s ease-in-out infinite; }
@keyframes sweep {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(60px); }
}
.vignette .sweep { animation: sweep 2.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Responsive */
@media (max-width: 760px) {
  main { display: block; padding: 30px 6%; }
  h1 { font-size: 60px; }
  .art { height: 190px; border-radius: 100px 100px 6px 6px; margin-top: 20px; }
  #map-box { margin-bottom: 35px; }
  .toolbar { margin-bottom: 22px; }
  .tools { justify-content: flex-start; }
  h2 { font-size: 30px; }
}
