/* Scroll reel ("Scroll to cook."). Behaviour in js/scroll-reel.js; --p (0..1, set on the card) is the scroll progress through the section. */
.scroll-reel {
  --p: 0;
  --card-h: min(72svh, 680px);                       /* leaves the corner free for the menu badge */
  --card-w: calc(var(--card-h) * 9 / 16);
  position: relative;
  height: 340svh;                                    /* the scroll distance that scrubs the whole clip */
  background: var(--shop-blue);
  color: var(--paper);
}
.scroll-reel__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(32px, 7vw, 120px);
  padding: 0 clamp(24px, 8vw, 140px);
  overflow: hidden;
}

/* ---- Story column ---- */
.scroll-reel__kicker {
  margin: 0 0 14px;
  font-family: var(--outfit), sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .75;
}
.scroll-reel__title {
  margin: 0 0 clamp(28px, 5svh, 56px);
  font-family: var(--veneer), sans-serif;
  font-size: clamp(56px, 8.4vw, 150px);
  font-weight: 400;
  line-height: .86;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.scroll-reel__steps {
  display: grid;
  gap: 4px;
  max-width: 30rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--outfit), sans-serif;
}
.scroll-reel__step {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 14px 0 14px 22px;
  font-size: clamp(17px, 1.45vw, 22px);
  line-height: 1.3;
  opacity: .62;                                      /* lowest that keeps 4.5:1 on the blue (WCAG AA) */
  transition: opacity .45s ease, transform .45s cubic-bezier(.23, 1, .32, 1);
}
.scroll-reel__step::before {                         /* a rule that lights up beside the current step */
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .45s cubic-bezier(.23, 1, .32, 1);
}
.scroll-reel__step.is-done {
  opacity: .8;
}
.scroll-reel__step.is-active {
  opacity: 1;
  transform: translateX(6px);
}
.scroll-reel__step.is-active::before {
  transform: scaleY(1);
}
.scroll-reel__num {
  font-size: .72em;
  font-weight: 600;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

/* ---- The reel card: tilts and drifts with the scroll ---- */
.scroll-reel__card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  margin: 0;
  overflow: hidden;
  border-radius: 28px;
  background: var(--shop-ink);
  box-shadow:
    0 0 0 1.5px rgb(244 240 230 / .5),
    0 50px 90px -40px rgb(4 10 40 / .85),
    0 18px 40px -20px rgb(4 10 40 / .6);
  transform:
    translateY(calc((.5 - var(--p)) * 7svh))
    rotate(calc(-4deg + var(--p) * 7deg));
  will-change: transform;
}
.scroll-reel__poster,
.scroll-reel__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) contrast(1.05);
}
.scroll-reel__video {                                /* hidden until a frame is really decoded (is-ready), so the card never goes blank */
  opacity: 0;
  transition: opacity .3s ease;
}
.scroll-reel.is-ready .scroll-reel__video {
  opacity: 1;
}
@supports (-webkit-touch-callout: none) {            /* iOS Safari paints a <video> with a CSS filter as blank inside a clipped, rotated card */
  .scroll-reel__video {
    filter: none;
  }
}
.scroll-reel__card::after {                          /* legibility shade for the bars, handle and caption */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(0 0 0 / .26), transparent 14%),
    linear-gradient(0deg, rgb(0 0 0 / .42), transparent 26%);
}
.scroll-reel__bars {
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  gap: 5px;
}
.scroll-reel__bar {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgb(244 240 230 / .35);
}
.scroll-reel__bar i {
  display: block;
  height: 100%;
  background: var(--paper);
  transform: scaleX(0);
  transform-origin: left;
}
.scroll-reel__head {
  position: absolute;
  z-index: 1;
  top: 30px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--outfit), sans-serif;
  font-size: 14px;
  font-weight: 600;
}
.scroll-reel__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--paper) url(../assets/brand/apple-touch-icon.png) center / cover;
  box-shadow: 0 0 0 2px var(--paper);
}
.scroll-reel__caption {
  position: absolute;
  z-index: 1;
  left: 20px;
  right: 20px;
  bottom: 22px;
  margin: 0;
  font-family: var(--veneer), sans-serif;
  font-size: clamp(26px, calc(var(--card-w) * .1), 38px);
  line-height: .95;
  text-transform: uppercase;
  text-wrap: balance;
}
.scroll-reel__caption.is-in {
  animation: scroll-reel-caption .55s cubic-bezier(.23, 1, .32, 1) both;
}
@keyframes scroll-reel-caption {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.scroll-reel__hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  translate: -50% 0;
  font-family: var(--outfit), sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .7;
  transition: opacity .4s ease;
}
.scroll-reel__hint::after {
  content: "";
  display: block;
  width: 1.5px;
  height: 28px;
  margin: 8px auto 0;
  background: currentColor;
  transform-origin: top;
  animation: scroll-reel-hint 1.6s cubic-bezier(.65, 0, .35, 1) infinite;
}
@keyframes scroll-reel-hint {
  0%   { transform: scaleY(0); }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
.scroll-reel.is-scrolling .scroll-reel__hint {
  opacity: 0;
}

/* ---- Phones: the card takes the stage, the caption tells the story ---- */
@media (max-width: 767px) {
  .scroll-reel {
    --card-h: min(calc(100svh - 280px), calc((100vw - 48px) * 16 / 9));   /* clears the title above and the menu badge below */
    height: 300svh;
  }
  .scroll-reel__stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    justify-items: center;
    align-items: start;
    gap: 16px;
    padding: 84px 24px 0;
  }
  .scroll-reel__kicker {
    margin-bottom: 6px;
    font-size: 12px;
    text-align: center;
  }
  .scroll-reel__title {
    margin: 0;
    font-size: 40px;
    text-align: center;
  }
  .scroll-reel__steps {
    display: none;
  }
  .scroll-reel__card {
    border-radius: 22px;
    transform:
      translateY(calc((.5 - var(--p)) * 3svh))
      rotate(calc(-2deg + var(--p) * 4deg));
  }
  .scroll-reel__hint {
    display: none;
  }
}

/* ---- Reduced motion: no pin, no scrub; a still card beside the steps ---- */
.scroll-reel.is-static {
  height: auto;
}
.scroll-reel.is-static .scroll-reel__stage {
  position: relative;
  height: auto;
  min-height: 100svh;
  padding-block: 96px;
}
.scroll-reel.is-static .scroll-reel__card {
  transform: none;
}
.scroll-reel.is-static .scroll-reel__step {
  opacity: 1;
  transform: none;
}
.scroll-reel.is-static .scroll-reel__step::before,
.scroll-reel.is-static .scroll-reel__hint {
  display: none;
}
@media (max-width: 767px) {
  .scroll-reel.is-static .scroll-reel__steps {
    display: grid;
  }
}
@media (forced-colors: active) {
  .scroll-reel__card {
    border: 2px solid CanvasText;
  }
}

/* iOS Safari paints a <video> on its own layer, above the menu sheet's expanding clip-path circle, so a video
   showed through the open sheet. Page videos are hidden while the sheet is open (it holds no video itself). */
html.menu-sheet-open video {
  visibility: hidden;
}
