:root {
  --fondo: #ffffff;
  --inchiostro: #17161b;
  --crema: #f7f2e8;
  --pomodoro: #c2412b;
  --acciaio: #b9bcc2;
  --carta: #f8f3e9;
  --grigio: #8b8891;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* the frame keeps room above the pill for the rail and the ticket */
.frame {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  width: min(330px, 92vw);
  height: min(206px, 52vh);
  padding-top: 94px;
}

/* ---- the ticket rail: a steel bar with two end stops, drawn in when the order is fired ---- */
.rail {
  position: absolute;
  left: 50%;
  top: 10px;
  width: min(256px, 78vw);
  height: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.rail__bar {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 22%, rgba(255, 255, 255, 0) 46%, rgba(255, 255, 255, 0.5) 74%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(180deg, #e4e6ea 0%, var(--acciaio) 45%, #8d9098 78%, #6f727a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 1px 1px rgba(23, 22, 27, 0.12),
    0 4px 8px -4px rgba(23, 22, 27, 0.3);
  opacity: 0.42;
  filter: saturate(0.4);
}
/* a light that runs along the bar when the order is fired */
.rail__bar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.95) 50%, transparent 100%);
  background-size: 30% 100%;
  background-repeat: no-repeat;
  background-position: var(--run, -40%) 0;
}
/* the slot under the bar the tickets are pinched in */
.rail__bar::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 1px;
  height: 1px;
  background: rgba(40, 42, 48, 0.45);
}
.rail__stop {
  position: absolute;
  top: -3px;
  width: 6px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, #7d8088, #d7d9de 45%, #8d9098);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 3px -1px rgba(23, 22, 27, 0.3);
  opacity: 0;
}
.rail__stop--l { left: -2px; }
.rail__stop--r { right: -2px; }

/* ---- the order ticket: outer for GSAP (x, y, scale), inner for the lean ---- */
.ticket {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 13px;
  width: 60px;
  height: 76px;
  margin-left: -30px;
  pointer-events: none;
  opacity: 0;
}
.ticket__in {
  width: 100%;
  height: 100%;
  transform-origin: 50% 0;
  filter: drop-shadow(0 1px 1px rgba(23, 22, 27, 0.12)) drop-shadow(0 8px 10px rgba(60, 40, 20, 0.16));
}
.ticket__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ticket__paper { fill: url(#k-paper); stroke: rgba(120, 96, 52, 0.18); stroke-width: 0.5; }
.ticket__crease { stroke: rgba(23, 22, 27, 0.14); stroke-width: 0.6; }
.ticket__rule { stroke: rgba(23, 22, 27, 0.3); stroke-width: 0.6; stroke-dasharray: 1.6 1.4; }
.ticket__svg text { font-family: "Mona Sans Variable", system-ui, sans-serif; fill: var(--inchiostro); }
.t-table { font-size: 6.6px; font-weight: 760; letter-spacing: 0.06em; font-stretch: 112%; }
.t-time { font-size: 6px; font-weight: 560; fill: var(--grigio) !important; }
.t-item { font-size: 5.6px; font-weight: 540; }
.t-q { font-weight: 760; fill: var(--pomodoro) !important; }
.t-note { font-size: 5px; font-weight: 500; font-style: italic; fill: #6a6770 !important; }
.t-house { font-size: 4.4px; font-weight: 660; letter-spacing: 0.16em; fill: var(--pomodoro) !important; }

/* ---- the pill: the button for GSAP (scale), the skin for CSS (hover, press) ---- */
.c {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 24px 0 19px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--crema);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  isolation: isolate;
  max-width: 92vw;
  -webkit-tap-highlight-color: transparent;
}
.c:focus-visible { outline: 2px solid var(--pomodoro); outline-offset: 4px; }

.c__skin {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, #26252b 0%, var(--inchiostro) 58%, #0f0e12 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 1px 1px rgba(23, 22, 27, 0.16),
    0 6px 14px -6px rgba(23, 22, 27, 0.3),
    0 22px 40px -22px rgba(23, 22, 27, 0.55);
  transition: inset 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.c__glow, .c__fill, .c__edge, .c__sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.c__glow {
  opacity: 0;
  background: radial-gradient(120px 80px at var(--gx, 50%) var(--gy, 50%), rgba(255, 228, 205, 0.16), transparent 70%);
}
/* the tomato fill that follows the ticket along the rail */
.c__fill {
  background:
    radial-gradient(120% 140% at 20% 0%, rgba(255, 190, 160, 0.35), transparent 55%),
    linear-gradient(180deg, #d4513a 0%, var(--pomodoro) 55%, #9a2f1d 100%);
  box-shadow: inset 0 1px 0 rgba(255, 214, 196, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  clip-path: inset(0 100% 0 0 round 999px);
}
/* the light on the fill's leading edge */
.c__edge {
  left: 0;
  right: auto;
  width: 18px;
  margin-left: -17px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 226, 206, 0.28) 60%, rgba(255, 240, 228, 0.55) 90%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent 8%, #000 30%, #000 70%, transparent 92%);
          mask-image: linear-gradient(180deg, transparent 8%, #000 30%, #000 70%, transparent 92%);
}
.c__sheen {
  opacity: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 240, 228, 0.34) 48%, transparent 64%);
  background-size: 260% 100%;
  background-position: 120% 0;
}

.c__icon {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  margin-right: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.c__icon svg {
  position: absolute;
  inset: 0;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.g__line { opacity: 0.55; }
.c__check path { stroke-width: 2; stroke-dasharray: 20; stroke-dashoffset: 20; }

.c__labels {
  position: relative;
  display: block;
  height: 22px;
  overflow: hidden;
}
.c__label {
  position: absolute;
  left: 50%;
  top: 0;
  display: inline-flex;
  align-items: center;
  width: max-content;
  height: 22px;
  line-height: 22px;
  white-space: nowrap;
  opacity: 0;
  font-stretch: inherit;
}
.c__label[data-l="idle"] { opacity: 1; }
.c__sep { margin: 0 0.42em; opacity: 0.55; }
.c__eta { font-weight: 680; color: #ffe1cf; }
.c__labels { font-stretch: 100%; transition: font-stretch 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }

.note {
  position: absolute;
  left: 0;
  right: 0;
  top: 166px;
  height: 18px;
  margin: 0;
  font-size: 13px;
  font-weight: 460;
  color: var(--grigio);
  white-space: nowrap;
}
.note__t {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}
.note__t[data-n="done"] { opacity: 0; }

/* the elastic pill: on hover the label widens on the wdth axis and the skin swells with a bounce */
@media (hover: hover) and (pointer: fine) {
  .c:hover .c__skin { inset: -2px -6px; }
  .c:hover .c__labels { font-stretch: 112%; }
  .c[data-mode="idle"]:hover .c__icon { transform: translateY(-2px) rotate(-8deg); }
}
.c:active .c__skin { transform: scale(1.02, 0.92); }

@media (max-width: 400px) {
  .c { height: 56px; font-size: 15px; padding: 0 21px 0 17px; gap: 9px; }
  .frame { padding-top: 92px; }
  .note { top: 160px; font-size: 12px; }
}
