:root {
  --ink: #111111;
  --paper: #f3ead7;
  --paper-deep: #e7d7b8;
  --yellow: #f5d547;
  --red: #e23d28;
  --teal: #1f9e8f;
  --line: #111111;
  --display: "Bangers", "Arial Black", system-ui, sans-serif;
  --body: "Comic Neue", "Comic Sans MS", cursive, system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(17, 17, 17, 0.14) 1px, transparent 0),
    linear-gradient(180deg, #f7efdc 0%, var(--paper) 40%, var(--paper-deep) 100%);
  background-size: 8px 8px, auto;
  font-family: var(--body);
  line-height: 1.35;
}

a {
  color: inherit;
  text-decoration: none;
}

.cover {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: end start;
  padding: clamp(4.5rem, 10vh, 7rem) clamp(1.1rem, 4vw, 3.5rem) clamp(1.5rem, 4vh, 2.5rem);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 6px solid var(--line);
}

.cover-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  animation: zoom-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cover-ink {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.82) 0%, rgba(17, 17, 17, 0.45) 48%, rgba(17, 17, 17, 0.2) 100%),
    linear-gradient(180deg, rgba(17, 17, 17, 0.15) 0%, rgba(17, 17, 17, 0.75) 100%);
}

.cover-copy {
  position: relative;
  z-index: 2;
  max-width: 34rem;
  color: #fff8e8;
  animation: slam 700ms cubic-bezier(0.2, 1.2, 0.3, 1) both;
}

.brand {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(4rem, 14vw, 9rem);
  line-height: 0.85;
  letter-spacing: 0.02em;
  color: var(--yellow);
  text-shadow:
    4px 4px 0 #000,
    -2px 0 0 var(--red);
  -webkit-text-stroke: 1px #000;
}

.cover h1 {
  margin: 0 0 0.7rem;
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  letter-spacing: 0.03em;
  text-shadow: 3px 3px 0 #000;
}

.lede {
  margin: 0 0 1.4rem;
  max-width: 26rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: rgba(255, 248, 232, 0.92);
}

.burst {
  display: inline-grid;
  place-items: center;
  min-width: 9.5rem;
  min-height: 9.5rem;
  padding: 1rem;
  border: 4px solid #000;
  border-radius: 55% 45% 60% 40% / 50% 55% 45% 50%;
  background: var(--yellow);
  color: #111;
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  text-align: center;
  box-shadow: 5px 5px 0 #000;
  transform: rotate(-6deg);
  transition: transform 160ms ease, background 160ms ease;
  animation: pop 900ms 200ms cubic-bezier(0.2, 1.3, 0.3, 1) both;
}

.burst:hover {
  transform: rotate(-2deg) scale(1.04);
  background: #ffe56a;
}

.burst.alt {
  background: var(--red);
  color: #fff8e8;
  min-width: 11rem;
  min-height: 11rem;
  font-size: 1.35rem;
  transform: rotate(5deg);
}

.burst.alt:hover {
  transform: rotate(2deg) scale(1.04);
  background: #ff5240;
}

.issue {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 2;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 3px solid #000;
  background: var(--teal);
  color: #fff;
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.04em;
  transform: rotate(4deg);
  box-shadow: 3px 3px 0 #000;
}

.book {
  padding: clamp(2.5rem, 7vh, 4.5rem) clamp(1rem, 3vw, 2.5rem);
}

.book-head {
  margin: 0 auto 1.75rem;
  max-width: 70rem;
}

.book-head h2,
.outro h2 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: 0.03em;
}

.book-head p,
.outro p {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  max-width: 34rem;
}

.pages {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-areas:
    "a b"
    "a c"
    "d d";
  gap: 1rem;
  max-width: 70rem;
  margin: 0 auto;
  padding: 1rem;
  border: 6px solid #000;
  background:
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 10px,
      rgba(17, 17, 17, 0.03) 10px,
      rgba(17, 17, 17, 0.03) 11px
    ),
    #fff8e8;
  box-shadow: 10px 10px 0 #000;
}

.panel {
  position: relative;
  margin: 0;
  border: 4px solid #000;
  background: #111;
  overflow: hidden;
  animation: rise 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.panel-a { grid-area: a; animation-delay: 40ms; }
.panel-b { grid-area: b; animation-delay: 120ms; }
.panel-c { grid-area: c; animation-delay: 200ms; }
.panel-d { grid-area: d; animation-delay: 280ms; }

.panel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 220px;
  transition: transform 280ms ease;
}

.panel:hover img {
  transform: scale(1.03);
}

.panel-a img {
  min-height: 100%;
  aspect-ratio: 3 / 4;
}

.panel-d img {
  aspect-ratio: 16 / 9;
  max-height: 420px;
  width: 100%;
  object-position: center;
}

.balloon {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: 3px solid #000;
  border-radius: 1.1rem;
  background: #fff;
  font-weight: 700;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  box-shadow: 3px 3px 0 #000;
}

.stamp {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border: 3px solid #000;
  border-radius: 50%;
  background: var(--yellow);
  font-family: var(--display);
  font-size: 1.2rem;
  box-shadow: 2px 2px 0 #000;
}

.outro {
  padding: clamp(3rem, 9vh, 5.5rem) clamp(1rem, 3vw, 2.5rem) clamp(2.5rem, 6vh, 4rem);
  border-top: 6px solid #000;
  background:
    radial-gradient(circle at 1px 1px, rgba(17, 17, 17, 0.16) 1px, transparent 0),
    linear-gradient(180deg, #ffe56a 0%, var(--yellow) 100%);
  background-size: 10px 10px, auto;
}

.outro .burst {
  margin-top: 1.4rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2.5rem) 1.4rem;
  border-top: 4px solid #000;
  background: #111;
  color: #f3ead7;
  font-weight: 700;
  font-size: 0.95rem;
}

@keyframes slam {
  from {
    opacity: 0;
    transform: translate(-18px, 28px) rotate(-2deg) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: rotate(-18deg) scale(0.4);
  }
  to {
    opacity: 1;
    transform: rotate(-6deg) scale(1);
  }
}

@keyframes zoom-in {
  from {
    transform: scale(1.08);
  }
  to {
    transform: scale(1);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 800px) {
  .pages {
    grid-template-columns: 1fr;
    grid-template-areas:
      "a"
      "b"
      "c"
      "d";
    box-shadow: 6px 6px 0 #000;
  }

  .panel-a img,
  .panel-d img {
    aspect-ratio: 1;
    max-height: none;
  }

  .issue {
    top: auto;
    bottom: 1rem;
    right: 1rem;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
