:root {
  --wall: #d7a467;
  --paper: #f8f4e8;
  --line: rgba(90, 135, 200, .26);
  --margin: rgba(232, 66, 58, .45);
  --ink: #2b2420;
  --pencil: #5a524b;

  --red: #e8423a;
  --orange: #f08a24;
  --yellow: #f5c518;
  --green: #3aa64a;
  --blue: #2f6fd6;
  --purple: #8a4fc9;
  --navy: #1f2e5c;

  /* the wobbly marker-drawn rounded rectangle */
  --hand: 255px 22px 225px 22px / 22px 225px 22px 255px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 20px;
  line-height: 1.45;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .35' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .35  0 0 0 0 .2  0 0 0 0 .08  0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E"),
    repeating-linear-gradient(90deg, rgba(60,30,5,.16) 0 2px, transparent 2px 160px),
    var(--wall);
  overflow-x: hidden;
}

a { color: var(--blue); }

.defs { position: absolute; width: 0; height: 0; }

.crayon { filter: url(#crayon); }

/* ---------- header ---------- */

.top {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Cabin Sketch", cursive;
  font-size: 28px;
  color: #3a2310;
  text-decoration: none;
}
.brand svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--red);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top nav { display: flex; flex-wrap: wrap; gap: 10px; }
.top nav a {
  padding: 2px 14px;
  font-family: "Schoolbell", cursive;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--hand);
  box-shadow: 2px 3px 0 rgba(60,30,5,.35);
  transform: rotate(-2deg);
  transition: transform .12s;
}
.top nav a:nth-child(even) { transform: rotate(2deg); }
.top nav a:hover { transform: rotate(0) scale(1.06); }

/* ---------- paper sheets on the wall ---------- */

.sheet {
  --margin-x: 64px;
  /* fibers, then blotchy uneven tone */
  --fiber: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' seed='2'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .38  0 0 0 0 .28  0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --blotch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006' numOctaves='3' seed='5'/%3E%3CfeColorMatrix values='0 0 0 0 .55  0 0 0 0 .45  0 0 0 0 .3  0 0 0 .16 -.03'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23b)'/%3E%3C/svg%3E");
  --ruling:
    linear-gradient(90deg, transparent calc(var(--margin-x) - 2px), var(--margin) calc(var(--margin-x) - 2px) var(--margin-x), transparent var(--margin-x)),
    repeating-linear-gradient(transparent 0 33px, var(--line) 33px 34px) 0 22px;
  position: relative;
  isolation: isolate;
  max-width: 1000px;
  margin: 40px auto 70px;
  padding: 48px 56px 52px 84px;
  /* shadow follows the torn edge and holes, lifted more at the bottom like the paper curls */
  filter: drop-shadow(0 1px 1px rgba(40,20,0,.28)) drop-shadow(0 14px 12px rgba(60,30,5,.28));
}
/* the paper itself: torn edge via clip-path, real spiral holes via mask */
.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    var(--fiber),
    var(--blotch),
    radial-gradient(120% 90% at 40% 30%, rgba(255,255,255,.55), transparent 60%),
    linear-gradient(170deg, transparent 70%, rgba(120,90,50,.07)),
    var(--ruling),
    var(--paper);
  clip-path: polygon(2px 0, 100% 0, calc(100% - 1px) 50%, 100% 100%, 5px 100.0%, 2px 97.8%, 6px 95.7%, 0px 93.5%, 1px 91.3%, 1px 89.1%, 5px 87.0%, 0px 84.8%, 3px 82.6%, 0px 80.4%, 1px 78.3%, 6px 76.1%, 6px 73.9%, 1px 71.7%, 3px 69.6%, 1px 67.4%, 6px 65.2%, 0px 63.0%, 1px 60.9%, 3px 58.7%, 0px 56.5%, 6px 54.3%, 0px 52.2%, 3px 50.0%, 0px 47.8%, 2px 45.7%, 4px 43.5%, 6px 41.3%, 2px 39.1%, 1px 37.0%, 4px 34.8%, 2px 32.6%, 1px 30.4%, 3px 28.3%, 5px 26.1%, 1px 23.9%, 1px 21.7%, 0px 19.6%, 3px 17.4%, 7px 15.2%, 6px 13.0%, 5px 10.9%, 7px 8.7%, 7px 6.5%, 5px 4.3%, 4px 2.2%, 3px 0.0%);
  -webkit-mask: radial-gradient(circle at 27px 18px, transparent 6.5px, #000 7.5px) 0 0 / 100% 36px repeat-y;
  mask: radial-gradient(circle at 27px 18px, transparent 6.5px, #000 7.5px) 0 0 / 100% 36px repeat-y;
}

.hero { transform: rotate(-.8deg); margin-top: 24px; }
.client { transform: rotate(.6deg); }
.faq { transform: rotate(-.5deg); max-width: 760px; }

.grid-paper {
  --ruling:
    linear-gradient(rgba(80,130,210,.14) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, rgba(80,130,210,.14) 1px, transparent 1px) 0 0 / 26px 26px;
}

.pin {
  position: absolute;
  top: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: 2px 4px 4px rgba(0,0,0,.3);
  z-index: 2;
}
.pin.red { left: 22%; background: radial-gradient(circle at 35% 30%, #ff9c95, var(--red) 45%, #9c1f19); }
.pin.green { right: 22%; background: radial-gradient(circle at 35% 30%, #9be0a4, var(--green) 45%, #1d6a29); }
.pin.blue { left: 50%; background: radial-gradient(circle at 35% 30%, #a8c5ff, var(--blue) 45%, #173e86); }

.tape {
  position: absolute;
  width: 130px;
  height: 34px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 3px, transparent 3px 7px),
    rgba(255, 240, 190, .72);
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  z-index: 2;
}
.tape.tr { top: -14px; right: 50px; transform: rotate(5deg); }
.tape.tl { top: -14px; left: 70px; transform: rotate(-6deg); }

h2 {
  margin: 0 0 4px;
  font-family: "Cabin Sketch", cursive;
  font-weight: 700;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  color: var(--blue);
}
h3 {
  margin: 36px 0 10px;
  font-family: "Cabin Sketch", cursive;
  font-size: 34px;
  color: var(--purple);
}
.sub { margin: 0 0 8px; color: var(--pencil); }

/* ---------- hero ---------- */

.hero-head {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.hero h1 {
  margin: 0;
  font-family: "Cabin Sketch", cursive;
  font-weight: 700;
  font-size: clamp(38px, 12vw, 132px);
  line-height: 1;
  white-space: nowrap;
  letter-spacing: .01em;
}
.hero h1 span { display: inline-block; }
.hero h1 span:nth-child(odd) { transform: translateY(-4px) rotate(-3deg); }
.hero h1 span:nth-child(even) { transform: translateY(3px) rotate(3deg); }
.c1 { color: var(--red); }
.c2 { color: var(--orange); }
.c3 { color: var(--green); }
.c4 { color: var(--blue); }
.c5 { color: var(--purple); }

.hero-crab {
  width: clamp(70px, 12vw, 130px);
  height: clamp(70px, 12vw, 130px);
  fill: none;
  stroke: var(--red);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(12deg);
}

/* carnival ride ticket: notched ends via mask, shadow on the wrapper so the mask doesn't eat it */
.ticket-wrap {
  display: inline-block;
  margin: 18px 0 4px;
  filter: drop-shadow(1px 3px 2px rgba(60,20,10,.35));
  transform: rotate(-4deg);
}
.ticket {
  display: flex;
  align-items: stretch;
  color: #fff4d6;
  background:
    linear-gradient(rgba(255,255,255,.12), rgba(0,0,0,.06)),
    var(--red);
  -webkit-mask:
    radial-gradient(circle at 0 50%, transparent 11px, #000 12px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 11px, #000 12px) right / 51% 100% no-repeat;
  mask:
    radial-gradient(circle at 0 50%, transparent 11px, #000 12px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 11px, #000 12px) right / 51% 100% no-repeat;
}
.t-stub {
  display: grid;
  place-items: center;
  padding: 8px 14px 6px 22px;
  font-family: "Luckiest Guy", cursive;
  font-size: 14px;
  line-height: 1.1;
  text-align: center;
  letter-spacing: .06em;
  border-right: 3px dotted rgba(255,244,214,.75);
}
.t-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 26px 4px 16px;
  font-family: "Luckiest Guy", cursive;
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1;
  letter-spacing: .03em;
}
.t-main small {
  font-family: "Schoolbell", cursive;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .9;
}

.lede { max-width: 44ch; margin: 18px 0 24px; font-size: 24px; }

.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* fat rounded marker-drawn button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 26px;
  font-family: "Schoolbell", cursive;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: var(--hand);
  box-shadow: 4px 5px 0 var(--ink);
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translate(-1px, -2px) rotate(-1.5deg); box-shadow: 5px 7px 0 var(--ink); }
.btn:active { transform: translate(3px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn.off {
  background: #e7e2d6;
  color: var(--pencil);
  border-style: dashed;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.btn small {
  font-family: "Luckiest Guy", cursive;
  font-size: 13px;
  padding: 3px 7px 0;
  color: #fff;
  background: var(--red);
  border-radius: 6px;
  transform: rotate(6deg);
}

/* ---------- the crab coaster mural ---------- */

.ride { position: relative; margin: 26px -24px -26px -18px; }
.ride svg { display: block; width: 100%; height: auto; overflow: hidden; }
.ride-train { position: absolute; inset: 0; }

.ride-art { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ride-art .hills { fill: rgba(58,166,74,.16); stroke: none; }
.ride-art .sun circle { fill: var(--yellow); stroke: var(--orange); stroke-width: 3; }
.ride-art .sun path { stroke: var(--orange); stroke-width: 4; }
.ride-art .cloud { fill: #fff; stroke: #8fb3e0; stroke-width: 3; }
.ride-art .towers { stroke: var(--blue); stroke-width: 3; }
.ride-art .braces { stroke: var(--blue); stroke-width: 1.6; opacity: .7; }
.ride-art .platform { fill: var(--yellow); stroke: var(--ink); stroke-width: 2.5; }
.ride-art .posts { stroke: var(--ink); stroke-width: 4; }
.ride-art .roof { fill: var(--red); stroke: #7a1d18; stroke-width: 2.5; }
.ride-art .sign { fill: #fff; stroke: var(--ink); stroke-width: 2.5; }
.ride-art .station text { font-family: "Schoolbell", cursive; font-weight: 700; font-size: 15px; fill: var(--red); stroke: none; }
.ride-art .flag path { stroke: var(--ink); stroke-width: 3; }
.ride-art .flag .flag-cloth { fill: var(--red); stroke-width: 2; }
/* ties underneath, then a fat red stroke with a paper-colored stroke inside = two rails */
.ride-art .ties { stroke: #9a6a3a; stroke-width: 22; stroke-dasharray: 3 11; stroke-linecap: butt; }
.ride-art .rail { stroke: var(--red); stroke-width: 11; }
.ride-art .gap { stroke: var(--paper); stroke-width: 5; }
.ride-art .ground { stroke: var(--green); stroke-width: 4; }
.ride-art .grass { stroke: var(--green); stroke-width: 9; stroke-dasharray: 2 7; stroke-linecap: butt; }
.ride-art .labels text { font-family: "Schoolbell", cursive; font-weight: 700; font-size: 22px; stroke: none; }
.ride-art .l1 { fill: var(--purple); }
.ride-art .l2 { fill: var(--green); }
.ride-art .l3 { fill: var(--orange); }
.ride-art .l4 { fill: var(--blue); font-size: 18px !important; }

.car { stroke: #3a1a12; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.car .line { fill: none; stroke-width: 2.5; }
.car .crab-fill { fill: var(--red); }
.car .eye { fill: #fff; stroke-width: 1.5; }
.car .pupil { fill: #1a1210; stroke: none; }
.car .wheel { fill: #3a3330; stroke: none; }

.doodle {
  position: absolute;
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
}
.star.s1 { width: 54px; height: 54px; top: 50px; right: 70px; stroke: var(--orange); transform: rotate(12deg); }
.star.s2 { width: 34px; height: 34px; top: 130px; right: 160px; stroke: var(--green); transform: rotate(-10deg); }


/* scribbled review next to "the client" */
.review { width: 170px; height: 110px; top: 44px; right: 64px; transform: rotate(5deg); }
.review text { font-family: "Cabin Sketch", cursive; font-weight: 700; font-size: 32px; fill: var(--red); stroke: none; }
.review text.small { font-family: "Schoolbell", cursive; font-size: 19px; fill: var(--purple); }
.review use { fill: var(--yellow); stroke: var(--orange); stroke-width: 1.6; }

/* crab peeking out from behind a big question mark */
.ask { width: 140px; height: 170px; top: 40px; right: 60px; transform: rotate(-6deg); }
.ask text { font-family: "Cabin Sketch", cursive; font-weight: 700; font-size: 150px; fill: var(--purple); stroke: none; }
.ask .crab-ink { stroke: var(--red); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- client screenshot with scribbled notes ---------- */

.shot {
  position: relative;
  margin: 84px 10px 84px;
}

.photo {
  display: block;
  padding: 10px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
  transform: rotate(-1deg);
}
.photo img, .photo video {
  display: block;
  width: 100%;
  height: auto;
  background: #222;
}
.photo video { aspect-ratio: 16 / 9; object-fit: cover; }
/* tape only grabs the white border, never the picture */
.tape.on-photo { width: 110px; height: 24px; }
.tape.on-photo.a { top: -14px; left: calc(50% - 55px); transform: rotate(-3deg); }
.tape.on-photo.b { bottom: -14px; left: calc(50% - 55px); transform: rotate(2deg); }

.note {
  position: absolute;
  margin: 0;
  font-family: "Schoolbell", cursive;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.note svg {
  position: absolute;
  width: 74px;
  height: 56px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.n1 { top: -66px; left: 12%; color: var(--blue); transform: rotate(-3deg); }
.n1 svg { left: 100%; top: 8px; }
.n2 { top: -66px; right: 3%; color: var(--green); transform: rotate(3deg); }
.n2 svg { left: 34%; top: 100%; width: 46px; height: 84px; }
.n3 { bottom: -64px; left: 17%; color: var(--red); transform: rotate(-2deg); }
.n3 svg { right: 100%; bottom: 6px; transform: rotate(180deg); }

.note-list { display: none; }

/* ---------- how it works board ---------- */

.board {
  padding: 44px 48px 44px;
  background: #fbfbf8;
  border: 12px solid var(--navy);
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.08), 0 18px 34px rgba(60,30,5,.35);
}
.board { filter: none; isolation: auto; }
.board::before { display: none; }
.board h2 { color: var(--orange); }

.board-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 40px;
  align-items: center;
  margin-top: 18px;
}

.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 34px;
}
.steps li:last-child { padding-bottom: 0; }
/* dashed path between numbers */
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 60px;
  bottom: 4px;
  border-left: 3px dashed var(--pencil);
}
.steps .n {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  font-family: "Cabin Sketch", cursive;
  font-size: 32px;
  border: 3.5px solid currentColor;
  border-radius: 52% 46% 55% 44% / 47% 55% 43% 53%;
}
.steps li:nth-child(1) .n { color: var(--red); }
.steps li:nth-child(2) .n { color: var(--blue); }
.steps li:nth-child(3) .n { color: var(--green); }
.steps b { font-weight: 400; color: var(--navy); font-size: 23px; }

.photo-wrap { position: relative; }

/* the Crab loader that pops up over the clip, synced to the video */
.mc-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  container-type: inline-size;
  background: #000;
}
.mc .mc-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mc-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46%;
  z-index: 3;
  translate: -50% -50%;
  border-radius: 1.2cqw;
  box-shadow: 0 2cqw 5cqw rgba(0, 0, 0, 0.55);
  opacity: 0;
  scale: 0.94;
  transition: opacity 0.3s ease, scale 0.3s ease;
}
.mc-bar { transform-box: fill-box; transform-origin: left; transform: scaleX(0.05); transition: transform 0.6s ease; }
.mc[data-state="loader"] .mc-loader { opacity: 1; scale: 1; }

.works {
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px 18px;
  align-items: center;
}
.works dt { font-family: "Cabin Sketch", cursive; font-size: 26px; color: var(--navy); }
.works dd { margin: 0; display: flex; flex-wrap: wrap; gap: 10px 14px; }
/* each name circled in crayon */
.works span {
  padding: 2px 14px;
  font-family: "Schoolbell", cursive;
  font-size: 22px;
  border: 3px solid currentColor;
  border-radius: var(--hand);
  filter: url(#crayon);
}
.works span:nth-child(5n+1) { color: var(--red); transform: rotate(-2deg); }
.works span:nth-child(5n+2) { color: var(--blue); transform: rotate(2deg); }
.works span:nth-child(5n+3) { color: var(--green); transform: rotate(-1deg); }
.works span:nth-child(5n+4) { color: var(--orange); transform: rotate(3deg); }
.works span:nth-child(5n+5) { color: var(--purple); transform: rotate(-3deg); }
.fine { margin: 18px 0 0; color: var(--pencil); }

/* ---------- faq ---------- */

.faq h2 { color: var(--red); margin-bottom: 14px; }
.faq dl { margin: 0; }
.faq dt { font-family: "Schoolbell", cursive; font-weight: 700; font-size: 24px; color: var(--blue); }
.faq dd { margin: 0 0 16px 22px; }

/* ---------- footer ---------- */

.foot {
  padding: 0 16px 50px;
  text-align: center;
  font-family: "Schoolbell", cursive;
  color: #3a2310;
}

a:focus-visible { outline: 3px dashed var(--blue); outline-offset: 4px; }

/* ---------- small screens ---------- */

/* the doodles need the empty space beside the text, which runs out below this */
@media (max-width: 980px) {
  .review, .ask { display: none; }
}

@media (max-width: 820px) {
  .sheet { --margin-x: 44px; margin: 28px 12px 44px; padding: 40px 22px 40px 56px; }
  .sheet::before {
    -webkit-mask: radial-gradient(circle at 20px 16px, transparent 5px, #000 6px) 0 0 / 100% 32px repeat-y;
    mask: radial-gradient(circle at 20px 16px, transparent 5px, #000 6px) 0 0 / 100% 32px repeat-y;
  }
  /* zoom in on the station, lift hill, drop and loop */
  .ride { margin: 20px -14px -24px -24px; overflow: hidden; }
  .ride svg { width: 175%; max-width: none; }
  .ride-train { right: auto; }
  .board { padding: 32px 20px; border-width: 8px; }
  .board-body { grid-template-columns: minmax(0, 1fr); }
  .star.s2 { display: none; }
  .star.s1 { top: 18px; right: 18px; width: 40px; height: 40px; }

  .shot { margin: 30px 0 20px; }
  .tape.on-photo { width: 70px; height: 18px; }
  .tape.on-photo.a, .tape.on-photo.b { left: calc(50% - 35px); }
  .tape.on-photo.a { top: -10px; }
  .tape.on-photo.b { bottom: -10px; }
  .works { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .works dd { margin-bottom: 10px; }
  .note { display: none; }
  .note-list {
    display: block;
    margin: 18px 0 0;
    padding-left: 0;
    list-style: none;
    font-family: "Schoolbell", cursive;
    font-size: 22px;
  }
  .note-list li::before { content: "\2192  "; color: var(--red); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mc-bar, .mc-loader { transition: none; }
}
