/* ==========================================================================
   Nanny Pickles: sweet-shop stylesheet
   Palette is taken from the header photo: bubblegum, raspberry, candyfloss,
   mint cabinets, lemon drops, lilac candyfloss and a cocoa text colour.
   ========================================================================== */

@font-face {
  font-family: "Pacifico";
  src: url("../fonts/pacifico.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-stretch: 75% 125%;
  font-display: swap;
}

:root {
  /* Chrome, Android in-app browsers: "only light" opts out of automatic darkening.
     The meta tag says "light dark" so Samsung Internet sees a site-provided dark
     theme (below) and uses it instead of inverting the colours itself. */
  color-scheme: only light;
  --bubblegum: #FF5FA2;
  --raspberry: #C2185B;
  --raspberry-deep: #8E0F45;
  --candyfloss: #FFE6F0;
  --cream: #FFF8F1;
  --mint: #8ED9C8;
  --mint-deep: #2E8A78;
  --mint-pale: #D9F5EE;
  --lemon: #FFD966;
  --lemon-deep: #C99A12;
  --lilac: #C6A9FF;
  --lilac-deep: #7B55D6;
  --cocoa: #4A2333;
  --cocoa-soft: #7A4A5C;

  --display: "Pacifico", "Brush Script MT", cursive;
  --body: "Fredoka", "Trebuchet MS", "Segoe UI", sans-serif;

  --wrap: 1180px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --bounce: cubic-bezier(.34, 1.56, .64, 1);

  --drip-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40'%3E%3Cpath d='M0,0 H200 V12 C192,12 190,14 189,20 C188,30 186,34 182,34 C178,34 176,30 175,22 C174,14 168,12 150,12 C138,12 136,15 135,24 C134,36 132,40 128,40 C124,40 122,36 121,24 C120,15 116,12 100,12 C86,12 84,14 83,18 C82,24 80,26 77,26 C74,26 72,24 71,18 C70,14 66,12 50,12 C38,12 36,15 35,22 C34,30 32,32 29,32 C26,32 24,30 23,22 C22,15 18,12 0,12 Z'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */

html { background: var(--candyfloss); }

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(1.05rem, 1rem + .25vw, 1.2rem);
  line-height: 1.6;
  color: var(--cocoa);
  background-color: var(--candyfloss);
  /* sweet-shop wallpaper: soft polka dots */
  background-image:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,.75) 0 5px, transparent 6px),
    radial-gradient(circle at 75% 75%, rgba(255,95,162,.12) 0 5px, transparent 6px);
  background-size: 56px 56px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--raspberry); text-underline-offset: .2em; text-decoration-thickness: 2px; }
a:hover { color: var(--raspberry-deep); }

:focus-visible {
  outline: 3px dashed var(--raspberry);
  outline-offset: 4px;
  border-radius: 8px;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }

p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.center { text-align: center; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--cocoa); color: #fff; padding: .6rem 1rem; border-radius: 999px;
}
.skip:focus { top: 1rem; }

.lede {
  font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem);
  max-width: 34em;
  color: var(--cocoa-soft);
}

/* ---------- Sticker type: the shop's signature lettering ---------- */

.sticker {
  display: inline-block;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.6rem + 2.4vw, 3.4rem);
  line-height: 1.25;
  color: #fff;
  transform: rotate(-3deg);
  margin: .2em 0 .6em;
  cursor: pointer;
  user-select: none;
  /* bubblegum outline + raspberry extrusion, same as the header lettering */
  text-shadow:
    -2px -2px 0 var(--bubblegum), 2px -2px 0 var(--bubblegum),
    -2px  2px 0 var(--bubblegum), 2px  2px 0 var(--bubblegum),
     0   -2px 0 var(--bubblegum), 0    2px 0 var(--bubblegum),
    -2px  0   0 var(--bubblegum), 2px  0   0 var(--bubblegum),
     3px  3px 0 var(--raspberry), 4px  4px 0 var(--raspberry),
     5px  5px 0 var(--raspberry), 6px  6px 0 var(--raspberry),
     7px  7px 0 var(--raspberry), 8px  8px 0 var(--raspberry),
     12px 14px 16px rgba(142,15,69,.28);
  transition: transform .4s var(--bounce);
}
.sticker:hover { transform: rotate(-1deg) scale(1.04); }
.sticker--big { font-size: clamp(2.3rem, 1.6rem + 3.4vw, 4.4rem); }
.nowrap { white-space: nowrap; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem var(--gutter);
  background: var(--cream);
  box-shadow: 0 2px 0 rgba(194,24,91,.08);
}

.brand {
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  color: #fff;
  text-decoration: none;
  line-height: 1.3;
  padding: .1em .2em .25em 0;
  text-shadow:
    -1.5px -1.5px 0 var(--bubblegum), 1.5px -1.5px 0 var(--bubblegum),
    -1.5px 1.5px 0 var(--bubblegum), 1.5px 1.5px 0 var(--bubblegum),
    2px 2px 0 var(--raspberry), 3px 3px 0 var(--raspberry), 4px 4px 0 var(--raspberry);
  transform: rotate(-4deg);
  transition: transform .4s var(--bounce);
}
.brand:hover { color: #fff; transform: rotate(2deg) scale(1.06); }

.nav { display: flex; gap: .5rem; flex-wrap: wrap; }

.nav__link {
  font-weight: 600;
  text-decoration: none;
  color: var(--cocoa);
  padding: .45rem 1.1rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 -3px 0 rgba(74,35,51,.1);
  transition: background .2s, color .2s;
}
.nav__link:hover { background: var(--candyfloss); color: var(--raspberry); animation: jelly .5s; }
.nav__link[aria-current="page"] {
  background: var(--bubblegum); color: #fff;
  box-shadow: inset 0 -3px 0 var(--raspberry);
}
.nav__link--order { background: var(--lemon); }

.menu-toggle {
  display: none;
  align-items: center; gap: .5rem;
  font: 600 1rem var(--body);
  color: var(--cocoa);
  background: #fff;
  border: 0; border-radius: 999px;
  padding: .45rem 1rem;
  box-shadow: inset 0 -3px 0 rgba(74,35,51,.12);
  cursor: pointer;
}
.menu-toggle__lolly {
  width: 22px; height: 22px; border-radius: 50%;
  background: conic-gradient(var(--bubblegum) 0 25%, #fff 0 50%, var(--mint) 0 75%, #fff 0);
  transition: transform .5s var(--bounce);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__lolly { transform: rotate(270deg); }

@media (max-width: 700px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 100%; right: var(--gutter);
    flex-direction: column; align-items: stretch;
    background: var(--cream); padding: .8rem; border-radius: 24px;
    box-shadow: 0 14px 30px rgba(74,35,51,.18);
    transform-origin: top right;
    transform: scale(.6); opacity: 0; visibility: hidden;
    transition: transform .35s var(--bounce), opacity .2s, visibility 0s .35s;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; transition: transform .35s var(--bounce), opacity .2s; }
  .nav__link { text-align: center; }
}

/* candy-cane stripe under the bar */
.candy-stripe {
  position: sticky; top: var(--topbar-h, 64px); z-index: 39;
  height: 12px;
  background: repeating-linear-gradient(-45deg,
    var(--bubblegum) 0 14px, #fff 14px 28px, var(--mint) 28px 42px, #fff 42px 56px);
  background-size: 79.2px 12px;
  animation: stripe-slide 2.5s linear infinite;
}
@keyframes stripe-slide { to { background-position: 79.2px 0; } }

/* ---------- Drips ---------- */

.drip {
  height: 40px;
  background: var(--drip-colour, var(--bubblegum));
  -webkit-mask: var(--drip-mask) repeat-x 0 0 / 200px 40px;
          mask: var(--drip-mask) repeat-x 0 0 / 200px 40px;
}
.drip--hero { margin-top: -1px; filter: drop-shadow(0 4px 0 var(--raspberry)); }

/* ---------- Hero ---------- */

.hero { position: relative; background: var(--bubblegum); cursor: pointer; }
.hero__img { width: 100%; }
.hero__hint {
  position: absolute; right: clamp(.8rem, 3vw, 2.5rem); bottom: clamp(.8rem, 3vw, 2rem);
  margin: 0;
  font-weight: 600; font-size: .95rem;
  background: #fff; color: var(--raspberry);
  padding: .4rem 1rem; border-radius: 999px 999px 4px 999px;
  box-shadow: 0 6px 0 var(--raspberry);
  animation: bob 3s ease-in-out infinite;
  pointer-events: none;
  transition: opacity .4s;
}
@media (max-width: 700px) { .hero__hint { display: none; } }
.hero.was-tapped .hero__hint { opacity: 0; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* ---------- Intro ---------- */

.intro { padding-block: clamp(2rem, 5vw, 4rem) 1rem; text-align: center; }
.intro .lede { margin-inline: auto; }

/* ---------- Sweet jars ---------- */

.jars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: 2rem clamp(3rem, 7vw, 5rem);
}

.jar {
  --lid: var(--bubblegum);
  --lid-dark: var(--raspberry);
  --s1: var(--bubblegum); --s2: var(--lemon); --s3: var(--mint); --s4: var(--lilac);
  display: block;
  text-decoration: none;
  color: var(--cocoa);
  transform-origin: 50% 100%;
}
.jar--mint  { --lid: var(--mint);  --lid-dark: var(--mint-deep); }
.jar--lemon { --lid: var(--lemon); --lid-dark: var(--lemon-deep); }
.jar:nth-child(2) { transform: translateY(1.2rem); }

.jar__lid {
  display: block;
  width: 62%; height: 44px;
  margin: 0 auto -6px;
  position: relative; z-index: 2;
  border-radius: 14px 14px 6px 6px;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(255,255,255,.28) 10px 14px),
    var(--lid);
  box-shadow: inset 0 -8px 0 var(--lid-dark);
  transition: transform .45s var(--bounce);
}
.jar__lid::before { /* knob */
  content: ""; position: absolute; left: 50%; top: -16px;
  width: 34px; height: 18px; translate: -50% 0;
  border-radius: 12px 12px 4px 4px;
  background: var(--lid); box-shadow: inset 0 -4px 0 var(--lid-dark);
}

.jar__body {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  min-height: 330px;
  padding: 2.4rem 1.4rem 5.5rem;
  border-radius: 46px 46px 70px 70px;
  background: linear-gradient(90deg, rgba(255,255,255,.55), rgba(255,255,255,.25) 40%, rgba(255,255,255,.45));
  border: 5px solid rgba(255,255,255,.9);
  box-shadow: inset 0 0 0 2px rgba(194,24,91,.08), 0 18px 30px rgba(142,15,69,.12);
  overflow: hidden;
}
.jar__body::before { /* glass shine */
  content: ""; position: absolute; left: 12%; top: 10%;
  width: 16px; height: 55%;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
}
.jar__sweets { /* a heap of boiled sweets in the bottom of the jar */
  position: absolute; inset: auto 0 0 0; height: 96px;
  background:
    radial-gradient(circle at 10% 70%, var(--s1) 0 17px, transparent 18px),
    radial-gradient(circle at 27% 82%, var(--s2) 0 17px, transparent 18px),
    radial-gradient(circle at 44% 66%, var(--s3) 0 17px, transparent 18px),
    radial-gradient(circle at 60% 84%, var(--s4) 0 17px, transparent 18px),
    radial-gradient(circle at 77% 68%, var(--s1) 0 17px, transparent 18px),
    radial-gradient(circle at 92% 82%, var(--s3) 0 17px, transparent 18px),
    radial-gradient(circle at 19% 40%, var(--s4) 0 15px, transparent 16px),
    radial-gradient(circle at 52% 36%, var(--s2) 0 15px, transparent 16px),
    radial-gradient(circle at 84% 40%, var(--s1) 0 15px, transparent 16px);
  transition: transform .5s var(--bounce);
}

.jar__label {
  position: relative; z-index: 1;
  display: block;
  background: var(--cream);
  padding: 1.4rem 1.2rem 1.5rem;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 0 0 4px var(--cream), 0 0 0 7px var(--lid), 0 10px 16px rgba(74,35,51,.12);
  rotate: -2deg;
}
.jar:nth-child(2) .jar__label { rotate: 2deg; }
.jar__title { display: block; font-family: var(--display); font-size: 1.9rem; color: var(--raspberry); line-height: 1.3; }
.jar__text { display: block; font-size: 1rem; color: var(--cocoa-soft); margin-top: .3rem; }

.jar:hover, .jar:focus-visible { animation: wobble .7s ease-in-out; }
.jar:hover .jar__lid, .jar:focus-visible .jar__lid { transform: translateY(-18px) rotate(-8deg); }
.jar:hover .jar__sweets { transform: translateY(-6px); }

@keyframes wobble {
  20% { rotate: -4deg; } 40% { rotate: 3deg; } 60% { rotate: -2deg; } 80% { rotate: 1deg; }
}

@media (max-width: 860px) {
  .jars { grid-template-columns: 1fr; max-width: 420px; }
  .jar:nth-child(2) { transform: none; }
  .jar__body { min-height: 0; }
}

/* ---------- Buttons, chips, swatches ---------- */

.btn {
  --b: var(--bubblegum); --b-dark: var(--raspberry); --t: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 1.05rem/1.2 var(--body);
  color: var(--t);
  background: var(--b);
  border: 0;
  border-radius: 999px;
  padding: .85rem 1.6rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--b-dark), 0 12px 18px rgba(74,35,51,.15);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { color: var(--t); animation: jelly .55s; }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--b-dark); animation: none; }
.btn--mint  { --b: var(--mint);  --b-dark: var(--mint-deep);  --t: var(--cocoa); }
.btn--lemon { --b: var(--lemon); --b-dark: var(--lemon-deep); --t: var(--cocoa); }
.btn--lilac { --b: var(--lilac); --b-dark: var(--lilac-deep); --t: var(--cocoa); }

@keyframes jelly {
  0%, 100% { transform: scale(1, 1); }
  30% { transform: scale(1.12, .88); }
  45% { transform: scale(.92, 1.08); }
  60% { transform: scale(1.05, .95); }
  75% { transform: scale(.98, 1.02); }
}

/* ---------- Cake builder ---------- */

.builder {
  position: relative;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.6) 0 4px, transparent 5px) 0 0 / 40px 40px,
    var(--mint-pale);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  margin-block: 2rem;
  border-block: 10px solid transparent;
  border-image: repeating-linear-gradient(90deg, var(--bubblegum) 0 24px, #fff 24px 48px) 10;
}

.builder__inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-areas: "intro intro" "stage controls";
  gap: 1.5rem clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.builder__intro { grid-area: intro; }
.builder__intro p { max-width: 38em; }
.builder__stage { grid-area: stage; position: sticky; top: 100px; }
.builder__controls { grid-area: controls; }

@media (max-width: 860px) {
  .builder__inner { grid-template-columns: 1fr; grid-template-areas: "intro" "stage" "controls"; }
  .builder__stage { position: relative; top: 0; }
}

.builder__stage {
  min-height: 470px;
  border-radius: 40px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255,255,255,.95) 0 30%, transparent 60%),
    radial-gradient(ellipse at 50% 0%, #FFF3D1 0, transparent 65%),
    linear-gradient(180deg, var(--candyfloss), #FFD0E2);
  box-shadow: inset 0 0 0 6px #fff, 0 20px 40px rgba(46,138,120,.18);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: 2rem 1rem 1.2rem;
  overflow: hidden;
}

.builder__summary {
  margin: 1rem 0 0;
  text-align: center;
  font-weight: 500;
  color: var(--cocoa-soft);
  min-height: 3.2em;
  max-width: 30em;
}

.cake { display: flex; flex-direction: column; align-items: center; position: relative; }

.cake__tiers { display: flex; flex-direction: column; align-items: center; }

.tier {
  --icing: var(--bubblegum);
  --icing-shade: var(--raspberry);
  --drip: transparent;
  position: relative;
  width: var(--w, 200px);
  height: 84px;
  margin-top: -6px;
  border: 0; padding: 0;
  border-radius: 10px 10px 14px 14px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.35), transparent 22%, transparent 70%, rgba(0,0,0,.12)),
    var(--icing);
  box-shadow: inset 0 -6px 0 var(--icing-shade), 0 6px 10px rgba(74,35,51,.12);
  cursor: pointer;
  transition: width .5s var(--bounce), background .3s;
  animation: tier-in .55s var(--bounce) both;
}
.tier::before { /* the top surface of the tier */
  content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 20px;
  border-radius: 50%;
  background: var(--icing);
  box-shadow: inset 0 4px 0 rgba(255,255,255,.4);
}
.tier::after { /* icing drip */
  content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 38px;
  background: var(--drip);
  -webkit-mask: var(--drip-mask) repeat-x 0 0 / 90px 34px;
          mask: var(--drip-mask) repeat-x 0 0 / 90px 34px;
  pointer-events: none;
}
.tier.is-selected { outline: 3px dashed var(--cocoa); outline-offset: 6px; }

.tier__deco { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }

.cake.has-sprinkles .tier__deco {
  background:
    radial-gradient(ellipse 4px 2px at 12% 55%, var(--lemon) 98%, transparent),
    radial-gradient(ellipse 2px 4px at 26% 75%, #fff 98%, transparent),
    radial-gradient(ellipse 4px 2px at 38% 45%, var(--mint-deep) 98%, transparent),
    radial-gradient(ellipse 2px 4px at 50% 70%, var(--lilac-deep) 98%, transparent),
    radial-gradient(ellipse 4px 2px at 63% 52%, #fff 98%, transparent),
    radial-gradient(ellipse 2px 4px at 75% 78%, var(--lemon) 98%, transparent),
    radial-gradient(ellipse 4px 2px at 87% 58%, var(--raspberry) 98%, transparent);
  background-size: 64px 84px;
}
.cake.has-stripes .tier__deco {
  background-image: repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,.55) 18px 28px);
}
.cake.has-sprinkles.has-stripes .tier__deco {
  background:
    radial-gradient(ellipse 4px 2px at 20% 55%, var(--lemon) 98%, transparent) 0 0 / 64px 74px,
    radial-gradient(ellipse 2px 4px at 60% 70%, var(--lilac-deep) 98%, transparent) 0 0 / 64px 74px,
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,.55) 18px 28px);
}
.cake.has-pearls .tier__deco::after {
  content: ""; position: absolute; left: 4px; right: 4px; bottom: -6px; height: 14px;
  background: radial-gradient(circle at 7px 7px, #fff 0 5px, #F2D8E2 6px, transparent 7px) repeat-x 0 0 / 14px 14px;
}

@keyframes tier-in { from { transform: scale(.2, .2) translateY(-60px); opacity: 0; } }

.cake__stand { width: 380px; max-width: 86vw; height: 44px; position: relative; margin-top: -6px; }
.cake__stand::before { /* plate */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: inset 0 -5px 0 #F1D7E1, 0 4px 8px rgba(74,35,51,.12);
}
.cake__stand::after { /* stem */
  content: ""; position: absolute; left: 50%; top: 16px; width: 60px; height: 28px; translate: -50% 0;
  background: linear-gradient(90deg, #F1D7E1, #fff 40%, #F1D7E1);
  clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%);
}

/* icing colours */
.tier--bubblegum { --icing: #FF8FBD; --icing-shade: #E8649E; }
.tier--mint      { --icing: #9EE3D3; --icing-shade: #6CC4B0; }
.tier--lemon     { --icing: #FFE08A; --icing-shade: #EFC254; }
.tier--lilac     { --icing: #D4BDFF; --icing-shade: #AE90F0; }
.tier--vanilla   { --icing: #FFF4DE; --icing-shade: #F0DEBE; }
.tier--chocolate { --icing: #8A5340; --icing-shade: #6A3B2C; }
.tier--rainbow   {
  --icing: #FFB3CF; --icing-shade: #B4E8DC;
  background:
    linear-gradient(90deg, rgba(255,255,255,.35), transparent 22%, transparent 70%, rgba(0,0,0,.1)),
    linear-gradient(180deg, #FFB3CF, #FFE08A 35%, #B4E8DC 65%, #D4BDFF);
}

.cake.drip-chocolate .tier { --drip: #5A2E22; }
.cake.drip-pink .tier      { --drip: #FF5FA2; }
.cake.drip-white .tier     { --drip: #FFFDF8; }

/* toppers */
.cake__topper { position: relative; height: 90px; width: 160px; margin-bottom: 6px; display: flex; justify-content: center; align-items: flex-end; }
.cake__topper > * { animation: pop-on .5s var(--bounce) both; }
@keyframes pop-on { from { transform: translateY(-40px) scale(.3); opacity: 0; } }

.top-cherries { position: relative; width: 70px; height: 70px; }
.top-cherries i {
  position: absolute; bottom: 0; width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 4px, #E8344E 5px, #B0152F);
}
.top-cherries i:nth-child(1) { left: 4px; } .top-cherries i:nth-child(2) { left: 30px; }
.top-cherries::before {
  content: ""; position: absolute; left: 18px; top: 4px; width: 34px; height: 44px;
  border: 3px solid #5E8F4E; border-bottom: 0; border-right: 0; border-radius: 60px 0 0 0;
}

.top-candles { display: flex; gap: 14px; align-items: flex-end; }
.top-candles i {
  position: relative; width: 12px; height: 46px; border-radius: 3px;
  background: repeating-linear-gradient(-45deg, #fff 0 5px, var(--bubblegum) 5px 10px);
}
.top-candles i:nth-child(2) { height: 56px; background: repeating-linear-gradient(-45deg, #fff 0 5px, var(--mint-deep) 5px 10px); }
.top-candles i::after {
  content: ""; position: absolute; left: 50%; top: -20px; width: 12px; height: 18px; translate: -50% 0;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff 0 2px, #FFD54A 3px, #FF8A3C);
  box-shadow: 0 0 12px 4px rgba(255,200,80,.55);
  animation: flicker .25s ease-in-out infinite alternate;
}
@keyframes flicker { to { transform: scale(.9, 1.1) rotate(4deg); } }

.top-lollipop { position: relative; width: 80px; height: 90px; }
.top-lollipop::before {
  content: ""; position: absolute; left: 37px; bottom: 0; width: 6px; height: 40px; background: #fff; border-radius: 3px;
  box-shadow: 0 0 0 1px #EEE;
}
.top-lollipop::after {
  content: ""; position: absolute; left: 4px; top: 0; width: 72px; height: 72px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--bubblegum), #fff, var(--mint), #fff, var(--lemon), #fff, var(--lilac), #fff, var(--bubblegum));
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.6);
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.top-flowers { display: flex; align-items: flex-end; }
.top-flowers i {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 -6px;
  background: radial-gradient(circle, #FFE08A 0 5px, transparent 6px),
              conic-gradient(#FF8FBD 0 12.5%, #FFB3CF 0 25%, #FF8FBD 0 37.5%, #FFB3CF 0 50%, #FF8FBD 0 62.5%, #FFB3CF 0 75%, #FF8FBD 0 87.5%, #FFB3CF 0);
  -webkit-mask: radial-gradient(circle, #000 64%, transparent 66%);
}
.top-flowers i:nth-child(2) { width: 52px; height: 52px; position: relative; z-index: 1;
  background: radial-gradient(circle, #FFE08A 0 6px, transparent 7px),
              conic-gradient(#fff 0 12.5%, #FFE6F0 0 25%, #fff 0 37.5%, #FFE6F0 0 50%, #fff 0 62.5%, #FFE6F0 0 75%, #fff 0 87.5%, #FFE6F0 0); }

/* controls */
.ctl { border: 0; padding: 0; margin: 0 0 1.4rem; }
.ctl legend { font-weight: 700; font-size: 1.1rem; margin-bottom: .55rem; padding: 0; }
.ctl__hint { font-weight: 400; color: var(--cocoa-soft); }
.ctl__tip { font-size: .9rem; color: var(--cocoa-soft); margin: .5rem 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  font: 500 1rem var(--body);
  color: var(--cocoa);
  background: #fff;
  border: 0;
  border-radius: 999px;
  padding: .5rem 1.05rem;
  min-width: 2.8rem;
  cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(74,35,51,.12);
  transition: background .2s, color .2s;
}
.chip:hover { animation: jelly .5s; }
.chip[aria-pressed="true"] { background: var(--bubblegum); color: #fff; box-shadow: inset 0 -4px 0 var(--raspberry); }

.swatches { display: flex; flex-wrap: wrap; gap: .6rem; }
.swatch {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid #fff;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(74,35,51,.15);
  transition: transform .3s var(--bounce);
}
.swatch:hover { transform: scale(1.15) rotate(-8deg); }
.swatch[aria-pressed="true"] { transform: scale(1.15); box-shadow: 0 0 0 3px var(--cocoa), 0 4px 0 rgba(74,35,51,.15); }
.swatch--bubblegum { background: #FF8FBD; }
.swatch--mint      { background: #9EE3D3; }
.swatch--lemon     { background: #FFE08A; }
.swatch--lilac     { background: #D4BDFF; }
.swatch--vanilla   { background: #FFF4DE; }
.swatch--chocolate { background: #8A5340; }
.swatch--rainbow   { background: conic-gradient(#FFB3CF, #FFE08A, #B4E8DC, #D4BDFF, #FFB3CF); }

.builder__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .5rem; }

/* ---------- Washing line of polaroids ---------- */

.washing-line { padding-block: clamp(2rem, 5vw, 4rem); overflow: hidden; }
.washing-line .sticker { margin-bottom: .2em; }

.line {
  height: 40px;
  margin-bottom: -26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 40' preserveAspectRatio='none'%3E%3Cpath d='M0,6 Q250,40 500,20 T1000,8' fill='none' stroke='%23C2185B' stroke-width='3' stroke-dasharray='10 6'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
}

.pegged {
  list-style: none; margin: 0; padding: 1.4rem var(--gutter) 2.5rem;
  display: flex; gap: clamp(1rem, 2.5vw, 2rem);
  justify-content: safe center;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.pegged__item {
  flex: 0 0 clamp(165px, 13vw, 195px);
  scroll-snap-align: center;
  position: relative;
  transform-origin: 50% 0;
  rotate: -3deg;
}
.pegged__item:nth-child(2) { rotate: 2deg;  margin-top: 14px; }
.pegged__item:nth-child(3) { rotate: -1deg; margin-top: 22px; }
.pegged__item:nth-child(4) { rotate: 3deg;  margin-top: 20px; }
.pegged__item:nth-child(5) { rotate: -2deg; margin-top: 10px; }
.pegged__item:nth-child(6) { rotate: 2deg; }
.pegged__item::before { /* wooden peg */
  content: ""; position: absolute; left: 50%; top: -18px; translate: -50% 0; z-index: 2;
  width: 14px; height: 34px; border-radius: 4px;
  background: linear-gradient(90deg, #E0B07A, #F5D3A6 50%, #E0B07A);
  box-shadow: 0 2px 0 rgba(74,35,51,.2);
}
.pegged__item:hover { animation: swing 1.2s ease-in-out; }
@keyframes swing { 25% { rotate: 6deg; } 50% { rotate: -4deg; } 75% { rotate: 2deg; } }
@media (max-width: 1000px) { .pegged { justify-content: flex-start; } }

.polaroid {
  display: block;
  background: #fff;
  padding: .7rem .7rem .4rem;
  border-radius: 6px;
  box-shadow: 0 12px 24px rgba(74,35,51,.18);
  color: var(--cocoa);
  text-decoration: none;
}
.polaroid img { width: 100%; border-radius: 3px; background: var(--candyfloss); }
.pegged .polaroid img { aspect-ratio: 1; object-fit: cover; }
.polaroid__caption {
  display: block;
  font-weight: 600; font-size: .98rem; line-height: 1.3;
  text-align: center;
  padding: .55rem .2rem .35rem;
}

.empty-note { color: var(--cocoa-soft); }

/* ---------- Order ticket ---------- */

.order { padding-block: clamp(2rem, 6vw, 4.5rem); }

.ticket {
  --notch: 26px;
  position: relative;
  max-width: 860px;
  margin-inline: auto;
  background: var(--lemon);
  padding: clamp(2rem, 5vw, 3rem) clamp(1.8rem, 6vw, 4rem);
  border-radius: 24px;
  -webkit-mask: radial-gradient(circle at 0 50%, transparent var(--notch), #000 calc(var(--notch) + 1px)) left / 51% 100% no-repeat,
                radial-gradient(circle at 100% 50%, transparent var(--notch), #000 calc(var(--notch) + 1px)) right / 51% 100% no-repeat;
          mask: radial-gradient(circle at 0 50%, transparent var(--notch), #000 calc(var(--notch) + 1px)) left / 51% 100% no-repeat,
                radial-gradient(circle at 100% 50%, transparent var(--notch), #000 calc(var(--notch) + 1px)) right / 51% 100% no-repeat;
  rotate: -1deg;
  filter: drop-shadow(0 10px 0 var(--lemon-deep));
}
.ticket::before { /* perforated inner border */
  content: ""; position: absolute; inset: 12px;
  border: 3px dashed rgba(74,35,51,.35);
  border-radius: 16px;
  pointer-events: none;
}
.ticket__title {
  font-family: var(--display);
  font-size: clamp(2rem, 1.6rem + 2vw, 3rem);
  color: var(--raspberry);
  text-align: center;
  margin-bottom: 1.2rem;
}
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 auto 1.8rem; max-width: 40em; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3.6rem;
  margin-bottom: 1.1rem;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -.15rem;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 1.3rem; color: #fff;
  background: var(--bubblegum);
  box-shadow: inset 0 -4px 0 var(--raspberry);
}
.steps li:nth-child(2)::before { background: var(--mint-deep); box-shadow: inset 0 -4px 0 #1F6457; }
.steps li:nth-child(3)::before { background: var(--lilac-deep); box-shadow: inset 0 -4px 0 #5634A8; }
.ticket__contact { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; position: relative; }

.ticket--small { text-align: center; max-width: 640px; }
.ticket--small .ticket__title { margin-bottom: .4rem; }
.ticket--small p { position: relative; }

/* ---------- Footer ---------- */

.footer { background: var(--cocoa); color: var(--cream); margin-top: 3rem; }
.footer .drip { --drip-colour: var(--candyfloss); }
.footer__inner { max-width: var(--wrap); margin: 0 auto; padding: 1.5rem var(--gutter) 2.5rem; text-align: center; }
.footer__brand { font-family: var(--display); font-size: 2rem; color: var(--bubblegum); margin: 0; }
.footer__tagline { opacity: .85; }
.footer__links { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.6rem; }
.footer a { color: var(--lemon); }
.footer a:hover { color: #fff; }
.footer__small { font-size: .85rem; opacity: .65; margin: 0; }

/* ---------- Gallery page ---------- */

.gallery-head { padding-block: clamp(2rem, 5vw, 3.5rem) 1.5rem; text-align: center; }
.gallery-head .lede { margin-inline: auto; }

.jellybeans { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: 1.2rem; }
.jellybean {
  --bean: #fff; --bean-dark: rgba(74,35,51,.15);
  font-weight: 600;
  text-decoration: none;
  color: var(--cocoa);
  background:
    radial-gradient(ellipse 30% 18% at 30% 25%, rgba(255,255,255,.7), transparent),
    var(--bean);
  padding: .55rem 1.3rem;
  border-radius: 999px 999px 999px 999px / 60% 70% 60% 70%;
  box-shadow: inset 0 -4px 0 var(--bean-dark);
}
.jellybean--0 { --bean: #FFB3CF; --bean-dark: #E8649E; }
.jellybean--1 { --bean: #B4E8DC; --bean-dark: #6CC4B0; }
.jellybean--2 { --bean: #FFE08A; --bean-dark: #EFC254; }
.jellybean--3 { --bean: #D4BDFF; --bean-dark: #AE90F0; }
.jellybean--4 { --bean: #FFD0B5; --bean-dark: #F0A47A; }
.jellybean:hover { color: var(--cocoa); animation: jelly .5s; }
.jellybean[aria-current="page"] { --bean: var(--raspberry); --bean-dark: var(--raspberry-deep); color: #fff; }

.masonry {
  list-style: none; margin: 0; padding: 1rem 0 2rem;
  columns: 3 280px;
  column-gap: clamp(1rem, 3vw, 2.2rem);
}
.masonry__item { break-inside: avoid; margin-bottom: clamp(1.2rem, 3vw, 2.2rem); }
.masonry__item:nth-child(4n+1) .polaroid { rotate: -2deg; }
.masonry__item:nth-child(4n+2) .polaroid { rotate: 1.5deg; }
.masonry__item:nth-child(4n+3) .polaroid { rotate: -1deg; }
.masonry__item:nth-child(4n)   .polaroid { rotate: 2.5deg; }
.polaroid--grid { transition: rotate .4s var(--bounce), transform .4s var(--bounce), box-shadow .3s; }
.polaroid--grid:hover, .polaroid--grid:focus-visible {
  rotate: 0deg; transform: scale(1.03);
  box-shadow: 0 0 0 5px var(--bubblegum), 0 20px 30px rgba(74,35,51,.22);
}

.empty-gallery { text-align: center; padding-block: 2rem 3rem; }
.empty-gallery__plate {
  width: 220px; height: 60px; margin: 0 auto 1.4rem; border-radius: 50%;
  background: #fff; box-shadow: inset 0 -8px 0 #F1D7E1, 0 10px 20px rgba(74,35,51,.12);
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  padding: 1rem;
  background: rgba(74,35,51,.88);
  backdrop-filter: blur(4px);
}
.lightbox[hidden] { display: none; }
.lightbox__figure {
  margin: 0; justify-self: center;
  max-height: 100%;
  display: flex; flex-direction: column; align-items: center;
  animation: pop-on .4s var(--bounce);
}
.lightbox__img {
  max-width: min(100%, 1100px);
  max-height: calc(100vh - 9rem);
  width: auto;
  border-radius: 10px;
  border: 10px solid #fff;
  box-shadow: 0 0 0 8px var(--bubblegum), 0 30px 60px rgba(0,0,0,.35);
  background: var(--candyfloss);
}
.lightbox__caption { color: var(--cream); text-align: center; margin-top: 1.2rem; max-width: 40em; }
.lightbox__title { display: block; font-family: var(--display); font-size: 1.6rem; color: #fff; line-height: 1.3; }
.lightbox__text { display: block; opacity: .9; }
.lightbox__nav, .lightbox__close {
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  font: 700 2rem/1 var(--body); color: var(--cocoa);
  background: conic-gradient(from 45deg, #fff 0 25%, var(--candyfloss) 0 50%, #fff 0 75%, var(--candyfloss) 0);
  box-shadow: 0 5px 0 var(--raspberry);
  cursor: pointer;
  transition: transform .3s var(--bounce);
}
.lightbox__nav:hover, .lightbox__close:hover { transform: scale(1.12) rotate(-10deg); }
.lightbox__close { position: absolute; top: 1rem; right: 1rem; z-index: 2; }

@media (max-width: 700px) {
  .lightbox { grid-template-columns: 1fr; padding: 4.5rem .6rem 5.5rem; }
  .lightbox__nav { position: absolute; bottom: 1.2rem; }
  .lightbox__nav--prev { left: calc(50% - 72px); }
  .lightbox__nav--next { right: calc(50% - 72px); }
  .lightbox__img { max-height: calc(100vh - 14rem); border-width: 6px; }
}

.notice-install { padding-block: 1rem 2rem; text-align: center; }

/* ---------- Confetti canvas ---------- */

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

/* ---------- "Dark theme": deliberately the same sweet-shop colours ----------
   Browsers that force dark mode skip sites that provide their own dark theme.
   This block is that theme, restating the light palette so nothing changes. */

@media (prefers-color-scheme: dark) {
  html { background: #FFE6F0; color-scheme: only light; }
  body { background-color: #FFE6F0; color: #4A2333; }
  .topbar, .nav { background: #FFF8F1; }
  .footer { background: #4A2333; color: #FFF8F1; }
  .polaroid, .chip, .nav__link { background-color: #fff; }
  .builder { background-color: #D9F5EE; }
  .ticket { background: #FFD966; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
