:root {
  --page: #f3efe9;          /* warm paper, the table cloth */
  --card: #fbf9f6;          /* the card */
  --ink: #1d1a17;           /* the chosen words */
  --ink-soft: #6f675e;      /* the notes */
  --ink-mute: #a49b90;      /* the dishes not in front */
  --line: rgba(60, 40, 20, 0.09);
  --accent: #c2512c;        /* terracotta: the one accent, the price, the button, the ring of light */
  --stone: #e6dccd;         /* travertine, the lazy Susan */
  --stone-deep: #cdbfac;    /* the stone's edge */

  --tray: clamp(150px, min(40vw, 60vh), 360px);
  --pad: clamp(14px, 3.2vh, 30px);
  --gap: clamp(18px, 4vw, 44px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background:
    radial-gradient(120% 80% at 50% 0%, #fbf8f3 0%, transparent 60%),
    var(--page);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 8px;
}

/* ---- the card ---- */
.card {
  position: relative;
  width: min(820px, 96vw);
  padding: var(--pad);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, var(--card) 40%);
  border: 1px solid rgba(70, 45, 20, 0.08);
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 1px 1px rgba(60, 35, 10, 0.06),
    0 6px 14px -6px rgba(60, 35, 10, 0.12),
    0 24px 48px -18px rgba(60, 35, 10, 0.18),
    0 60px 90px -40px rgba(120, 60, 20, 0.18);
  isolation: isolate;
}

/* the top edge catches the lamp */
.card__edge {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: radial-gradient(90% 50% at 28% 0%, rgba(255, 190, 140, 0.55), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  padding-bottom: clamp(10px, 2.4vh, 18px);
  margin-bottom: clamp(10px, 2.6vh, 22px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.brand__mark { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; flex: none; }
.brand__name { font-family: "Fraunces Variable", Georgia, serif; font-size: 17px; font-weight: 560; letter-spacing: -0.01em; }
.brand__sub { color: var(--ink-mute); font-variation-settings: "wdth" 92; white-space: nowrap; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: #f4efe8;
  box-shadow: inset 0 0 0 1px rgba(70, 45, 20, 0.07), inset 0 1px 0 #fff;
  white-space: nowrap;
  font-weight: 520;
}
.tab__words--soft { color: var(--ink-soft); font-weight: 450; }
.tab__count { display: inline-block; height: 1.25em; line-height: 1.25em; overflow: hidden; color: var(--accent); font-weight: 650; }
.tab__col { display: inline-block; width: 0.66em; text-align: center; }
.tab__col > span { display: block; }
.tab__col > span > span { display: block; height: 1.25em; }

/* ---- layout ---- */
.body {
  display: grid;
  grid-template-columns: var(--tray) minmax(0, 300px);
  justify-content: center;
  align-items: center;
  gap: var(--gap);
}

/* ---- the lazy Susan ---- */
.lazy {
  position: relative;
  width: var(--tray);
  height: var(--tray);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.lazy.is-dragging { cursor: grabbing; }

.lazy__shadow {
  position: absolute;
  inset: 3%;
  border-radius: 50%;
  box-shadow:
    0 2px 3px rgba(60, 35, 10, 0.16),
    0 14px 26px -8px rgba(60, 35, 10, 0.26),
    0 34px 50px -22px rgba(90, 45, 15, 0.3);
}

/* travertine: a warm stone with soft veins and a polished rim; it does not turn, so the lamp stays where it is */
.lazy__stone {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(70% 55% at 32% 24%, rgba(255, 255, 255, 0.75), transparent 62%),
    repeating-radial-gradient(circle at 60% 70%, rgba(150, 120, 90, 0.05) 0 2px, transparent 2px 7px),
    radial-gradient(circle at 50% 50%, var(--stone) 0%, var(--stone) 62%, var(--stone-deep) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -3px 6px rgba(120, 90, 60, 0.18),
    inset 0 0 0 1px rgba(110, 80, 50, 0.12);
}
.lazy__stone::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0.35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.lazy__turn {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  --sx: 0;
  --sy: 1;
  --back: 0deg;
}

.lazy__ticks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lazy__ticks line { stroke: rgba(110, 80, 50, 0.28); stroke-width: 0.5; stroke-linecap: round; }
.lazy__ticks line.is-long { stroke: rgba(110, 80, 50, 0.5); }

/* the lamp's soft reflection over the whole stone, on top of the plates but faint */
.lazy__sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(60% 40% at 30% 18%, rgba(255, 255, 255, 0.22), transparent 70%);
}

.lazy__notch {
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 16px;
  height: 8px;
  margin-left: -8px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- the plates: placed in percent on the ring, so they follow any size ---- */
.plate {
  position: absolute;
  width: 35%;
  aspect-ratio: 1;
  left: calc(50% + 26% * cos(var(--a)));
  top: calc(50% + 26% * sin(var(--a)));
  transform: translate(-50%, -50%);
  border-radius: 50%;
  padding: 0;
  cursor: inherit;
}
.plate:focus-visible { outline: none; }
.plate:focus-visible .plate__lift { outline: 2px solid var(--accent); outline-offset: 3px; }

.plate__lift {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: block;
  /* the shadow falls the same way whatever the tray's angle: the script turns the offset back */
  box-shadow:
    calc(var(--sx) * 1px) calc(var(--sy) * 1px) 2px rgba(60, 35, 10, 0.18),
    calc(var(--sx) * 5px) calc(var(--sy) * 5px) 10px rgba(60, 35, 10, 0.18),
    calc(var(--sx) * 12px) calc(var(--sy) * 12px) 22px -6px rgba(60, 35, 10, 0.28);
}
.plate__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.plate__dim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #efe7dc;
  opacity: 0;
  pointer-events: none;
}
/* the lamp's gloss on the plate: turned back by the tray's angle so it stays at the top left */
.plate__gloss {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  transform: rotate(var(--back));
  background:
    radial-gradient(48% 30% at 34% 16%, rgba(255, 255, 255, 0.4), transparent 70%),
    radial-gradient(circle at 50% 50%, transparent 66%, rgba(255, 255, 255, 0.16) 70%, transparent 74%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), inset 0 -2px 5px rgba(60, 35, 10, 0.12);
}
/* the ring of light that runs round the rim when the dish goes on the order */
.plate__ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  padding: 2px;
  background: conic-gradient(from var(--ring, 0deg), transparent 0deg, rgba(194, 81, 44, 0) 200deg, var(--accent) 330deg, #ffd2b4 356deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* ---- the words ---- */
.info { display: grid; gap: clamp(6px, 1.4vh, 10px); min-width: 0; }
.info__mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.info__mask > span { display: inline-block; }

.info__kicker { font-size: 12px; color: var(--accent); font-weight: 560; letter-spacing: 0.02em; font-variation-settings: "wdth" 104; }
.info__name {
  font-family: "Fraunces Variable", Georgia, serif;
  font-size: clamp(19px, min(3.1vw, 5vh), 30px);
  line-height: 1.08;
  font-weight: 520;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 72;
  min-height: 2.16em;
  display: flex;
  align-items: flex-end;
}
.info__line { font-size: 13.5px; color: var(--ink-soft); line-height: 1.4; }

.info__meta { display: flex; align-items: center; gap: 12px; margin-top: 2px; }

.price {
  display: inline-flex;
  align-items: flex-start;
  font-size: clamp(22px, 4vh, 28px);
  font-weight: 620;
  letter-spacing: -0.02em;
  color: var(--ink);
  height: 1.15em;
  line-height: 1.15em;
  overflow: hidden;
}
.price__cur { font-size: 0.6em; line-height: 1.6; margin-right: 2px; color: var(--accent); }
.price__col { display: inline-block; width: 0.6em; text-align: center; }
.price__col > span { display: block; }
.price__col > span > span { display: block; height: 1.15em; }

.serves {
  font-size: 11.5px;
  font-weight: 540;
  color: var(--ink-soft);
  padding: 4px 9px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  white-space: nowrap;
}

/* the list of the four dishes */
.list { position: relative; display: grid; margin: 6px 0 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.list__hi {
  position: absolute;
  left: -8px;
  right: -8px;
  top: 0;
  height: 0;
  border-radius: 10px;
  background: #f3ede5;
  box-shadow: inset 0 0 0 1px rgba(70, 45, 20, 0.06), inset 0 1px 0 #fff;
  pointer-events: none;
}
.row {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: clamp(28px, 5vh, 34px);
  font-size: 13.5px;
  color: var(--ink-mute);
  text-align: left;
  transition: color 0.25s ease;
}
.row.is-on { color: var(--ink); }
.row__name { font-variation-settings: "wdth" 100; transition: font-variation-settings 0.35s ease; }
.row.is-on .row__name { font-variation-settings: "wdth" 108; }
.row__price { font-size: 12.5px; }

/* Add to table: the elastic pill */
.add {
  justify-self: start;
  height: 40px;
  border-radius: 999px;
  margin-top: 2px;
}
.add__face {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 18px 0 14px;
  border-radius: inherit;
  background: linear-gradient(180deg, #2a2420 0%, #171310 100%);
  color: #fbf6ef;
  font-size: 13.5px;
  font-weight: 560;
  font-variation-settings: "wdth" 100;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 1px 1px rgba(30, 15, 5, 0.25),
    0 8px 18px -8px rgba(30, 15, 5, 0.45);
  white-space: nowrap;
}
.add.is-added .add__face { background: linear-gradient(180deg, #d0603a 0%, #b4461f 100%); }
.add__icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.add__tick { stroke-dasharray: 1; stroke-dashoffset: 1; }
.add__words { display: inline-block; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.add__words > span { display: inline-block; }

@media (hover: hover) {
  .row:hover { color: var(--ink); }
  .add:hover .add__face { font-variation-settings: "wdth" 112; }
}

/* the drawn pointer of the pilot */
.pointer {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #ffffff;
  stroke: #1d1a17;
  stroke-width: 1.4;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(30, 15, 5, 0.25));
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- narrow: the tray on top, the words under it, the list hidden ---- */
@media (max-width: 620px) {
  :root {
    --tray: min(60vw, 40vh, 280px);
    --pad: clamp(12px, 3vh, 20px);
  }
  .card { width: min(440px, 96vw); }
  .body { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: clamp(14px, 3.6vh, 22px); }
  .info { width: 100%; gap: clamp(3px, 1vh, 8px) 12px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .info__name, .info__line { grid-column: 1 / -1; }
  .add { justify-self: end; margin-top: 0; }
  .info__kicker, .list { display: none; }
  .info__name { min-height: 0; font-size: clamp(17px, 4.4vh, 24px); }
  .info__line { font-size: 12.5px; }
  .info__meta { margin-top: 0; }
  .brand__sub { display: none; }
}
@media (max-width: 620px) and (max-height: 520px) {
  .info__line { display: none; }
}

/* a hair of a line between the table and the count */
.tab__count { margin-left: 4px; padding-left: 8px; border-left: 1px solid rgba(70, 45, 20, 0.14); }
