/* The tasting menu with the belt of plates: a dark warm card on a near black page. The belt is a window with the
   plates in a row; the script places each plate from the belt's position (a spring), so the same code serves the
   loop, the drag and the reduced motion. The course card under it never moves: only its words change. */
:root {
  --page: #0c0a09;          /* the page */
  --card: #15120f;          /* the body of the card */
  --well: #0e0c0a;          /* the inside of the belt window */
  --edge: rgba(255, 236, 214, 0.08); /* the 1px edges at rest */
  --ink: #f2ebe1;           /* the words */
  --muted: #988c7e;         /* the small words */
  --accent: #e3a35c;        /* the warm light of the pass: lamp, course, bars */
  --wine: #8e2f3a;          /* the wine in the glass */
  --button: #f2ebe1;        /* the button */
  --button-ink: #15120f;    /* the words on the button */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background:
    radial-gradient(120% 70% at 50% 0%, #1b1612 0%, transparent 60%),
    var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2.4vh, 20px) 12px;
  overflow: hidden;
}

.menu {
  position: relative;
  width: min(92vw, 384px);
  padding: clamp(12px, 3.2vh, 20px) clamp(12px, 3.8vw, 18px) clamp(12px, 3vh, 18px);
  border-radius: 22px;
  background: linear-gradient(180deg, #1a1612 0%, var(--card) 40%);
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 240, 222, 0.07),
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 12px 24px -12px rgba(0, 0, 0, 0.7),
    0 40px 80px -40px rgba(0, 0, 0, 0.9);
  opacity: 0;
}

/* a fine grain over the whole card, like printed stock */
.menu__grain {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.menu__brand {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.menu__mark {
  font-size: 15px;
  font-weight: 640;
  font-variation-settings: 'wdth' 118;
  letter-spacing: 0.02em;
}

.menu__sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu__chip {
  flex: none;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 236, 214, 0.1);
}

/* ---------------------------------------------------------------- the belt */
.belt {
  position: relative;
  margin-top: clamp(10px, 2.6vh, 16px);
  height: clamp(118px, 32vh, 220px);
  border-radius: 16px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--edge), inset 0 10px 24px -12px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

.belt.is-dragging {
  cursor: grabbing;
}

.belt:focus-visible {
  box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 2px var(--accent);
}

/* the warm lamp over the pass: it sits over the middle plate and dims while the belt runs */
.belt__lamp {
  position: absolute;
  left: 50%;
  top: -40%;
  width: 90%;
  height: 120%;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 34%, transparent), transparent);
  pointer-events: none;
  z-index: 0;
}

.belt__track {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.plate {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  will-change: transform;
}

/* GSAP and the spring move .plate, the body carries the press */
.plate__body {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #221c17;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.4),
    0 8px 16px -6px rgba(0, 0, 0, 0.7),
    0 24px 40px -20px rgba(0, 0, 0, 0.8);
  position: relative;
}

/* the 1px edge that catches the lamp: --lit goes from 0 to 1 as the plate reaches the middle */
.plate__body::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 240, 222, calc(0.05 + 0.14 * var(--lit, 0))),
    inset 0 1px 0 rgba(255, 226, 190, calc(0.3 * var(--lit, 0)));
  background: linear-gradient(180deg, rgba(255, 214, 160, calc(0.1 * var(--lit, 0))), transparent 40%);
  pointer-events: none;
}

.plate__body img {
  position: absolute;
  left: -8%;
  top: 0;
  width: 116%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  will-change: transform, filter;
}

.belt__fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  z-index: 2;
  pointer-events: none;
}

.belt__fade--l {
  left: 0;
  background: linear-gradient(90deg, var(--well), transparent);
}

.belt__fade--r {
  right: 0;
  background: linear-gradient(270deg, var(--well), transparent);
}

/* the rail under the belt: ticks that run with it, a notch that stays */
.rail {
  position: relative;
  height: 12px;
  margin: 6px 6px 0;
}

.rail__ticks {
  position: absolute;
  inset: 0 0 5px;
  background-image: linear-gradient(90deg, rgba(255, 236, 214, 0.16) 0 1px, transparent 1px);
  background-size: var(--tick, 12px) 100%;
  background-repeat: repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
}

.rail__notch {
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 10px;
  height: 6px;
  translate: -50% 0;
  fill: var(--accent);
}

/* ---------------------------------------------------------------- the course card */
.course {
  margin-top: clamp(6px, 1.6vh, 12px);
}

.course__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 16px;
}

.course__slot {
  display: block;
  position: relative;
  overflow: hidden;
  margin: 0;
}

.course__slot > span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course__slot > span + span {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
}

.course__slot--label {
  flex: 1;
  height: 16px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.course__time {
  flex: none;
  display: flex;
  align-items: center;
  height: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}

.course__time .col {
  display: inline-block;
  height: 16px;
  overflow: hidden;
}

.course__time .col > span {
  display: block;
}

.course__time .col > span > span {
  display: block;
  line-height: 16px;
  height: 16px;
}

.course__slot--dish {
  margin-top: clamp(2px, 0.8vh, 6px);
  height: clamp(24px, 6.4vh, 30px);
  font-size: clamp(19px, min(5.6vw, 5.4vh), 23px);
  line-height: clamp(24px, 6.4vh, 30px);
  font-weight: 580;
  font-variation-settings: 'wdth' 96;
  letter-spacing: -0.015em;
}

.course__slot--dish .w {
  display: inline-block;
  white-space: pre;
}

.course__slot--notes {
  height: 19px;
  font-size: 13px;
  line-height: 19px;
  color: var(--muted);
}

.course__pair {
  margin: clamp(4px, 1.2vh, 8px) 0 0;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 18px;
}

.course__glass {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.1;
  stroke-linejoin: round;
  stroke-linecap: round;
  overflow: visible;
}

.course__wine {
  fill: var(--wine);
  stroke: none;
}

.course__slot--wine {
  flex: 1;
  height: 18px;
  font-size: 12.5px;
  line-height: 18px;
  color: #c9bdae;
}

.course__bars {
  display: flex;
  gap: 5px;
  margin-top: clamp(8px, 2vh, 14px);
}

.bar {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 236, 214, 0.1);
  overflow: hidden;
  padding: 0;
  border: 0;
  cursor: pointer;
  position: relative;
}

/* a taller hit area than the 2px line */
.bar::before {
  content: '';
  position: absolute;
  inset: -8px 0;
}

.bar__fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------------------------------------------------------------- the foot */
.menu__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(10px, 2.4vh, 16px);
  padding-top: clamp(10px, 2.4vh, 14px);
  border-top: 1px solid rgba(255, 236, 214, 0.07);
}

.menu__price {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.menu__amount {
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.menu__per {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.reserve {
  flex: none;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--button-ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.reserve:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 999px;
}

.reserve__face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-width: 118px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--button);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18), 0 6px 16px -8px rgba(227, 163, 92, 0.5);
}

.reserve__words {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  font-variation-settings: 'wdth' 100;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
  .reserve:hover .reserve__words {
    font-variation-settings: 'wdth' 112;
  }
}

.reserve__icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.reserve__check {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

@media (max-height: 470px) {
  .menu__sub {
    display: none;
  }
}
