/* ---------- Tokens ---------- */
:root {
  /* --bg and --ink are animated by script.js as you scroll */
  --bg: #ffd6e4;
  --ink: #5c0e2f;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --pad: clamp(1.25rem, 4vw, 4rem);
}

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

* { margin: 0; }

html {
  background: var(--bg);
  scrollbar-gutter: stable; /* keeps the layout from shifting when the lock turns on and off */
}

/* While the hero is showing flavours 1 to 3, the page cannot scroll at all.
   script.js removes this class once the last flavour has fully appeared. */
html.is-locked,
html.is-locked body {
  overflow: hidden;
  overscroll-behavior: none;
}

html.is-locked { touch-action: none; }

/* Photo viewer open: the page behind it doesn't scroll */
html.lb-open { overflow: hidden; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 4px;
}

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

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--pad);
}

.brand {
  font-size: 1.7rem;
  font-weight: 800;
  font-stretch: 80%;
  letter-spacing: -0.04em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-weight: 500;
}

.nav__links a { transition: opacity 0.2s; }
.nav__links a:hover { opacity: 0.6; }

.nav__order {
  padding: 0.5rem 1.2rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100svh;
  height: 100dvh;
}

.stage {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 5.5rem var(--pad) 1.5rem;
  overflow: hidden;
}

.content {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 2rem;
  min-height: 0;
}

/* Image window */
.arch {
  position: relative;
  justify-self: center;
  height: min(72svh, 48vw, 720px);
  aspect-ratio: 0.86;
  overflow: hidden;
  border-radius: 999px 999px 28px 28px;
  background: rgba(0, 0, 0, 0.06);
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.3s var(--ease);
}

.is-ready .arch { clip-path: inset(0); }

.layer {
  position: absolute;
  inset: 0;
  will-change: clip-path;
}

.layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  will-change: transform;
}

/* Text slides share one grid cell so the column never jumps in height */
.copy {
  display: grid;
  align-items: center;
}

.slide {
  grid-area: 1 / 1;
  pointer-events: none;
}

.slide.is-active { pointer-events: auto; }

.slide:not(.is-active) {
  visibility: hidden;
  transition: visibility 0s 0.7s;
}

.slide__name {
  font-size: clamp(2.4rem, min(8.6vw, 14svh), 9rem);
  font-weight: 800;
  font-stretch: 78%;
  line-height: 0.9;
  letter-spacing: -0.045em;
  margin-bottom: 1.5rem;
}

/* Masked line reveal: lines slide in from below or above depending on scroll direction */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.line > span {
  display: block;
  transition: transform 0.55s var(--ease);
}

.slide.is-after .line > span { transform: translateY(130%); }
.slide.is-before .line > span { transform: translateY(-130%); }

.slide.is-active .line > span {
  transform: none;
  transition-duration: 0.9s;
  transition-delay: calc(var(--i) * 80ms + 120ms);
}

/* Supporting text fades with a small shift */
.slide__desc,
.slide__facts,
.btn {
  transition: opacity 0.35s ease, transform 0.6s var(--ease);
}

.slide:not(.is-active) .slide__desc,
.slide:not(.is-active) .slide__facts,
.slide:not(.is-active) .btn { opacity: 0; }

.slide.is-after .slide__desc,
.slide.is-after .slide__facts,
.slide.is-after .btn { transform: translateY(14px); }

.slide.is-before .slide__desc,
.slide.is-before .slide__facts,
.slide.is-before .btn { transform: translateY(-14px); }

.slide.is-active .slide__desc { transition-delay: 0.3s; }
.slide.is-active .slide__facts { transition-delay: 0.38s; }
.slide.is-active .btn { transition-delay: 0.46s; }

.slide__desc {
  max-width: 34ch;
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  line-height: 1.45;
}

.slide__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
  margin: 1.6rem 0 2rem;
}

.slide__facts dt {
  font-size: 0.85rem;
  opacity: 0.65;
}

.slide__facts dd {
  font-weight: 600;
  font-size: 1.05rem;
}

.btn {
  display: inline-block;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}

.btn:hover { filter: brightness(1.15); }

/* Scroll hint */
.hint {
  position: absolute;
  right: var(--pad);
  bottom: 5.2rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Flavour tabs */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.tab {
  position: relative;
  padding: 1rem 0 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.tab:hover,
.tab.is-active { opacity: 1; }

.tab::before,
.tab::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}

.tab::before { opacity: 0.25; }

.tab::after {
  transform-origin: left;
  transform: scaleX(var(--fill, 0));
}

/* Placeholder section after the hero */
.next {
  min-height: 60svh;
  display: grid;
  place-items: center;
  padding: 4rem var(--pad);
  text-align: center;
  font-size: 1.2rem;
}


/* ---------- About us ---------- */
.about {
  --wine: #5c0e2f;
  --blush: #ffe6ee;
  margin: 0 clamp(0.5rem, 1.5vw, 1.25rem);
  padding: clamp(4.5rem, 10vw, 9rem) clamp(1.25rem, 4vw, 4rem);
  border-radius: 40px;
  background: var(--wine);
  color: var(--blush);
}

.about :focus-visible { outline-color: var(--blush); }

.about__title {
  font-size: clamp(2.4rem, 8vw, 8rem);
  font-weight: 800;
  font-stretch: 78%;
  line-height: 0.92;
  letter-spacing: -0.045em;
}

/* Statement lights up word by word as you scroll */
.about__statement {
  max-width: 24em;
  margin: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 7vw, 6rem);
  font-size: clamp(1.6rem, 3.4vw, 3.2rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.word {
  opacity: 0.22;
  transition: opacity 0.35s ease;
}

.word.lit { opacity: 1; }

/* Chapters: pick one and the photo wipes to match */
.chapters {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 6rem);
  align-items: center;
}

.chapters__media {
  position: relative;
  order: 2;
  aspect-ratio: 1 / 1;
  max-height: 72svh;
  width: 100%;
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255, 230, 238, 0.1);
}

.media-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.media-layer:not(:first-child) { clip-path: inset(100% 0 0 0); }

.media-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapters__list { order: 1; }

.chapter {
  position: relative;
  padding: 1.4rem 0;
  border-top: 1px solid rgba(255, 230, 238, 0.25);
}

.chapter:last-child { border-bottom: 1px solid rgba(255, 230, 238, 0.25); }

.chapter__head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.4s;
}

.chapter__head:hover,
.chapter.is-active .chapter__head { opacity: 1; }

.chapter__num { min-width: 1.75rem; font-size: 0.95rem; font-weight: 600; }

.chapter__name {
  font-size: clamp(1.8rem, 3.6vw, 3.4rem);
  font-weight: 700;
  font-stretch: 80%;
  line-height: 1;
  letter-spacing: -0.03em;
}

.chapter__more {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.7s var(--ease), opacity 0.35s ease;
}

.chapter__more > div { min-height: 0; overflow: hidden; }

.chapter.is-active .chapter__more {
  grid-template-rows: 1fr;
  opacity: 1;
  transition-delay: 0.15s;
}

.chapter__more p {
  max-width: 40ch;
  margin-top: 0.9rem;
  padding-left: calc(1.75rem + 1.25rem);
  line-height: 1.5;
}

/* Timer line on the open chapter (also advances the slideshow) */
.chapter__bar {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
}

.chapter__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--blush);
  transform: scaleX(0);
  transform-origin: left;
}

.chapter.is-active .chapter__bar::after { transform: scaleX(1); }

.about.is-playing .chapter.is-active .chapter__bar::after {
  animation: chapter-fill 6s linear;
}

.chapters:hover .chapter__bar::after { animation-play-state: paused !important; }

@keyframes chapter-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Numbers */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: clamp(3rem, 7vw, 6rem);
  padding: 0;
  list-style: none;
}

.stats strong {
  display: block;
  font-size: clamp(2.6rem, 7vw, 6.5rem);
  font-weight: 800;
  font-stretch: 78%;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stats span {
  display: block;
  margin-top: 0.5rem;
  max-width: 18ch;
  opacity: 0.8;
}

/* ---------- Ingredients ---------- */
.ingr {
  --cream: #efe2cf;
  --cocoa: #2a1710;
  background: var(--cream);
  color: var(--cocoa);
  padding: clamp(4rem, 9vw, 8rem) var(--pad) clamp(3rem, 6vw, 5rem);
}

.ingr__head {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: end;
  gap: 2rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.ingr__title {
  font-size: clamp(2.6rem, 8.6vw, 8.5rem);
  font-weight: 800;
  font-stretch: 78%;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.ingr__intro {
  max-width: 30ch;
  justify-self: end;
  padding-bottom: 0.6rem;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  line-height: 1.45;
}

/* Cards stack: each one slides over the last as you scroll */
.card {
  --bg-card: #f9c6d3;
  --ink-card: #5c0e2f;
  position: sticky;
  top: calc(4.75rem + var(--i) * 16px);
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  height: calc(100svh - 7rem);
  min-height: 460px;
  margin-bottom: 6svh;
  overflow: hidden;
  border-radius: 36px;
  background: var(--bg-card);
  color: var(--ink-card);
  transform-origin: 50% 0;
  transform: scale(calc(1 - var(--p, 0) * 0.05));
  will-change: transform;
}

.card:last-child { margin-bottom: 0; }

.card--nut { --bg-card: #d9e6b0; --ink-card: #2c3a12; }
.card--mango { --bg-card: #ffd23f; --ink-card: #4a2a00; }

/* Darkens a card slightly once the next one covers it */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: calc(var(--p, 0) * 0.2);
  pointer-events: none;
}

.card__text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.5rem, 3.5vw, 3.5rem);
}

.card__num { font-weight: 600; }

.card__name {
  font-size: clamp(2.4rem, 6vw, 6rem);
  font-weight: 800;
  font-stretch: 78%;
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.card__desc {
  max-width: 34ch;
  margin-top: 1.25rem;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.45;
}

.card__used {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.card__used span { opacity: 0.7; margin-right: 0.25rem; }

.card__used b {
  padding: 0.35rem 0.9rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-weight: 600;
}

.card__media {
  margin: clamp(0.75rem, 1.5vw, 1.25rem);
  overflow: hidden;
  border-radius: 26px;
}

.card--flip .card__media { order: -1; }

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

.card:hover .card__media img { transform: scale(1.05); }


/* ---------- Gallery ---------- */
.gallery {
  --pink: #ffd6e4;
  --wine: #5c0e2f;
  position: relative;
  z-index: 1;
  margin-top: -2.5rem;
  padding: clamp(4rem, 9vw, 8rem) var(--pad) calc(clamp(4rem, 9vw, 8rem) + 2.5rem);
  border-radius: 2.5rem 2.5rem 0 0;
  background: var(--pink);
  color: var(--wine);
}

.gallery :focus-visible { outline-color: var(--wine); }

.gallery__head {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: end;
  gap: 2rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.gallery__title {
  font-size: clamp(2.6rem, 8.6vw, 8.5rem);
  font-weight: 800;
  font-stretch: 78%;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.gallery__intro {
  max-width: 30ch;
  justify-self: end;
  padding-bottom: 0.6rem;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  line-height: 1.45;
}

.gallery__grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1rem;
  height: min(80svh, 760px);
  min-height: 520px;
}

.tile--a { grid-row: 1 / span 2; }

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: #f3b9cb;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  /* reveal: opens up from the middle */
  clip-path: inset(14% 10% 14% 10% round 28px);
  opacity: 0;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition:
    clip-path 1.1s var(--ease) calc(var(--n) * 130ms),
    opacity 0.8s ease calc(var(--n) * 130ms),
    transform 0.4s var(--ease);
}

.gallery.in-view .tile {
  clip-path: inset(0 0 0 0 round 28px);
  opacity: 1;
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

.tile:hover img { transform: scale(1.06); }

/* Dark fade for the caption */
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(70, 10, 35, 0.78) 0%, transparent 55%);
  pointer-events: none;
}

/* Soft light that follows the mouse */
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.3), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.tile:hover::before { opacity: 1; }

.tile__plus {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--wine);
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.5s var(--ease);
}

.tile:hover .tile__plus { transform: rotate(90deg) scale(1.1); }

.tile__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: block;
  padding: 1.25rem 1.5rem;
}

.tile__title {
  display: block;
  font-size: clamp(1.5rem, 2.3vw, 2.2rem);
  font-weight: 800;
  font-stretch: 80%;
  line-height: 1;
  letter-spacing: -0.03em;
}

.tile__text {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.5s var(--ease), opacity 0.35s ease;
}

.tile__text p { min-height: 0; margin: 0.5rem 0 0; overflow: hidden; max-width: 34ch; line-height: 1.4; }

.tile:hover .tile__text,
.tile:focus-visible .tile__text {
  grid-template-rows: 1fr;
  opacity: 1;
}

@media (hover: none) {
  .tile__text { grid-template-rows: 1fr; opacity: 1; }
}

/* "View" bubble that follows the mouse over the photos */
.view-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 5.2rem;
  height: 5.2rem;
  border-radius: 50%;
  background: var(--blush, #ffe6ee);
  color: #5c0e2f;
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.view-cursor span { display: block; transform: scale(0.6); transition: transform 0.4s var(--ease); }
.view-cursor.is-on { opacity: 1; }
.view-cursor.is-on span { transform: scale(1); }

/* ---------- Photo viewer ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.lb[hidden] { display: none; }

.lb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 10, 22, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.lb.is-open .lb__backdrop { opacity: 1; }

.lb__fig {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 0;
  color: #ffe6ee;
}

.lb__img {
  display: block;
  max-width: none;
  border-radius: 20px;
  object-fit: cover;
  will-change: transform, clip-path;
}

.lb__cap {
  display: grid;
  gap: 0.2rem;
  max-width: 90vw;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease 0.35s;
}

.lb.is-open .lb__cap { opacity: 1; }
.lb__cap strong { font-size: 1.25rem; }
.lb__cap span { opacity: 0.8; }

.lb__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 230, 238, 0.16);
  color: #ffe6ee;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.5s ease 0.2s, background-color 0.2s;
}

.lb.is-open .lb__btn,
.lb.is-open .lb__count { opacity: 1; }
.lb__btn:hover { background: rgba(255, 230, 238, 0.32); }
.lb__btn:focus-visible { outline: 2px solid #ffe6ee; outline-offset: 3px; }

.lb__close { top: 1.25rem; right: 1.25rem; font-size: 2rem; }
.lb__prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb__next { right: 1.25rem; top: 50%; transform: translateY(-50%); }

.lb__count {
  position: absolute;
  top: 1.7rem;
  left: 1.5rem;
  color: #ffe6ee;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.5s ease 0.2s;
}

/* ---------- Call to action + footer ---------- */
.cta {
  --wine: #5c0e2f;
  --blush: #ffe6ee;
  position: relative;
  z-index: 2;
  margin-top: -2.5rem;
  padding: calc(clamp(4rem, 9vw, 8rem) + 2.5rem) var(--pad) 0;
  overflow: hidden;
  border-radius: 2.5rem 2.5rem 0 0;
  background: var(--wine);
  color: var(--blush);
}

.cta :focus-visible { outline-color: var(--blush); }

.cta__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.cta__title .line { white-space: nowrap; }

.cta__title {
  font-size: clamp(2.8rem, 7.2vw, 7.5rem);
  font-weight: 800;
  font-stretch: 78%;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.cta__lead {
  max-width: 36ch;
  margin: 1.75rem 0 2rem;
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  line-height: 1.5;
}

.cta__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.cta .btn { transition: transform 0.3s var(--ease), background-color 0.3s, color 0.3s; }
.btn--blush { background: var(--blush); color: var(--wine); }
.btn--ghost { background: transparent; color: var(--blush); box-shadow: inset 0 0 0 1.5px rgba(255, 230, 238, 0.6); }
.btn--ghost:hover { background: rgba(255, 230, 238, 0.12); filter: none; }

.cta__info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 230, 238, 0.25);
}

.cta__info dt { font-size: 0.85rem; opacity: 0.7; }
.cta__info dd { font-weight: 600; font-size: 1.1rem; }

.cta__visual { position: relative; justify-self: center; }

.cta__disc {
  position: relative;
  width: min(44vw, 640px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

/* The photo turns slowly as you scroll */
.cta__disc img {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 120%;
  width: auto;
  max-width: none;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
}

.badge {
  position: absolute;
  left: -1rem;
  bottom: 6%;
  display: grid;
  place-items: center;
  width: clamp(6.5rem, 10vw, 9rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--blush);
  color: var(--wine);
  transition: transform 0.5s var(--ease);
}

.badge:hover { transform: scale(1.08) rotate(-6deg); }

.badge__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: badge-spin 18s linear infinite;
}

.badge__ring text {
  fill: currentColor;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
}

.badge__arrow { font-size: clamp(1.6rem, 2.6vw, 2.4rem); font-weight: 700; }

@keyframes badge-spin { to { transform: rotate(360deg); } }

/* Footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: clamp(3rem, 7vw, 6rem);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 230, 238, 0.25);
  font-size: 0.95rem;
}

.foot__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.foot__links a:hover { opacity: 0.65; }
.foot__note { opacity: 0.7; }

.foot__mark {
  flex-basis: 100%;
  margin: 1rem 0 0;
  padding-bottom: 0.25em;
  font-size: 24vw;
  font-weight: 800;
  font-stretch: 78%;
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-align: center;
  color: rgba(255, 230, 238, 0.1);
  user-select: none;
}

/* Nav gets a soft backdrop once the page scrolls past the hero */
.nav { transition: background-color 0.3s, backdrop-filter 0.3s; }

.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* Cue on the last flavour: tells people the page continues */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: rgba(30, 14, 8, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.5s ease, transform 0.6s var(--ease);
  pointer-events: none;
}

.scroll-cue.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Bestsellers ---------- */
.best {
  --cream: #efe2cf;
  --cocoa: #2a1710;
  background: var(--cream);
  color: var(--cocoa);
  padding: clamp(4rem, 9vw, 8rem) var(--pad);
}

.best__head {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: end;
  gap: 2rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.best__title {
  font-size: clamp(2.8rem, 9vw, 8.5rem);
  font-weight: 800;
  font-stretch: 78%;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.best__intro {
  max-width: 30ch;
  justify-self: end;
  padding-bottom: 0.6rem;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  line-height: 1.45;
}

.best .line > span,
.about .line > span,
.ingr .line > span,
.gallery .line > span,
.cta .line > span { transform: translateY(130%); }

.best.in-view .line > span,
.about.in-view .line > span,
.ingr.in-view .line > span,
.gallery.in-view .line > span,
.cta.in-view .line > span {
  transform: none;
  transition-duration: 0.9s;
  transition-delay: calc(var(--i) * 90ms + 100ms);
}

/* Panels: the one you pick grows and shows its details */
.best__grid {
  display: flex;
  gap: 1rem;
  height: min(78svh, 700px);
  min-height: 460px;
}

.panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 32px;
  background: #d9c9b2;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(48px);
  transition:
    flex 0.8s var(--ease),
    opacity 0.8s var(--ease) calc(var(--n) * 120ms),
    transform 0.9s var(--ease) calc(var(--n) * 120ms);
}

.best.in-view .panel {
  opacity: 1;
  transform: none;
}

.panel.is-active { flex: 2.6 1 0; cursor: default; }

.panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  transition: transform 1.2s var(--ease);
}

.panel.is-active img { transform: scale(1); }

/* Dark fade at the bottom so the text is easy to read */
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(24, 10, 8, 0.85) 0%, rgba(24, 10, 8, 0.4) 38%, transparent 68%);
}

/* Extra dimming on the panels you haven't picked */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(24, 10, 8, 0.28);
  transition: opacity 0.6s;
}

.panel.is-active::before { opacity: 0; }

.panel__rank {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 3;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(24, 10, 8, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 0.8rem;
  font-weight: 600;
}

.panel__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 1.5rem;
}

.panel__name {
  font-size: clamp(1.4rem, 2vw, 2.2rem);
  font-weight: 800;
  font-stretch: 80%;
  line-height: 1;
  letter-spacing: -0.03em;
  transition: font-size 0.7s var(--ease);
}

.panel.is-active .panel__name { font-size: clamp(2.2rem, 4.6vw, 4.4rem); }

.panel__tag {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  opacity: 0.85;
}

/* Details open smoothly using a grid-row trick */
.panel__more {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.7s var(--ease), opacity 0.35s ease;
}

.panel__more > div { min-height: 0; overflow: hidden; }

.panel.is-active .panel__more {
  grid-template-rows: 1fr;
  opacity: 1;
  transition-delay: 0.2s;
}

.panel__more p {
  max-width: 36ch;
  margin: 0.9rem 0 1.25rem;
  line-height: 1.45;
}

.panel .btn { background: #fff; color: var(--cocoa); }

/* ---------- Responsive ---------- */
/* Short desktop windows: drop the detail row so the button never hits the tabs */
@media (min-width: 821px) and (max-height: 720px) {
  .slide__facts { display: none; }
  .slide__desc { font-size: 1rem; }
  .slide__name { margin-bottom: 1rem; }
  .btn { margin-top: 1.25rem; }
}

/* Phones and narrow windows: image on top, text below.
   The image takes whatever height is left, so the text never gets squeezed. */
@media (max-width: 820px) {
  .nav__links a:not(.nav__order) { display: none; }

  .stage { padding-top: 4.5rem; }

  .content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .arch {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    max-height: 400px;
    max-width: 100%;
    align-self: center;
  }

  .copy { flex: none; }

  .slide__name {
    font-size: clamp(2.2rem, min(14vw, 7.5svh), 3.6rem);
    margin-bottom: 0.8rem;
  }

  .slide__desc {
    max-width: 40ch;
    font-size: clamp(0.88rem, 2.3svh, 1rem);
  }

  .slide__facts { display: none; }
  .btn { margin-top: 1rem; padding: 0.8rem 1.4rem; }

  .hint { display: none; }

  .tabs { gap: 0.5rem; }
  .tab { font-size: 0.75rem; }

  /* Bestsellers: panels stack, the picked one grows taller */
  .best__head { grid-template-columns: 1fr; gap: 1rem; }
  .best__intro { justify-self: start; }

  .best__grid {
    flex-direction: column;
    gap: 0.75rem;
    height: min(82svh, 640px);
    min-height: 520px;
  }

  /* About */
  .about { border-radius: 28px; }
  .chapters { grid-template-columns: 1fr; gap: 1.75rem; }
  .chapters__media { order: -1; aspect-ratio: 4 / 3; max-height: none; border-radius: 22px; }
  .chapter { padding: 1.1rem 0; }
  .chapter__name { font-size: 1.7rem; }
  .stats { gap: 1rem; }
  .stats span { font-size: 0.85rem; }

  /* Ingredients */
  .ingr__head { grid-template-columns: 1fr; gap: 1rem; }
  .ingr__intro { justify-self: start; }

  .card {
    top: calc(4.25rem + var(--i) * 10px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    height: calc(100svh - 6.25rem);
    min-height: 440px;
    border-radius: 26px;
  }

  .card__media,
  .card--flip .card__media { order: -1; margin: 0.6rem 0.6rem 0; border-radius: 20px; }
  .card__text { gap: 0.75rem; padding: 1.1rem 1.25rem 1.25rem; }
  .card__num { display: none; }
  .card__name { font-size: clamp(2.1rem, 11vw, 3rem); }
  .card__desc { margin-top: 0.6rem; font-size: 0.95rem; }
  .card__used { font-size: 0.8rem; }
  .card__used b { padding: 0.25rem 0.7rem; }

  /* Gallery */
  .gallery { margin-top: -1.75rem; border-radius: 1.75rem 1.75rem 0 0; }
  .gallery__head { grid-template-columns: 1fr; gap: 1rem; }
  .gallery__intro { justify-self: start; }

  .gallery__grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 0.75rem;
    height: auto;
    min-height: 0;
  }

  .tile--a { grid-row: auto; }
  .tile { aspect-ratio: 4 / 3; border-radius: 22px; }
  .tile__text { grid-template-rows: 1fr; opacity: 1; }
  .tile__cap { padding: 1rem 1.15rem; }
  .view-cursor { display: none; }

  .lb__prev { left: 0.5rem; }
  .lb__next { right: 0.5rem; }

  /* Call to action */
  .cta { margin-top: -1.75rem; border-radius: 1.75rem 1.75rem 0 0; padding-top: calc(clamp(4rem, 9vw, 8rem) + 1.75rem); }
  .cta__grid { grid-template-columns: 1fr; }
  .cta__disc { width: min(82vw, 440px); }
  .badge { left: -0.25rem; width: 6.25rem; }
  .foot { flex-direction: column; align-items: flex-start; }

  .panel { border-radius: 24px; }
  .panel.is-active { flex: 4 1 0; }

  .panel__rank { top: 0.9rem; left: auto; right: 0.9rem; }
  .panel__body { padding: 1rem 1.15rem; }
  .panel__name { font-size: 1.5rem; }
  .panel.is-active .panel__name { font-size: 2.4rem; }
  .panel__more p { margin: 0.6rem 0 1rem; font-size: 0.95rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .tile,
  .tile img,
  .tile__text,
  .badge__ring,
  .word,
  .chapter__more,
  .card__media img,
  .panel,
  .panel img,
  .panel__more,
  .panel__name,
  .scroll-cue,
  .arch,
  .line > span,
  .slide__desc,
  .slide__facts,
  .btn { transition: none !important; }

  .arch { clip-path: inset(0); }
}
