.menu-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: clamp(38rem, 100svh, 60rem);
  background: #a80a33;
  color: #fff3dc;
  padding-block: 7rem calc(clamp(60px, 10vw, 130px) + 1.5rem);
  text-align: center;
  overflow: hidden;
}

.menu-hero__strata {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: clamp(60px, 10vw, 130px);
}

.menu-hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 58%;
  width: min(120vw, 880px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 223, 158, 0.16);
  clip-path: polygon(50% 0, 100% 86.6%, 0 86.6%);
  background: linear-gradient(180deg, rgba(255, 223, 158, 0.08), transparent 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.menu-hero .container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.menu-hero__title {
  margin: 0.7rem 0 1.3rem;
  font-family: "Piazzolla", Georgia, serif;
  font-weight: 800;
  font-size: clamp(2.1rem, 6vw + 0.6rem, 5.4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.menu-hero__box {
  position: relative;
  width: min(76vw, 20rem, max(11rem, calc((100svh - 30rem) * 1.45)));
  aspect-ratio: 1000 / 729;
  margin-top: 1.6rem;
}

.menu-hero__box::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 58%;
  width: 150%;
  aspect-ratio: 2 / 1;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 228, 170, 0.5) 0%, rgba(255, 228, 170, 0.18) 45%, rgba(255, 228, 170, 0) 72%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.menu-hero__box picture {
  position: absolute;
  inset: 0;
}

.menu-hero__box-img {
  width: 100%;
  transition: opacity 0.25s ease;
}

.menu-hero__gl {
  position: absolute;
  inset: -12% -8%;
  width: 116%;
  height: 124%;
  max-width: none;
  opacity: 0;
  transform: translateZ(0);
  transition: opacity 0.25s ease;
  contain: strict;
  -webkit-mask-image:
    linear-gradient(180deg, transparent 0%, #000 10%, #000 86%, transparent 100%),
    linear-gradient(90deg, transparent 0%, #000 9%, #000 91%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(180deg, transparent 0%, #000 10%, #000 86%, transparent 100%),
    linear-gradient(90deg, transparent 0%, #000 9%, #000 91%, transparent 100%);
  mask-composite: intersect;
}

.menu-hero__box.is-live .menu-hero__box-img {
  opacity: 0;
}

.menu-hero__box.is-live .menu-hero__gl {
  opacity: 1;
}

@media (min-width: 768px) {
  .menu-hero__box {
    width: min(25rem, max(11rem, calc((100svh - 30rem) * 1.45)));
    margin-top: 1.8rem;
  }
}

.menu-hero__lead {
  max-width: 36rem;
  font-size: 1.125rem;
  line-height: 1.6;
  text-wrap: balance;
}

.sweets-index {
  position: relative;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 1rem 2.25rem;
  background: #1a0508;
}

.sweets-index__rail {
  position: relative;
  max-width: 100%;
  isolation: isolate;
  padding: 0.4rem;
  border-radius: 999px;
  background: rgba(251, 243, 224, 0.9);
  color: #3a1214;
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
  box-shadow:
    0 14px 34px rgba(26, 5, 8, 0.28),
    0 2px 6px rgba(26, 5, 8, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.sweets-index__rail::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(100deg, rgba(232, 176, 74, 0) 30%, rgba(232, 176, 74, 0.95) 46%, rgba(168, 10, 51, 0.75) 54%, rgba(232, 176, 74, 0) 70%) 0 0 / 300% 100% no-repeat,
    linear-gradient(rgba(168, 10, 51, 0.14), rgba(168, 10, 51, 0.14));
  pointer-events: none;
}

.sweets-index__rail::after {
  content: "";
  position: absolute;
  inset: 1.5px;
  z-index: -1;
  border-radius: inherit;
  background: #fbf3e0;
  pointer-events: none;
}

.sweets-index ul {
  position: relative;
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.sweets-index ul::-webkit-scrollbar {
  display: none;
}

.sweets-index a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.6rem;
  padding-inline: 0.9rem 1.05rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  color: #3a1214;
  transition: color 0.35s;
}

.sweets-index a:hover {
  color: #a80a33;
}

.sweets-index a.is-active {
  color: #fff4dc;
}

.sweets-index__dot {
  width: 0.62rem;
  height: 0.54rem;
  flex: none;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: #d9a440;
  transition: transform 0.35s, background-color 0.35s;
}

.sweets-index__dot--cocoa {
  background: #7a3d22;
}

.sweets-index__dot--honey {
  background: #e09a2c;
}

.sweets-index__dot--walnut {
  background: #a3561f;
}

.sweets-index__dot--berry {
  background: #e5254b;
}

.sweets-index a.is-active .sweets-index__dot {
  background: #ffdf9e;
  transform: rotate(180deg);
}

.sweets-index__glider {
  position: absolute;
  border-radius: 999px;
  z-index: 0;
  top: 0.4rem;
  left: 0;
  height: calc(100% - 0.8rem);
  width: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #b8103d 0%, #a80a33 45%, #86072a 100%);
  box-shadow: 0 6px 16px rgba(168, 10, 51, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  opacity: 0;
  transition:
    transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1),
    width 0.55s cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 0.3s;
  pointer-events: none;
}

.js .sweets-index.is-floating {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(4.25rem + env(safe-area-inset-bottom));
  padding: 0 0.75rem;
  background: none;
  pointer-events: none;
  transform: translateY(160%);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.4s;
}

.js .sweets-index.is-floating .sweets-index__rail {
  pointer-events: auto;
}

.js .sweets-index.is-floating.is-shown {
  transform: none;
  opacity: 1;
}

.sweet {
  scroll-margin-top: 0;
  overflow: clip;
}

.sweet--butter {
  background: #f7e8c0;
  color: #2a0e0c;
}

.sweet--cocoa {
  background: #2b120c;
  color: #fbefd2;
}

.sweet--honey {
  background: #eab45a;
  color: #2a0e0c;
}

.sweet--walnut {
  background: #5a2c12;
  color: #fbefd2;
}

.sweet--berry {
  background: #c9213a;
  color: #fff8e6;
}

.sweet__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  padding-bottom: 3.5rem;
}

.sweet__hero {
  overflow: hidden;
}

.sweet__hero img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

.sweet__copy {
  padding-inline: 1.25rem;
}

.sweet__name {
  font-family: "Piazzolla", Georgia, serif;
  font-weight: 800;
  font-size: clamp(2.1rem, 2.6vw + 1.2rem, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.sweet__tag {
  margin: 0.6rem 0 1.1rem;
  font-family: "Piazzolla", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.3rem;
  line-height: 1.25;
}

.sweet__desc {
  max-width: 36rem;
}

.sweet__sub {
  margin-top: 1.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.flavours {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.flavours li {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: #7e0626;
  color: #fff8e6;
  font-size: 0.9375rem;
}

.sweet__grid:has(.sweet__gallery) {
  padding-bottom: 0;
}

.sweet__gallery {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.sweet__gallery::-webkit-scrollbar {
  display: none;
}

.sweet__gallery figure {
  position: relative;
  flex: 0 0 86%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  scroll-snap-align: start;
}

.sweet__gallery--1 figure {
  flex-basis: 100%;
  aspect-ratio: 16 / 9;
}

.sweet__pan {
  position: absolute;
  inset: -9% 0;
}

.sweet__pan picture {
  display: block;
  height: 100%;
}

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

.sweet__gallery figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26, 5, 8, 0.18), transparent 30%);
  pointer-events: none;
}

@media (min-width: 768px) {
  .js .sweets-index.is-floating {
    bottom: calc(4.75rem + env(safe-area-inset-bottom));
  }

  .sweet__grid {
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    gap: 0;
    padding-bottom: 0;
  }

  .sweet__hero {
    grid-column: 1 / span 7;
    grid-row: 1;
    justify-self: stretch;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
  }

  .sweet__hero picture {
    display: block;
    height: 100%;
  }

  .sweet__hero img {
    height: 100%;
    aspect-ratio: auto;
  }

  .sweet__copy {
    grid-column: 8 / span 5;
    grid-row: 1;
    padding-block: 3rem;
    padding-inline: 2.5rem;
  }

  .sweet--flip .sweet__hero {
    grid-column: 6 / span 7;
  }

  .sweet--flip .sweet__copy {
    grid-column: 1 / span 5;
  }

  .sweet__gallery {
    grid-column: 1 / span 12;
    overflow: visible;
    gap: 0;
  }

  .sweet__gallery figure {
    flex: 1 1 0;
    aspect-ratio: 3 / 2;
  }

  .sweet__gallery--3 figure {
    aspect-ratio: 4 / 3;
  }

  .sweet__gallery--1 figure {
    aspect-ratio: 21 / 8;
  }

}

@media (min-width: 1025px) {
  .js .sweets-index.is-floating {
    bottom: 1.5rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .sweet__hero picture {
    display: block;
    overflow: hidden;
  }

  .sweet__hero img {
    animation: sweet-breathe 14s ease-in-out infinite alternate;
  }

  @keyframes sweet-breathe {
    from {
      transform: scale(1);
    }

    to {
      transform: scale(1.07);
    }
  }

  .sweets-index__glider::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 223, 158, 0.38) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: glider-sheen 4.5s ease-in-out 1s infinite;
  }

  .sweets-index__rail::before {
    animation: index-sheen 7s ease-in-out infinite;
  }

  @keyframes index-sheen {
    0% {
      background-position: 120% 0, 0 0;
    }

    60%,
    100% {
      background-position: -40% 0, 0 0;
    }
  }

  @keyframes glider-sheen {
    0%,
    65% {
      transform: translateX(-120%);
    }

    100% {
      transform: translateX(120%);
    }
  }

  .sweets-index a.is-active .sweets-index__dot {
    animation: dot-bob 1.6s ease-in-out infinite;
  }

  @keyframes dot-bob {
    0%,
    100% {
      translate: 0 0;
    }

    50% {
      translate: 0 2px;
    }
  }

  .menu-hero::before {
    animation: hero-tri 60s linear infinite;
  }

  @keyframes hero-tri {
    to {
      transform: translate(-50%, -50%) rotate(360deg);
    }
  }
}

@media (max-width: 767px) {
  .sweet__copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .sweet__desc {
    max-width: 30rem;
  }

  .flavours {
    justify-content: center;
  }

  /* No gallery: balance the copy vertically in the colored field */
  .sweet__grid:not(:has(.sweet__gallery)) {
    gap: 0;
    padding-bottom: 0;
  }

  .sweet__grid:not(:has(.sweet__gallery)) .sweet__copy {
    padding-block: 2.75rem;
  }
}

@media (min-width: 768px) and (max-width: 900px) {
  .sweet__hero {
    aspect-ratio: 4 / 5;
  }

  .sweet__copy {
    padding-block: 1.75rem;
    padding-inline: 1.5rem;
  }

  .sweet__desc {
    font-size: 0.9375rem;
  }
}

@media (min-width: 1025px) {
  .sweet__hero {
    aspect-ratio: 5 / 4;
  }

  .sweet__copy {
    padding-block: 2rem;
  }
}

@media (min-width: 1025px) and (max-width: 1279px) {
  .sweet__copy {
    padding-block: 1.25rem;
  }
}
