:root {
  --vanilla: #FFF2D8;
  --strawberry: #F05A7E;
  --pistachio: #A8D8A0;
  --custard: #FFD166;
  --cocoa: #3B241F;
  --blueberry: #5E5CE6;
  --glass: #F8CFE8;
  --heading: 'Jost', Futura, 'Trebuchet MS', Arial, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --mono: 'DM Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--cocoa);
  background:
    radial-gradient(circle at 18% 12%, rgba(248, 207, 232, .75), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(168, 216, 160, .55), transparent 25%),
    linear-gradient(135deg, var(--vanilla) 0%, #ffe8df 50%, #fff7e8 100%);
  font-family: var(--heading);
  overflow-x: hidden;
}

.sprinkle-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .75;
}

.sprinkle {
  position: absolute;
  width: 18px;
  height: 7px;
  border: 2px solid var(--cocoa);
  border-radius: 20px;
  background: var(--custard);
  transform: translate3d(0,0,0) rotate(var(--r));
  animation: drift var(--d) linear infinite;
}

.sprinkle.dot { width: 10px; height: 10px; background: var(--strawberry); }
.sprinkle.moon { width: 18px; height: 18px; border-radius: 50%; background: var(--pistachio); clip-path: inset(0 0 0 45%); }
.sprinkle.zig { width: 24px; height: 12px; background: transparent; border: 0; border-top: 4px solid var(--blueberry); border-radius: 0; }

@keyframes drift {
  from { translate: 0 -12vh; }
  to { translate: 0 112vh; }
}

.foil-nav {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 10;
  display: flex;
  gap: 10px;
  transform: rotate(-2deg);
}

.foil-nav a {
  color: var(--cocoa);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .16em;
  font: 700 11px var(--heading);
  background: linear-gradient(135deg, var(--custard), #fff1af);
  border: 2px solid var(--cocoa);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: 4px 4px 0 rgba(59, 36, 31, .18);
}

.scene {
  min-height: 100vh;
  position: relative;
  z-index: 2;
  padding: 8vh 6vw;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.hero-scene { grid-template-columns: 1.05fr .95fr; }

.glass-band {
  position: absolute;
  width: 24vw;
  height: 140vh;
  top: -20vh;
  rotate: 24deg;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  filter: blur(1px);
}

.band-one { left: 10vw; }
.band-two { right: 16vw; opacity: .55; }

.hero-plaque {
  position: relative;
  padding: 58px;
  border: 3px solid var(--cocoa);
  border-radius: 44% 56% 52% 48% / 36% 42% 58% 64%;
  background: rgba(255, 242, 216, .72);
  box-shadow: 18px 18px 0 rgba(240, 90, 126, .18), inset 0 0 70px rgba(255, 209, 102, .35);
}

.mono { font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
.overline { color: var(--blueberry); }

h1, h2 { margin: 0; line-height: .92; }

h1 {
  position: relative;
  margin-top: 18px;
  font: 800 clamp(58px, 9vw, 132px) var(--heading);
  letter-spacing: -.05em;
  text-transform: lowercase;
  color: var(--custard);
  -webkit-text-stroke: 2px var(--cocoa);
  text-shadow: 5px 5px 0 var(--strawberry), -5px -2px 0 var(--blueberry);
  animation: warmOn 1.8s ease both;
}

h1::before, h1::after {
  content: attr(data-glitch);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

h1::before { color: var(--glass); transform: translate(4px, -2px); }
h1::after { color: var(--blueberry); transform: translate(-3px, 2px); }
.sugar-static h1::before, .sugar-static h1::after { animation: glitchFrost .38s steps(2) both; }

@keyframes warmOn {
  from { filter: brightness(.65); opacity: .35; transform: translateY(18px); }
  to { filter: brightness(1.1); opacity: 1; transform: translateY(0); }
}

@keyframes glitchFrost {
  0%, 100% { opacity: 0; clip-path: inset(0); }
  25% { opacity: .55; clip-path: inset(10% 0 55% 0); }
  50% { opacity: .45; clip-path: inset(54% 0 15% 0); }
  75% { opacity: .5; clip-path: inset(26% 0 34% 0); }
}

.hero-plaque p, .chapter-card p, .receipt-ribbon p {
  max-width: 620px;
  font: 500 20px/1.55 var(--serif);
}

.window-counter {
  min-height: 62vh;
  border: 3px solid var(--cocoa);
  border-radius: 36px;
  background: linear-gradient(155deg, rgba(248,207,232,.54), rgba(255,242,216,.85));
  box-shadow: inset 0 0 80px rgba(255,255,255,.62), 18px 24px 0 rgba(94,92,230,.16);
  transform: perspective(900px) rotateY(-8deg) rotateZ(2deg);
  display: grid;
  place-items: center;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 34px;
}

.display-dessert {
  width: 100%;
  min-height: 220px;
  border: 2px solid var(--cocoa);
  border-radius: 42% 58% 48% 52% / 58% 46% 54% 42%;
  background: var(--vanilla);
  display: grid;
  place-items: center;
  box-shadow: 8px 8px 0 rgba(59,36,31,.14);
}

.display-dessert span { width: 90px; height: 90px; border: 3px solid var(--cocoa); background: var(--strawberry); border-radius: 24px 24px 48px 48px; }
.display-dessert b { font: 700 13px var(--heading); letter-spacing: .18em; text-transform: uppercase; }
.soda span { border-radius: 18px; background: linear-gradient(var(--glass), var(--pistachio)); }
.macaron span { height: 58px; border-radius: 50px; background: var(--custard); }

.icing { position: absolute; pointer-events: none; fill: none; stroke: var(--strawberry); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 24 18; opacity: .62; }
.icing-hero { left: 8vw; bottom: 8vh; width: 58vw; }

.vitrine-scene { grid-template-columns: .72fr 1.28fr; gap: 5vw; background: linear-gradient(165deg, rgba(168,216,160,.28), transparent 55%); }
.chapter-card, .wall-title, .receipt-ribbon {
  position: relative;
  z-index: 2;
  background: rgba(255, 242, 216, .82);
  border: 3px solid var(--cocoa);
  border-radius: 34px;
  padding: 34px;
  box-shadow: 12px 12px 0 rgba(59, 36, 31, .12);
}

h2 { font: 700 clamp(42px, 6vw, 92px) var(--serif); letter-spacing: -.05em; }

.tray-grid, .portfolio-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(82px, auto);
  gap: 22px;
  transform: rotate(-2deg);
}

.sweet-card {
  position: relative;
  min-height: 240px;
  grid-column: span 4;
  border: 3px solid var(--cocoa);
  border-radius: 28px;
  background:
    radial-gradient(circle at 16px 16px, rgba(59,36,31,.16) 2px, transparent 3px) 0 0/34px 34px,
    rgba(255, 242, 216, .94);
  box-shadow: 10px 12px 0 rgba(94,92,230,.18);
  display: grid;
  place-items: center;
  transform: translateY(30px) scale(.94);
  opacity: 0;
  transition: transform .8s cubic-bezier(.2,.8,.2,1), opacity .8s ease, box-shadow .25s ease;
}

.sweet-card.in-view { transform: translateY(0) scale(1); opacity: 1; }
.sweet-card.from-left { translate: -8vw 0; }
.sweet-card.from-right { translate: 8vw 0; }
.sweet-card.from-left.in-view, .sweet-card.from-right.in-view { translate: 0 0; }
.sweet-card.tall { grid-row: span 2; min-height: 360px; }
.sweet-card.wide { grid-column: span 6; }
.sweet-card:hover { transform: translateY(-8px) rotate(1.5deg) scale(1.02); box-shadow: 16px 18px 0 rgba(240,90,126,.22); }

.blob {
  position: absolute;
  width: 72%;
  height: 62%;
  border-radius: 52% 48% 62% 38% / 38% 56% 44% 62%;
  border: 2px solid var(--cocoa);
  animation: blobMorph 7s ease-in-out infinite;
}
.blob-pink { background: var(--glass); }
.blob-green { background: var(--pistachio); }
.blob-yellow { background: var(--custard); }
.blob-blue { background: rgba(94,92,230,.32); }

@keyframes blobMorph {
  0%, 100% { border-radius: 52% 48% 62% 38% / 38% 56% 44% 62%; }
  50% { border-radius: 39% 61% 41% 59% / 60% 36% 64% 40%; }
}

.label-strip {
  position: absolute;
  left: 18px;
  bottom: 20px;
  padding: 9px 16px;
  background: var(--strawberry);
  color: var(--vanilla);
  border: 2px solid var(--cocoa);
  box-shadow: 4px 4px 0 var(--blueberry);
  transform: rotate(-4deg) translateX(-18px);
  font: 700 13px var(--heading);
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: transform .35s ease;
}
.sweet-card.in-view .label-strip { transform: rotate(-4deg) translateX(0); }
.sweet-card:hover .label-strip { animation: labelStatic .28s steps(2) 2; }
@keyframes labelStatic { 50% { translate: 4px -2px; box-shadow: -4px 3px 0 var(--blueberry); } }

.dessert-icon {
  position: relative;
  z-index: 1;
  width: 116px;
  height: 116px;
  filter: drop-shadow(5px 5px 0 rgba(59,36,31,.15));
}
.dessert-icon::before, .dessert-icon::after, .dessert-icon i { content: ''; position: absolute; border: 3px solid var(--cocoa); background: var(--vanilla); }
.cake-icon::before { width: 94px; height: 78px; left: 9px; top: 22px; clip-path: polygon(0 0,100% 22%,84% 100%,0 84%); background: linear-gradient(var(--glass) 0 32%, var(--vanilla) 32% 58%, var(--strawberry) 58%); }
.cake-icon::after { width: 18px; height: 18px; border-radius: 50%; right: 14px; top: 4px; background: var(--strawberry); }
.soda-icon::before { width: 54px; height: 92px; left: 30px; top: 18px; border-radius: 12px 12px 22px 22px; background: linear-gradient(var(--glass), var(--pistachio)); }
.soda-icon::after { width: 58px; height: 8px; left: 54px; top: 5px; rotate: 62deg; background: repeating-linear-gradient(90deg, var(--strawberry) 0 8px, var(--vanilla) 8px 16px); }
.roll-icon::before { width: 88px; height: 72px; left: 14px; top: 25px; border-radius: 50%; background: radial-gradient(circle, var(--strawberry) 0 18%, var(--vanilla) 19% 38%, var(--custard) 39%); }
.cup-icon::before { width: 72px; height: 58px; left: 16px; top: 40px; border-radius: 8px 8px 34px 34px; background: var(--glass); }
.cup-icon::after { width: 28px; height: 28px; right: 5px; top: 51px; border-radius: 50%; background: transparent; }
.parfait-icon::before { width: 52px; height: 92px; left: 30px; top: 15px; clip-path: polygon(16% 0,84% 0,70% 100%,30% 100%); background: linear-gradient(var(--strawberry), var(--vanilla), var(--pistachio)); }
.parfait-icon::after { width: 18px; height: 90px; right: 18px; top: 0; rotate: 24deg; border-radius: 20px; background: var(--custard); }
.puff-icon::before { width: 88px; height: 70px; left: 14px; top: 34px; border-radius: 50% 50% 42% 42%; background: var(--custard); }
.puff-icon::after { width: 70px; height: 18px; left: 23px; top: 58px; border-radius: 20px; background: var(--vanilla); }
.candy-icon::before { width: 74px; height: 48px; left: 21px; top: 34px; border-radius: 18px; background: repeating-linear-gradient(45deg, var(--glass) 0 12px, var(--custard) 12px 24px); }
.candy-icon::after { width: 108px; height: 62px; left: 4px; top: 27px; clip-path: polygon(0 50%,18% 8%,82% 8%,100% 50%,82% 92%,18% 92%); background: transparent; }
.macaron-icon::before { width: 88px; height: 42px; left: 14px; top: 38px; border-radius: 50px; background: var(--glass); }
.macaron-icon::after { width: 78px; height: 18px; left: 19px; top: 63px; border-radius: 20px; background: var(--vanilla); }
.pie-icon::before { width: 86px; height: 74px; left: 15px; top: 26px; border-radius: 14px 14px 42px 42px; background: repeating-linear-gradient(45deg, var(--custard) 0 12px, var(--vanilla) 12px 24px); }
.sugar-icon::before { width: 52px; height: 52px; left: 18px; top: 43px; background: var(--vanilla); }
.sugar-icon::after { width: 52px; height: 52px; right: 18px; top: 20px; background: var(--glass); }
.cherry-icon::before { width: 36px; height: 36px; left: 24px; top: 56px; border-radius: 50%; background: var(--strawberry); }
.cherry-icon::after { width: 36px; height: 36px; right: 24px; top: 56px; border-radius: 50%; background: var(--strawberry); }
.cherry-icon i { width: 50px; height: 42px; left: 33px; top: 18px; border: 0; border-top: 4px solid var(--cocoa); border-radius: 50%; background: transparent; }

.gallery-scene { align-items: start; padding-top: 11vh; }
.wall-title { max-width: 760px; margin-bottom: 42px; transform: rotate(1deg); }
.gallery-icing { inset: 16vh 5vw auto auto; width: 82vw; height: 58vh; stroke: var(--blueberry); }
.portfolio-grid { position: relative; z-index: 2; transform: rotate(1deg); }
.p1 { grid-column: 1 / span 3; }
.p2 { grid-column: 4 / span 3; margin-top: 52px; }
.p3 { grid-column: 7 / span 5; }
.p4 { grid-column: 2 / span 3; }
.p5 { grid-column: 5 / span 3; margin-top: -26px; }
.p6 { grid-column: 8 / span 3; margin-top: 38px; }
.p7 { grid-column: 1 / span 5; }
.p8 { grid-column: 9 / span 3; margin-top: -60px; }

.receipt-scene {
  place-items: center;
  background:
    linear-gradient(90deg, rgba(59,36,31,.06) 1px, transparent 1px) 0 0/36px 36px,
    linear-gradient(180deg, transparent, rgba(248,207,232,.45));
}
.receipt-ribbon {
  max-width: 760px;
  border-radius: 18px 18px 52px 52px;
  background: linear-gradient(var(--vanilla), #fff9ed);
  transform: rotate(-2deg);
}
.receipt-ribbon::before, .receipt-ribbon::after {
  content: '';
  position: absolute;
  top: -20px;
  width: 160px;
  height: 42px;
  background: var(--strawberry);
  border: 3px solid var(--cocoa);
  border-radius: 999px;
}
.receipt-ribbon::before { left: -70px; rotate: -18deg; }
.receipt-ribbon::after { right: -70px; rotate: 18deg; background: var(--blueberry); }
.receipt-lines { display: grid; gap: 10px; margin-top: 28px; font: 500 14px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.receipt-lines span { border-top: 2px dashed rgba(59,36,31,.36); padding-top: 10px; }
.final-sweets { position: absolute; bottom: 11vh; display: flex; gap: 18px; }
.tiny-sweet { width: 44px; height: 44px; border: 3px solid var(--cocoa); border-radius: 50%; background: var(--custard); box-shadow: 52px -18px 0 -6px var(--glass), -46px -10px 0 -8px var(--pistachio); animation: bob 3s ease-in-out infinite; }
.tiny-sweet:nth-child(2) { animation-delay: .4s; background: var(--strawberry); }
.tiny-sweet:nth-child(3) { animation-delay: .8s; background: var(--pistachio); }
@keyframes bob { 50% { transform: translateY(-12px); } }

.flavor-note {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 11;
  max-width: 320px;
  padding: 12px 16px;
  border: 2px solid var(--cocoa);
  border-radius: 999px;
  background: var(--vanilla);
  box-shadow: 6px 6px 0 rgba(59,36,31,.16);
  font: 500 12px var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  transform: translateY(90px);
  transition: transform .35s ease;
}
.flavor-note.show { transform: translateY(0); }

@media (max-width: 900px) {
  .foil-nav { left: 14px; right: 14px; justify-content: center; flex-wrap: wrap; }
  .hero-scene, .vitrine-scene { grid-template-columns: 1fr; padding-top: 16vh; }
  .window-counter { transform: none; grid-template-columns: 1fr; }
  .tray-grid, .portfolio-grid { grid-template-columns: 1fr; transform: none; }
  .sweet-card, .sweet-card.wide, .sweet-card.tall, .p1, .p2, .p3, .p4, .p5, .p6, .p7, .p8 { grid-column: 1; margin-top: 0; }
  .hero-plaque { padding: 34px; }
}
