/* Regular and bold Cuprum come from ../assets/mh.css; the italic nameplates need their own face. */
@font-face {
  font-family: "Cuprum";
  src: url("fonts/Cuprum-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #000000;
  --paper: #ffffff;
  --text: #29292e;
  --muted: #5c5c66;
  --signal: #ff9310;
  --amanda: #7e0c98;
  --amanda-paper: #ffeed3;
  --makoto: #9d0d23;
  --makoto-paper: #fbe8ea;
  --talleah: #110b92;
  --talleah-paper: #def8fc;
  --gutter: clamp(16px, 4vw, 40px);
  --shadow: 8px 8px 0 var(--ink);
  --plate-slant: 0.9em;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Shared layer (../assets/mh.css): black chrome around the comic page */
  --mh-bg: var(--ink);
  --mh-surface: var(--paper);
  --mh-line: rgba(255, 255, 255, 0.24);
  --mh-text: var(--paper);
  --mh-muted: #b9b9c2;
  --mh-accent: var(--signal);
  --mh-on-accent: var(--ink);
  --mh-radius: 0;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Cuprum", "Arial Narrow", sans-serif;
  font-size: 1.1875rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h2,
h3 {
  color: var(--ink);
  line-height: 1.1;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a,
button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

svg .fill {
  fill: currentColor;
}

svg .stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.hero :focus-visible,
.section-play :focus-visible,
.mh-foot :focus-visible,
.viewer :focus-visible {
  outline-color: var(--paper);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.nameplate {
  display: inline-block;
  margin-bottom: 0.9em;
  padding: 0.3em calc(var(--plate-slant) + 0.9em) 0.32em 0.75em;
  background: var(--ink);
  color: var(--paper);
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem);
  font-weight: 700;
  font-style: italic;
  line-height: 1.05;
  clip-path: polygon(0 0, calc(100% - var(--plate-slant)) 0, 100% 100%, 0 100%);
}

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: min(calc(100svh - 49px), 980px);
  padding-bottom: var(--gutter);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

.hero-backdrop,
.hero-lines {
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.hero-backdrop {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0) brightness(0.62);
  transition: filter 1.4s ease;
}

.hero-lines {
  top: 0;
  left: 0;
  height: 100%;
  width: auto;
  max-width: none;
  filter: invert(1);
  opacity: 0.08;
  transition: opacity 1.4s ease;
}

.js .hero[data-state="prologue"] .hero-backdrop {
  filter: grayscale(1) brightness(0.3);
}

.js .hero[data-state="prologue"] .hero-lines {
  opacity: 0.22;
}

.hero-stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding: 16px var(--gutter) 0;
}

.hero-title {
  align-self: center;
  justify-self: center;
  width: min(100%, 560px);
  padding-block: 8px 0;
}

.hero-title img {
  width: 100%;
  height: auto;
}

.suspects {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: clamp(260px, 44vh, 680px);
  margin-bottom: clamp(-120px, -9vh, -48px);
}

.suspect-frame {
  flex: 0 1 auto;
  min-width: 0;
  height: 100%;
  margin-inline: -2.5%;
  filter: drop-shadow(2px 0 0 var(--paper)) drop-shadow(-2px 0 0 var(--paper)) drop-shadow(0 2px 0 var(--paper)) drop-shadow(0 -2px 0 var(--paper));
}

.suspect {
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: brightness(1);
  transition:
    filter 0.7s ease calc(var(--order) * 0.28s),
    transform 0.7s var(--ease-out) calc(var(--order) * 0.28s);
}

.js .hero[data-state="prologue"] .suspect {
  filter: brightness(0);
  transform: translateY(14px);
}

.dialogue {
  position: relative;
  z-index: 2;
  width: calc(100% - 2 * var(--gutter));
  max-width: 1160px;
  margin-inline: auto;
}

.dialogue .nameplate {
  position: relative;
  z-index: 1;
  margin: 0 0 -3px 10px;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  box-shadow: none;
}

.dialogue-box {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 11.5em;
  padding: clamp(18px, 2.5vw, 30px) clamp(18px, 3vw, 40px) 16px;
  background: var(--paper);
  color: var(--text);
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 3px var(--paper), 11px 11px 0 3px var(--signal);
}

.dialogue-lines {
  flex: 1;
  max-width: 62ch;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.6rem);
  line-height: 1.42;
}

.dialogue-lines p + p {
  margin-top: 0.5em;
}

.js .dialogue-lines p {
  display: none;
}

.js .dialogue-lines p.is-current {
  display: block;
  margin-top: 0;
}

.dialogue-lines.is-typing p.is-current::after,
.dialogue-lines.is-waiting p.is-current::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.3em;
  background: var(--signal);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.dialogue-lines.is-typing p.is-current::after {
  visibility: hidden;
}

.dialogue-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dialogue-controls[hidden],
.quick[hidden] {
  display: none;
}

.quick,
.advance {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 44px;
  padding: 0.35em 0.8em;
  font-weight: 700;
  border: 3px solid var(--ink);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background-color 0.15s;
}

.quick svg,
.advance svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.quick {
  margin-right: auto;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.quick + .quick {
  margin-right: 0;
}

.quick .sound-waves {
  stroke-width: 4;
  opacity: 0.35;
}

.quick[aria-pressed="true"] {
  background: var(--signal);
}

.quick[aria-pressed="true"] .sound-waves {
  opacity: 1;
}

.advance {
  padding-inline: 1.1em 0.9em;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.15rem;
  box-shadow: 4px 4px 0 var(--signal);
}

.quick:hover,
.advance:hover {
  box-shadow: inset 0 0 0 3px var(--signal), 4px 4px 0 var(--ink);
}

.advance:hover {
  box-shadow: inset 0 0 0 3px var(--signal), 4px 4px 0 var(--signal);
}

.quick:active,
.advance:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.cta-strip {
  border-bottom: 4px solid var(--ink);
}

.cta-strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
  padding-block: 28px;
}

.button {
  display: inline-block;
  padding: 0.55em 1.3em;
  font-size: 1.35rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1.1;
  text-decoration: none;
  border: 3px solid var(--ink);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out);
}

.button-primary {
  background: var(--signal);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.button-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.button-primary:active {
  transform: translate(6px, 6px);
  box-shadow: none;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.facts li {
  padding: 0.15em 0.65em;
  color: var(--ink);
  font-weight: 700;
  border: 2px solid var(--ink);
}

.section {
  padding-block: clamp(64px, 9vw, 120px);
}

.section + .section {
  border-top: 4px solid var(--ink);
}

.story-intro {
  display: grid;
  gap: 0.9em;
  max-width: 66ch;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.lead {
  color: var(--ink);
  font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.6rem);
  line-height: 1.38;
}

.days {
  display: grid;
  gap: 16px;
}

.day {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 4px solid var(--ink);
  overflow: hidden;
}

.day img {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
}

.day-caption {
  padding: 16px 18px 20px;
  border-top: 4px solid var(--ink);
}

.day-caption h3 {
  margin-bottom: 0.3em;
  font-size: 1.45rem;
  font-style: italic;
}

.day-sunday {
  background: var(--ink);
  color: var(--paper);
}

.day-sunday h3 {
  color: var(--paper);
}

.day-sunday .day-caption {
  border-top-color: var(--paper);
}

.day-blank {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  color: var(--paper);
  font-size: clamp(7rem, 5rem + 8vw, 12rem);
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  text-shadow: 8px 8px 0 var(--signal);
  background:
    repeating-linear-gradient(-62deg, transparent 0 22px, rgba(255, 255, 255, 0.07) 22px 26px);
}

.section-note {
  max-width: 60ch;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.badges {
  display: grid;
  gap: 32px 28px;
}

.badge {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
}

.badge-art {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: clamp(280px, 70vw, 380px);
  padding-top: 26px;
  background: var(--tint);
  border-top: 22px solid var(--skin);
  border-bottom: 4px solid var(--ink);
  overflow: hidden;
}

.badge-art::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 50%;
  width: 72px;
  height: 12px;
  margin-left: -36px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 6px;
}

.badge-art img {
  grid-area: 1 / 1;
  justify-self: center;
  align-self: start;
  width: auto;
  max-width: none;
  height: 210%;
  transition: opacity 0.25s ease, transform 0.35s var(--ease-out);
}

.badge-art .badge-secret {
  opacity: 0;
  transform: scale(0.94) rotate(-3deg);
}

.badge.is-flipped .badge-art .badge-face {
  opacity: 0;
  transform: scale(1.04) rotate(2deg);
}

.badge.is-flipped .badge-art .badge-secret {
  opacity: 1;
  transform: none;
}

.badge-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 22px;
}

.badge-body h3 {
  color: var(--skin);
  font-size: clamp(1.9rem, 1.6rem + 1vw, 2.4rem);
  font-style: italic;
}

.badge-body p {
  flex: 1;
}

.badge-body .badge-secret,
.badge.is-flipped .badge-body .badge-face {
  display: none;
}

.badge.is-flipped .badge-body .badge-secret {
  display: block;
}

.badge-flip {
  align-self: flex-start;
  min-height: 44px;
  padding: 0.35em 0.9em;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background-color 0.15s, color 0.15s;
}

.badge-flip:hover {
  box-shadow: inset 0 0 0 3px var(--signal), 4px 4px 0 var(--ink);
}

.badge-flip:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.badge-flip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

html:not(.js) .badge-flip {
  display: none;
}

.shots {
  display: grid;
  gap: 14px;
}

.shot a {
  position: relative;
  display: block;
  border: 4px solid var(--ink);
  cursor: zoom-in;
}

.shot a::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 0 var(--signal);
  transition: box-shadow 0.15s ease;
}

.shot a:hover::after {
  box-shadow: inset 0 0 0 5px var(--signal);
}

.shot img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.features {
  display: grid;
  gap: 36px 40px;
}

.features li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 4px;
  align-content: start;
}

.features svg {
  grid-row: span 2;
  width: 52px;
  height: 52px;
  padding: 10px;
  background: var(--ink);
  color: var(--paper);
}

.features h3 {
  align-self: center;
  font-size: 1.4rem;
  font-style: italic;
}

.section-play {
  position: relative;
  isolation: isolate;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

.section-play::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("img/speed-lines.webp") left center / auto 100% no-repeat;
  filter: invert(1);
  opacity: 0.12;
  -webkit-mask-image: linear-gradient(to right, #000 40%, transparent 70%);
  mask-image: linear-gradient(to right, #000 40%, transparent 70%);
}

.play-cast {
  display: none;
}

.section-play .nameplate {
  background: var(--paper);
  color: var(--ink);
}

.play-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.play-lead {
  max-width: 54ch;
  margin-bottom: 32px;
  font-size: 1.3rem;
}

.choices {
  display: grid;
  gap: 16px;
  width: min(100%, 640px);
  margin-bottom: 44px;
}

.choice {
  display: block;
  padding: 0.6em 1.1em;
  background: var(--paper);
  color: var(--ink);
  font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.45rem);
  font-weight: 700;
  font-style: italic;
  line-height: 1.15;
  text-decoration: none;
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 3px var(--paper), 7px 7px 0 3px var(--muted);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out);
}

.choice-primary {
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--paper), 7px 7px 0 3px var(--paper);
}

.choice:hover {
  transform: translateX(6px);
  box-shadow: inset 0 0 0 4px var(--signal), 0 0 0 3px var(--paper), 7px 7px 0 3px var(--signal);
}

.choice-primary:hover {
  box-shadow: inset 0 0 0 4px var(--ink), 0 0 0 3px var(--paper), 7px 7px 0 3px var(--paper);
}

.choice:active {
  transform: translate(7px, 7px);
  box-shadow: 0 0 0 3px var(--paper);
}

.specs {
  display: grid;
  gap: 10px;
  width: min(100%, 640px);
}

.specs div {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr);
  gap: 16px;
  padding-top: 10px;
  border-top: 2px solid rgba(255, 255, 255, 0.28);
}

.specs dt {
  color: #b9b9c2;
}

.mh-foot__note .studio {
  width: auto;
  height: 44px;
  margin-bottom: 14px;
}

.viewer {
  width: min(1600px, 94vw);
  max-width: none;
  max-height: none;
  padding: 0;
  background: transparent;
  color: var(--paper);
  border: 0;
  overflow: visible;
  overscroll-behavior: contain;
}

.viewer::backdrop {
  background: rgba(0, 0, 0, 0.9);
}

.viewer-image {
  width: 100%;
  height: auto;
  max-height: calc(100svh - 160px);
  object-fit: contain;
  background: var(--ink);
  border: 4px solid var(--paper);
}

.viewer-caption {
  min-height: 1.5em;
  margin-top: 10px;
  max-width: 70ch;
}

.viewer-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.viewer-count {
  min-width: 4.5em;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.viewer-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 10px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
}

.viewer-button:hover {
  box-shadow: inset 0 0 0 3px var(--signal);
}

.viewer-button[data-viewer="close"] {
  margin-left: auto;
}

@media (min-width: 640px) {
  .shots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shot-wide {
    grid-column: span 2;
  }

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

@media (min-width: 640px) and (max-width: 959px) {
  .shot:last-child {
    grid-column: span 2;
  }
}

@media (min-width: 760px) {
  .days {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: clamp(320px, 34vw, 430px);
    gap: 18px;
  }

  .day {
    display: block;
  }

  .day:nth-child(1),
  .day:nth-child(4) {
    grid-column: span 7;
  }

  .day:nth-child(2),
  .day:nth-child(3) {
    grid-column: span 5;
  }

  .day img,
  .day-blank {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  .day-caption {
    position: absolute;
    left: 14px;
    bottom: 14px;
    max-width: min(36ch, calc(100% - 28px));
    background: var(--paper);
    border: 3px solid var(--ink);
    box-shadow: 5px 5px 0 var(--ink);
  }

  .day-sunday .day-caption {
    background: var(--ink);
    border-color: var(--paper);
    box-shadow: 5px 5px 0 var(--signal);
  }

  .badges {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .badge-art {
    height: clamp(300px, 34vw, 400px);
  }
}

@media (min-width: 960px) {
  .hero-stage {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    column-gap: 24px;
  }

  .hero-title {
    justify-self: start;
    width: min(100%, 600px);
    padding-bottom: clamp(70px, 10vh, 140px);
  }

  .suspects {
    height: clamp(420px, 66vh, 700px);
  }

  .shots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shot-wide {
    grid-row: span 2;
  }

  .features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .play-cast {
    position: absolute;
    right: max(0px, calc((100vw - 1320px) / 2));
    bottom: 0;
    z-index: -1;
    display: flex;
    align-items: flex-end;
    width: min(48vw, 700px);
    height: 86%;
    pointer-events: none;
  }

  .play-cast img {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(2px 0 0 var(--paper)) drop-shadow(-2px 0 0 var(--paper)) drop-shadow(0 -2px 0 var(--paper));
  }

  .play-cast img:nth-child(2) {
    flex-grow: 1.4;
    height: 94%;
  }
}

@media (max-width: 520px) {
  .quick span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .quick {
    width: 48px;
    justify-content: center;
    padding-inline: 0;
  }

  .specs div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
  }
}
