/* The Book a cut button of a made-up barbershop, alone on black. The card is one element moved by GSAP (height,
   lift, press, radius); a GSAP element never has a transform in the CSS. Its body, grain and sheen sit in a
   clipped layer. The striped barber pole is an SVG whose stripes are one group that GSAP slides along y. */
:root {
  --page: #000000;            /* the page */
  --card-top: #25221f;        /* the top of the card's body, a warm graphite */
  --card-bottom: #100f0e;     /* the bottom of the card's body */
  --ink: #f6f1ea;             /* the words */
  --muted: #9a928a;           /* the small words */
  --disc: #efe7da;            /* the ivory disc that holds the pole */
  --red: #d6453c;             /* the pole's red stripe and the chosen time */
  --blue: #2a4a8c;            /* the pole's blue stripe */
  --brass: #c9a46a;           /* the pole's caps and the chosen barber's ring */
  --tick: #1d8f5a;            /* the tick once booked */
  --b1: #d9a77c;              /* Theo */
  --b2: #9db7a4;              /* Mo */
  --b3: #c79bb0;              /* Rina */
}

* { 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: 8px; }

.wrap {
  position: relative;
  width: min(352px, calc(100vw - 20px));
  height: min(250px, 92vh);
  display: grid;
  align-items: start;
  padding-top: min(24px, 4vh);
}

/* ---- the card ---- */
.card {
  position: relative;
  width: 100%;
  height: 64px;
  border-radius: 32px;
  overflow: hidden;
  box-shadow:
    0 18px 34px -16px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.07),
    0 0 46px -18px rgba(214, 69, 60, var(--glow, 0));
  isolation: isolate;
}
.card__glow { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: radial-gradient(120px 40px at var(--gx, 50%) 0%, rgba(255, 244, 228, 0.22), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 1px; opacity: 0.7; }
.card__clip { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; z-index: -1;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom)); }
.card__grain { position: absolute; inset: 0; opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }
.card__sheen { position: absolute; top: -20%; bottom: -20%; width: 40%; left: -50%;
  background: linear-gradient(100deg, transparent, rgba(255, 246, 232, 0.09), transparent); }

/* ---- the top row ---- */
.top { position: relative; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 10px 0 14px; }

.faces { position: relative; width: 62px; height: 34px; flex: none; }
.face {
  position: absolute; top: 0; left: 0;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 640; letter-spacing: 0.02em; color: #1b1714;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 55%), var(--c);
  box-shadow: 0 0 0 2px #1a1816, 0 0 0 var(--ring, 0px) var(--brass);
}

.words { position: relative; flex: 1; min-width: 0; height: 38px; overflow: hidden; }
.state { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; white-space: nowrap; }
.state b { font-size: 15.5px; font-weight: 620; font-variation-settings: "wdth" var(--w, 100); letter-spacing: -0.005em; overflow: hidden; text-overflow: ellipsis; }
.state small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

.disc {
  position: relative; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 28%, #fffaf2, var(--disc) 55%, #d9cdb9);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.18), 0 6px 14px -6px rgba(0, 0, 0, 0.8);
}
.pole { width: 22px; height: 36px; grid-area: 1 / 1; overflow: visible; }
.pole__base { fill: #fbf7f0; }
.pole__red { fill: var(--red); }
.pole__blue { fill: var(--blue); }
.pole__shine { fill: rgba(255, 255, 255, 0.55); }
.pole__cap { fill: var(--brass); }
.tick { grid-area: 1 / 1; width: 24px; height: 24px; opacity: 0; }
.tick path { fill: none; stroke: var(--tick); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; }

.hit { position: absolute; inset: 0; border: 0; background: transparent; border-radius: 32px; cursor: pointer; z-index: 2; }
.hit:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* ---- the drawer ---- */
.drawer { padding: 4px 12px 14px; display: grid; gap: 12px; }
.barbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.barber {
  appearance: none; border: 0; font: inherit; color: var(--ink); cursor: pointer;
  display: grid; justify-items: center; gap: 3px; padding: 9px 4px 8px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.barber__face {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 640; color: #1b1714;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 55%), var(--c);
  box-shadow: 0 0 0 var(--ring, 0px) var(--brass);
}
.barber__name { font-size: 12.5px; font-weight: 600; }
.barber__next { font-size: 10.5px; color: var(--muted); }
.barber.is-on { background: rgba(201, 164, 106, 0.12); box-shadow: inset 0 0 0 1px rgba(201, 164, 106, 0.55); }
.barber:focus-visible, .time:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.times { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.time {
  appearance: none; border: 0; font: inherit; cursor: pointer;
  height: 34px; border-radius: 999px; font-size: 12.5px; font-weight: 580; color: var(--ink);
  background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.time.is-on { background: var(--red); color: #fff; box-shadow: 0 6px 14px -6px rgba(214, 69, 60, 0.8); }

@media (hover: hover) {
  .barber:hover { background: rgba(255, 255, 255, 0.08); }
  .time:hover { background: rgba(255, 255, 255, 0.11); }
  .time.is-on:hover { background: var(--red); }
}

/* the drawn pointer of the autopilot */
.ghost { position: absolute; left: 0; top: 0; width: 22px; height: 22px; pointer-events: none; z-index: 10; opacity: 0; }
.ghost path { fill: #fff; stroke: #111; stroke-width: 1.4; stroke-linejoin: round; }
