/* The valet card of a hotel app, alone on black. GSAP moves only whole elements (the card, the car, the button, the
   lines of text); colours, edges and states live in CSS on classes. A GSAP element never has a transform in the CSS. */
:root {
  --page: #000000;          /* the page */
  --card: #111113;          /* the card */
  --edge: rgba(255, 255, 255, 0.08);  /* the card edge */
  --ink: #f2f1ee;           /* the main text */
  --muted: #8b8a92;         /* labels and notes */
  --faint: #3a3a40;         /* the route still to drive, the empty rings */
  --brass: #d3ae72;         /* the one accent: the route driven, the rings, the button */
  --brass-deep: #a9834a;    /* the brass in shadow */
  --car: #e9e7e2;           /* the little car */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

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

/* ---- the card ---- */
.valet {
  position: relative;
  width: min(372px, 92vw);
  padding: clamp(14px, 3.4vh, 22px) clamp(14px, 4vw, 20px) clamp(14px, 3vh, 20px);
  border-radius: 24px;
  background: linear-gradient(180deg, #17171a 0%, var(--card) 46%);
  border: 1px solid var(--edge);
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: grid;
  gap: clamp(9px, 2.2vh, 14px);
}
.valet__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 60% at 50% -10%, rgba(211, 174, 114, 0.09), transparent 60%);
  opacity: 0;
  transition: opacity 0.8s ease;
}
.valet.is-ready .valet__sheen { opacity: 1; }

/* ---- the head ---- */
.head { display: flex; align-items: center; gap: 10px; }
.mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #2a2620, #1c1915);
  border: 1px solid rgba(211, 174, 114, 0.28);
}
.mark svg { width: 16px; height: 16px; fill: none; stroke: var(--brass); stroke-width: 1.8; stroke-linecap: round; }
.head__txt { display: grid; line-height: 1.15; }
.head__name { font-size: 14px; font-weight: 640; letter-spacing: -0.01em; }
.head__sub { font-size: 11.5px; color: var(--muted); }
.ticket {
  margin-left: auto;
  font-size: 11px; color: var(--muted);
  padding: 5px 9px; border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
}
.ticket b { color: var(--ink); font-weight: 620; }

/* ---- the car row ---- */
.carrow {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.carrow__icon { width: 30px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.carrow__txt { display: grid; line-height: 1.2; min-width: 0; }
.carrow__name { font-size: 13px; font-weight: 600; }
.carrow__where { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.plate {
  margin-left: auto;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: #17171a; background: #ece7d8;
  padding: 4px 7px; border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

/* ---- the route ---- */
.route { position: relative; }
.route__svg { display: block; width: 100%; height: auto; overflow: visible; }
.route__track { fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 6; }
.route__done { fill: none; stroke: var(--brass); stroke-width: 2.2; stroke-linecap: round; }
.garage rect, .door rect { fill: #1b1b1f; stroke: rgba(255, 255, 255, 0.1); }
.garage path, .door path { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.door rect { transition: fill 0.5s ease, stroke 0.5s ease; }
.door path { transition: stroke 0.5s ease; }
.valet.is-ready .door rect { fill: rgba(211, 174, 114, 0.16); stroke: rgba(211, 174, 114, 0.6); }
.valet.is-ready .door path { stroke: var(--brass); }
.car__body { fill: var(--car); }
.car__glass { fill: #2b2b31; }
.car__lamp { fill: #f6e7c4; }
.car__beam { opacity: 0; }
.route__labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: -2px; padding: 0 2px; }

/* ---- the status ---- */
.status { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.status__roll { position: relative; display: block; height: 26px; overflow: hidden; flex: 1; min-width: 0; }
.status__line { position: absolute; left: 0; top: 0; font-size: clamp(17px, 2.6vh, 20px); line-height: 26px; font-weight: 640; letter-spacing: -0.015em; white-space: nowrap; }
.eta { display: inline-flex; align-items: baseline; gap: 4px; color: var(--muted); }
.eta__num { display: inline-block; font-size: 20px; font-weight: 600; color: var(--ink); min-width: 0.7em; text-align: right; }
.eta__unit { font-size: 12px; }
.valet.is-ready .eta__num { color: var(--brass); }

/* ---- the steps ---- */
.steps { list-style: none; display: flex; justify-content: space-between; gap: 6px; }
.step { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); transition: color 0.4s ease; white-space: nowrap; }
.step__ring {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--faint);
  display: grid; place-items: center;
  transition: background 0.35s ease, border-color 0.35s ease;
}
.step__ring svg { width: 10px; height: 10px; fill: none; stroke: #17171a; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 10; stroke-dashoffset: 10; }
.step.is-on { color: var(--ink); }
.step.is-on .step__ring { background: var(--brass); border-color: var(--brass); }

/* ---- the button ---- */
.go {
  position: relative;
  appearance: none; border: 0; font: inherit; cursor: pointer;
  height: clamp(44px, 7vh, 50px);
  border-radius: 999px;
  overflow: hidden;
  background: var(--brass);
  color: #17140f;
  box-shadow: 0 10px 22px -12px rgba(211, 174, 114, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  transition: background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}
.go:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.go__face { position: relative; display: grid; place-items: center; height: 100%; }
.go__label { font-size: 14.5px; font-weight: 640; letter-spacing: -0.005em; font-variation-settings: "wdth" 100; }
.go__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(211, 174, 114, 0.22); }
.go.is-busy { background: #1d1c20; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); cursor: default; }
.go.is-done { background: #f2efe7; color: #17140f; box-shadow: 0 10px 22px -12px rgba(255, 255, 255, 0.3), inset 0 1px 0 #fff; }
@media (hover: hover) {
  .go:not(.is-busy):hover { box-shadow: 0 14px 26px -12px rgba(211, 174, 114, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.2); }
  .go:not(.is-busy):hover .go__label { font-variation-settings: "wdth" 112; }
}
.go__label { transition: font-variation-settings 0.35s ease; }

/* ---- the drawn pointer of the autopilot ---- */
.ghost {
  position: fixed; left: 0; top: 0;
  width: 22px; height: 22px;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}
.ghost path { fill: #f2f1ee; stroke: #000; stroke-width: 1.4; stroke-linejoin: round; }

@media (max-height: 520px) {
  .carrow { padding: 7px 9px; }
  .route__labels { display: none; }
}
