:root {
  --grass: #4f9a3a;
  --deep: #2f6a25;
  --corgi: #d9772f;
  --red: #d6262b;
  --board: #f6f7f3;
  --marker: #2346a8;
  --cone: #ff7a1a;
  --ink: #1d1f1c;
  --note: #ffe066;
  --display: "Passion One", "Arial Black", sans-serif;
  --body: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Ubuntu Mono", "Courier New", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  background: var(--grass) url("/images/grass.webp") repeat;
  background-size: 360px;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a,
button {
  color: inherit;
  cursor: pointer;
}

p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.wrap {
  width: min(1180px, 100% - 32px);
  margin: 0 auto;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  background: var(--board);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn--red {
  color: #fff;
  background: var(--red);
}

.title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 900;
  line-height: 0.95;
  color: var(--board);
  text-shadow: 4px 4px 0 var(--deep);
  transform: rotate(-2deg);
  width: fit-content;
}

/* whiteboard look, shared by the hero and the toy */
.board {
  background: var(--board);
  border: 10px solid #c9ced3;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px #9aa1a8, 0 2px 0 3px #8c939a, 8px 12px 0 rgba(0, 0, 0, 0.25);
}

/* header: masking tape holding the logo and links */
.top {
  position: relative;
  z-index: 5;
  padding-top: 18px;
}

.tape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px;
  background: rgba(238, 225, 190, 0.94);
  transform: rotate(-0.8deg);
  clip-path: polygon(0 8%, 2% 0, 98% 6%, 100% 0, 99% 92%, 100% 100%, 1% 94%, 0 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.tape-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.5rem;
  text-decoration: none;
}

.tape-logo img {
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.tape-links {
  display: flex;
  gap: 6px;
}

.tape-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--marker);
  text-decoration: none;
}

.tape-links a:hover {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 3px;
}

/* hero */
.hero {
  padding: 28px 0 40px;
}

.hero-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 6px solid var(--ink);
  border-radius: 8px;
  background: var(--deep);
  box-shadow: 10px 12px 0 rgba(0, 0, 0, 0.25);
}

.hero-park {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.hero-board {
  position: absolute;
  left: 4%;
  top: 14%;
  width: 54%;
  padding: 3% 4% 4%;
  transform: rotate(-1.5deg);
}

.hero-title {
  margin: 0;
  font-family: var(--display);
  line-height: 0.82;
  color: var(--marker);
}

.hero-small {
  display: block;
  font-size: clamp(1.8rem, 4.2vw, 3.6rem);
  font-weight: 700;
}

.hero-big {
  position: relative;
  display: block;
  width: fit-content;
  padding: 0 0.05em 0.14em 0;
  font-size: clamp(3.6rem, 9vw, 8.2rem);
  font-weight: 900;
  text-transform: uppercase;
}

/* red marker swoosh under the name, the running dog crosses it */
.hero-big::after {
  content: "";
  position: absolute;
  left: -4%;
  right: 0.05em;
  bottom: 0;
  height: 0.12em;
  background: var(--red);
  border-radius: 40% 60% 50% 50%;
  transform: rotate(-2deg) skewX(-20deg);
}

.hero-small {
  text-transform: uppercase;
}

.hero-line {
  margin-top: 0.7em;
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.3vw, 2rem);
  color: var(--ink);
}

.hero-dog {
  position: absolute;
  left: 41%;
  top: 38%;
  width: 48%;
  filter: drop-shadow(6px 10px 0 rgba(0, 0, 0, 0.2));
  animation: charge-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

@keyframes charge-in {
  from {
    transform: translateX(-30%);
  }
  to {
    transform: none;
  }
}

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

/* the plan toy */
.plan {
  padding: 30px 0 50px;
}

.plan-intro {
  margin: 14px 0 22px;
  max-width: 34em;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 26px;
  align-items: start;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.step {
  display: flex;
  flex-direction: column;
  padding: 8px 8px 10px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  font: inherit;
  text-align: left;
  background: var(--board);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.step:nth-child(odd) {
  transform: rotate(-1.5deg);
}

.step:nth-child(even) {
  transform: rotate(1.2deg);
}

.step:hover {
  transform: translateY(-3px);
}

.step img {
  border-radius: 3px;
  aspect-ratio: 1;
  object-fit: cover;
}

.step span {
  margin-top: 8px;
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.05;
  color: var(--marker);
}

.step.is-picked {
  opacity: 0.45;
}

.step:disabled {
  cursor: default;
}

.plan-board {
  position: relative;
  padding: 20px 22px 18px;
}

.slots {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: slot;
  cursor: pointer;
}

.slot {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 12px;
  border: 3px dashed #b8bec4;
  border-radius: 6px;
  font-family: var(--display);
  font-size: 1.45rem;
  color: #a2a8ae;
  cursor: default;
  counter-increment: slot;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1), opacity 0.5s ease;
}

.slot::before {
  content: counter(slot);
  font-size: 2rem;
  color: var(--marker);
}

.slot.is-filled {
  border: 3px solid var(--marker);
  color: var(--marker);
  background: #fff;
  cursor: grab;
  touch-action: none;
}

.slot.is-dragging {
  cursor: grabbing;
  box-shadow: 4px 4px 0 var(--ink);
}

.slot-remove {
  margin-left: auto;
  min-width: 40px;
  min-height: 40px;
  border: 0;
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--red);
  background: none;
}

.odds {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-weight: 600;
}

.odds-number {
  font-family: var(--display);
  font-size: 3.4rem;
  line-height: 1;
  color: var(--marker);
  transform: rotate(-4deg);
}

.track {
  position: relative;
  height: 150px;
  margin-top: 10px;
  overflow: hidden;
  border-bottom: 4px solid var(--marker);
}

.track-sit {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 140px;
  width: auto;
  transition: opacity 0.15s ease;
}

.track-run {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 120px;
  width: auto;
  opacity: 0;
}

.track.is-running .track-sit {
  opacity: 0;
}

.track.is-running .track-run {
  opacity: 1;
  animation: run-across 0.9s cubic-bezier(0.5, 0, 0.8, 0.6) forwards;
}

@keyframes run-across {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(var(--track-width, 500px) + 20px));
  }
}

.plan-controls {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.result {
  min-height: 3em;
  margin-top: 14px;
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1.1;
}

.tally {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 1rem;
  color: #555b60;
}

.tally b {
  color: var(--red);
}

/* who he is: sticky notes */
.who {
  padding: 30px 0 50px;
}

.notes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 26px;
}

.note {
  position: relative;
  margin: 0;
  padding: 12px 12px 18px;
  background: var(--note);
  box-shadow: 4px 8px 0 rgba(0, 0, 0, 0.22);
}

.note::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 90px;
  height: 26px;
  margin-left: -45px;
  background: rgba(238, 225, 190, 0.9);
  transform: rotate(-4deg);
}

.note:nth-child(1) {
  transform: rotate(-2deg);
}

.note:nth-child(2) {
  transform: rotate(1.5deg) translateY(18px);
  background: #ffd0a6;
}

.note:nth-child(3) {
  transform: rotate(-1deg);
  background: #c9ecff;
}

.note:nth-child(4) {
  transform: rotate(2deg) translateY(12px);
  background: #d7f5b0;
}

.note p {
  margin-top: 12px;
  font-size: 1rem;
  line-height: 1.35;
}

.note b {
  display: block;
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--marker);
}

/* things slide in from the left, a little too far, then settle */
.can-slide .slide-in {
  translate: 0 18px;
}

.can-slide .slide-in.is-in {
  translate: 0 0;
  transition: translate 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.6);
}

/* the coin: a yellow sticky note */
.coin {
  padding: 40px 0 50px;
}

.sticky {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 34px 34px 30px;
  background: var(--note);
  transform: rotate(-1.5deg);
  box-shadow: 8px 14px 0 rgba(0, 0, 0, 0.22);
}

.sticky::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 130px;
  height: 30px;
  margin-left: -65px;
  background: rgba(238, 225, 190, 0.92);
  transform: rotate(3deg);
}

.ticker {
  font-family: var(--display);
  font-size: clamp(3rem, 9vw, 5.4rem);
  font-weight: 900;
  line-height: 0.9;
  color: var(--marker);
}

.sticky-line {
  margin-top: 8px;
  font-weight: 600;
}

.ca-box {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 3px solid var(--marker);
  border-radius: 4px;
  text-align: left;
  background: #fff8c9;
}

.ca-box[hidden] {
  display: none !important;
}

.ca-text {
  display: block;
  font-family: var(--mono);
  font-size: clamp(11px, 3.2vw, 18px);
  font-weight: 700;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.ca-status {
  display: block;
  margin-top: 4px;
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--red);
}

.sticky-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

/* footer */
.end {
  padding: 20px 0 40px;
}

.end-frame {
  position: relative;
  border: 6px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 10px 12px 0 rgba(0, 0, 0, 0.25);
}

.end-frame img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.end-title {
  position: absolute;
  left: 4%;
  top: 8%;
  padding: 6px 18px 10px;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1;
  color: var(--marker);
  background: var(--board);
  border: 6px solid #c9ced3;
  transform: rotate(-2deg);
}

.end-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
}

.end-note {
  max-width: 40em;
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* 404 */
.lost {
  padding: 30px 0 60px;
}

.lost-card {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
  align-items: center;
  padding: 30px;
}

.lost-title {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  line-height: 0.9;
  color: var(--marker);
}

.lost-card p {
  margin-bottom: 22px;
}

@media (max-width: 900px) {
  .plan-grid {
    grid-template-columns: 1fr;
  }

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

  .lost-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .hero-frame {
    aspect-ratio: 3 / 4;
  }

  .hero-board {
    left: 5%;
    top: 5%;
    width: 90%;
    padding: 5% 6% 6%;
  }

  .hero-big {
    font-size: clamp(3rem, 16vw, 4.6rem);
  }

  .hero-dog {
    left: 18%;
    top: auto;
    bottom: 4%;
    width: 78%;
  }

  .tape {
    padding: 6px 10px;
  }

  .tape-logo {
    font-size: 1.15rem;
    white-space: nowrap;
  }

  .tape-links a {
    padding: 0 8px;
    font-size: 1.1rem;
    white-space: nowrap;
  }

  .steps {
    gap: 10px;
  }

  .step {
    padding: 5px 5px 8px;
  }

  .step span {
    font-size: 0.95rem;
  }

  .notes {
    gap: 18px;
  }

  .note p {
    font-size: 0.9rem;
  }

  .sticky {
    padding: 28px 20px 24px;
  }

  .end-frame img {
    aspect-ratio: 4 / 3;
  }

  .end-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .tape-links a:first-child {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
