/* Hero slider: every new slide glides in from the left. Works with scripts/hero-slider.js */
html:root {
  --deep: #052e1a;
  --deep-foreground: #ffffff;
  --primary: #a3e635;
  --font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-head: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --accent: #a3e635;
  --primary-foreground: #111111;
}
.hero-stage {
  display: grid;
  overflow: hidden;
}
.hero-slide {
  grid-area: 1 / 1;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-14%);
  transition: transform 0.9s cubic-bezier(0.22, 0.8, 0.2, 1), opacity 0.7s ease, visibility 0s linear 0.9s;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: transform 0.9s cubic-bezier(0.22, 0.8, 0.2, 1), opacity 0.7s ease, visibility 0s;
  z-index: 2;
}
.hero-slide.is-leaving {
  opacity: 0;
  visibility: visible;
  transform: translateX(10%);
  transition: transform 0.9s cubic-bezier(0.22, 0.8, 0.2, 1), opacity 0.5s ease, visibility 0s;
  z-index: 1;
}

/* Without JavaScript the first slide simply shows */
.hero-stage:not([data-ready]) .hero-slide:first-child {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Words and photo follow one after another from the left */
.hero-stage[data-ready] .hero-slide [data-rise] {
  opacity: 0;
  transform: translateX(-56px);
  transition: transform 0.9s cubic-bezier(0.22, 0.8, 0.2, 1), opacity 0.7s ease;
  transition-delay: 0s;
}
.hero-stage[data-ready] .hero-slide.is-active [data-rise] {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--d, 0) * 1ms + 120ms);
}
.hero-stage[data-ready] .hero-slide .hero-zoom {
  transform: scale(1.08);
  transition: transform 7s cubic-bezier(0.22, 0.8, 0.2, 1);
}
.hero-stage[data-ready] .hero-slide.is-active .hero-zoom {
  transform: scale(1);
}

/* Light green band for the "On the shelf" section */
.shelf-green {
  background: #07301b;
}

/* Hero background: a faint drifting dot pattern, a warm glow behind the pictures and a slow sweep of light */
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: #042a17;
}
/* One background per slide; the one for the slide on show fades in (slide's "bg": green, white or orange) */
.hero-bg-layer {
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
  background-size: 220% 220%;
  animation: hero-gradient 18s ease-in-out infinite alternate;
}
/* Each background takes the main colour of its slide's product, with a glow of the same colour behind the picture */
.hero-bg-layer::after {
  content: "";
  position: absolute;
  right: -8%;
  top: 4%;
  width: min(62vw, 760px);
  aspect-ratio: 1;
  border-radius: 9999px;
  background: radial-gradient(closest-side, rgba(var(--g), 0.55), rgba(var(--g), 0.2) 55%, transparent 78%);
  filter: blur(12px);
  animation: hero-glow 9s ease-in-out infinite alternate;
}
.hero-bg-green {
  --g: 52, 211, 120;
  background-image: linear-gradient(120deg, #042a17 0%, #0a5a30 45%, #07803f 62%, #063b20 85%, #042a17 100%);
}
.hero-bg-red {
  --g: 248, 90, 90;
  background-image: linear-gradient(120deg, #2a0409 0%, #6e0d1b 45%, #9b1428 62%, #4a0813 85%, #2a0409 100%);
}
.hero-bg-teal {
  --g: 45, 212, 200;
  background-image: linear-gradient(120deg, #03282b 0%, #07575c 45%, #0b7f86 62%, #053f43 85%, #03282b 100%);
}
.hero-bg-navy {
  --g: 96, 165, 250;
  background-image: linear-gradient(120deg, #060f2b 0%, #0f2559 45%, #183a86 62%, #0a1a46 85%, #060f2b 100%);
}
.hero-bg-gold {
  --g: 255, 255, 255;
  background-image: linear-gradient(120deg, #fbbf24 0%, #fcd34d 50%, #f9b514 100%);
}
.hero-bg-white {
  background: #f1f1f1;
  animation: none;
}
.hero-bg-white::after {
  display: none;
}
.hero-sec:has(.hero-light.is-active) .hero-bg-sweep {
  opacity: 0 !important;
}
.hero-bg-sweep {
  transition: opacity 0.9s ease;
}
.hero-bg-orange {
  background-image: linear-gradient(120deg, #c85a00 0%, #ff7a00 50%, #d96500 100%);
}
.hero-sec:not(:has(.hero-stage[data-ready])) .hero-bg-layer[data-bg-i="0"],
.hero-sec:has(.hero-slide:nth-child(1).is-active) .hero-bg-layer[data-bg-i="0"],
.hero-sec:has(.hero-slide:nth-child(2).is-active) .hero-bg-layer[data-bg-i="1"],
.hero-sec:has(.hero-slide:nth-child(3).is-active) .hero-bg-layer[data-bg-i="2"],
.hero-sec:has(.hero-slide:nth-child(4).is-active) .hero-bg-layer[data-bg-i="3"],
.hero-sec:has(.hero-slide:nth-child(5).is-active) .hero-bg-layer[data-bg-i="4"],
.hero-sec:has(.hero-slide:nth-child(6).is-active) .hero-bg-layer[data-bg-i="5"] {
  opacity: 1;
}
/* On a white slide the writing turns dark green */
.hero-sec [class*="text-deep-foreground"],
.hero-sec [class*="border-white"] {
  transition: color 0.6s ease, border-color 0.6s ease;
}
.hero-sec:has(.hero-light.is-active) [class*="text-deep-foreground"] {
  color: #0b2a17 !important;
}
.hero-sec:has(.hero-light.is-active) .text-primary {
  color: #0b2a17 !important;
}
.hero-hl-light {
  color: #3f7a05;
}
.hero-sec:has(.hero-light.is-active) .hero-hl {
  color: #3f7a05 !important;
}
.hero-sec:has(.hero-light.is-active) .hero-dot-fill {
  background-color: #0b2a17 !important;
}
.hero-sec:has(.hero-light.is-active) .hero-kick {
  filter: drop-shadow(0 22px 20px rgba(11, 42, 23, 0.28));
}
.hero-sec:has(.hero-light.is-active) [class*="border-white"] {
  border-color: rgba(7, 40, 22, 0.25) !important;
}
.hero-sec:has(.hero-light.is-active) .hero-dot-track {
  background: rgba(7, 40, 22, 0.2) !important;
}
.hero-bg > span {
  position: absolute;
  display: block;
}
.hero-bg-glow {
  right: -8%;
  top: 4%;
  width: min(62vw, 760px);
  aspect-ratio: 1;
  border-radius: 9999px;
  background: radial-gradient(closest-side, rgba(52, 211, 120, 0.55), rgba(16, 150, 80, 0.22) 55%, transparent 78%);
  filter: blur(12px);
  animation: hero-glow 9s ease-in-out infinite alternate;
}
.hero-bg-sweep {
  top: -20%;
  bottom: -20%;
  left: -30%;
  width: 28%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  transform: skewX(-18deg);
  animation: hero-sweep 14s ease-in-out infinite;
}
@keyframes hero-gradient {
  from { background-position: 0% 40%; }
  to { background-position: 100% 60%; }
}
@keyframes hero-glow {
  from { transform: translate(0, 0) scale(0.94); opacity: 0.65; }
  to { transform: translate(-6%, 5%) scale(1.06); opacity: 1; }
}
@keyframes hero-sweep {
  0% { left: -30%; opacity: 0; }
  15% { opacity: 1; }
  60% { left: 110%; opacity: 1; }
  100% { left: 110%; opacity: 0; }
}

/* When a picture lands it is tipped over, then rocks back upright like a kicked bottle */
.hero-kick {
  transform-origin: 50% 100%;
}
.hero-stage[data-ready] .hero-slide.is-active .hero-kick {
  animation: hero-kick 1.3s ease-out 0.95s both;
}
@keyframes hero-kick {
  0% { transform: rotate(0deg); }
  16% { transform: rotate(-5deg); }
  38% { transform: rotate(2.5deg); }
  58% { transform: rotate(-1.5deg); }
  78% { transform: rotate(0.6deg); }
  100% { transform: rotate(0deg); }
}

/* One flat colour per product, taken from its pack, with a soft lighter glow of the same colour behind it */
.hero-bg-layer.hero-bg-orange { --g: 255, 168, 90; background: #c2500a; }
.hero-bg-layer.hero-bg-purple { --g: 196, 140, 255; background: #4a1d8f; }
.hero-bg-layer.hero-bg-green { --g: 120, 214, 140; background: #1c6a34; }
.hero-bg-layer.hero-bg-red { --g: 255, 120, 130; background: #a3162b; }
.hero-bg-layer.hero-bg-blue { --g: 120, 180, 255; background: #1a4a9e; }
.hero-bg-layer.hero-bg-orange,
.hero-bg-layer.hero-bg-purple,
.hero-bg-layer.hero-bg-green,
.hero-bg-layer.hero-bg-red,
.hero-bg-layer.hero-bg-blue {
  animation: none;
}
.hero-bg-layer.hero-bg-orange::after,
.hero-bg-layer.hero-bg-purple::after,
.hero-bg-layer.hero-bg-green::after,
.hero-bg-layer.hero-bg-red::after,
.hero-bg-layer.hero-bg-blue::after {
  top: 50%;
  right: 4%;
  margin-top: calc(min(62vw, 760px) / -2);
  background: radial-gradient(closest-side, rgba(var(--g), 0.4), rgba(var(--g), 0.12) 60%, transparent 80%);
}

/* The product floats gently up and down on its own, with a soft shadow beneath it */
.hero-kick {
  filter: drop-shadow(0 26px 24px rgba(0, 0, 0, 0.35));
}
.hero-stage[data-ready] .hero-slide.is-active .hero-float {
  animation: hero-float 4.5s ease-in-out 2.3s infinite alternate;
}
@keyframes hero-float {
  from { transform: translateY(0); }
  to { transform: translateY(-14px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-stage[data-ready] .hero-slide.is-active .hero-float {
    animation: none;
  }
}

/* Progress line inside the active dot */
.hero-dot-fill {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
}
[aria-current="true"] > .hero-dot-track > .hero-dot-fill {
  animation: hero-progress var(--hero-speed, 6s) linear forwards;
}
[data-hero].is-paused [aria-current="true"] > .hero-dot-track > .hero-dot-fill {
  animation-play-state: paused;
}
@keyframes hero-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-slide.is-active,
  .hero-slide.is-leaving,
  .hero-stage[data-ready] .hero-slide [data-rise],
  .hero-stage[data-ready] .hero-slide .hero-zoom {
    transition: none;
    transform: none;
  }
  [aria-current="true"] > .hero-dot-track > .hero-dot-fill {
    animation: none;
    transform: scaleX(1);
  }
  .hero-stage[data-ready] .hero-slide.is-active .hero-kick,
  .hero-bg,
  .hero-bg-glow,
  .hero-bg-sweep {
    animation: none;
  }
}
