/* ============================================================================
   Binge Bakes: home.css
   Homepage only, loaded after styles.css. The homepage is a baker's lookbook
   laid out on a pink kitchen table: tilted photo prints, polaroids, hand-drawn
   underlines and sprinkles.

   Motion rules:
   - Everything plays once, then the page is still.
   - Only transform, opacity and stroke-dashoffset are animated.
   - Every hidden "before" state hangs off html.home-motion, which home.js adds
     only when it is going to animate. Without it (no script, an error,
     reduced motion or ?still=1) the page shows its finished state.
   - Animations use backwards fill and end on the element's resting style, so
     once they finish, hover and other transitions work as normal.
   ========================================================================== */

:root {
  --bg-tabletop:     #FBF6F2;
  --bg-sheet:        #FFFDFB;
  --bg-tasting:      #F9EFE9;
  --border-paper:    #EAD9CE;
  --shadow-print:    0 14px 32px rgba(92, 38, 9, 0.13), 0 3px 9px rgba(92, 38, 9, 0.07);
  --shadow-print-lg: 0 20px 46px rgba(92, 38, 9, 0.16), 0 5px 14px rgba(92, 38, 9, 0.08);
  --tape-tint:       rgba(251, 203, 184, 0.62);
}

/* The kitchen table under the whole page */
body {
  background-color: var(--bg-tabletop);
  background-image:
    radial-gradient(circle at 15% 12%, rgba(248, 160, 164, 0.12), transparent 45%),
    radial-gradient(circle at 85% 38%, rgba(251, 203, 184, 0.22), transparent 50%),
    repeating-linear-gradient(0deg, rgba(92, 38, 9, 0.012) 0px, rgba(92, 38, 9, 0.012) 1px, transparent 1px, transparent 28px);
}

/* The homepage decorates itself once and then stays still, so the shared
   WhatsApp bob is switched off here. Other pages keep it. */
.whatsapp-fab { animation: none; }

/* ----------------------------------------------------------------------------
   1. SHARED PIECES: hand-drawn underlines, masking tape, the little heart
   -------------------------------------------------------------------------- */
.hand-underline {
  display: block;
  width: 210px;
  height: 16px;
  margin: 4px 0 18px;
  color: var(--accent);
  overflow: visible;
}
.hand-underline--center {
  margin-left: auto;
  margin-right: auto;
}

.print-tape {
  position: absolute;
  z-index: 4;
  width: 74px;
  height: 22px;
  background: var(--tape-tint);
  border-left: 1.5px dashed rgba(92, 38, 9, 0.14);
  border-right: 1.5px dashed rgba(92, 38, 9, 0.14);
  box-shadow: 0 2px 5px rgba(92, 38, 9, 0.07);
  pointer-events: none;
}
.print-tape--top {
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
}
.print-tape--left {
  top: -9px;
  left: 28%;
  transform: rotate(4deg);
}

.print-heart {
  font-family: var(--font-body);
  font-size: 0.78em;
  color: var(--accent);
}

/* ----------------------------------------------------------------------------
   2. HERO: two tilted photo prints
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
}
.hero__blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero__blob--top {
  top: -140px;
  right: -90px;
  width: 540px;
  height: 540px;
  background: radial-gradient(circle, rgba(248, 160, 164, 0.32), transparent 70%);
}
.hero__blob--bottom {
  bottom: -120px;
  left: -100px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(251, 203, 184, 0.4), transparent 70%);
}

.hero__inner {
  position: relative;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 54px 24px 72px;
  display: grid;
  grid-template-columns: 0.96fr 1.04fr;
  grid-template-areas:
    "head prints"
    "body prints";
  gap: 14px 52px;
  align-items: center;
}
.hero__head { grid-area: head; align-self: end; }
.hero__body { grid-area: body; align-self: start; }

.hero__script {
  display: block;
  font-size: 38px;
  margin: 0 0 6px;
}
.hero__title {
  font-family: var(--font-display);
  color: var(--text-heading);
  font-weight: var(--fw-extra);
  font-size: clamp(40px, 5vw, 66px);
  line-height: 1.04;
  letter-spacing: var(--ls-tight);
  margin: 0 0 18px;
}
.hero__word {
  display: inline-block;
  transform-origin: 0 100%;
}
.hand-underline--hero {
  width: 240px;
  height: 18px;
  margin: 2px 0 10px;
}
.hero__lead {
  font-size: 19px;
  color: var(--text-body);
  max-width: 480px;
  margin: 0 0 30px;
  line-height: 1.62;
}
.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.hero__points {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.hero__point {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--text-body);
}
.hero__point-heart { color: var(--accent); font-size: 17px; }

/* The stage holding the two prints, side by side with a clear gap; the right
   one sits lower so they still read as a pair. --px / --py is how far the
   sprinkle layer reaches beyond the stage. */
.hero__prints {
  grid-area: prints;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 10 / 7.7;
  margin: 0 auto;
  --px: 40px;
  --py: 40px;
}
/* Warm glow on the table behind the prints */
.hero__prints::before {
  content: "";
  position: absolute;
  inset: 4% 2%;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 84, 109, 0.22), rgba(251, 203, 184, 0.25) 58%, transparent 76%);
  filter: blur(28px);
  pointer-events: none;
}

.hero-print {
  position: absolute;
  margin: 0;
  padding: 11px 11px 14px;
  background: #fff;
  border: 1px solid var(--border-paper);
  border-radius: 8px;
  box-shadow: var(--shadow-print-lg);
  transform: rotate(var(--rot));
  backface-visibility: hidden;
}
.hero-print--left {
  top: 0;
  left: 0;
  z-index: 1;
  width: 46.5%;
  --rot: -3.4deg;
}
.hero-print--right {
  bottom: 0;
  right: 0;
  z-index: 2;
  width: 49%;
  --rot: 2.6deg;
}
.hero-print__photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.6;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-blush-tint);
}
.hero-print__caption {
  padding: 10px 2px 2px;
  font-family: var(--font-script);
  font-weight: var(--fw-bold);
  font-size: 22px;
  line-height: 1.15;
  color: var(--color-cocoa);
  text-align: center;
}

/* Handwritten note in the margin beside the prints (wide screens only) */
.hero__note {
  position: absolute;
  bottom: 5%;
  left: 3%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  background: rgba(255, 253, 251, 0.94);
  border: 1px solid var(--border-paper);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 12px rgba(92, 38, 9, 0.08);
  color: var(--color-pink-deep);
  font-family: var(--font-script);
  font-size: 22px;
  line-height: 1;
  transform: rotate(-4deg);
  pointer-events: none;
}
.hero__note-arrow {
  color: var(--accent);
  transform: rotate(25deg);
}

/* Tablets and phones: title, then the two prints, then the lead and buttons */
@media (max-width: 960px) {
  .hero__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "prints"
      "body";
    gap: 10px;
    padding: 20px 20px 40px;
  }
  .hero__prints {
    max-width: 420px;
    aspect-ratio: 16 / 11;
    margin: 22px auto 24px;
    --px: 30px;
    --py: 18px;
  }
  .hero-print { padding: 8px 8px 10px; }
  .hero-print--right { width: 50%; }
  .hero-print__photo { aspect-ratio: 4 / 4.2; }
  .hero-print__caption { font-size: 18px; padding: 6px 2px 0; }
  .hero__note { font-size: 18px; bottom: 4%; left: 2%; padding: 4px 8px; }
}

/* Phones: title, both prints and both buttons fit the first 390 x 844 screen */
@media (max-width: 640px) {
  .hero__inner { padding: 12px 18px 28px; gap: 8px; }
  .hero__script { font-size: 25px; margin: 0 0 2px; line-height: 1.08; }
  .hero__title { font-size: clamp(30px, 8.2vw, 36px); line-height: 1.04; margin: 0 0 2px; }
  .hand-underline--hero { width: 165px; height: 12px; margin: 2px 0; }

  .hero__prints {
    max-width: 318px;
    aspect-ratio: 16 / 10.9;
    margin: 13px auto 15px;
    --px: 18px;
    --py: 11px;
  }
  .hero-print { padding: 6px 6px 8px; }
  .hero-print__photo { aspect-ratio: 4 / 3.9; }
  .hero-print__caption { font-size: 15.5px; padding: 5px 2px 0; }
  .print-tape { width: 50px; height: 15px; }
  .hero__note { display: none; }

  .hero__lead { font-size: 14.5px; line-height: 1.44; margin: 0 0 10px; }
  .hero__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }
  .hero__actions .btn {
    padding: 12px 10px;
    font-size: 13.5px;
    line-height: 1.2;
    text-align: center;
  }
  .hero__points { gap: 8px 14px; }
  .hero__point { font-size: 12.5px; }
}
@media (max-width: 355px) {
  .hero__actions { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------------------
   3. CUPCAKE FLAVOURS
   Wide screens: hover, focus or tap a flavour to slide its print forward.
   Phones and small tablets: the same six cards are a swipe row with dots.
   -------------------------------------------------------------------------- */
.section--cupcakes {
  padding: 78px 0 86px;
  background: var(--bg-tasting);
  border-top: 1px solid var(--border-paper);
  border-bottom: 1px solid var(--border-paper);
}
.cupcakes__head {
  max-width: 640px;
  margin: 0 0 36px;
}
.cupcakes__head .script-accent {
  display: block;
  margin-bottom: 4px;
}
.cupcakes__title {
  font-family: var(--font-display);
  color: var(--text-heading);
  font-weight: var(--fw-extra);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: var(--ls-tight);
  margin: 0 0 4px;
}
.cupcakes__lede {
  max-width: 52ch;
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-body);
}

.flavours {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 4.5vw, 58px);
  align-items: start;
}
.flavours__stage {
  position: sticky;
  top: 102px;
  z-index: 1;
}
.flavours__plate {
  position: relative;
  width: 100%;
  padding: 22px 24px 28px;
}
.flavours__rim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 16px 32px rgba(92, 38, 9, 0.09));
}

/* A stacked deck of the six prints in a fixed-ratio frame, so nothing shifts
   as the photo changes */
.flavour-deck {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 4 / 3.15;
}
.flavour-card {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border-paper);
  border-radius: 10px;
  box-shadow: var(--shadow-print);
  opacity: 0;
  transform: translate3d(32px, 10px, 0) rotate(3.8deg) scale(0.94);
  transition:
    transform 460ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 360ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
/* the flavour just put down, peeking out on the left */
.flavour-card.is-prev {
  z-index: 1;
  opacity: 0.58;
  transform: translate3d(-12px, 8px, 0) rotate(-3.2deg) scale(0.95);
}
/* one more print under the pile, peeking out on the right */
.flavour-card.is-under {
  z-index: 0;
  opacity: 0.34;
  transform: translate3d(12px, 10px, 0) rotate(2.8deg) scale(0.93);
}
.flavour-card.is-active {
  z-index: 3;
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(-0.7deg) scale(1);
  pointer-events: auto;
}
.flavour-card__photo {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
  border-radius: 5px;
  background: var(--color-blush-tint);
}
.flavour-card__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 11px 4px 0;
}
.flavour-card__num {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-blush-tint);
  color: var(--accent);
  font-size: 12px;
  font-weight: var(--fw-extra);
  letter-spacing: 0.14em;
}
.flavour-card__name {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 20px;
  color: var(--color-cocoa);
}
.flavour-card__note {
  margin-left: auto;
  font-family: var(--font-script);
  font-size: 21px;
  color: var(--color-cocoa-soft);
}

/* The numbered flavour menu beside the deck */
.flavours__menu {
  padding: 22px 24px 26px;
  background: var(--bg-sheet);
  border: 1px solid var(--border-paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.flavours__prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13.5px;
  font-weight: var(--fw-bold);
  color: var(--color-cocoa-soft);
}
.flavours__prompt-heart { color: var(--accent); }

.flavour-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  counter-reset: flavour;
}
.flavour-list li {
  counter-increment: flavour;
  border-top: 1px dashed var(--border-paper);
}
.flavour-list li:last-child { border-bottom: 1px dashed var(--border-paper); }

.flavour-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: calc(100% + 12px);
  margin: 2px -6px;
  padding: 11px 14px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms var(--ease-out);
}
.flavour-item::before {
  content: counter(flavour, decimal-leading-zero);
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: var(--color-buttercream-tint);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: var(--fw-extra);
  letter-spacing: 0.14em;
}
.flavour-item__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.flavour-item__name {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: clamp(20px, 2.1vw, 25px);
  line-height: 1.15;
  color: var(--color-cocoa);
}
.flavour-item__sub {
  font-size: 13.5px;
  font-weight: var(--fw-medium);
  line-height: 1.35;
  color: var(--text-muted);
}
.flavour-item__tag {
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--color-blush-tint);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: var(--fw-extra);
  white-space: nowrap;
  opacity: 0.72;
}
.flavour-item:hover,
.flavour-item:focus-visible { transform: translateX(4px); }
.flavour-item.is-active {
  background: var(--color-blush-tint);
  transform: translateX(6px);
}
.flavour-item.is-active::before {
  background: var(--accent);
  color: #fff;
}
.flavour-item.is-active .flavour-item__sub { color: var(--color-cocoa-soft); }
.flavour-item.is-active .flavour-item__tag {
  background: var(--accent);
  color: #fff;
  opacity: 1;
}

.flavours__order {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  background: var(--color-buttercream-tint);
  border: 1px solid var(--border-paper);
  border-radius: var(--radius-md);
}
.flavours__order .btn { align-self: flex-start; }
.cupcakes__price {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}
.cupcakes__price strong { color: var(--text-heading); }

/* Dots for the phone swipe row; home.js adds them, CSS shows them */
.flavour-dots { display: none; }

@media (max-width: 820px) {
  .flavours { display: block; }
  .flavours__stage {
    position: static;
    margin: 0 calc(-1 * var(--container-pad));
  }
  .flavours__plate { padding: 0; }
  .flavours__rim { display: none; }

  .flavour-deck {
    display: flex;
    align-items: stretch;
    gap: 14px;
    aspect-ratio: auto;
    padding: 6px var(--container-pad) 18px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--container-pad);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .flavour-deck::-webkit-scrollbar { display: none; }
  /* keeps the right padding when scrolled to the end */
  .flavour-deck::after {
    content: "";
    flex: 0 0 1px;
  }
  .flavour-card,
  .flavour-card.is-active,
  .flavour-card.is-prev,
  .flavour-card.is-under {
    position: relative;
    inset: auto;
    z-index: auto;
    flex: 0 0 78%;
    max-width: 330px;
    padding: 10px 10px 14px;
    opacity: 1;
    transform: none;
    transition: none;
    pointer-events: auto;
    scroll-snap-align: start;
  }
  .flavour-card__photo {
    flex: none;
    aspect-ratio: 4 / 3;
  }
  .flavour-card__caption {
    align-items: center;
    gap: 4px 9px;
  }
  .flavour-card__name { font-size: 21px; }
  .flavour-card__note {
    flex: 0 0 100%;
    margin-left: 0;
    line-height: 1.2;
  }

  .flavour-dots {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin: -4px 0 14px;
  }
  .flavour-dot {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .flavour-dot::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.28;
    transform: scale(0.8);
    transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
  }
  .flavour-dot.is-active::before {
    opacity: 1;
    transform: scale(1.3);
  }

  /* The list is the wide-screen control; on phones the row is */
  .flavours__menu {
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .flavours__prompt,
  .flavour-list { display: none; }
}

@media (max-width: 640px) {
  .section--cupcakes { padding: 60px 0 64px; }
  .flavours__order .btn { align-self: stretch; }
}

/* ----------------------------------------------------------------------------
   4. SHOP TREATS STRIP
   -------------------------------------------------------------------------- */
.section--treats {
  position: relative;
  overflow: hidden;
  padding: 76px 0 80px;
  background:
    radial-gradient(circle at 12% 0%, rgba(248, 160, 164, 0.26), transparent 46%),
    linear-gradient(180deg, #FDE6E7, #FDEEE8);
  border-bottom: 1px solid var(--border-paper);
}
.treats__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 20px;
  margin-bottom: 26px;
}
.treats__head .script-accent {
  display: block;
  margin-bottom: 2px;
}
.treats__head .hand-underline { margin-bottom: 0; }
.treats__title {
  font-family: var(--font-display);
  color: var(--color-cocoa);
  font-weight: var(--fw-extra);
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.12;
  letter-spacing: var(--ls-tight);
  margin: 0 0 4px;
}

.treat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 0 10px;
}
.treat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 18px;
  background: #fff;
  border: 1px solid var(--border-paper);
  border-radius: 10px;
  box-shadow: var(--shadow-print);
  color: inherit;
  text-decoration: none;
  transform: rotate(var(--r, 0deg)) translateY(var(--ty, 0px));
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.treat-strip .treat-card:nth-child(5n + 1) { --r: -1.3deg; --ty: 0px; }
.treat-strip .treat-card:nth-child(5n + 2) { --r: 1.1deg;  --ty: 5px; }
.treat-strip .treat-card:nth-child(5n + 3) { --r: -0.8deg; --ty: -3px; }
.treat-strip .treat-card:nth-child(5n + 4) { --r: 1.5deg;  --ty: 3px; }
.treat-strip .treat-card:nth-child(5n + 5) { --r: -1deg;  --ty: -2px; }

.treat-card__tape {
  position: absolute;
  top: -9px;
  left: 50%;
  z-index: 3;
  width: 62px;
  height: 19px;
  background: rgba(248, 160, 164, 0.5);
  border-left: 1px dashed rgba(92, 38, 9, 0.14);
  border-right: 1px dashed rgba(92, 38, 9, 0.14);
  box-shadow: 0 2px 4px rgba(92, 38, 9, 0.06);
  transform: translateX(-50%) rotate(-1.5deg);
  pointer-events: none;
}

/* A fixed 4:3 slot holding the tinted placeholder. A real photo fades in over
   it once its onload marks it .is-loaded; a missing one removes itself (see
   the img's onerror). The photo stays transparent until then, so even with
   scripts off there is never a broken-image icon, just the placeholder, and
   never a layout shift. */
.treat-card__photo {
  flex: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 5px;
}
.treat-card__photo .placeholder__label { font-size: 27px; }
.treat-card__img {
  opacity: 0;
  transition: opacity 400ms var(--ease-out);
}
.treat-card__img.is-loaded { opacity: 1; }

.treat-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 4px 0;
}
.treat-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.treat-card__name {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 20px;
  line-height: 1.2;
  color: var(--color-cocoa);
}
.treat-card__price {
  flex: none;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  box-shadow: 0 4px 10px rgba(233, 84, 109, 0.26);
  color: #fff;
  font-size: 14px;
  font-weight: var(--fw-extra);
  transform: rotate(2deg);
}
.treat-card__desc {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-body);
}

/* ----------------------------------------------------------------------------
   5. GALLERY: polaroid prints, captions written underneath
   -------------------------------------------------------------------------- */
.home-gallery {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 20%, rgba(248, 160, 164, 0.18), transparent 45%),
    var(--color-buttercream);
  border-bottom: 1px solid var(--border-paper);
}
.home-gallery .gallery__head .script-accent {
  display: block;
  margin-bottom: 2px;
}
.home-gallery .gallery__head .hand-underline { margin-bottom: 0; }

.polaroid-deck {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 22px;
  padding: 12px 0 20px;
}
.polaroid {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 18px;
  background: #fff;
  border: 1px solid var(--border-paper);
  border-radius: 8px;
  box-shadow: var(--shadow-print);
  text-decoration: none;
  transform: rotate(var(--r, 0deg)) translateY(var(--ty, 0px));
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.polaroid-deck .polaroid:nth-child(4n + 1) { --r: -2.1deg; --ty: 0px; }
.polaroid-deck .polaroid:nth-child(4n + 2) { --r: 1.7deg;  --ty: 6px; }
.polaroid-deck .polaroid:nth-child(4n + 3) { --r: -1.4deg; --ty: -4px; }
.polaroid-deck .polaroid:nth-child(4n + 4) { --r: 2.2deg;  --ty: 4px; }

.polaroid__tape {
  position: absolute;
  top: -9px;
  left: 50%;
  z-index: 3;
  width: 62px;
  height: 19px;
  background: rgba(253, 235, 226, 0.78);
  border-left: 1px dashed rgba(92, 38, 9, 0.14);
  border-right: 1px dashed rgba(92, 38, 9, 0.14);
  box-shadow: 0 2px 4px rgba(92, 38, 9, 0.06);
  transform: translateX(-50%) rotate(-1.5deg);
  pointer-events: none;
}
.polaroid__photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-blush-tint);
}
.polaroid__caption {
  display: block;
  padding: 14px 6px 2px;
  font-family: var(--font-script);
  font-weight: var(--fw-bold);
  font-size: 23px;
  line-height: 1.18;
  color: var(--color-cocoa);
  text-align: center;
}

@media (hover: hover) {
  .treat-strip .treat-card:hover,
  .treat-strip .treat-card:focus-visible,
  .polaroid-deck .polaroid:hover,
  .polaroid-deck .polaroid:focus-visible {
    z-index: 5;
    transform: rotate(0deg) translateY(-7px) scale(1.02);
  }
}

/* The Bespoke Cake Enquiry card inside the gallery */
.bespoke-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 34px;
  padding: 26px 30px;
  background: var(--bg-sheet);
  border: 1.5px dashed var(--color-blush);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.bespoke-note__copy { max-width: 580px; }
.bespoke-note__copy .script-accent {
  display: block;
  margin-bottom: 2px;
  font-size: 28px;
}
.bespoke-note__title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.18;
  color: var(--color-cocoa);
}
.bespoke-note__text {
  margin: 0;
  font-size: 15.5px;
  color: var(--text-body);
}
.bespoke-note__cta { text-align: center; }

/* Laptops, tablets and phones: swipe rows with a peek of the next card */
@media (max-width: 1199px) {
  .treat-strip {
    display: flex;
    align-items: stretch;
    gap: 16px;
    margin: 0 calc(-1 * var(--container-pad));
    padding: 16px var(--container-pad) 26px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--container-pad);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .treat-strip::-webkit-scrollbar { display: none; }
  .treat-strip::after {
    content: "";
    flex: 0 0 1px;
  }
  .treat-strip .treat-card {
    flex: 0 0 76%;
    max-width: 300px;
    scroll-snap-align: start;
  }
  .treat-strip .treat-card:nth-child(odd)  { --r: -1.1deg; --ty: 0px; }
  .treat-strip .treat-card:nth-child(even) { --r: 1.1deg;  --ty: 3px; }
}

@media (max-width: 768px) {
  .polaroid-deck {
    display: flex;
    gap: 16px;
    margin: 0 calc(-1 * var(--container-pad));
    padding: 16px var(--container-pad) 28px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--container-pad);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .polaroid-deck::-webkit-scrollbar { display: none; }
  .polaroid-deck::after {
    content: "";
    flex: 0 0 1px;
  }
  .polaroid-deck .polaroid {
    flex: 0 0 74%;
    max-width: 280px;
    scroll-snap-align: start;
  }
  .polaroid-deck .polaroid:nth-child(odd)  { --r: -1.4deg; --ty: 0px; }
  .polaroid-deck .polaroid:nth-child(even) { --r: 1.4deg;  --ty: 3px; }
}

@media (max-width: 640px) {
  .section--treats { padding: 52px 0 50px; }
  .treats__head { margin-bottom: 14px; }
  .treats__cta { padding: 12px 20px; font-size: 14.5px; }

  .bespoke-note { padding: 20px 18px; }
  .bespoke-note__cta { width: 100%; }
}

/* ----------------------------------------------------------------------------
   6. MEET THE BAKER: Anna's polaroid and the "made with love" stamp
   -------------------------------------------------------------------------- */
.section--about { overflow: hidden; }
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: center;
}
.about__media { position: relative; }
.about-polaroid {
  position: relative;
  margin: 0;
  padding: 14px 14px 20px;
  background: #fff;
  border: 1px solid var(--border-paper);
  border-radius: 10px;
  box-shadow: var(--shadow-print-lg);
  transform: rotate(-1.8deg);
}
.placeholder--about {
  aspect-ratio: 4 / 5;
  border-radius: 4px;
}
.placeholder--about .placeholder__highlight {
  background: radial-gradient(circle at 70% 24%, rgba(255, 255, 255, 0.4), transparent 48%);
}
.about-polaroid__caption {
  padding: 14px 6px 2px;
  font-family: var(--font-script);
  font-weight: var(--fw-bold);
  font-size: 25px;
  line-height: 1.15;
  color: var(--color-cocoa);
  text-align: center;
}

.about__badge {
  position: absolute;
  bottom: 74px;
  right: -14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 14px;
  background: #FFFDF9;
  border: 1.5px solid var(--color-blush);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(92, 38, 9, 0.16), inset 0 0 0 4px #fff, inset 0 0 0 5.5px var(--color-blush);
  transform: rotate(-5deg);
}
/* the ring that flashes out as the stamp lands */
.about__badge::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(233, 84, 109, 0.55);
  opacity: 0;
  pointer-events: none;
}
.about__badge-pin {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}
.about__badge-text {
  margin: 0;
  font-family: var(--font-script);
  font-weight: var(--fw-bold);
  font-size: 27px;
  line-height: 1;
  color: var(--accent);
}

.about__copy .script-accent {
  display: block;
  margin-bottom: 4px;
}
.about__title {
  font-family: var(--font-display);
  color: var(--color-cocoa);
  font-weight: var(--fw-extra);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: var(--ls-tight);
  margin: 0 0 6px;
}
.about__para {
  font-size: 18px;
  color: var(--text-body);
  line-height: 1.7;
  margin: 0 0 18px;
}
.about__para:last-of-type { margin-bottom: 28px; }
.about__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
}
.stat__value {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-extra);
  font-size: 34px;
  color: var(--accent);
}
.stat__label {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: var(--fw-bold);
  color: var(--text-body);
}

@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; gap: 44px; }
  .about__media { max-width: 420px; }
}
@media (max-width: 640px) {
  .about__badge { right: -6px; bottom: 72px; padding: 10px 16px 12px; }
  .about__stats { gap: 24px; }
}

/* ----------------------------------------------------------------------------
   7. FAQ: recipe cards on the tasting cloth
   -------------------------------------------------------------------------- */
.section--faq {
  background: var(--bg-tasting);
  border-top: 1px solid var(--border-paper);
  border-bottom: 1px solid var(--border-paper);
}
.section--faq .faq-item {
  background: var(--bg-sheet);
  border: 1px solid var(--border-paper);
}

/* ----------------------------------------------------------------------------
   8. CLOSING BAND: pinker, with room at the bottom for the sprinkle heap
   -------------------------------------------------------------------------- */
.section--cta {
  position: relative;
  overflow: hidden;
  padding-bottom: 168px;
  background: linear-gradient(180deg, rgba(253, 230, 231, 0) 0%, #FCDDDF 100%);
}
.section--cta .container {
  position: relative;
  z-index: 1;
}
.cta-card {
  position: relative;
  padding: 48px 32px;
  background: var(--bg-sheet);
  border: 1.5px solid var(--border-paper);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-print);
  text-align: center;
}
.cta-card .section__lead { margin-bottom: 28px; }
.cta-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
@media (max-width: 640px) {
  .section--cta { padding-bottom: 140px; }
  .cta-card { padding: 34px 20px; }
  .cta-card__actions { flex-direction: column; align-items: stretch; }
}

/* ----------------------------------------------------------------------------
   9. SPRINKLES
   home.js flies the pieces in on a short-lived canvas, then swaps it for this
   static layer positioned in percentages and removes the canvas.
   -------------------------------------------------------------------------- */
.sprinkles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.sprinkles canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.sprinkles__piece {
  position: absolute;
  display: block;
  border-radius: 99px;
  opacity: 0;
}
.sprinkles.is-set .sprinkles__piece { opacity: 1; }
/* the hero layer reaches a little beyond the stage, behind both prints */
.sprinkles--hero {
  inset: calc(-1 * var(--py)) calc(-1 * var(--px));
}
/* the small burst when a primary button is pressed */
.sprinkle-pop {
  position: fixed;
  z-index: 100;
  width: 260px;
  height: 260px;
  margin: -130px 0 0 -130px;
  pointer-events: none;
}

/* ----------------------------------------------------------------------------
   10. ONE-SHOT MOTION (only under html.home-motion)
   -------------------------------------------------------------------------- */
@keyframes homeSlideIn {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes homeWordSettle {
  from { opacity: 0; transform: translateY(0.5em) rotate(5deg); }
  to   { opacity: 1; transform: translateY(0) rotate(0); }
}
@keyframes homePrintIn {
  from { opacity: 0; transform: translate3d(0, 30px, 0) rotate(calc(var(--rot) * 3.2)) scale(0.84); }
  55%  { opacity: 1; }
  to   { opacity: 1; transform: rotate(var(--rot)); }
}
@keyframes homeDeal {
  from { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(22deg) scale(1.16); }
  35%  { opacity: 1; }
  to   { opacity: 1; transform: rotate(var(--r, 0deg)) translateY(var(--ty, 0px)); }
}
@keyframes homeStamp {
  0%   { opacity: 0; transform: rotate(-20deg) scale(2.4); }
  45%  { opacity: 1; transform: rotate(-4deg) scale(0.9); }
  70%  { opacity: 1; transform: rotate(-5.5deg) scale(1.05); }
  100% { opacity: 1; transform: rotate(-5deg) scale(1); }
}
@keyframes homeStampRing {
  0%   { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.35, 1.7); }
}
@keyframes homePress {
  0%   { transform: rotate(-1.8deg) scale(1); }
  30%  { transform: rotate(-1.2deg) scale(0.982); }
  100% { transform: rotate(-1.8deg) scale(1); }
}
@keyframes homePop {
  from { opacity: 0; transform: translateY(18px) scale(0.86); }
  to   { opacity: 1; transform: none; }
}

/* Hero: the words settle, the prints are laid down, the rest slides in */
html.home-motion .hero__script { animation: homeSlideIn 700ms var(--ease-out) 40ms backwards; }
html.home-motion .hero__word { animation: homeWordSettle 760ms cubic-bezier(0.22, 1.2, 0.36, 1) backwards; }
html.home-motion .hero__word:nth-child(1) { animation-delay: 160ms; }
html.home-motion .hero__word:nth-child(2) { animation-delay: 250ms; }
html.home-motion .hero__word:nth-child(3) { animation-delay: 340ms; }
html.home-motion .hero__word:nth-child(4) { animation-delay: 430ms; }
html.home-motion .hero__word:nth-child(5) { animation-delay: 520ms; }
html.home-motion .hero__lead    { animation: homeSlideIn 700ms var(--ease-out) 560ms backwards; }
html.home-motion .hero__actions { animation: homeSlideIn 700ms var(--ease-out) 680ms backwards; }
html.home-motion .hero__point   { animation: homeSlideIn 600ms var(--ease-out) backwards; }
html.home-motion .hero__point:nth-child(1) { animation-delay: 820ms; }
html.home-motion .hero__point:nth-child(2) { animation-delay: 930ms; }
html.home-motion .hero__point:nth-child(3) { animation-delay: 1040ms; }
html.home-motion .hero-print { animation: homePrintIn 760ms cubic-bezier(0.22, 1.25, 0.36, 1) 160ms backwards; }
html.home-motion .hero-print--right { animation-delay: 330ms; }

/* Underlines draw in once seen. home.js measures each path into --len; if it
   never does, var(--len) is invalid and the line is simply drawn. */
html.home-motion .hand-underline__path {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  transition: stroke-dashoffset 900ms cubic-bezier(0.22, 1, 0.36, 1);
}
html.home-motion .hand-underline.is-drawn .hand-underline__path { stroke-dashoffset: 0; }

/* Treat cards and polaroids are dealt onto the table one by one */
.deal {
  --dx: 70%;
  --dy: -46%;
}
@media (max-width: 960px) {
  .deal {
    --dx: 52%;
    --dy: 0%;
  }
}
html.home-motion .deal:not(.is-in) > a { opacity: 0; }
html.home-motion .deal.is-in > a {
  animation: homeDeal 720ms cubic-bezier(0.2, 0.9, 0.3, 1.12) backwards;
  animation-delay: calc(var(--i, 0) * 110ms);
}

/* "made with love" stamps onto Anna's polaroid, which gives a little under it */
html.home-motion .about__media:not(.is-in) .about__badge { opacity: 0; }
html.home-motion .about__media.is-in .about__badge { animation: homeStamp 560ms cubic-bezier(0.3, 0, 0.2, 1) backwards; }
html.home-motion .about__media.is-in .about__badge::after { animation: homeStampRing 700ms ease-out 250ms; }
html.home-motion .about__media.is-in .about-polaroid { animation: homePress 520ms ease-out 240ms; }

/* The closing buttons pop in under the last shower */
html.home-motion .section--cta:not(.is-in) .cta-card__actions .btn { opacity: 0; }
html.home-motion .section--cta.is-in .cta-card__actions .btn { animation: homePop 620ms cubic-bezier(0.34, 1.5, 0.64, 1) backwards; }
html.home-motion .section--cta.is-in .cta-card__actions .btn + .btn { animation-delay: 140ms; }
