/* ==========================================================================
   BLENDZ — blend builder ("why us?")  ·  PHASE 1: static layout only
   --------------------------------------------------------------------------
   Every number below is traced from assets/references/blendz why us.png.
   Reference poster = 432 x 709 px (the purple canvas inside the mock-up's
   white bezel; the mock crops the poster top and both sides of the strip).

   Reference ink boxes, measured off that canvas:
     why us?      x  33..398   y  53..116   (366 x 63)
     lede         x  17..413   y 141..158   (397 x 17)
     spark        x 207..245   y 198..236   ( 39 x 38)
     blender      x 178..273   y 270..432   ( 96 x 162)
     hint         x  96..365   y 448..465   (270 x 17)
     fruit band              y 477..570   (h 94)
       rose belt             y 498..560   (h 62)
     blendz btn   x 143..309   y 629..678  (167 x 49)

   Scaling model
   -------------
   Same as the two finished sections: .blend-builder__inner is a size
   container and every shape-defining number is `cqw` = 1% of its width, so
   the poster scales as one piece. The stack is a flex column, so the gaps
   quoted above are reproduced as margins — corrected for each face's ink
   offset the way quality.css does, so the *ink* lands on the reference
   measurement rather than the invisible line box.

   The conveyor is the one exception. It is allowed to grow past the
   composition (up to the reference's implied 660-unit fruit row = 152.8% of
   the canvas) and is capped at the viewport, so on phones the belt runs edge
   to edge exactly as it does in the reference. It carries its own
   `container-type`, so inside it 1cqw = 1% of the *belt*, which is what keeps
   the six fruits on a fixed 1/6 pitch at every width.

   Colours: --purple / --cream come from hero.css and --coral from
   quality.css. Only the belt and the softer button coral are new. Neither
   earlier stylesheet is touched.
   ========================================================================== */

:root {
  --belt:       #b2869a; /* dusty-rose fruit strip  (ref rgb 178 134 154) */
  --coral-soft: #ffa7a7; /* BLENDZ button fill      (ref rgb 255 167 167) */
}

/* ==========================================================================
   Section shell
   ========================================================================== */
.blend-builder {
  --pad-x: clamp(16px, 4vw, 32px);

  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;      /* fallback for browsers without svh */
  min-height: 100svh;
  padding: clamp(40px, 7vw, 96px) var(--pad-x);
  background: var(--purple);
  /* lets the belt reach the viewport edges without ever reaching the page
     scrollbars — same guard the hero and quality sections use */
  overflow: hidden;
}

/* Size container. The three caps are, in order: never wider than the section
   box, never wider than the poster should get, and never so wide that the
   stack (1.447 x canvas width, plus padding) outgrows the viewport. */
.blend-builder__inner {
  width: min(100%, 760px, 60vh);    /* fallback for browsers without svh */
  width: min(100%, 760px, 60svh);
  container-type: inline-size;
}

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

/* ==========================================================================
   1 — "WHY US?"  (ref ink 366 x 63)
   --------------------------------------------------------------------------
   Pixel Gosub — the same face as the hero wordmark, and the face the
   reference sets this line in. Measured at 1em: ink is 4.26em wide and 0.74em
   tall, starting 0.27em below the top of a line-height:1 box. Solving
   4.26F + 6 x 0.00833F = 84.72cqw (the reference's ink width) gives F below;
   0.00833em is the hero's tracking, which the reference also uses here.
   The negative top margin puts the ink top, not the line box, on the
   composition's first line.
   ========================================================================== */
.blend-builder__title {
  /* Pixel Gosub's W overhangs its advance box on the left and the ? falls
     short of it on the right, so centring the *box* leaves the ink .0823em
     left of centre — measured, then put back here. */
  position: relative;
  left: .0823em;
  margin: -.27em 0 calc(5.79cqw + .01em);
  font-family: var(--font-display);
  font-size: 19.66cqw;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .00833em;
  text-align: center;
  color: var(--coral);
  white-space: nowrap;
}

/* the reference sets only the question mark in the pale yellow */
.blend-builder__title-mark { color: var(--cream); }

/* ==========================================================================
   2 — Supporting sentence  (ref ink 397 x 17)
   --------------------------------------------------------------------------
   Partita1990, as used by the hero's tagline and the quality heading. At 1em
   its ink runs 0.275em..1.175em down a line-height:1 box, so the box
   overhangs the ink by .175em at the bottom — that is what the +.175em in the
   bottom margin backs out. 22.80em is this string's measured ink width, so
   4.04cqw is the size at which it rasterises to the reference's 91.9cqw.
   ========================================================================== */
.blend-builder__lede {
  max-width: 100%;
  margin: -.275em 0 calc(9.26cqw + .175em);
  font-family: var(--font-label);
  font-size: 4.04cqw;
  line-height: 1;
  text-align: center;
  color: var(--cream);
  white-space: nowrap;
}

/* ==========================================================================
   3 — Coral pixel spark  (ref 39 x 38)
   The reference decoration is pixel-for-pixel the 5 x 5 grid already defined
   as #pxSpark in index.html, so the symbol is reused rather than redrawn.
   ========================================================================== */
.blend-builder__spark {
  position: relative;
  top: -1.2cqw;
  left: 0.8cqw;
  z-index: 1;
  display: block;
  width: 7.95cqw;
  margin-bottom: 8.72cqw;
  aspect-ratio: 1;
  fill: var(--coral);
  shape-rendering: crispEdges;   /* sharp pixel corners at any scale */
}

/* ==========================================================================
   Sprite crop
   --------------------------------------------------------------------------
   Same model as hero.css's .pxsprite, restated locally because these boxes
   sit in flow and the fruits must not be pixelated. Every supplied PNG is a
   1080 x 1350 canvas with the artwork floating in transparent padding; the
   wrapper is sized to the *artwork* and the image is pulled into place behind
   it, so offsets stay predictable and the buttons' hit areas will match the
   fruit silhouettes rather than the whole 1080 x 1350 box.
     --wf  artwork width  / 1080     --ar  artwork aspect
     --lf  artwork left   / 1080
     --tf  artwork top    / 1350
   These boxes are sized by *height* (the fruit row reads as one band), so the
   width falls out of --ar.
   -------------------------------------------------------------------------- */
.px-crop {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: var(--ar);
}

.px-crop > img {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / var(--wf));
  height: auto;
  transform: translate(calc(var(--lf) * -100%), calc(var(--tf) * -100%));
}

/* ==========================================================================
   4 — Blender  (ref 96 x 162)
   --------------------------------------------------------------------------
   .blend-builder__machine is the wrapper Phase 4 will shake: it owns the
   blender, the three Phase 3 landing slots and the Phase 4 sparkle layer, so
   a transform on it moves the whole machine as one object.
   ========================================================================== */
.blend-builder__machine {
  position: relative;
  width: 22.22cqw;
  margin-bottom: 3.01cqw;
}

/* blender.png — artwork 654 x 1124 at x 209, y 156 of the 1080 x 1350 canvas */
.blend-builder__blender {
  --wf: .6055556;
  --lf: .1935185;
  --tf: .1155556;
  --ar: 654 / 1124;
  width: 100%;
}

.blend-builder__blender > img { image-rendering: pixelated; }

.blend-builder__blender-target {
  position: absolute;
  left: 50%;
  top: 21%;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Three stable floating positions around the blender. The wrappers stay put
   while their artwork is cloned into the fixed Phase 4 flight layer. */
.blend-builder__slots {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: visible;
  pointer-events: none;
}

.blend-builder__slot {
  position: absolute;
  display: grid;
  place-items: center;
  width: max-content;
  height: max-content;
}

.blend-builder__slot[data-slot="0"] {
  right: calc(100% + 3cqw);
  top: 42%;
  transform: translateY(-50%);
}

.blend-builder__slot[data-slot="1"] {
  left: 50%;
  bottom: calc(100% - 2cqw);
  z-index: 2;
  transform: translateX(-50%);
}

.blend-builder__slot[data-slot="2"] {
  left: calc(100% + 3cqw);
  top: 49%;
  transform: translateY(-50%);
}

.blend-builder__slot .px-crop {
  max-width: none;
  height: var(--slot-fruit-height, clamp(60px, 20cqw, 132px));
  transform: scale(.96);
  opacity: .96;
  animation: blend-builder-slot-in 180ms ease-out;
}

.blend-builder__slot[data-selected-fruit="mango"] {
  --slot-fruit-height: clamp(60px, 19cqw, 125px);
}

.blend-builder__slot[data-selected-fruit="banana"] {
  --slot-fruit-height: clamp(60px, 18cqw, 118px);
}

.blend-builder__slot[data-selected-fruit="grape"] {
  --slot-fruit-height: clamp(60px, 20cqw, 132px);
}

.blend-builder__slot[data-selected-fruit="cherry"] {
  --slot-fruit-height: clamp(64px, 21cqw, 138px);
}

.blend-builder__slot[data-selected-fruit="pineapple"] {
  --slot-fruit-height: clamp(68px, 22cqw, 145px);
}

.blend-builder__slot.is-consumed .px-crop {
  visibility: hidden;
}

.blend-builder__sparkles {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.blend-builder__sparkle {
  position: absolute;
  left: 50%;
  top: 21%;
  width: var(--spark-size);
  aspect-ratio: 1;
  background: var(--spark-color);
  clip-path: polygon(
    34% 0, 66% 0, 66% 34%, 100% 34%, 100% 66%, 66% 66%,
    66% 100%, 34% 100%, 34% 66%, 0 66%, 0 34%, 34% 34%
  );
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.blend-builder__sparkles.is-active .blend-builder__sparkle {
  animation: blend-builder-pixel-spark 1100ms steps(4, end) var(--spark-delay) both;
}

.blend-builder__flight-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.blend-builder__flight {
  position: fixed;
  max-width: none;
  margin: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

/* ==========================================================================
   5 — Instruction line  (ref ink 270 x 17)
   Same face and same ink corrections as the lede; 15.45em is this string's
   measured ink width, which at 4.04cqw rasterises to the reference's 62.5cqw.
   ========================================================================== */
.blend-builder__hint {
  max-width: 100%;
  margin: -.275em 0 calc(1.2cqw + .175em);
  font-family: var(--font-label);
  font-size: 4.04cqw;
  line-height: 1;
  text-align: center;
  color: var(--cream);
  white-space: nowrap;
}

.blend-builder__counter {
  position: relative;
  min-height: 1em;
  margin: -.18em 0 calc(1.58cqw + .12em);
  font-family: var(--font-display);
  font-size: 3.8cqw;
  line-height: 1;
  letter-spacing: .00833em;
  color: var(--cream);
  white-space: nowrap;
}

.blend-builder__feedback {
  position: absolute;
  top: 0;
  left: calc(100% + .9em);
  display: inline-block;
  min-width: 12ch;
  color: var(--coral);
  opacity: 0;
}

.blend-builder__feedback.is-active {
  animation: blend-builder-feedback 220ms steps(2, end) 2;
  opacity: 1;
}

@keyframes blend-builder-feedback {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(.22em); }
}

/* ==========================================================================
   6 — Fruit conveyor  (PHASE 2: continuous left-to-right belt)
   --------------------------------------------------------------------------
   Everything here is now measured against the 432-unit reference canvas, the
   same ruler the rest of the composition uses, rather than against the belt.
   That is what lets the row keep the reference's fruit size at every width:
   the pitch is a fixed slice of the canvas (ref 110 / 432), so the sequence is
   as wide as it is and the window simply clips it. On desktop the belt still
   works out to exactly the approved width — 6 x 25.463cqw = 152.78cqw, the
   same `min(152.8%, 100vw)` box Phase 1 shipped — so nothing above phone
   widths changes size. Below that the belt is full-bleed and the sequence is
   wider than the viewport, which is what produces the locked reference
   behaviour: partial fruits entering at the left and leaving at the right.

   Seamless loop
   -------------
   The track carries two identical sequences (6 canonical + 6 clones) and is
   `width: max-content`, so its used width is exactly the sum of the twelve
   cells. Animating translateX from -50% to 0 therefore travels exactly one
   sequence — the browser takes 50% of the *used* width, so the loop distance
   can never drift from the laid-out pitch the way a re-derived calc() can.
   The frame at -50% is pixel-identical to the frame at 0 (sequence 2 sits
   where sequence 1 will), so the restart is invisible.

   Two sequences is the minimum that always covers the window: the belt is
   capped at one sequence width, and at any point in the cycle at least one
   whole sequence spans the window. No third copy is needed.
   ========================================================================== */
.blend-builder__conveyor {
  --fruit-count: 6;
  --fruit-pitch: 25.463cqw;    /* ref 110 / 432 */
  --sequence-width: calc(var(--fruit-count) * var(--fruit-pitch));
  --conveyor-duration: 16s;    /* seconds per full six-fruit sequence */

  /* the belt never exceeds one sequence, which keeps it off the huge empty
     stretches a full-bleed belt would leave on wide screens, and never
     exceeds the viewport, which keeps the bleed inside the section's clip */
  width: min(var(--sequence-width), 100vw);
  margin-bottom: 13.66cqw;
}

/* Snap the pitch to a half pixel where the browser can do the arithmetic.
   The loop distance is already exact without this — translateX(-50%) lands on
   the six-cell run to 0.0000px at every width tested — but a *fractional*
   sequence width means the second sequence is rasterised inside the track's
   composited layer at a different sub-pixel phase than the first, so the
   restart swaps one anti-aliasing phase for another. Half a pixel is the
   coarsest step that keeps 6 x pitch a whole number while leaving the widths
   where the pitch is already clean (1440, 1920) untouched. */
@supports (width: round(1px, 1px)) {
  .blend-builder__conveyor { --fruit-pitch: round(25.463cqw, .5px); }
}

/* Everything in the belt is a fraction of the pitch, the reference's own
   relationship (its pitch is 110 units), so the band, the backplate and the
   fruits always rescale together with it — including when reduced motion
   drops the pitch to fit all six on screen at once. */

/* the clipping window — the only place overflow is hidden for the conveyor */
.blend-builder__viewport {
  position: relative;
  height: calc(.854545 * var(--fruit-pitch));   /* ref band 94 / 110 */
  overflow: hidden;
}

/* the dusty-rose backplate: flat colour, square corners, no shadow.
   Unchanged from Phase 1, and a sibling of the track so the belt stays put
   while the fruits move over it. */
.blend-builder__belt {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(.190909 * var(--fruit-pitch));      /* ref 21 / 110 */
  height: calc(.563636 * var(--fruit-pitch));   /* ref 62 / 110 */
  background: var(--belt);
  pointer-events: none;
}

/* `right` is deliberately not set: the track must be as wide as its content
   so that translateX(-50%) lands exactly on one sequence. */
.blend-builder__track {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: max-content;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  /* transform only — no layout, paint or filter work per frame */
  animation: blend-builder-conveyor var(--conveyor-duration) linear infinite;
  will-change: transform;
}

/* left to right: the track starts one sequence back and travels to 0, so
   fruits enter at the left edge and leave through the right. */
@keyframes blend-builder-conveyor {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

.blend-builder__cell {
  flex: 0 0 var(--fruit-pitch);
  /* flex items default to min-width:auto, which would let a wide fruit push
     its cell past the pitch and break the twelve-cell run the loop distance
     depends on. The pitch is authoritative. */
  min-width: 0;
  display: grid;
  place-items: center;
  height: 100%;
}

/* ==========================================================================
   7 — Fruit options
   --------------------------------------------------------------------------
   The cell owns conveyor spacing; each target shrink-wraps the cropped fruit
   so transparent cell space never becomes part of the pointer target.
   ========================================================================== */
.fruit-option {
  position: relative;
  display: grid;
  place-items: center;
  width: fit-content;
  height: fit-content;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  line-height: 0;
  color: inherit;
  /* Keep both semantic controls and visual pointer mirrors fully opaque. */
  opacity: 1;
  cursor: pointer;
  touch-action: manipulation;
}

/* Sized by height so the six fruits read as one band. --h is each fruit's
   reference height as a fraction of the reference pitch (110 units), so the
   row keeps its proportions at whatever pitch the conveyor is running. */
.fruit-option .px-crop {
  height: calc(var(--h, .772727) * var(--fruit-pitch));
  width: auto;
  pointer-events: none;
  transition: opacity 160ms ease, filter 160ms ease;
}

.fruit-option.is-selected .px-crop {
  opacity: .36;
  filter: saturate(.72) brightness(.95);
}

.fruit-option.is-selected::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(.25 * var(--fruit-pitch));
  aspect-ratio: 1;
  border: max(2px, calc(.018182 * var(--fruit-pitch))) solid var(--cream);
  background:
    linear-gradient(var(--cream), var(--cream)) 30% 62% / 18% 18% no-repeat,
    linear-gradient(var(--cream), var(--cream)) 48% 72% / 18% 18% no-repeat,
    linear-gradient(var(--cream), var(--cream)) 68% 42% / 18% 54% no-repeat,
    var(--coral);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.fruit-option:focus-visible {
  outline: max(2px, calc(.018182 * var(--fruit-pitch))) solid var(--cream);
  outline-offset: calc(-.027273 * var(--fruit-pitch));
}

.fruit-option--clone {
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.blend-builder[data-state="blending"] .fruit-option--clone,
.blend-builder[data-state="blended"] .fruit-option--clone,
.blend-builder[data-state="result"] .fruit-option--clone,
.blend-builder[data-state="resetting"] .fruit-option--clone {
  cursor: default;
  pointer-events: none;
}

/* Per-fruit artwork bounds inside the 1080 x 1350 canvases, and the heights
   each fruit is drawn at in the reference strip — listed in strip order.
   The crop factors are the approved Phase 1 values, untouched; only --h is
   restated as ref-height / 110 instead of an absolute cqw, which is the same
   size at the approved pitch. */
.fruit-option[data-fruit="strawberry"] .px-crop {
  --h: .800000; --ar: 827 / 909; --wf: .7657407; --lf: .0990741; --tf: .1370370;
}
.fruit-option[data-fruit="mango"] .px-crop {
  --h: .772727; --ar: 937 / 915; --wf: .8675926; --lf: .0731481; --tf: .1348148;
}
.fruit-option[data-fruit="banana"] .px-crop {
  --h: .709091; --ar: 976 / 768; --wf: .9037037; --lf: .0351852; --tf: .2170370;
}
.fruit-option[data-fruit="grape"] .px-crop {
  --h: .718182; --ar: 958 / 961; --wf: .8870370; --lf: .0537037; --tf: .1562963;
}
.fruit-option[data-fruit="cherry"] .px-crop {
  --h: .809091; --ar: 689 / 964; --wf: .6379630; --lf: .2009259; --tf: .1222222;
}
.fruit-option[data-fruit="pineapple"] .px-crop {
  --h: .836364; --ar: 506 / 782; --wf: .4685185; --lf: .2500000; --tf: .1666667;
}

/* ==========================================================================
   8 — BLENDZ button  (ref box 167 x 49, ink 124 x 22, radius 7)
   --------------------------------------------------------------------------
   Flat coral fill, purple pixel type and the reference's small square-ish
   radius — no gradient, shadow or pill. The disabled state remains fully
   opaque while selection and blending determine interactivity.
   ========================================================================== */
.blend-builder__blendz {
  display: grid;
  place-items: center;
  width: 38.66cqw;
  height: 11.34cqw;
  padding: 0;
  border: 0;
  border-radius: 1.62cqw;
  background: var(--coral-soft);
  font-family: var(--font-display);
  font-size: 6.88cqw;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .158em;
  color: var(--purple);
  opacity: 1;
  cursor: default;
}

.blend-builder__blendz.is-ready {
  background: var(--cream);
  color: var(--purple);
  cursor: pointer;
}

.blend-builder__blendz:focus-visible {
  outline: max(3px, .7cqw) solid var(--cream);
  outline-offset: .8cqw;
}

/* -.291em is the ink correction, measured off the render: Pixel Gosub's ink
   sits low in a line-height:1 box, and the reference seats the word a little
   above the button's centre line on top of that.
   -.158em cancels the tracking that letter-spacing adds after the final Z, so
   the *ink* centres in the button rather than the advance width. */
.blend-builder__blendz-label {
  margin-top: -.291em;
  margin-right: -.158em;
}

@keyframes blend-builder-slot-in {
  from {
    opacity: 0;
    transform: scale(.91);
  }
  to {
    opacity: .96;
    transform: scale(.96);
  }
}

.blend-builder__machine.is-shaking {
  transform-origin: 50% 93%;
  animation: blend-builder-shake 1.45s steps(1, end);
}

@keyframes blend-builder-shake {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  8%  { transform: translate3d(-.55cqw, -.08cqw, 0) rotate(-1.4deg) scale(1.006); }
  17% { transform: translate3d(.7cqw, .06cqw, 0) rotate(1.7deg) scale(1.01); }
  27% { transform: translate3d(-.8cqw, 0, 0) rotate(-1.8deg) scale(1.004); }
  38% { transform: translate3d(.65cqw, -.1cqw, 0) rotate(1.4deg) scale(1.012); }
  50% { transform: translate3d(-.72cqw, .05cqw, 0) rotate(-1.6deg) scale(1.006); }
  63% { transform: translate3d(.58cqw, -.07cqw, 0) rotate(1.2deg) scale(1.01); }
  76% { transform: translate3d(-.45cqw, .04cqw, 0) rotate(-1deg) scale(1.004); }
  88% { transform: translate3d(.3cqw, 0, 0) rotate(.7deg) scale(1.002); }
}

@keyframes blend-builder-pixel-spark {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate3d(0, 0, 0) scale(.7);
  }
  10%, 54% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%)
      translate3d(var(--spark-x), var(--spark-y), 0) scale(.25);
  }
}

/* ==========================================================================
   9 - Juice result
   Anchored to the blender so the glass rises from the machine without a
   modal, card or unrelated overlay.
   ========================================================================== */
.blend-result {
  position: absolute;
  top: -23cqw;
  left: 50%;
  z-index: 4;
  width: min(96vw, 620px);
  transform: translateX(-50%);
  pointer-events: none;
}

.blend-result[hidden],
.blend-result__image-wrap[hidden] {
  display: none;
}

.blend-result__panel {
  position: relative;
  display: grid;
  justify-items: center;
  width: 100%;
  color: var(--cream);
  text-align: center;
  isolation: isolate;
}

.blend-result__eyebrow {
  z-index: 3;
  margin: 0 0 -2px;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--cream);
}

.blend-result__hero {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(210px, 60cqw, 420px);
  aspect-ratio: 1;
  isolation: isolate;
}

.blend-result__image-wrap {
  z-index: 2;
  width: 100%;
  aspect-ratio: 1;
}

.blend-result__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  transform-origin: 50% 82%;
}

.blend-result__image[src$="berry-voltage.webp"],
.blend-result__image[src$="cherry-pixel.webp"] {
  clip-path: inset(0 0 0 .8%);
}

.blend-result__image[src$="berry-glitch.webp"] {
  clip-path: inset(0 .2% 0 .8%);
}

.blend-result__image[src$="cherry-island.webp"] {
  clip-path: inset(.3%);
}

.blend-result__image[src$="purple-tropic.webp"] {
  clip-path: inset(.3% .9% .3% .8%);
}

.blend-result__decor {
  position: absolute;
  z-index: 3;
  width: clamp(10px, 2.5cqw, 18px);
  aspect-ratio: 1;
  background: var(--decor-color, var(--cream));
  clip-path: polygon(
    34% 0, 66% 0, 66% 34%, 100% 34%, 100% 66%, 66% 66%,
    66% 100%, 34% 100%, 34% 66%, 0 66%, 0 34%, 34% 34%
  );
}

.blend-result__decor--a {
  --decor-color: var(--coral);
  --decor-x: -14px;
  --decor-y: 8px;
  top: 23%;
  left: 3%;
}

.blend-result__decor--b {
  --decor-x: 12px;
  --decor-y: 10px;
  top: 13%;
  right: 2%;
  width: clamp(8px, 2cqw, 14px);
}

.blend-result__decor--c {
  --decor-color: var(--coral);
  --decor-x: 10px;
  --decor-y: -8px;
  right: 8%;
  bottom: 21%;
  width: clamp(8px, 1.8cqw, 13px);
}

.blend-result__name {
  max-width: 100%;
  z-index: 3;
  margin: clamp(-52px, -6cqw, -24px) 0 0;
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0;
  color: var(--cream);
  text-transform: uppercase;
  text-wrap: balance;
}

.blend-result__ingredients {
  z-index: 3;
  max-width: min(94vw, 36em);
  margin: 12px 0 0;
  font-family: var(--font-label);
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--cream);
  text-wrap: balance;
}

.blend-result__reset {
  display: grid;
  place-items: center;
  width: min(72vw, 260px);
  min-height: 48px;
  margin: 18px auto 0;
  padding: 12px 18px;
  border: 0;
  background: var(--coral-soft);
  box-shadow: inset 0 -4px 0 rgba(90, 53, 182, .38);
  clip-path: polygon(
    6px 0, calc(100% - 6px) 0, calc(100% - 6px) 3px, 100% 3px,
    100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px),
    calc(100% - 3px) 100%, 6px 100%, 6px calc(100% - 3px),
    0 calc(100% - 3px), 0 6px, 3px 6px, 3px 3px, 6px 3px
  );
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--purple);
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition: transform 120ms cubic-bezier(.23, 1, .32, 1),
    background-color 160ms ease, color 160ms ease;
}

@media (hover: hover) {
  .blend-result__reset:hover:not(:disabled) {
    background: var(--cream);
    transform: translate3d(0, -2px, 0);
  }
}

.blend-result__reset:active:not(:disabled) {
  box-shadow: inset 0 -2px 0 rgba(90, 53, 182, .38);
  transform: translate3d(0, 2px, 0);
}

.blend-result__reset:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 4px;
}

.blend-result__reset:disabled {
  color: rgba(90, 53, 182, .62);
  cursor: wait;
}

.blend-result.has-image-error .blend-result__name {
  margin-top: 14px;
}

.blend-result__panel,
.blend-result__image,
.blend-result__decor,
.blend-result__eyebrow,
.blend-result__name,
.blend-result__ingredients {
  opacity: 0;
}

.blend-result__panel {
  transform: translate3d(0, 8px, 0);
}

.blend-result__eyebrow,
.blend-result__name,
.blend-result__ingredients {
  transform: translate3d(0, 14px, 0);
}

.blend-result__decor {
  transform: translate3d(var(--decor-x), var(--decor-y), 0) scale(.55);
}

.blend-result.is-active .blend-result__panel {
  animation: blend-result-stage-in 360ms cubic-bezier(.16, 1, .3, 1) both;
}

.blend-result.is-active .blend-result__image {
  animation: blend-result-rise 920ms cubic-bezier(.2, .78, .2, 1) both;
}

.blend-result.is-active .blend-result__eyebrow,
.blend-result.is-active .blend-result__name {
  animation: blend-result-copy-in 440ms cubic-bezier(.16, 1, .3, 1) both;
}

.blend-result.is-active .blend-result__ingredients {
  animation: blend-result-copy-in 360ms cubic-bezier(.16, 1, .3, 1) both;
}

.blend-result.is-active .blend-result__decor {
  animation: blend-result-decor-in 420ms steps(3, end) both;
}

.blend-result.is-active .blend-result__reset {
  animation: blend-result-reset-in 320ms cubic-bezier(.16, 1, .3, 1) 820ms both;
}

.blend-result.is-active .blend-result__eyebrow { animation-delay: 430ms; }
.blend-result.is-active .blend-result__name { animation-delay: 560ms; }
.blend-result.is-active .blend-result__ingredients { animation-delay: 700ms; }
.blend-result.is-active .blend-result__decor--a { animation-delay: 500ms; }
.blend-result.is-active .blend-result__decor--b { animation-delay: 580ms; }
.blend-result.is-active .blend-result__decor--c { animation-delay: 660ms; }

.blend-result.is-exiting .blend-result__panel {
  animation: blend-result-stage-out 440ms cubic-bezier(.77, 0, .175, 1) both;
}

.blend-result.is-exiting .blend-result__reset {
  animation: blend-result-stage-out 320ms cubic-bezier(.77, 0, .175, 1) both;
}

.blend-builder__title,
.blend-builder__lede,
.blend-builder__spark,
.blend-builder__blender,
.blend-builder__slots,
.blend-builder__hint,
.blend-builder__counter,
.blend-builder__conveyor,
.blend-builder__blendz {
  transition: opacity 320ms ease;
}

.blend-builder[data-state="result"] .blend-builder__title { opacity: .32; }
.blend-builder[data-state="result"] .blend-builder__lede { opacity: .24; }
.blend-builder[data-state="result"] .blend-builder__spark { opacity: .2; }
.blend-builder[data-state="result"] .blend-builder__blender {
  opacity: .1;
}

.blend-builder[data-state="result"] .blend-builder__slots { opacity: .08; }

.blend-builder[data-state="result"] .blend-builder__hint,
.blend-builder[data-state="result"] .blend-builder__counter,
.blend-builder[data-state="result"] .blend-builder__conveyor,
.blend-builder[data-state="result"] .blend-builder__blendz {
  opacity: .1;
}

.blend-result.has-image-error .blend-result__hero {
  display: none;
}

@keyframes blend-result-stage-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes blend-result-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 28%, 0) scale(.58);
  }
  72% {
    opacity: 1;
    transform: translate3d(0, -3%, 0) scale(1.035);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes blend-result-copy-in {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes blend-result-decor-in {
  from {
    opacity: 0;
    transform: translate3d(var(--decor-x), var(--decor-y), 0) scale(.55);
  }
  to {
    opacity: .9;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes blend-result-reset-in {
  from {
    opacity: 0;
    visibility: hidden;
  }
  1% { visibility: visible; }
  to {
    opacity: 1;
    visibility: visible;
  }
}

@keyframes blend-result-stage-out {
  from {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
  }
  99% { visibility: visible; }
  to {
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, -8px, 0);
  }
}

/* ==========================================================================
   Utilities
   ========================================================================== */
/* the accessible name of each fruit button; the artwork carries alt="" */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

/* ==========================================================================
   Narrow viewports
   --------------------------------------------------------------------------
   The reference is itself a portrait poster, so its proportions hold all the
   way down to ~460px of canvas and are left alone above that. Below it the
   art direction is still kept exactly — same seven elements, same order, same
   full-bleed belt — and only the parts that would fall under a comfortable
   size are grown against the canvas: the two Partita lines, the blender, and
   the button. The heading already fills 84.7% of the canvas at the reference
   proportion, so it is left alone.
   ========================================================================== */
@media (max-width: 460px) {
  .blend-builder { padding-block: clamp(48px, 12vw, 88px); }

  /* the reference sets this on one line; at phone sizes it is allowed to wrap
     rather than shrink below reading size */
  .blend-builder__lede {
    margin-bottom: calc(8cqw + .175em);
    font-size: 5cqw;
    white-space: normal;
    text-wrap: balance;
  }

  .blend-builder__hint { font-size: 5cqw; }

  .blend-builder__counter { font-size: 4.6cqw; }

  /* the blender is the section's subject — hold its presence on small screens */
  .blend-builder__machine { width: 26cqw; }

  /* the belt is full-bleed and narrower than one sequence at these widths, so
     less of the row is on screen at a time — run it a little quicker so the
     same fruit comes back around at a comparable rate */
  .blend-builder__conveyor { --conveyor-duration: 13s; }

  .blend-builder__blendz {
    width: 54cqw;
    height: 15.8cqw;
    border-radius: 2.3cqw;
    font-size: 9.6cqw;
  }

  .blend-result {
    top: -22.5cqw;
    width: min(94vw, 420px);
  }

  .blend-result__hero {
    width: clamp(190px, 66cqw, 265px);
  }

  .blend-result__eyebrow { font-size: 12px; }

  .blend-result__name {
    font-size: 33px;
    line-height: 1.06;
  }

  .blend-result__ingredients {
    max-width: 90vw;
    margin-top: 8px;
    font-size: 14px;
  }
}

@media (max-width: 340px) {
  .fruit-option[data-fruit="cherry"] {
    padding-inline: 1px;
  }

  .fruit-option[data-fruit="pineapple"] {
    padding-inline: 2.25px;
  }
}

/* ==========================================================================
   Reduced motion
   --------------------------------------------------------------------------
   No slow version and no crawl: the belt simply stops. Because a stopped belt
   would otherwise strand fruits 5 and 6 outside a phone-width window, the
   pitch also falls back to whatever fits, which lands the row back on the
   fitted, fully visible layout — all six options on screen, same artwork,
   same alignment, same backplate. The clones are removed from the flow so the
   track is exactly one sequence wide and nothing is cut off at the right.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .blend-builder__conveyor {
    --fruit-pitch: min(25.463cqw, calc(100vw / var(--fruit-count)));
  }

  .blend-builder__track {
    animation: none;
    transform: none;
    will-change: auto;
  }

  .blend-builder__cell[data-clone] { display: none; }

  .fruit-option .px-crop,
  .blend-builder__slot .px-crop {
    transition: none;
    animation: none;
  }

  .blend-builder__feedback.is-active {
    animation: none;
  }

  .blend-builder__machine.is-shaking {
    animation: none;
  }

  .blend-builder__sparkles.is-active .blend-builder__sparkle {
    animation: none;
    opacity: .9;
    transform: translate(-50%, -50%)
      translate3d(var(--spark-x), var(--spark-y), 0);
  }

  .blend-builder__title,
  .blend-builder__lede,
  .blend-builder__spark,
  .blend-builder__blender,
  .blend-builder__slots,
  .blend-builder__hint,
  .blend-builder__counter,
  .blend-builder__conveyor,
  .blend-builder__blendz,
  .blend-result__reset {
    transition: none;
  }

  .blend-result.is-active .blend-result__panel,
  .blend-result.is-active .blend-result__image,
  .blend-result.is-active .blend-result__eyebrow,
  .blend-result.is-active .blend-result__name,
  .blend-result.is-active .blend-result__ingredients {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .blend-result.is-active .blend-result__decor {
    opacity: .9;
    transform: none;
    animation: none;
  }

  .blend-result.is-active .blend-result__reset {
    opacity: 1;
    visibility: visible;
    transform: none;
    animation: none;
  }

  .blend-result.is-exiting .blend-result__panel,
  .blend-result.is-exiting .blend-result__reset {
    opacity: 0;
    visibility: hidden;
    transform: none;
    animation: none;
  }
}
