/* The tasting booking form: a dark card on pure black, with a photo of the cellar on top. Every size is a share of --w
   (the width of the card) through --u, so the card keeps its proportions from the phone box to a wide screen, and the
   width is also bound to the height of the window so the whole card always fits. GSAP moves the pills ([data-pill])
   only in x and width, their insides ([data-pill-in]) only in scale; the buttons only in scale. */
:root {
  --page: #000000;           /* the page */
  --card: #141012;           /* the card, a warm near black */
  --raise: #1e181b;          /* the raised parts: cells, pills, stepper */
  --ink: #f6efe6;            /* the words */
  --muted: #9b9089;          /* the small words */
  --wine: #8c1d36;           /* the wine red of the selection and the button */
  --wine-hi: #c43c5a;        /* its light edge */
  --gold: #e3c08a;           /* the gold of the details, the check and the glasses */
  --w: min(420px, 90vw, 71vh);
  --u: calc(var(--w) / 420);
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

body {
  min-height: 100svh;
  background: 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: 2vh 0;
}

button {
  font: inherit;
  color: inherit;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ------------------------------------------------------------------ the card */
.book {
  position: relative;
  width: var(--w);
  margin: 0;
}

.book__halo {
  position: absolute;
  inset: 18% 8% -4%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(140 29 54 / .34), rgb(140 29 54 / 0));
  filter: blur(calc(30 * var(--u)));
  pointer-events: none;
}

.book__card {
  position: relative;
  overflow: hidden;
  border-radius: calc(26 * var(--u));
  background:
    radial-gradient(120% 60% at 50% 0%, rgb(255 236 214 / .05), rgb(255 236 214 / 0) 60%),
    var(--card);
  box-shadow:
    inset 0 1px 0 rgb(255 240 225 / .12),
    inset 0 0 0 1px rgb(255 240 225 / .07),
    0 1px 1px rgb(0 0 0 / .5),
    0 calc(10 * var(--u)) calc(24 * var(--u)) rgb(0 0 0 / .45),
    0 calc(36 * var(--u)) calc(70 * var(--u)) rgb(40 6 14 / .55);
}

/* a very fine grain over the whole card */
.book__card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%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");
}

/* ------------------------------------------------------------------ the photo */
.photo {
  position: relative;
  margin: 0;
  height: calc(142 * var(--u));
  overflow: hidden;
}

.photo__move {
  position: absolute;
  inset: 0;
}

.photo__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 46%;
  user-select: none;
}

.photo__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(20 16 18 / 0) 26%, rgb(20 16 18 / .74) 70%, rgb(20 16 18 / .96) 92%, var(--card) 100%),
    linear-gradient(90deg, rgb(10 6 8 / .55), rgb(10 6 8 / 0) 62%);
}

.photo__sheen {
  position: absolute;
  inset: -20% auto -20% 0;
  width: 40%;
  background: linear-gradient(100deg, rgb(255 225 180 / 0), rgb(255 225 180 / .16), rgb(255 225 180 / 0));
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
}

.photo__cap {
  position: absolute;
  left: calc(20 * var(--u));
  right: calc(20 * var(--u));
  bottom: calc(10 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(4 * var(--u));
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: calc(5 * var(--u));
  padding: calc(4 * var(--u)) calc(10 * var(--u)) calc(4 * var(--u)) calc(8 * var(--u));
  margin-bottom: calc(4 * var(--u));
  border-radius: 999px;
  font-size: calc(10.5 * var(--u));
  font-weight: 560;
  letter-spacing: .02em;
  color: var(--ink);
  background: rgb(30 20 24 / .45);
  box-shadow: inset 0 0 0 1px rgb(255 240 225 / .18), inset 0 1px 0 rgb(255 240 225 / .2);
  -webkit-backdrop-filter: blur(8px) saturate(1.3);
  backdrop-filter: blur(8px) saturate(1.3);
}

.chip__icon {
  width: calc(12 * var(--u));
  height: calc(12 * var(--u));
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.photo__title {
  font-size: calc(25 * var(--u));
  line-height: 1;
  font-weight: 640;
  font-stretch: 112%;
  letter-spacing: -.01em;
  text-shadow: 0 1px 12px rgb(0 0 0 / .4);
}

.photo__sub {
  font-size: calc(11.5 * var(--u));
  color: rgb(246 239 230 / .72);
  font-weight: 450;
}

/* ------------------------------------------------------------------ the form */
.body {
  position: relative;
  padding: calc(14 * var(--u)) calc(18 * var(--u)) calc(12 * var(--u));
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: calc(7 * var(--u));
}

.label {
  font-size: calc(11 * var(--u));
  font-weight: 620;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}

.hint {
  font-size: calc(11 * var(--u));
  color: var(--muted);
}

/* the two pickers: the cells sit in a row, and one pill behind them slides to the chosen one */
.pick {
  position: relative;
  display: flex;
  gap: calc(4 * var(--u));
  margin-bottom: calc(13 * var(--u));
}

.pick__pill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.pick__pill-in {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--wine-hi) -60%, var(--wine) 55%, #5e1124 120%);
  box-shadow:
    inset 0 1px 0 rgb(255 210 215 / .35),
    inset 0 0 0 1px rgb(255 190 200 / .14),
    0 calc(6 * var(--u)) calc(16 * var(--u)) rgb(140 29 54 / .45),
    0 1px 2px rgb(0 0 0 / .5);
}

.pick--days .pick__pill,
.pick--days .pick__pill-in {
  border-radius: calc(14 * var(--u));
}

.pick--times .pick__pill,
.pick--times .pick__pill-in {
  border-radius: 999px;
}

.day,
.slot {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  cursor: pointer;
  background: rgb(255 240 225 / .035);
  box-shadow: inset 0 0 0 1px rgb(255 240 225 / .07);
  transition: color .35s, background-color .35s, box-shadow .35s;
}

.day {
  height: calc(54 * var(--u));
  border-radius: calc(14 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(3 * var(--u));
  padding: 0;
  color: var(--muted);
}

.day__wd {
  font-size: calc(10 * var(--u));
  font-weight: 520;
  letter-spacing: .04em;
}

.day__n {
  font-size: calc(17 * var(--u));
  line-height: 1;
  font-weight: 560;
  color: var(--ink);
  font-stretch: 100%;
  transition: font-weight .4s, font-stretch .4s, color .35s;
}

.day[aria-checked='true'],
.slot[aria-checked='true'] {
  background-color: transparent;
  box-shadow: inset 0 0 0 1px rgb(255 240 225 / 0);
  color: rgb(255 228 232 / .85);
}

.day[aria-checked='true'] .day__n {
  font-weight: 700;
  font-stretch: 108%;
}

.day:disabled {
  cursor: default;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgb(255 240 225 / .04);
}

.day:disabled .day__n {
  color: var(--muted);
  opacity: .5;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.day:disabled .day__wd {
  opacity: .5;
}

.day__off {
  position: absolute;
  bottom: calc(-2 * var(--u));
  left: 50%;
  transform: translate(-50%, 50%);
  padding: 0 calc(4 * var(--u));
  font-size: calc(7.5 * var(--u));
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--card);
  white-space: nowrap;
}

.slot {
  height: calc(34 * var(--u));
  border-radius: 999px;
  padding: 0;
  font-size: calc(12.5 * var(--u));
  font-weight: 560;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(4 * var(--u));
}

.slot__left {
  font-size: calc(8.5 * var(--u));
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .02em;
  white-space: nowrap;
}

.slot[aria-checked='true'] {
  color: #fff;
}

.slot[aria-checked='true'] .slot__left {
  color: #ffd9a0;
}

/* ------------------------------------------------------------------ the guests */
.guests {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: calc(42 * var(--u));
  margin-bottom: calc(11 * var(--u));
}

.guests__text {
  display: flex;
  flex-direction: column;
  gap: calc(7 * var(--u));
}

.glasses {
  display: flex;
  gap: calc(3 * var(--u));
}

.glass {
  width: calc(11 * var(--u));
  height: calc(15 * var(--u));
  overflow: visible;
}

.glass__cup {
  fill: none;
  stroke: rgb(246 239 230 / .3);
  stroke-width: 1.1;
  stroke-linejoin: round;
  transition: stroke .4s;
}

.glass__stem {
  fill: none;
  stroke: rgb(246 239 230 / .3);
  stroke-width: 1.1;
  stroke-linecap: round;
  transition: stroke .4s;
}

.glass.is-on .glass__cup,
.glass.is-on .glass__stem {
  stroke: var(--gold);
}

.glass__wine {
  fill: var(--wine-hi);
}

.step {
  display: flex;
  align-items: center;
  gap: calc(4 * var(--u));
  padding: calc(4 * var(--u));
  border-radius: 999px;
  background: rgb(255 240 225 / .04);
  box-shadow: inset 0 0 0 1px rgb(255 240 225 / .08), inset 0 1px 0 rgb(255 240 225 / .05);
}

.step__btn {
  width: calc(34 * var(--u));
  height: calc(34 * var(--u));
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #2a2226, #1c1619);
  box-shadow: inset 0 1px 0 rgb(255 240 225 / .14), 0 1px 2px rgb(0 0 0 / .6), 0 4px 10px rgb(0 0 0 / .3);
  transition: opacity .3s;
}

.step__btn svg {
  width: calc(14 * var(--u));
  height: calc(14 * var(--u));
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.step__btn:disabled {
  opacity: .32;
  cursor: default;
}

.step__num {
  position: relative;
  width: calc(30 * var(--u));
  height: calc(24 * var(--u));
  overflow: hidden;
  font-size: calc(19 * var(--u));
  line-height: calc(24 * var(--u));
  font-weight: 650;
  text-align: center;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 28%, #000 72%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 28%, #000 72%, transparent);
}

/* a rolling column: one row per value, slid by yPercent */
.roll {
  display: flex;
  flex-direction: column;
}

.roll > span {
  display: block;
}

.step__num .roll > span {
  height: calc(24 * var(--u));
}

/* ------------------------------------------------------------------ the total */
.rule {
  display: block;
  height: 1px;
  margin-bottom: calc(11 * var(--u));
  background: linear-gradient(90deg, rgb(255 240 225 / 0), rgb(255 240 225 / .14) 20%, rgb(255 240 225 / .14) 80%, rgb(255 240 225 / 0));
}

.total {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: calc(12 * var(--u));
}

.total__left {
  display: flex;
  flex-direction: column;
  gap: calc(4 * var(--u));
}

.total__each {
  font-size: calc(11 * var(--u));
  color: var(--muted);
}

.total__price {
  display: flex;
  align-items: flex-start;
  height: calc(32 * var(--u));
  font-size: calc(30 * var(--u));
  line-height: calc(32 * var(--u));
  font-weight: 660;
  font-stretch: 106%;
  letter-spacing: -.01em;
}

.total__cur {
  display: inline-block;
  font-size: .62em;
  line-height: 1;
  margin: calc(3 * var(--u)) calc(2 * var(--u)) 0 0;
  color: var(--gold);
  font-weight: 560;
}

.total__digits {
  display: flex;
  height: calc(32 * var(--u));
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}

.digit {
  position: relative;
  display: block;
  width: calc(var(--on, 1) * .6em);
  opacity: var(--on, 1);
  text-align: center;
}

.digit .roll > span {
  height: calc(32 * var(--u));
}

/* ------------------------------------------------------------------ the button */
.go {
  position: relative;
  display: block;
  width: 100%;
  height: calc(50 * var(--u));
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 999px;
}

.go__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(9 * var(--u));
  color: #fff;
  background: linear-gradient(180deg, var(--wine-hi) -70%, var(--wine) 45%, #5a0f21 125%);
  box-shadow:
    inset 0 1px 0 rgb(255 210 215 / .38),
    inset 0 -1px 0 rgb(0 0 0 / .25),
    inset 0 0 0 1px rgb(255 190 200 / .12),
    0 calc(10 * var(--u)) calc(24 * var(--u)) rgb(140 29 54 / .38),
    0 1px 2px rgb(0 0 0 / .6);
  transition: filter .3s;
}

.go__sweep {
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  background: linear-gradient(100deg, rgb(255 230 210 / 0), rgb(255 230 210 / .26), rgb(255 230 210 / 0));
  opacity: 0;
  pointer-events: none;
}

.go__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, rgb(227 192 138 / .2), var(--gold));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.go__words {
  position: relative;
  display: grid;
  font-size: calc(14.5 * var(--u));
  font-weight: 620;
  letter-spacing: .01em;
}

.go__word {
  grid-area: 1 / 1;
  text-align: center;
  white-space: nowrap;
}

.go__word[data-word='busy'],
.go__word[data-word='done'] {
  opacity: 0;
}

.go__icon {
  position: relative;
  width: calc(18 * var(--u));
  height: calc(18 * var(--u));
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.go__arrow {
  stroke: #fff;
  stroke-width: 1.7;
}

.go__spin {
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-dasharray: .28 .72;
  opacity: 0;
  transform-origin: 10px 10px;
}

.go__check {
  stroke: var(--gold);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.go__ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 1px var(--gold);
  opacity: 0;
  pointer-events: none;
}

.note {
  position: relative;
  display: grid;
  margin: calc(9 * var(--u)) 0 0;
  font-size: calc(10.5 * var(--u));
  line-height: 1.3;
  color: var(--muted);
  text-align: center;
}

.note__a,
.note__b {
  grid-area: 1 / 1;
}

.note__b {
  opacity: 0;
  color: var(--gold);
}

/* ------------------------------------------------------------------ states */
.day:focus-visible,
.slot:focus-visible,
.step__btn:focus-visible,
.go:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (hover: hover) {
  .day:not(:disabled):not([aria-checked='true']):hover,
  .slot:not([aria-checked='true']):hover {
    background-color: rgb(255 240 225 / .07);
    box-shadow: inset 0 0 0 1px rgb(255 240 225 / .14);
  }

  .step__btn:not(:disabled):hover {
    background: linear-gradient(180deg, #342a2f, #211a1d);
  }

  .go:hover .go__face {
    filter: brightness(1.08) saturate(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .day,
  .slot,
  .day__n {
    transition: none;
  }
}
