:root {
  --red: #E94135;
  --yellow: #FFD84D;
  --teal: #13A8A1;
  --purple: #6C4BD8;
  --cream: #FFF4D6;
  --ink: #29231D;
  --green: #75B843;
  --metal: #bfc7bd;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "Atkinson Hyperlegible", sans-serif;
  overflow-x: hidden;
}

.wax-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(41,35,29,.08) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 12%, rgba(233,65,53,.1) 0 1px, transparent 2px),
    linear-gradient(115deg, rgba(255,255,255,.42), transparent 48%, rgba(41,35,29,.05));
  background-size: 34px 34px, 47px 47px, 100% 100%;
  mix-blend-mode: multiply;
}

.sticker-nav {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-sticker {
  font-family: "Kalam", cursive;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 13px 6px;
  border: 2px solid var(--ink);
  border-radius: 999px 14px 999px 18px;
  box-shadow: 3px 4px 0 rgba(41,35,29,.25);
  transform: rotate(var(--tilt, -2deg));
  transition: transform .22s ease, box-shadow .22s ease;
}

.nav-sticker:hover { transform: translateY(-4px) rotate(2deg); box-shadow: 6px 8px 0 rgba(41,35,29,.2); }
.nav-sticker.red { background: var(--red); color: var(--cream); --tilt: -3deg; }
.nav-sticker.teal { background: var(--teal); color: var(--cream); --tilt: 2deg; }
.nav-sticker.purple { background: var(--purple); color: var(--cream); --tilt: -1deg; }
.nav-sticker.green { background: var(--green); --tilt: 3deg; }
.nav-sticker.yellow { background: var(--yellow); --tilt: -2deg; }

.journey { position: relative; z-index: 1; }
.scene {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 92px 5vw 52px;
  isolation: isolate;
}

.latch-scene {
  perspective: 1400px;
  background:
    linear-gradient(90deg, rgba(41,35,29,.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(41,35,29,.055) 1px, transparent 1px),
    var(--cream);
  background-size: 54px 54px;
}

.table-note {
  position: absolute;
  background: var(--yellow);
  padding: 16px 22px;
  border: 2px solid var(--ink);
  box-shadow: 8px 9px 0 rgba(41,35,29,.17);
  font-family: "Kalam", cursive;
  font-weight: 700;
}
.note-one { left: 6vw; top: 24vh; transform: rotate(-8deg); }
.note-two { right: 7vw; bottom: 18vh; transform: rotate(7deg); background: var(--cream); }

.lunchbox { width: min(82vw, 850px); height: min(58vw, 520px); position: relative; transform: rotateX(55deg) rotateZ(-5deg); transform-style: preserve-3d; }
.lid {
  position: absolute;
  inset: 0;
  border-radius: 46px;
  border: 7px solid var(--ink);
  background:
    radial-gradient(ellipse at 28% 20%, rgba(255,255,255,.45), transparent 28%),
    repeating-linear-gradient(105deg, rgba(255,255,255,.09) 0 7px, transparent 8px 24px),
    var(--red);
  box-shadow: 0 30px 0 #ad2d25, 0 42px 42px rgba(41,35,29,.42), inset 0 0 0 14px rgba(255,244,214,.12);
  transform-origin: 50% 0%;
  transition: transform .9s cubic-bezier(.2,1.25,.25,1), box-shadow .7s ease;
}
body.box-open .lid { transform: rotateX(-72deg) translateY(-24px); box-shadow: 0 12px 0 #ad2d25, 0 25px 32px rgba(41,35,29,.25), inset 0 0 0 14px rgba(255,244,214,.12); }

.lid h1 {
  position: absolute;
  inset: 30% 9% auto;
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(3rem, 9vw, 8.5rem);
  color: var(--red);
  text-shadow: -2px -2px 0 rgba(255,244,214,.45), 3px 4px 0 #9b2821, 0 0 0 var(--ink);
  letter-spacing: -.05em;
  filter: drop-shadow(0 2px 0 rgba(41,35,29,.55));
}

.latch {
  position: absolute;
  left: 50%;
  bottom: -38px;
  width: 120px;
  height: 66px;
  transform: translateX(-50%);
  border: 5px solid var(--ink);
  border-radius: 20px 20px 28px 28px;
  background: linear-gradient(#e5eadf, var(--metal));
  box-shadow: 0 9px 0 rgba(41,35,29,.35);
  cursor: pointer;
  transition: transform .2s ease;
}
.latch span { display: block; width: 48px; height: 12px; margin: 18px auto; border-radius: 20px; background: var(--ink); }
body.box-open .latch { transform: translateX(-50%) rotateX(42deg) translateY(13px); }
.hinge { position: absolute; top: -26px; width: 128px; height: 42px; background: var(--metal); border: 5px solid var(--ink); border-radius: 20px; z-index: -1; }
.hinge-left { left: 14%; } .hinge-right { right: 14%; }
.tray-shadow { position: absolute; inset: 22px; border-radius: 42px; background: var(--teal); border: 7px solid var(--ink); transform: translateZ(-70px); opacity: .42; }

.sticker { position: absolute; border: 3px solid var(--ink); font-family: "Kalam", cursive; font-weight: 700; box-shadow: 4px 5px 0 rgba(41,35,29,.25); transition: transform .28s cubic-bezier(.2,1.5,.3,1); }
.sticker.peeled { transform: rotate(-14deg) translateY(-12px) scale(1.06); }
.sticker-build { left: 15%; top: 18%; background: var(--yellow); padding: 12px 24px; border-radius: 20px 999px 18px 999px; transform: rotate(-13deg); }
.sticker-api { right: 20%; top: 20%; background: var(--purple); color: var(--cream); padding: 12px 18px; border-radius: 12px; transform: rotate(9deg); }
.sticker-ok { right: 12%; bottom: 22%; background: var(--green); padding: 10px 18px; border-radius: 999px; transform: rotate(-5deg); }
.enamel-chip { position: absolute; background: var(--ink); border-radius: 50%; opacity: .55; }
.chip-a { left: 9%; bottom: 21%; width: 32px; height: 20px; } .chip-b { right: 31%; top: 13%; width: 22px; height: 14px; }
.scratch { position: absolute; width: 120px; height: 3px; background: rgba(255,244,214,.55); border-radius: 10px; transform: rotate(-12deg); }
.scratch-a { left: 31%; top: 22%; } .scratch-b { right: 19%; bottom: 32%; }
.chapter-ticket { position: absolute; bottom: 30px; font-family: "Fraunces", serif; max-width: 580px; text-align: center; background: var(--cream); border: 2px dashed var(--ink); padding: 14px 18px; }

.scene-label { position: absolute; top: 88px; left: 6vw; font-family: "Fredoka", sans-serif; font-size: clamp(3rem, 10vw, 8rem); color: var(--red); text-shadow: 4px 5px 0 var(--yellow); transform: rotate(-4deg); z-index: -1; }
.open-lunchbox, .trade-board, .refill-box, .memory-box { width: min(1100px, 92vw); }
.inside-lid { min-height: 140px; border: 6px solid var(--ink); border-radius: 36px 36px 16px 16px; background: var(--red); box-shadow: 0 18px 0 rgba(41,35,29,.16); padding: 22px; display: flex; align-items: center; justify-content: space-around; gap: 20px; transform: rotate(-2deg); }
.lid-strip, .barcode, .hand-arrow { background: var(--cream); border: 3px solid var(--ink); padding: 12px 18px; box-shadow: 4px 5px 0 rgba(41,35,29,.25); }
.lid-strip { font-family: "Fraunces", serif; font-weight: 800; } .barcode { font-family: "Atkinson Hyperlegible", sans-serif; background: repeating-linear-gradient(90deg, var(--ink) 0 3px, var(--cream) 3px 8px); color: transparent; text-shadow: 0 38px 0 var(--ink); overflow: hidden; height: 45px; } .hand-arrow { font-family: "Kalam", cursive; background: var(--yellow); }

.bento-tray { margin-top: 28px; padding: 26px; border: 7px solid var(--ink); border-radius: 40px; background: var(--teal); box-shadow: 0 18px 0 #0b6c68, 0 32px 38px rgba(41,35,29,.25); display: grid; grid-template-columns: 1.2fr .8fr; grid-template-rows: 260px 220px; gap: 22px; }
.well { position: relative; overflow: hidden; border: 5px solid var(--ink); border-radius: 32px; background: var(--cream); padding: 24px; box-shadow: inset 0 0 0 8px rgba(41,35,29,.06), 5px 6px 0 rgba(41,35,29,.22); cursor: pointer; transition: transform .3s ease, box-shadow .3s ease; }
.well:hover, .well.active { transform: scale(1.025) rotate(-1deg); box-shadow: inset 0 0 0 8px rgba(41,35,29,.06), 10px 13px 0 rgba(41,35,29,.2); }
.well h2, .silicone-cup h2, .half-lid h2 { margin: 0 0 12px; font-family: "Fraunces", serif; font-size: clamp(1.4rem, 3vw, 2.4rem); }
.well p { max-width: 34ch; line-height: 1.45; margin: 10px 0 0; }
.sandwich-well { grid-row: span 2; background: #FFF4D6; }
.apple-well { background: var(--yellow); } .grape-well { background: #eee5ff; } .sauce-well { background: #f8ded5; }
.wrapper-corner { position: absolute; right: -20px; top: -20px; width: 140px; height: 120px; background: repeating-linear-gradient(45deg, var(--cream) 0 10px, rgba(19,168,161,.35) 10px 20px); border: 4px solid var(--ink); transform: rotate(12deg); transition: transform .35s ease; }
.well:hover .wrapper-corner { transform: rotate(32deg) translate(12px,-18px); }
.sandwich-stack { position: relative; height: 190px; margin-top: 20px; }
.sandwich { position: absolute; width: 190px; height: 150px; clip-path: polygon(0 0, 100% 50%, 0 100%); background: linear-gradient(90deg, #f8df9a 0 16%, var(--green) 17% 31%, #fff 32% 48%, #e88b57 49% 67%, #f8df9a 68%); border: 5px solid var(--ink); filter: drop-shadow(8px 10px 0 rgba(41,35,29,.2)); }
.sandwich.left { left: 10%; transform: rotate(-13deg); } .sandwich.right { left: 38%; transform: rotate(180deg) rotate(-8deg); }
.apple-slices, .grapes { display: flex; gap: 10px; flex-wrap: wrap; }
.apple-slices span { width: 72px; height: 42px; background: var(--cream); border: 4px solid var(--red); border-radius: 50% 50% 12px 12px; display: grid; place-items: center; font-family: "Kalam", cursive; }
.grapes i { width: 42px; height: 42px; background: var(--purple); border: 4px solid var(--ink); border-radius: 50%; box-shadow: 4px 5px 0 rgba(41,35,29,.18); }
.sauce-packet { width: 170px; height: 76px; background: var(--red); color: var(--cream); border: 4px solid var(--ink); border-radius: 22px 10px 22px 10px; display: grid; place-items: center; font-family: "Fredoka", sans-serif; font-size: 2rem; box-shadow: 6px 7px 0 rgba(41,35,29,.22); }

.trade-scene { background: linear-gradient(135deg, rgba(117,184,67,.18), transparent 38%), var(--cream); }
.trade-board { border: 7px solid var(--ink); border-radius: 44px; background: var(--yellow); padding: 34px; box-shadow: 0 18px 0 rgba(41,35,29,.2); display: grid; gap: 30px; }
.napkin-code { background: var(--cream); border: 3px dashed var(--ink); padding: 22px; font-family: "Kalam", cursive; display: grid; gap: 8px; transform: rotate(-2deg); }
.trade-lane { min-height: 120px; position: relative; border: 4px solid var(--ink); border-radius: 999px; background: rgba(255,244,214,.75); display: flex; align-items: center; justify-content: space-around; padding: 20px; }
.trade-snack { border: 4px solid var(--ink); color: var(--ink); font-family: "Fredoka", sans-serif; font-size: 1rem; cursor: pointer; box-shadow: 6px 8px 0 rgba(41,35,29,.22); transition: transform .45s cubic-bezier(.25,1.5,.35,1), background .2s ease; }
.thermos { width: 160px; height: 64px; border-radius: 34px; background: var(--teal); color: var(--cream); }
.pretzel { width: 135px; height: 74px; border-radius: 50%; background: #c1743f; color: var(--cream); }
.juice { width: 140px; height: 86px; border-radius: 12px; background: var(--purple); color: var(--cream); }
.trade-snack.traded { transform: translateY(78px) rotate(8deg) scale(1.04); }
.trade-compartments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.trade-cup { min-height: 130px; border: 5px solid var(--ink); border-radius: 30px; background: var(--cream); display: grid; place-items: center; box-shadow: inset 0 0 0 10px rgba(19,168,161,.16); font-family: "Kalam", cursive; font-size: 1.7rem; }
.trade-cup.active { background: var(--green); }

.refill-scene { background: radial-gradient(circle at 70% 30%, rgba(108,75,216,.2), transparent 30%), var(--cream); }
.refill-box { position: relative; min-height: 560px; border: 7px solid var(--ink); border-radius: 48px; background: var(--teal); padding: 42px; box-shadow: 0 18px 0 #0b6c68; overflow: hidden; }
.silicone-cup { width: min(430px, 80%); min-height: 260px; border: 6px solid var(--ink); border-radius: 48px 48px 80px 80px; background: #f5ceff; padding: 28px; box-shadow: inset 0 -22px 0 rgba(108,75,216,.16), 8px 10px 0 rgba(41,35,29,.2); }
.snippet-lines i { display: block; height: 18px; margin: 15px 0; border-radius: 20px; background: var(--ink); opacity: .75; transform-origin: left; animation: refillLine 2.4s ease-in-out infinite; }
.snippet-lines i:nth-child(2) { width: 78%; animation-delay: .2s; } .snippet-lines i:nth-child(3) { width: 62%; animation-delay: .4s; } .snippet-lines i:nth-child(4) { width: 88%; animation-delay: .6s; }
.cheese-note { position: absolute; right: 7%; top: 22%; width: 290px; background: var(--yellow); border: 4px solid var(--ink); border-radius: 14px; padding: 22px; transform: rotate(7deg); box-shadow: 9px 11px 0 rgba(41,35,29,.22); font-family: "Fraunces", serif; }
.cheese-note strong, .cheese-note span { display: block; }
.cheese-note strong { font-size: 1.5rem; margin-bottom: 12px; }
.ingredient-rain span { position: absolute; width: 28px; height: 28px; border: 3px solid var(--ink); border-radius: 50%; background: var(--green); left: calc(20% + var(--x, 0px)); top: -40px; opacity: 0; }
.ingredient-rain.raining span { animation: ingredientDrop 1.1s cubic-bezier(.3,.8,.4,1) forwards; }
.ingredient-rain span:nth-child(1) { --x: 40px; animation-delay: 0s; } .ingredient-rain span:nth-child(2) { --x: 130px; background: var(--yellow); animation-delay: .08s; } .ingredient-rain span:nth-child(3) { --x: 230px; background: var(--red); animation-delay: .16s; } .ingredient-rain span:nth-child(4) { --x: 330px; animation-delay: .24s; } .ingredient-rain span:nth-child(5) { --x: 460px; background: var(--purple); animation-delay: .32s; } .ingredient-rain span:nth-child(6) { --x: 570px; background: var(--cream); animation-delay: .4s; }
.refill-button { position: absolute; right: 8%; bottom: 12%; border: 5px solid var(--ink); border-radius: 999px; background: var(--red); color: var(--cream); font-family: "Fredoka", sans-serif; font-size: 1.5rem; padding: 17px 28px; box-shadow: 7px 9px 0 rgba(41,35,29,.28); cursor: pointer; }
.refill-button:active { transform: translateY(5px); box-shadow: 2px 4px 0 rgba(41,35,29,.28); }

.memory-box { min-height: 600px; position: relative; border: 7px solid var(--ink); border-radius: 48px; background: var(--cream); box-shadow: 0 18px 0 rgba(41,35,29,.18); overflow: hidden; }
.half-lid { position: absolute; left: -6%; top: -20%; width: 112%; height: 52%; background: var(--red); border: 7px solid var(--ink); border-radius: 54px; transform: rotateX(52deg) rotate(-3deg); transform-origin: top center; display: grid; place-items: center; color: var(--cream); box-shadow: 0 18px 0 #ad2d25; }
.curl-sticker { right: 16%; bottom: 18%; background: var(--yellow); color: var(--ink); padding: 12px 20px; border-radius: 20px; }
.crumb-map span { position: absolute; width: 16px; height: 11px; background: var(--ink); border-radius: 50%; opacity: .65; animation: crumbFloat 4s ease-in-out infinite; }
.crumb-map span:nth-child(1) { left: 16%; top: 58%; } .crumb-map span:nth-child(2) { left: 30%; top: 70%; animation-delay: .2s; } .crumb-map span:nth-child(3) { left: 45%; top: 62%; animation-delay: .4s; } .crumb-map span:nth-child(4) { left: 58%; top: 75%; animation-delay: .6s; } .crumb-map span:nth-child(5) { left: 72%; top: 59%; animation-delay: .8s; } .crumb-map span:nth-child(6) { left: 83%; top: 72%; animation-delay: 1s; } .crumb-map span:nth-child(7) { left: 21%; top: 84%; animation-delay: 1.2s; }
.leftover-copy { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%) rotate(-1deg); width: min(620px, 78%); background: var(--yellow); border: 3px dashed var(--ink); padding: 24px; font-family: "Fraunces", serif; font-size: 1.4rem; box-shadow: 7px 9px 0 rgba(41,35,29,.18); }
.focus-note { position: fixed; left: 18px; bottom: 18px; z-index: 40; max-width: 320px; background: var(--ink); color: var(--cream); border: 3px solid var(--cream); border-radius: 18px; padding: 13px 16px; font-family: "Kalam", cursive; transform: rotate(-2deg); box-shadow: 5px 6px 0 rgba(41,35,29,.25); }

@keyframes refillLine { 0%, 100% { transform: scaleX(.45); } 50% { transform: scaleX(1); } }
@keyframes ingredientDrop { 0% { opacity: 0; transform: translateY(0) rotate(0); } 20% { opacity: 1; } 100% { opacity: 1; transform: translateY(360px) rotate(230deg); } }
@keyframes crumbFloat { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(8px,-12px) rotate(30deg); } }

@media (max-width: 820px) {
  .sticker-nav { top: 8px; gap: 5px; }
  .nav-sticker { padding: 6px 8px 4px; font-size: .9rem; }
  .scene { padding-top: 105px; }
  .lunchbox { width: 92vw; height: 62vw; }
  .inside-lid { flex-direction: column; align-items: stretch; }
  .bento-tray, .trade-compartments { grid-template-columns: 1fr; grid-template-rows: auto; }
  .sandwich-well { grid-row: auto; }
  .trade-lane { border-radius: 34px; flex-direction: column; gap: 16px; }
  .trade-snack.traded { transform: translateX(22px) rotate(8deg); }
  .cheese-note, .refill-button { position: relative; right: auto; top: auto; bottom: auto; margin: 24px 0 0; }
  .refill-box { min-height: 720px; }
  .leftover-copy { font-size: 1.1rem; }
}
