:root {
  color-scheme: light;
  --ink: #f8f8f2;
  --paper: #050505;
  --line: #f8f8f2;
  --dark-line: #211d1a;
  --mint: #45c7a5;
  --coral: #f06b57;
  --lemon: #ffd54d;
  --sky: #83c7ee;
  --violet: #7058c8;
  --shadow: 7px 7px 0 var(--line);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

button,
input {
  font: inherit;
}

.topbar {
  align-items: center;
  background: rgba(0, 0, 0, 0.92);
  border-bottom: 3px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  left: 0;
  padding: 14px clamp(16px, 4vw, 48px);
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
}

.brand,
nav a,
.primary-action,
.secondary-action,
.ghost-button {
  color: var(--ink);
  text-decoration: none;
}

.brand {
  align-items: center;
  display: inline-flex;
  width: min(220px, 48vw);
}

.brand img {
  display: block;
  height: auto;
  width: 100%;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-end;
}

nav a {
  font-weight: 800;
}

.hero {
  display: grid;
  gap: clamp(28px, 6vw, 72px);
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  min-height: calc(100vh - 76px);
  overflow: hidden;
  padding: clamp(28px, 6vw, 72px) clamp(16px, 5vw, 64px) 44px;
}

.hero-art {
  align-self: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: zoom-in;
  margin: 0;
  max-height: min(78vh, 860px);
  overflow: hidden;
  padding: 0;
  position: relative;
}

.hero-art img {
  display: block;
  height: 100%;
  max-height: min(78vh, 860px);
  object-fit: contain;
  width: 100%;
}

.hero-copy {
  align-self: center;
  max-width: 560px;
}

.kicker {
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  line-height: .85;
  margin-bottom: 24px;
}

.hero-logo {
  display: block;
  height: auto;
  margin-left: -8px;
  max-width: 760px;
  width: min(100%, 72vw);
}

h2 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: .92;
  margin-bottom: 0;
  max-width: 960px;
}

h3 {
  font-size: 1.45rem;
  margin-bottom: 8px;
}

.hero-copy p:not(.kicker) {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.35;
  max-width: 460px;
}

.primary-action,
.secondary-action,
.ghost-button,
.choices button,
.quote-maker button {
  border: 3px solid var(--line);
  cursor: pointer;
  font-weight: 900;
}

.primary-action,
.secondary-action {
  box-shadow: 4px 4px 0 var(--line);
  display: inline-flex;
  justify-content: center;
  padding: 13px 18px;
}

.primary-action {
  background: var(--lemon);
  color: var(--dark-line);
}

.secondary-action,
.ghost-button {
  background: #fff;
  color: var(--dark-line);
}

.episode,
.characters,
.workshop {
  padding: 64px clamp(16px, 5vw, 64px);
}

.section-heading {
  margin-bottom: 28px;
}

.reader-shell {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: 220px minmax(0, 1fr);
}

.reader-panel {
  background: #fff;
  border: 4px solid var(--line);
  display: grid;
  gap: 16px;
  padding: 18px;
  position: sticky;
  top: 100px;
}

.panel-label {
  display: block;
  font-size: .78rem;
  font-weight: 900;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.progress-track {
  background: #efe6d4;
  border: 3px solid var(--line);
  height: 18px;
  overflow: hidden;
}

.progress-track span {
  background: var(--mint);
  display: block;
  height: 100%;
  transition: width .24s ease;
  width: 16.66%;
}

.ghost-button {
  padding: 10px 12px;
}

.comic-strip {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.comic-panel {
  background: #fffdf7;
  border: 4px solid var(--line);
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto auto;
  min-height: 370px;
  opacity: .38;
  overflow: hidden;
  transform: translateY(10px);
  transition: opacity .24s ease, transform .24s ease;
}

.comic-panel.active,
.comic-panel.revealed {
  opacity: 1;
  transform: translateY(0);
}

.comic-panel.active {
  box-shadow: var(--shadow);
}

.panel-art {
  border-bottom: 4px solid var(--line);
  min-height: 230px;
  overflow: hidden;
  position: relative;
}

.market {
  background: #86c9ef;
}

.awning {
  background: repeating-linear-gradient(90deg, #fff 0 28px, var(--coral) 28px 56px);
  border-bottom: 4px solid var(--line);
  height: 56px;
}

.window {
  background: #24314f;
}

.shop-window {
  background: linear-gradient(135deg, rgba(255,255,255,.8), rgba(255,255,255,.12));
  border: 4px solid var(--line);
  height: 142px;
  left: 18%;
  position: absolute;
  top: 46px;
  transform: skew(-6deg);
  width: 64%;
}

.close {
  background: #f7d35a;
}

.crossroad {
  background: #69bad9;
}

.result {
  background: #2b315c;
}

.finale {
  background: #f3a35e;
}

.character,
.avatar {
  background: var(--mint);
  border: 4px solid var(--line);
  border-radius: 50% 45% 52% 48%;
  height: 94px;
  position: absolute;
  width: 94px;
}

.character-blason {
  display: block;
  height: auto;
  object-fit: contain;
  position: absolute;
  width: 118px;
}

.avatar {
  display: block;
  height: 116px;
  margin-bottom: 18px;
  position: relative;
  width: 116px;
}

.avatar-blason {
  display: block;
  height: auto;
  margin-bottom: 18px;
  width: 132px;
}

.character.big {
  bottom: 18%;
  height: 180px;
  width: 180px;
}

.character.small,
.character-blason.small {
  height: 70px;
  width: 92px;
}

.character.huge,
.character-blason.huge {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
}

.mint {
  background: var(--mint);
}

.coral {
  background: var(--coral);
}

.lemon {
  background: var(--lemon);
}

.market .mint {
  bottom: 24px;
  left: 16%;
}

.market .lemon {
  bottom: 28px;
  right: 18%;
}

.finale .mint {
  bottom: 28px;
  left: 12%;
}

.finale .coral {
  bottom: 44px;
  left: 39%;
}

.finale .lemon {
  bottom: 24px;
  right: 12%;
}

.eye {
  background: var(--line);
  border-radius: 50%;
  height: 11px;
  position: absolute;
  top: 34%;
  width: 11px;
}

.character.big .eye,
.character.huge .eye {
  height: 18px;
  width: 18px;
}

.left {
  left: 28%;
}

.right {
  right: 28%;
}

.mouth {
  border-bottom: 4px solid var(--line);
  border-radius: 50%;
  bottom: 28%;
  height: 18px;
  left: 36%;
  position: absolute;
  width: 28%;
}

.mouth.smile {
  border-bottom-width: 5px;
  bottom: 24%;
  height: 24px;
}

.mouth.worried {
  border-bottom: 0;
  border-top: 5px solid var(--line);
  bottom: 21%;
}

.speech-pop {
  background: #fff;
  border: 4px solid var(--line);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--line);
  font-size: 2rem;
  font-weight: 900;
  padding: 24px 26px;
  position: absolute;
  right: 12%;
  top: 12%;
  transform: rotate(8deg);
}

.spark {
  background: var(--lemon);
  clip-path: polygon(50% 0, 61% 35%, 100% 50%, 61% 64%, 50% 100%, 39% 64%, 0 50%, 39% 35%);
  height: 52px;
  position: absolute;
  width: 52px;
}

.spark.one {
  right: 18%;
  top: 28px;
}

.spark.two {
  left: 18%;
  top: 138px;
}

.arrow {
  border: 4px solid var(--line);
  height: 42px;
  position: absolute;
  top: 58px;
  width: 112px;
}

.left-arrow {
  background: var(--lemon);
  left: 32px;
  transform: rotate(-18deg);
}

.right-arrow {
  background: var(--coral);
  right: 32px;
  transform: rotate(18deg);
}

.crossroad .mint {
  bottom: 30px;
  left: calc(50% - 35px);
}

.moon {
  background: var(--lemon);
  border: 4px solid var(--line);
  border-radius: 50%;
  height: 68px;
  position: absolute;
  right: 28px;
  top: 24px;
  width: 68px;
}

.rope {
  background: #c99353;
  border-left: 3px solid var(--line);
  border-right: 3px solid var(--line);
  height: 180px;
  left: 24%;
  position: absolute;
  top: 0;
  width: 20px;
}

.door {
  background: #8d5743;
  border: 4px solid var(--line);
  bottom: -4px;
  height: 150px;
  position: absolute;
  right: 20%;
  width: 84px;
}

.bubble,
.live-bubble {
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 0 18px 18px 18px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 16px;
  padding: 14px;
}

.choices {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 16px 16px;
}

.choices button,
.quote-maker button {
  background: var(--lemon);
  padding: 10px;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
  margin-top: 26px;
}

.character-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.character-grid article {
  background: #fff;
  border: 4px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  padding: 22px;
}

.character-grid p {
  line-height: 1.45;
  margin-bottom: 0;
}

.workshop {
  background: #96d4c6;
  border-top: 4px solid var(--line);
}

.quote-maker {
  display: grid;
  gap: 10px;
  max-width: 720px;
}

.quote-maker label {
  font-weight: 900;
}

.quote-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 120px;
}

.quote-row input {
  border: 3px solid var(--line);
  padding: 12px;
}

.live-bubble {
  display: inline-block;
  margin-left: 0;
  max-width: 620px;
}

.reader-panel,
.comic-panel,
.character-grid article {
  border-color: var(--dark-line);
  color: var(--dark-line);
}

.character,
.avatar,
.shop-window,
.arrow,
.moon,
.door,
.progress-track {
  border-color: var(--dark-line);
}

.panel-art,
.awning {
  border-color: var(--dark-line);
}

.eye {
  background: var(--dark-line);
}

.mouth {
  border-color: var(--dark-line);
}

.mouth.worried {
  border-top-color: var(--dark-line);
}

.bubble,
.live-bubble,
.speech-pop,
.choices button,
.quote-maker button,
.quote-row input {
  border-color: var(--dark-line);
  color: var(--dark-line);
}

.speech-pop {
  box-shadow: 4px 4px 0 var(--dark-line);
}

.workshop {
  color: var(--dark-line);
}

@media (max-width: 980px) {
  .hero,
  .reader-shell {
    grid-template-columns: 1fr;
  }

  .reader-panel {
    position: static;
  }

  .comic-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: auto;
  }

  .hero-art {
    min-height: 360px;
  }

  .comic-strip,
  .character-grid,
  .choices,
  .quote-row {
    grid-template-columns: 1fr;
  }

  .comic-panel {
    min-height: 330px;
  }

  .reader-actions {
    justify-content: stretch;
  }

  .reader-actions button,
  .reader-actions a {
    width: 100%;
  }
}


.cover-lightbox {
  align-items: center;
  background: rgba(0, 0, 0, .94);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: fixed;
  z-index: 100;
}

.cover-lightbox.open {
  display: flex;
}

.cover-lightbox img {
  display: block;
  max-height: calc(100vh - 44px);
  max-width: calc(100vw - 44px);
  object-fit: contain;
}

.lightbox-close {
  background: #fff;
  border: 3px solid #211d1a;
  color: #211d1a;
  cursor: pointer;
  font-size: 2rem;
  font-weight: 900;
  height: 50px;
  line-height: 1;
  position: fixed;
  right: 22px;
  top: 22px;
  width: 50px;
  z-index: 101;
}

body.lightbox-open {
  overflow: hidden;
}
