:root {
  color-scheme: dark;
  --background: #191016;
  --surface: #271a22;
  --line: #5f444e;
  --ink: #f7ece7;
  --muted: #d6c1c3;
  --accent: #f0b6b7;
  --display: Georgia, "Times New Roman", serif;
  --utility: system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--utility);
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 54px;
  width: min(100% - 40px, 980px);
  margin-inline: auto;
  border-bottom: 1px solid var(--line);
}

.imprint {
  display: flex;
  gap: 9px;
  align-items: center;
  font: bold 14px var(--display);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.imprint svg {
  flex: none;
  width: 25px;
  height: 25px;
  color: var(--accent);
}

.edition, .genre, figcaption, .eyebrow {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.edition { color: var(--muted); }

main {
  width: min(100% - 40px, 980px);
  margin-inline: auto;
  padding-block: 18px 36px;
}

.opening {
  display: grid;
  grid-template-areas: "title" "ad" "cover" "details";
}

.title { grid-area: title; }

.genre {
  margin: 0 0 7px;
  color: var(--accent);
}

h1, h2, legend {
  font-family: var(--display);
  font-weight: 400;
}

h1 {
  margin: 0 0 15px;
  font-size: clamp(29px, 9.1vw, 42px);
  line-height: .99;
  letter-spacing: -.033em;
}

h1 span { display: block; }

.cover {
  grid-area: cover;
  width: min(100%, 306px);
  margin: 0 auto;
  padding: 6px 6px 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: contain;
}

figcaption {
  padding-block: 6px;
  text-align: center;
  color: var(--muted);
}

.details { grid-area: details; }

.synopsis {
  margin: 15px 0 13px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.choice {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.eyebrow {
  display: block;
  color: var(--accent);
  margin: 10px 0 4px;
}

legend {
  width: 100%;
  float: left;
  padding: 0;
  font-size: 20px;
  line-height: 1.15;
}

.choices {
  clear: both;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 9px;
}

.choices button, .resume-story {
  min-height: 46px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  font: 650 12px/1.25 var(--utility);
  cursor: pointer;
  text-align: center;
}

.choices button:hover, .resume-story:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.choices button:focus-visible,
.resume-story:focus-visible,
.fold-story:focus-visible,
.story h2:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ad-slot-a { grid-area: ad; }

.ad-slot {
  display: flex;
  justify-content: center;
  min-width: 0;
  min-height: 250px;
  margin: 0 0 12px;
  overflow-anchor: none;
}

.ad-slot > .adsbygoogle { flex: 0 0 auto; }

.ad-slot:has(> .adsbygoogle:is([data-ad-status="unfilled"], [data-ad-status="unfill-optimized"])) {
  display: none;
}

@media (width < 300px) {
  .ad-slot { display: none; }
}

.resume-story { width: 100%; }

#story-area {
  width: min(100%, 620px);
  margin: clamp(26px, 6vw, 50px) auto 0;
}

.story {
  padding-top: 6px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 12px;
}

.story-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.story-bar .eyebrow { margin: 0; }

.fold-story {
  min-height: 44px;
  padding: 4px 0 4px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 12px/1.3 var(--utility);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.fold-story:hover { color: var(--ink); }

.story h2 {
  margin: 0;
  font-size: clamp(28px, 6vw, 42px);
  line-height: 1.08;
}

.response {
  margin-top: 14px;
  border-left: 2px solid var(--accent);
  padding: 9px 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.response .eyebrow { margin: 0 0 4px; }
#story-response { margin: 0; }

.scene-copy {
  margin: 16px 0 7px;
  font: 19px/1.55 var(--display);
}

.story-context {
  margin-top: 27px;
  padding: 13px 0 17px;
  border-block: 1px solid var(--line);
}

.story-context .eyebrow { margin-top: 0; }

.story-context h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.story-context p:not(.eyebrow) {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.story-context p:last-child { margin-bottom: 0; }

.ad-slot-b { margin: 14px 0 0; }

@media (max-width: 680px) {
  .cover { width: min(100%, clamp(208px, 35svh, 270px)); }
}

@media (min-width: 681px) {
  main { padding-top: clamp(30px, 7vh, 66px); }

  .opening {
    grid-template-areas: "cover title" "cover details" "ad details";
    grid-template-columns: minmax(245px, .94fr) minmax(0, 1fr);
    grid-template-rows: min-content 1fr min-content;
    column-gap: clamp(26px, 7vw, 80px);
    align-items: start;
  }

  .cover { width: min(100%, 386px); margin: 0; }
  .ad-slot-a { width: min(100%, 386px); margin: 12px 0 0; }
  h1 { font-size: clamp(34px, 4.3vw, 54px); }
  .synopsis { font-size: 16px; margin: 9px 0 24px; }
  .eyebrow { margin-top: 15px; }
  legend { font-size: 25px; }
  .choices button, .resume-story { min-height: 48px; font-size: 14px; }
}
