:root {
  --chalk: #FFF3CF;
  --tomato: #FF3B30;
  --duck: #FFD43B;
  --blue: #2457FF;
  --mint: #9BFFD5;
  --ink: #171717;
  --purple: #7B2CFF;
  --title: "Barriecito", system-ui, sans-serif;
  --sign: "Bricolage Grotesque", system-ui, sans-serif;
  --copy: "Atkinson Hyperlegible", Arial, sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --mono-duty: "sparingly for machine logs";
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--chalk);
  font-family: var(--copy);
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: .22;
  background-image:
    radial-gradient(var(--ink) .8px, transparent .8px),
    linear-gradient(90deg, rgba(255,59,48,.14) 1px, transparent 1px),
    linear-gradient(rgba(36,87,255,.1) 1px, transparent 1px);
  background-size: 11px 11px, 58px 58px, 58px 58px;
  mix-blend-mode: multiply;
}

.cursor-potato {
  position: fixed;
  left: 4vw;
  top: 65vh;
  width: 68px;
  height: 50px;
  border: 4px solid var(--ink);
  border-radius: 58% 42% 51% 49%;
  background: var(--duck);
  box-shadow: 8px 8px 0 var(--purple);
  z-index: 20;
  transform: rotate(-14deg);
  transition: transform .25s ease;
}

.cursor-potato span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--title);
  font-size: 2rem;
}

.lab-rail {
  position: fixed;
  left: 18px;
  top: 18px;
  z-index: 30;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: calc(100vw - 36px);
  padding: 8px 12px;
  border: 3px solid var(--ink);
  background: var(--mint);
  box-shadow: 5px 5px 0 var(--ink);
  font-family: var(--mono);
  font-size: .72rem;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.lab-rail b { color: var(--tomato); }

.scene {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(72px, 10vw, 120px) clamp(18px, 5vw, 74px) 46px;
  border-bottom: 8px solid var(--ink);
  isolation: isolate;
}

.worksheet-grid {
  position: absolute;
  inset: -12%;
  z-index: -2;
  background-image:
    linear-gradient(rgba(23,23,23,.13) 2px, transparent 2px),
    linear-gradient(90deg, rgba(23,23,23,.13) 2px, transparent 2px);
  background-size: 74px 74px;
  transform: rotate(-2.4deg);
}

.intake { background: var(--chalk); }
.button-room { background: var(--mint); }
.permanence { background: var(--duck); }
.parade { background: var(--chalk); }
.graduation { background: var(--blue); color: var(--chalk); }

.placard, .instruction-panel, .log-card, .progress-box, .certificate, .answer-sheet, .peel-sticker {
  border: 5px solid var(--ink);
  box-shadow: 9px 9px 0 var(--ink);
}

.placard {
  width: min(500px, 88vw);
  padding: 18px 20px;
  background: var(--mint);
  transform: rotate(-4deg);
}

.placard strong {
  display: block;
  font-family: var(--sign);
  font-size: clamp(2.2rem, 6vw, 5.2rem);
  line-height: .88;
}

.placard em { display: block; margin-top: 8px; font-style: normal; font-weight: 700; }

.machine { font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; }

.site-title {
  display: flex;
  flex-wrap: wrap;
  gap: .03em;
  max-width: 1120px;
  margin: 8vh 0 0 9vw;
  font-family: var(--title);
  font-size: clamp(5rem, 17vw, 16rem);
  line-height: .72;
  color: var(--ink);
}

.site-title span, .site-title i {
  display: inline-block;
  font-style: normal;
  text-shadow: 7px 7px 0 var(--duck), 12px 12px 0 var(--tomato);
  animation: letterDrop 1.2s both;
}

.site-title span:nth-child(2n) { transform: rotate(7deg) translateY(10px); color: var(--blue); }
.site-title span:nth-child(3n) { transform: rotate(-9deg) translateY(-6px); color: var(--tomato); }
.site-title i { font-size: .34em; align-self: flex-end; margin-left: .12em; color: var(--purple); }

@keyframes letterDrop {
  from { opacity: 0; transform: translateY(-70px) rotate(30deg); }
}

.robot-head {
  position: absolute;
  right: 9vw;
  bottom: 15vh;
  width: clamp(150px, 22vw, 260px);
  aspect-ratio: 1;
  border: 7px solid var(--ink);
  border-radius: 28px 42px 30px 38px;
  background: var(--mint);
  box-shadow: 13px 13px 0 var(--purple);
  transform: rotate(7deg);
  animation: wobble 4s infinite steps(2, end);
}

.antenna {
  position: absolute;
  left: 45%;
  top: -44px;
  width: 12px;
  height: 44px;
  background: var(--ink);
}

.antenna::after {
  content: "";
  position: absolute;
  left: -14px;
  top: -24px;
  width: 38px;
  height: 38px;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: var(--duck);
}

.eye {
  position: absolute;
  top: 36%;
  width: 34px;
  height: 48px;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: var(--chalk);
  animation: blink 4.8s infinite;
}

.eye.left { left: 24%; }
.eye.right { right: 24%; transform: scaleY(.55); }

.mouth {
  position: absolute;
  left: 24%;
  bottom: 22%;
  padding: 5px 15px;
  border: 4px solid var(--ink);
  background: var(--chalk);
  font-family: var(--mono);
  transform: rotate(-4deg);
}

@keyframes blink { 47%, 51% { transform: scaleY(.08); } }
@keyframes wobble { 50% { transform: rotate(-4deg) translateX(8px); } }

.bad-button, .self-button {
  border: 6px solid var(--ink);
  background: var(--duck);
  color: var(--ink);
  font-family: var(--sign);
  font-size: clamp(1.1rem, 2.4vw, 2rem);
  font-weight: 800;
  padding: 18px 24px;
  box-shadow: 8px 8px 0 var(--tomato);
  cursor: pointer;
  transform: rotate(3deg);
}

.dodge { position: absolute; left: 11vw; bottom: 12vh; }
.bad-button:hover { transform: rotate(-4deg) translate(18px, -8px); }

.wandering-note {
  position: absolute;
  max-width: 320px;
  padding: 12px 14px;
  border: 4px dashed var(--tomato);
  background: var(--chalk);
  font-weight: 700;
}

.note-a { right: 34vw; top: 24vh; transform: rotate(8deg); }
.note-b { right: 9vw; bottom: 12vh; transform: rotate(-5deg); }

.stamp {
  position: absolute;
  border: 7px solid currentColor;
  padding: 7px 14px;
  font-family: var(--sign);
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 800;
  opacity: .88;
  transform: rotate(-17deg);
  color: var(--tomato);
  mix-blend-mode: multiply;
}

.probably { right: 7vw; top: 15vh; }
.approved { left: 9vw; bottom: 15vh; color: var(--duck); transform: rotate(13deg); }

.doodle-arrow {
  position: absolute;
  width: min(320px, 42vw);
  fill: none;
  stroke: var(--tomato);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: overshoot 2.7s infinite cubic-bezier(.3,1.6,.6,1);
}

.arrow-one { left: 55vw; top: 44vh; }
.arrow-two { left: 6vw; bottom: 10vh; stroke: var(--blue); }

@keyframes overshoot { 50% { transform: translate(34px, -18px) rotate(9deg); } }

.warning-curtain {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(115deg, var(--duck) 0 28px, var(--ink) 28px 42px, var(--tomato) 42px 70px, transparent 70px 118px);
  opacity: .18;
}

.room-label {
  width: max-content;
  max-width: 88vw;
  padding: 12px 18px;
  border: 5px solid var(--ink);
  background: var(--chalk);
  color: var(--ink);
  box-shadow: 7px 7px 0 var(--tomato);
  transform: rotate(-2deg);
}

.room-label span { font-family: var(--mono); font-weight: 700; color: var(--blue); }
.room-label h2 { margin: 2px 0 0; font-family: var(--sign); font-size: clamp(2rem, 5vw, 5.6rem); line-height: .9; }

.giant-finger {
  position: absolute;
  right: 5vw;
  top: 18vh;
  width: min(380px, 46vw);
  padding: 30px;
  border: 8px solid var(--ink);
  border-radius: 90px 90px 36px 36px;
  background: var(--tomato);
  color: var(--chalk);
  font-family: var(--title);
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: .75;
  text-align: center;
  box-shadow: 13px 13px 0 var(--purple);
  transform: rotate(12deg);
}

.giant-finger small { font-family: var(--mono); font-size: .18em; }

.button-stage { position: absolute; left: 12vw; top: 45vh; }
.self-button { font-size: clamp(2rem, 5vw, 5rem); transition: transform .28s ease; }
.self-button.flee { transform: translateX(90px) rotate(-12deg); }

.peel-sticker {
  position: absolute;
  left: 58%;
  top: 92%;
  width: 260px;
  padding: 13px;
  background: var(--chalk);
  font-weight: 700;
  opacity: 0;
  transform: translateY(30px) rotate(9deg);
  transition: .35s ease;
}

.peel-sticker.show { opacity: 1; transform: translateY(0) rotate(9deg); }

.instruction-panel {
  position: absolute;
  left: 38vw;
  bottom: 10vh;
  max-width: 390px;
  padding: 20px;
  background: var(--chalk);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
  transform: rotate(-6deg);
}

.log-card {
  position: absolute;
  left: 50vw;
  top: 28vh;
  padding: 15px;
  background: var(--ink);
  color: var(--mint);
  font-family: var(--mono);
  transform: rotate(4deg);
}

.loading-object { position: absolute; left: 10vw; top: 38vh; width: 420px; height: 280px; }
.hole {
  position: absolute;
  left: 20px;
  top: 32px;
  width: 210px;
  height: 210px;
  display: grid;
  place-items: center;
  border: 8px solid var(--ink);
  border-radius: 50%;
  background: var(--chalk);
  font-family: var(--sign);
  font-weight: 800;
  text-align: center;
}

.block {
  position: absolute;
  right: 20px;
  top: 12px;
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  border: 8px solid var(--ink);
  background: var(--purple);
  color: var(--chalk);
  font-family: var(--sign);
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 11px 11px 0 var(--tomato);
  animation: wrongFit 3.2s infinite;
}

@keyframes wrongFit { 50% { transform: translate(-130px, 38px) rotate(45deg); } }

.progress-box {
  position: absolute;
  right: 10vw;
  top: 38vh;
  width: min(460px, 82vw);
  padding: 20px;
  background: var(--chalk);
  color: var(--ink);
  transform: rotate(2deg);
}

.progress-track { height: 42px; border: 5px solid var(--ink); margin: 12px 0; background: #FFF3CF; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: repeating-linear-gradient(90deg, var(--blue) 0 24px, var(--mint) 24px 42px, var(--tomato) 42px 52px); transition: width .2s linear; }
#progressText { font-family: var(--title); font-size: 3rem; color: var(--tomato); }

.thought-cloud {
  position: absolute;
  right: 28vw;
  bottom: 10vh;
  padding: 28px 36px;
  border: 6px solid var(--ink);
  border-radius: 50%;
  background: var(--purple);
  color: var(--chalk);
  font-family: var(--title);
  font-size: 3rem;
  text-align: center;
  box-shadow: 10px 10px 0 var(--ink);
  animation: floatCloud 3s infinite ease-in-out;
}

.thought-cloud small { font-family: var(--mono); font-size: .22em; }
@keyframes floatCloud { 50% { transform: translateY(-18px) rotate(-5deg); } }

.eraser-dust span, .confetti-field i {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--chalk);
  border: 3px solid var(--ink);
  animation: dust 4s infinite;
}

.eraser-dust span:nth-child(1) { left: 42%; top: 34%; }
.eraser-dust span:nth-child(2) { left: 51%; top: 48%; animation-delay: .4s; }
.eraser-dust span:nth-child(3) { left: 36%; top: 62%; animation-delay: .8s; }
.eraser-dust span:nth-child(4) { left: 69%; top: 69%; animation-delay: 1.2s; }
.eraser-dust span:nth-child(5) { left: 74%; top: 30%; animation-delay: 1.6s; }
@keyframes dust { 50% { transform: translate(20px, -26px) rotate(80deg); opacity: .35; } }

.answer-sheet {
  position: absolute;
  left: 8vw;
  top: 30vh;
  width: min(560px, 84vw);
  padding: 24px;
  background: var(--chalk);
  transform: rotate(-3deg);
}

.choice {
  position: relative;
  display: grid;
  grid-template-columns: 48px 70px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  margin: 9px 0;
  font-family: var(--sign);
  font-size: 1.35rem;
  font-weight: 800;
}

.choice b { color: var(--blue); font-family: var(--title); font-size: 2.8rem; }
.choice span { width: 48px; height: 48px; border: 5px solid var(--ink); border-radius: 50%; background: var(--chalk); }
.choice em { font-style: normal; }
.choice.chosen span::after, .choice.runaway span::after {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tomato);
  transform: translate(48px, -9px);
}
.choice.runaway { animation: runaway 3s infinite steps(3, end); }
@keyframes runaway { 50% { transform: translateX(52px) rotate(5deg); } }

.red-pencil {
  position: absolute;
  right: 13vw;
  top: 34vh;
  padding: 18px 30px;
  border: 7px solid var(--tomato);
  color: var(--tomato);
  font-family: var(--title);
  font-size: clamp(4rem, 11vw, 10rem);
  transform: rotate(-18deg);
  animation: stampHit 2.4s infinite;
}
@keyframes stampHit { 45% { transform: rotate(-18deg) scale(1.25); } 55% { transform: rotate(-18deg) scale(.92); } }

.confetti-field i:nth-child(1) { left: 65%; top: 72%; background: var(--purple); }
.confetti-field i:nth-child(2) { left: 72%; top: 58%; background: var(--duck); animation-delay: .2s; }
.confetti-field i:nth-child(3) { left: 83%; top: 67%; background: var(--blue); animation-delay: .4s; }
.confetti-field i:nth-child(4) { left: 58%; top: 42%; background: var(--tomato); animation-delay: .6s; }
.confetti-field i:nth-child(5) { left: 90%; top: 39%; background: var(--mint); animation-delay: .8s; }
.confetti-field i:nth-child(6) { left: 49%; top: 80%; background: var(--purple); animation-delay: 1s; }
.confetti-field i:nth-child(7) { left: 76%; top: 24%; background: var(--duck); animation-delay: 1.2s; }
.confetti-field i:nth-child(8) { left: 61%; top: 21%; background: var(--blue); animation-delay: 1.4s; }

.parade-panel { right: 6vw; left: auto; bottom: 10vh; }

.certificate {
  position: absolute;
  left: 10vw;
  top: 26vh;
  width: min(620px, 84vw);
  padding: 28px;
  background: var(--chalk);
  color: var(--ink);
  transform: rotate(2deg);
}

.certificate h3 { margin: 10px 0; font-family: var(--title); font-size: clamp(2.8rem, 7vw, 6.4rem); line-height: .82; }
.certificate p { max-width: 440px; font-size: 1.15rem; font-weight: 700; }
.ribbon {
  position: absolute;
  right: -30px;
  top: 35%;
  width: 130px;
  height: 130px;
  display: grid;
  place-items: center;
  border: 6px solid var(--ink);
  border-radius: 50%;
  background: var(--tomato);
  color: var(--chalk);
  font-family: var(--title);
  font-size: 3rem;
  transform: rotate(-14deg);
}

.graduate { right: 12vw; bottom: 22vh; background: var(--duck); box-shadow: 13px 13px 0 var(--tomato); }
.final { position: absolute; right: 8vw; bottom: 8vh; }

.scene.is-active .room-label, .scene.is-active .placard { animation: rubberStamp .55s cubic-bezier(.2,1.8,.5,1); }
@keyframes rubberStamp { from { transform: scale(1.9) rotate(-18deg); opacity: .1; } }

@media (max-width: 800px) {
  .cursor-potato { display: none; }
  .robot-head, .giant-finger, .instruction-panel, .log-card, .progress-box, .thought-cloud, .certificate, .red-pencil, .answer-sheet, .loading-object, .button-stage { position: relative; left: auto; right: auto; top: auto; bottom: auto; margin: 28px 0; }
  .scene { min-height: auto; padding-bottom: 80px; }
  .site-title { margin-left: 0; }
  .dodge, .final { position: relative; left: auto; right: auto; bottom: auto; margin-top: 24px; }
  .wandering-note, .stamp, .doodle-arrow { display: none; }
  .loading-object { width: min(420px, 90vw); }
  .peel-sticker { left: 10px; width: 230px; }
}
