/* The table booking form with the table that lights up: the reservation card of a small osteria on a warm dark wall,
   lit from above like a dining room at night, with a fine grain. On the left the round table seen from above, with its
   wood, the line chairs and the plates; on the right the days, the times, the notes and the button. On a phone the
   table sits small next to the guests and the rest follows below. */
:root {
  --page: #120d09;          /* the wall behind */
  --warm: #3b2414;          /* the warm light on the wall */
  --card: #1c1611;          /* the body of the card */
  --card-lo: #15100c;       /* the bottom of the card */
  --edge: rgba(255, 228, 196, 0.1); /* the thin edge of the card */
  --ink: #f4ece1;           /* the words */
  --muted: #a6978a;         /* the small words */
  --line: rgba(244, 236, 225, 0.11); /* the lines of the fields */
  --wood-hi: #6b4b33;       /* the wood of the table, where the light falls */
  --wood: #4a3222;          /* the wood of the table */
  --wood-lo: #2f1f15;       /* the wood of the table, at its edge */
  --chair: #8b7a6c;         /* the line of the chairs */
  --accent: #f2a65e;        /* the warm light: chosen day and time, lit table */
  --button: #f4ece1;        /* the button */
  --button-ink: #170f0a;    /* 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: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* the room: a warm light from above, a darker floor and a fine grain */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: clamp(10px, 3vh, 28px) clamp(10px, 3vw, 28px);
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 50% 0%, color-mix(in srgb, var(--warm) 90%, transparent), transparent 70%),
    radial-gradient(70% 50% at 50% 110%, rgba(0, 0, 0, 0.55), transparent 70%),
    var(--page);
}

.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.9;
  background: 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='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.9 0 0 0 0 0.8 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ---- the card ---- */
.book {
  --mx: 30%;
  --my: 0%;
  position: relative;
  z-index: 1;
  width: min(664px, 100%);
  margin: 0;
  padding: clamp(16px, 3.6vh, 26px) clamp(16px, 3.4vw, 28px);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--card), var(--card-lo));
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 236, 214, 0.08),
    0 1px 1px rgba(0, 0, 0, 0.4),
    0 18px 40px -18px rgba(0, 0, 0, 0.8),
    0 50px 90px -40px rgba(0, 0, 0, 0.9);
  opacity: 0;
}

/* a soft light that follows the pointer over the card, and the top edge catching the room light */
.book__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(280px 200px at var(--mx) var(--my), rgba(255, 220, 180, 0.06), transparent 70%),
    linear-gradient(90deg, transparent 10%, rgba(255, 224, 190, 0.22) 50%, transparent 90%) top / 100% 1px no-repeat;
}

.book__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.book__title {
  min-width: 0;
}

.book__brand {
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-style: italic;
  font-size: clamp(19px, 3.4vh, 24px);
  font-weight: 460;
  font-variation-settings: 'opsz' 48;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

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

.book__chip {
  flex: none;
  margin: 0;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 540;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: color 0.5s, box-shadow 0.5s;
}

.book__chip-roll {
  display: flex;
  flex-direction: column;
}

.book__chip-roll > span {
  text-align: center;
  height: 26px;
  line-height: 26px;
  white-space: nowrap;
}

.is-booked .book__chip {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

.book__body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 230px) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 26px);
  margin-top: clamp(14px, 3vh, 22px);
}

/* ---- the table ---- */
.seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 14px;
  border-radius: 18px;
  background: radial-gradient(90% 70% at 50% 40%, rgba(255, 220, 180, 0.035), rgba(0, 0, 0, 0.18));
  box-shadow: inset 0 0 0 1px rgba(255, 228, 196, 0.06), inset 0 10px 24px -14px rgba(0, 0, 0, 0.7);
}

.seat__table {
  position: relative;
  width: min(206px, 33vh);
  aspect-ratio: 1;
}

.seat__pool {
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 34%, transparent), transparent);
  opacity: 0;
  pointer-events: none;
}

.seat__svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.w1 { stop-color: var(--wood-hi); }
.w2 { stop-color: var(--wood); }
.w3 { stop-color: var(--wood-lo); }
.l1 { stop-color: var(--accent); stop-opacity: 0.62; }
.l2 { stop-color: var(--accent); stop-opacity: 0.2; }
.l3 { stop-color: var(--accent); stop-opacity: 0; }

.seat__shadow { fill: rgba(0, 0, 0, 0.55); }
.seat__grain { fill: none; stroke: rgba(255, 230, 200, 0.05); stroke-width: 0.7; }
.seat__lamp { opacity: 0; mix-blend-mode: screen; }
.seat__edge { fill: none; stroke: rgba(255, 228, 196, 0.16); stroke-width: 0.8; }
.seat__rim {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-dasharray: 0.16 0.84;
  opacity: 0;
}

.chair__line {
  fill: none;
  stroke: var(--chair);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.7s ease;
}

.chair__seat {
  fill: rgba(255, 236, 214, 0.03);
}

.place {
  fill: none;
  stroke: rgba(255, 228, 196, 0.16);
  stroke-width: 1;
  stroke-linecap: round;
}

.plate { fill: none; stroke: rgba(244, 236, 225, 0.55); stroke-width: 0.9; transition: stroke 0.7s ease; }
.plate--in { stroke: rgba(244, 236, 225, 0.22); stroke-width: 0.7; }
.glass { fill: none; stroke: rgba(244, 236, 225, 0.35); stroke-width: 0.8; }

.seat__vase circle { fill: none; stroke: rgba(244, 236, 225, 0.4); stroke-width: 0.9; }
.seat__leaves path { fill: color-mix(in srgb, #9bb48a 70%, transparent); }

.is-lit .chair__line { stroke: var(--accent); }
.is-lit .plate { stroke: color-mix(in srgb, var(--accent) 70%, #fff); }

.guests {
  display: grid;
  justify-items: center;
  gap: 6px;
}

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

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 236, 214, 0.04);
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 rgba(255, 236, 214, 0.04);
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.25s, box-shadow 0.25s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.step svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.step:disabled {
  opacity: 0.35;
  cursor: default;
}

.step:active:not(:disabled),
.step.is-press {
  transform: scale(0.9);
}

@media (hover: hover) {
  .step:hover:not(:disabled) {
    background: rgba(255, 236, 214, 0.08);
  }
}

.count {
  width: 28px;
  height: 30px;
  overflow: hidden;
  text-align: center;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
}

.count__roll {
  display: flex;
  flex-direction: column;
  transform-origin: 50% 0;
}

.count__roll span {
  height: 30px;
  line-height: 30px;
  font-size: 24px;
  font-weight: 600;
  font-variation-settings: 'wdth' 92;
  font-variant-numeric: tabular-nums;
}

/* ---- the fields ---- */
.pick {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.4vh, 16px);
  min-width: 0;
}

.field {
  display: block;
  min-width: 0;
}

.field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.field__label {
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field__aside {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* the days: a strip that scrolls, faded at both ends */
.days {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 22px), transparent);
}

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

.days__track {
  position: relative;
  display: flex;
  gap: 6px;
  width: max-content;
  padding: 1px 18px 1px 2px;
}

.days__ind,
.times__ind {
  position: absolute;
  left: 0;
  top: 1px;
  bottom: 1px;
  width: 40px;
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 10%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 6px 16px -8px color-mix(in srgb, var(--accent) 60%, transparent);
  pointer-events: none;
}

.day {
  position: relative;
  z-index: 1;
  flex: none;
  width: 46px;
  height: 50px;
  display: grid;
  place-content: center;
  gap: 1px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.3s;
}

.day__wd {
  font-size: 10px;
  font-weight: 560;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}

.day__n {
  font-size: 17px;
  font-weight: 600;
  font-variation-settings: 'wdth' 94;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.day[aria-checked='true'] .day__wd,
.day[aria-checked='true'] .day__n {
  color: var(--accent);
}

.day:disabled {
  cursor: default;
  color: rgba(244, 236, 225, 0.3);
}

.day:disabled .day__n {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

@media (hover: hover) {
  .day:not(:disabled):hover {
    box-shadow: inset 0 0 0 1px rgba(244, 236, 225, 0.24);
  }
}

/* the times: a row of slots, the indicator snaps from one to the next */
.times {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.times__ind {
  border-radius: 11px;
}

.slot {
  position: relative;
  z-index: 1;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 540;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s, opacity 0.3s;
}

.slot__t {
  display: inline-block;
}

.slot[aria-checked='true'] {
  color: var(--accent);
}

.slot.is-full {
  color: rgba(244, 236, 225, 0.28);
  cursor: default;
}

.slot.is-full .slot__t {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

@media (hover: hover) {
  .slot:not(.is-full):hover {
    box-shadow: inset 0 0 0 1px rgba(244, 236, 225, 0.24);
  }
}

/* the notes: one line at rest, it grows with what is written */
.notes {
  display: block;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s;
  overflow: hidden;
}

.notes__input {
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  line-height: 18px;
  resize: none;
  outline: none;
  overflow: hidden;
}

.notes__input::placeholder {
  color: rgba(166, 151, 138, 0.75);
}

.notes:focus-within,
.is-typing .notes {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
}

/* the button */
.reserve {
  position: relative;
  height: 46px;
  margin-top: 2px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--button);
  color: var(--button-ink);
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 24px -12px rgba(255, 220, 180, 0.35);
  -webkit-tap-highlight-color: transparent;
}

.reserve:focus-visible,
.step:focus-visible,
.day:focus-visible,
.slot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.reserve__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent));
  clip-path: circle(0% at 50% 50%);
}

.reserve__sweep {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  opacity: 0;
}

.reserve__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.reserve__face--done {
  opacity: 0;
}

.reserve__words {
  font-size: 14px;
  font-weight: 600;
  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 [data-face-idle] .reserve__words {
    font-variation-settings: 'wdth' 110;
  }
}

.reserve__arrow,
.reserve__check {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

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

.is-booked .pick > .field {
  opacity: 0.5;
  transition: opacity 0.6s;
}

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  width: 22px;
  height: 22px;
  fill: var(--ink);
  stroke: #120d09;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  opacity: 0;
}

/* ---- the phone: the table small beside the guests, the rest below ---- */
@media (max-width: 560px) {
  .book {
    padding: 12px 13px 13px;
    border-radius: 20px;
  }

  .book__brand {
    font-size: 18px;
  }

  .book__sub {
    font-size: 11px;
  }

  .book__chip {
    height: 22px;
    padding: 0 9px;
    font-size: 10.5px;
  }

  .book__chip-roll > span {
    height: 22px;
    line-height: 22px;
  }

  .book__body {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 8px;
  }

  .seat {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 4px 12px 4px 4px;
    border-radius: 16px;
  }

  .seat__table {
    width: min(84px, 20vh);
  }

  .guests {
    justify-items: start;
    gap: 3px;
  }

  .stepper {
    gap: 8px;
  }

  .step {
    width: 30px;
    height: 30px;
  }

  .guests__note {
    font-size: 11px;
  }

  .pick {
    gap: 8px;
  }

  .field--days .field__row,
  .field--times .field__row {
    display: none;
  }

  .field__row {
    margin-bottom: 4px;
  }

  .day {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .day__wd {
    font-size: 9px;
  }

  .day__n {
    font-size: 15px;
  }

  .days__ind {
    border-radius: 12px;
  }

  .slot {
    height: 30px;
    font-size: 11.5px;
    border-radius: 10px;
  }

  .times {
    gap: 4px;
  }

  .notes__input {
    height: 36px;
    padding: 9px 12px;
    font-size: 13px;
  }

  .reserve {
    height: 40px;
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reserve__words,
  .step,
  .chair__line,
  .plate {
    transition: none;
  }
}

/* inside the scrolling strip the glow below would be cut: the day pill keeps only its edge */
.days__ind {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent);
}
