:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #172d31;
  background: #e8e8df;
  --paper: #f5f4eb;
  --ink: #172d31;
  --muted: #485e5e;
  --line: #a7b4ab;
  --accent: #245047;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { max-width: 1390px; margin: 0 auto; padding: 0 clamp(1rem, 5vw, 5rem); }
a { color: inherit; text-underline-offset: .24em; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid #78391f; outline-offset: 4px; }

.masthead, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  font-size: .875rem;
}
.masthead { min-height: 4.5rem; }
.wordmark { display: inline-flex; align-items: center; gap: .6rem; font-weight: 760; text-decoration: none; }
.mark { display: grid; position: relative; width: 1.35rem; height: 1.1rem; align-items: center; }
.mark::before {
  content: "";
  position: absolute;
  left: .25rem;
  width: .9rem;
  height: .7rem;
  border: 1px solid var(--accent);
  border-left: 0;
}
.mark i { width: .32rem; aspect-ratio: 1; border-radius: 50%; background: var(--accent); position: absolute; }
.mark i:nth-child(2) { right: 0; top: 0; }
.mark i:nth-child(3) { right: 0; bottom: 0; }
.source-link span { margin-inline-start: .18rem; }

.spread {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--paper);
  border: 1px solid #b0b7ae;
  min-height: clamp(32rem, 50vw, 41rem);
}
.cover {
  display: flex;
  position: relative;
  align-items: flex-end;
  isolation: isolate;
  min-height: 100%;
  overflow: hidden;
  color: #fff9e9;
  background: #243a43;
}
.art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -2;
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #101f2bf2 2%, #15232de0 35%, #121e2e8c 62%, transparent 95%);
}
.cover-copy { padding: clamp(1.75rem, 4vw, 3.5rem); width: 100%; }
.genre { margin: 0 0 .75rem; font-size: .875rem; letter-spacing: .045em; color: #e7ebe7; }
.premise { max-width: 30ch; margin: .8rem 0 0; line-height: 1.48; color: #fff9e9; }
.play-link {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.75rem;
  margin-block-start: 1rem;
  padding: .55rem .85rem;
  border: 1px solid #fff9e9;
  border-radius: .22rem;
  background: #fff9e9;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}
.play-link:hover { background: #e8ede4; }
.play-link:focus-visible { outline-color: #fff9e9; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; }
h1 {
  font-size: clamp(2.6rem, 5.5vw, 5.65rem);
  line-height: .99;
  letter-spacing: -.045em;
  margin: 0;
  text-wrap: balance;
}

.story { padding: clamp(1.35rem, 4.4vw, 4.4rem); min-width: 0; }
.story-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2rem;
  margin-block-end: clamp(1.4rem, 4vw, 2.8rem);
  padding-block-end: .45rem;
  border-bottom: 1px solid var(--line);
  gap: .5rem;
  color: var(--muted);
  font-size: .875rem;
}
.text-button { border: 0; padding: .35rem 0 .35rem .4rem; color: var(--ink); background: transparent; text-decoration: underline; text-underline-offset: .23em; }
h2 { font-size: clamp(2.15rem, 3.4vw, 3.5rem); line-height: 1.04; letter-spacing: -.045em; margin: 0 0 .85rem; }
h2:focus:not(:focus-visible) { outline: none; }
.scene-text {
  color: #253d3e;
  font-size: clamp(1.025rem, 1.35vw, 1.2rem);
  line-height: 1.65;
  margin: 0;
  max-width: 45ch;
}
.choices { display: grid; gap: .65rem; margin-block-start: clamp(1.5rem, 4vw, 2.5rem); }
.choices:empty { display: none; }
.choice {
  display: flex;
  align-items: center;
  gap: .8rem;
  width: 100%;
  min-height: 3.4rem;
  border: 1px solid var(--line);
  border-radius: .22rem;
  padding: .65rem .8rem;
  background: #fcfbf5;
  color: var(--ink);
  text-align: left;
  font-size: 1rem;
  line-height: 1.35;
}
.choice:hover { background: #e8ede4; border-color: var(--accent); }
.choice kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  aspect-ratio: 1;
  border: 1px solid #93aa9e;
  border-radius: .18rem;
  color: var(--accent);
  font: 600 .8rem/1 system-ui, sans-serif;
}
.choice .direction { margin-inline-start: auto; color: var(--accent); }
.notice { padding: .65rem .8rem; border-left: 3px solid #91563c; background: #f3e6d6; font-size: .9rem; }

.outcome { margin-block-start: 1.65rem; padding-block-start: 1.2rem; border-top: 1px solid var(--line); }
.outcome h3 { margin: 0 0 .65rem; font-size: 1.45rem; }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .85rem; list-style: none; padding: 0; margin: 0; }
.route li { display: inline-flex; gap: .45rem; align-items: center; font-size: .825rem; white-space: nowrap; padding-block: .25rem; }
.route li::before { content: ""; display: inline-block; flex: none; width: .5rem; height: .5rem; border: 1px solid var(--accent); border-radius: 50%; }
.route li:last-child { font-weight: 700; }
.route li:last-child::before { background: var(--accent); }
.alternate { color: var(--muted); font-size: .875rem; margin: .65rem 0 0; }
.ending-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-block-start: 1.25rem; }
.primary-button, .secondary-button { min-height: 2.85rem; padding: .5rem .8rem; border: 1px solid var(--accent); border-radius: .22rem; font-size: .9rem; font-weight: 650; }
.primary-button { background: var(--accent); color: white; }
.primary-button:hover { background: #173c34; }
.secondary-button { background: transparent; color: var(--accent); }
.secondary-button:hover { background: #e8ede4; }
.share-fallback { display: grid; gap: .35rem; margin-block-start: .8rem; font-size: .85rem; }
.share-fallback input { width: 100%; color: var(--ink); background: #fcfbf5; border: 1px solid var(--line); padding: .5rem; }
.share-status { margin: .5rem 0 0; color: var(--muted); font-size: .85rem; }
.share-status:empty { margin: 0; }
.story-notes {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.25rem, 4vw, 2.5rem) 0;
  border-bottom: 1px solid var(--line);
}
.story-notes h2 { font-size: clamp(1.65rem, 2.5vw, 2.25rem); margin-block-end: .6rem; }
.story-notes p { color: var(--muted); max-width: 54ch; margin: 0; line-height: 1.55; }
.story-notes p + p { margin-block-start: .7rem; }
.story-facts { margin: 0; font-size: .9rem; }
.story-facts div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .5rem 1rem; padding-block: .45rem; }
.story-facts div + div { border-top: 1px solid var(--line); }
.story-facts dt { font-weight: 650; }
.story-facts dd { margin: 0; }
.footer { padding: 1rem 0 1.5rem; flex-wrap: wrap; justify-content: flex-end; gap: .6rem 1.2rem; color: var(--muted); }

@media (max-width: 860px) {
  body { padding-inline: clamp(.75rem, 4vw, 2rem); }
  .spread { grid-template-columns: 1fr; }
  .cover { min-height: clamp(16rem, 49vw, 25rem); }
  .art { object-position: center 43%; }
  h1 br { display: none; }
  .story-notes { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .masthead { min-height: 3.5rem; }
  .cover-copy { padding: 1.2rem; }
  h1 { text-wrap: initial; }
  h1 br { display: initial; }
  .story-top { margin-block-end: 1rem; }
  .footer { justify-content: flex-start; }
}
