:root {
  --paper: #eef5c8;
  --paper-deep: #dce891;
  --ink: #11110f;
  --purple: #6f47b7;
  --purple-dark: #271235;
  --red: #ec392f;
  --green: #9ab43c;
  --gray: #d9d9cb;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(17, 17, 15, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(17, 17, 15, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 46px 46px;
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 24%, rgba(236, 57, 47, 0.14), transparent 18rem),
    radial-gradient(circle at 82% 64%, rgba(111, 71, 183, 0.18), transparent 20rem);
  opacity: 0.9;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.topbar {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  display: flex;
  gap: 10px;
}

.topbar a {
  min-width: 58px;
  padding: 11px 13px;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: "Courier New", monospace;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.hero {
  position: relative;
  min-height: 92vh;
  padding: 84px clamp(18px, 5vw, 76px) 34px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.72fr);
  align-items: center;
  gap: clamp(22px, 4vw, 60px);
  border-bottom: 5px solid var(--ink);
}

.hero-copy,
.hero-frame {
  position: relative;
  z-index: 2;
}

.case-id,
.stamp,
.hero-note,
.hero-frame figcaption,
.copy {
  font-family: "Courier New", Courier, monospace;
  font-weight: 900;
}

.case-id {
  display: inline-block;
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 3px solid var(--ink);
  background: var(--gray);
  box-shadow: 4px 4px 0 var(--red);
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.86;
  text-transform: uppercase;
}

h1 {
  max-width: 950px;
  font-size: clamp(84px, 15vw, 228px);
  text-shadow:
    7px 7px 0 var(--red),
    14px 14px 0 var(--purple);
}

.hero-line {
  max-width: 820px;
  margin: 32px 0 0;
  padding: 18px 20px;
  border: 4px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  box-shadow: 8px 8px 0 var(--red);
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(24px, 4vw, 54px);
  font-weight: 900;
  line-height: 1.02;
  text-transform: uppercase;
}

.hero-note {
  margin: 28px 0 0;
  font-size: clamp(18px, 2vw, 26px);
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.btn,
.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 15px 24px;
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  font-weight: 950;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.btn:hover,
.copy:hover {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-primary {
  min-width: 160px;
  background: var(--red);
  color: var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 28px;
}

.btn-secondary {
  background: var(--paper);
  font-family: "Courier New", monospace;
  font-size: 16px;
}

.hero-frame {
  position: relative;
  margin: 0;
  transform: rotate(3deg);
  animation: idleTilt 5s ease-in-out infinite;
}

.hero-frame::before {
  content: "ESC";
  position: absolute;
  top: -38px;
  left: -26px;
  z-index: 2;
  width: 102px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 5px solid var(--ink);
  background: var(--red);
  box-shadow: 7px 7px 0 var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 44px;
}

.hero-frame img {
  display: block;
  width: min(100%, 540px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 6px solid var(--ink);
  box-shadow: 16px 16px 0 var(--red), 24px 24px 0 var(--purple);
}

.hero-frame figcaption {
  width: max-content;
  max-width: 92%;
  margin: 16px 0 0 auto;
  padding: 9px 12px;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
  text-transform: uppercase;
}

.paper-mark {
  position: absolute;
  z-index: 1;
  border: 4px solid var(--red);
  color: var(--red);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(24px, 3vw, 48px);
  line-height: 0.95;
  padding: 10px 14px;
  text-transform: uppercase;
  transform: rotate(-8deg);
  opacity: 0.8;
}

.paper-one {
  left: 7%;
  bottom: 38px;
}

.paper-two {
  right: 12%;
  top: 106px;
  transform: rotate(7deg);
}

.ticker {
  overflow: hidden;
  border-bottom: 5px solid var(--ink);
  background: var(--purple);
  color: var(--paper);
}

.ticker-track {
  width: max-content;
  display: flex;
  gap: 34px;
  padding: 17px 0;
  animation: marquee 22s linear infinite;
}

.ticker span {
  font-family: "Courier New", Courier, monospace;
  font-size: 22px;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.file-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: clamp(22px, 4vw, 56px);
  padding: clamp(52px, 7vw, 96px) clamp(18px, 5vw, 76px);
  border-bottom: 5px solid var(--ink);
}

.incident {
  position: relative;
  padding: clamp(26px, 5vw, 52px);
  border: 6px solid var(--ink);
  background: var(--purple-dark);
  color: var(--paper);
  box-shadow: 14px 14px 0 var(--red);
}

.incident .stamp,
.closing .stamp {
  display: inline-block;
  margin: 0 0 22px;
  padding: 9px 12px;
  border: 3px solid currentColor;
  color: var(--red);
  transform: rotate(-3deg);
  text-transform: uppercase;
}

.incident h2,
.inventory h2,
.rule h2,
.closing h2 {
  font-size: clamp(52px, 7vw, 118px);
}

.incident p:not(.stamp),
.rule p:not(.case-id, .prompt),
.closing p:not(.stamp) {
  max-width: 850px;
  font-size: clamp(20px, 2.2vw, 34px);
  font-weight: 850;
  line-height: 1.16;
}

.inventory {
  padding: 24px;
  border: 5px solid var(--ink);
  background: var(--paper-deep);
  box-shadow: 10px 10px 0 var(--ink);
  align-self: start;
  transform: rotate(1.2deg);
}

.inventory h2 {
  margin-bottom: 18px;
  font-size: clamp(42px, 5vw, 82px);
}

.inventory dl {
  margin: 0;
  border-top: 4px solid var(--ink);
}

.inventory div {
  display: grid;
  grid-template-columns: 0.86fr 1.2fr;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 3px solid var(--ink);
}

.inventory dt,
.inventory dd {
  margin: 0;
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  font-weight: 950;
  text-transform: uppercase;
}

.inventory dt {
  color: var(--purple-dark);
}

.rule {
  padding: clamp(58px, 8vw, 110px) clamp(18px, 5vw, 76px);
  border-bottom: 5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.rule-inner {
  max-width: 1180px;
}

.rule .case-id {
  color: var(--ink);
}

.rule h2 {
  max-width: 1020px;
  text-shadow: 6px 6px 0 var(--red);
}

.prompt {
  margin: 34px 0 0;
  color: var(--red);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(104px, 18vw, 260px);
  line-height: 0.78;
  text-transform: uppercase;
  animation: blink 1.35s steps(2, start) infinite;
}

.closing {
  min-height: 72vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  gap: 28px;
  align-items: center;
  padding: clamp(54px, 8vw, 110px) clamp(18px, 5vw, 76px);
  background:
    linear-gradient(135deg, rgba(236, 57, 47, 0.2) 0 25%, transparent 25% 50%, rgba(111, 71, 183, 0.2) 50% 75%, transparent 75%),
    var(--paper);
  background-size: 64px 64px;
}

.closing h2 {
  font-size: clamp(78px, 12vw, 180px);
  text-shadow: 7px 7px 0 var(--red);
}

.ca-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 5px solid var(--ink);
  background: var(--purple);
  box-shadow: 12px 12px 0 var(--ink);
}

.ca-panel .btn {
  width: 100%;
}

.copy {
  width: 100%;
  min-width: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes idleTilt {
  0%,
  100% {
    transform: rotate(3deg) translateY(0);
  }

  50% {
    transform: rotate(-1deg) translateY(-8px);
  }
}

@keyframes blink {
  0%,
  42% {
    opacity: 1;
  }

  43%,
  70% {
    opacity: 0.18;
  }

  71%,
  100% {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .topbar {
    position: absolute;
  }

  .hero,
  .file-band,
  .closing {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 92px;
  }

  .hero-frame {
    justify-self: center;
  }

  .paper-mark {
    display: none;
  }

  .inventory div {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

@media (max-width: 560px) {
  .topbar {
    left: 12px;
    right: 12px;
    justify-content: flex-end;
  }

  .topbar a {
    min-width: 52px;
    padding: 9px 10px;
  }

  h1 {
    font-size: 76px;
    text-shadow: 4px 4px 0 var(--red), 8px 8px 0 var(--purple);
  }

  .hero-line {
    font-size: 24px;
  }

  .btn,
  .copy {
    width: 100%;
  }

  .hero-frame::before {
    top: -24px;
    left: -12px;
    width: 72px;
    height: 54px;
    font-size: 31px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
