/* The salon time picker, alone on white. The haircut is a block as long as its minutes, fixed in the middle of the
   rail like a lens; GSAP slides the day's timeline under it. GSAP moves only whole elements (the track, the lens
   body, the tag, the highlight, the chips); colours, edges and states live in CSS on classes. An element GSAP moves
   never has a transform in the CSS: the face inside it carries the look. */
:root {
  --page: #ffffff;          /* the page */
  --card: #ffffff;          /* the card */
  --card-low: #faf8f5;      /* the card towards the bottom */
  --well: #f5f2ee;          /* the wells: days, the rail */
  --ink: #18161a;           /* the main text, the chosen day, the tag */
  --muted: #8b858d;         /* labels and notes */
  --line: #e9e4de;          /* thin lines and borders */
  --taken: #e6e0d9;         /* the taken appointments on the rail */
  --accent: #c4592f;        /* the one accent: the haircut block, the ring of the stylist */
  --accent-deep: #9c4220;   /* the accent in shadow */
  --accent-soft: #f7e6dc;   /* the accent as a wash */
  --q: 18px;                /* the width of a quarter of an hour on the rail */
}

* { 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;
  font-variant-numeric: tabular-nums;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, .rail__view:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus:not(:focus-visible), .rail__view:focus:not(:focus-visible) { outline: none; }

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

/* ---- the card ---- */
.pick {
  position: relative;
  width: min(372px, 94vw);
  padding: clamp(12px, 3vh, 18px) clamp(12px, 3.6vw, 17px) clamp(12px, 2.8vh, 16px);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--card) 0%, var(--card) 55%, var(--card-low) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(24, 22, 26, 0.06),
    inset 0 -1px 0 rgba(255, 255, 255, 0.9),
    0 1px 1px rgba(24, 22, 26, 0.04),
    0 3px 6px -2px rgba(24, 22, 26, 0.05),
    0 18px 36px -14px rgba(24, 22, 26, 0.13),
    0 40px 80px -40px rgba(156, 66, 32, 0.18);
  isolation: isolate;
  display: grid;
  gap: clamp(9px, 2.2vh, 13px);
}
/* a fine grain on the card, under everything */
.pick::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .05 0'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
}
.pick__glow {
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(240px 150px at 50% 60%, rgba(196, 89, 47, 0.12), transparent 70%);
}

/* ---- the head ---- */
.head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
}
.mark {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #24211f, #121013);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(0, 0, 0, 0.18), 0 6px 12px -6px rgba(0, 0, 0, 0.35);
}
.mark svg { width: 17px; height: 17px; fill: none; stroke: #f1d9c9; stroke-width: 1.5; stroke-linecap: round; }
.head__t { display: grid; gap: 1px; min-width: 0; }
.head__brand { font-size: 11px; font-weight: 520; color: var(--muted); letter-spacing: 0.01em; }
.head__svc { font-size: 15.5px; font-weight: 640; font-stretch: 104%; letter-spacing: -0.01em; white-space: nowrap; }
.head__meta { display: grid; justify-items: end; gap: 1px; }
.head__min { font-size: 11px; color: var(--muted); font-weight: 520; }
.head__price { font-size: 15px; font-weight: 620; }

/* ---- the stylists ---- */
.stylists {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
.sty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 14px;
  text-align: left;
  min-width: 0;
  transition: background-color 0.25s ease;
}
.sty__av {
  position: relative;
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
}
.sty__in {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 650; letter-spacing: 0.02em;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(24, 22, 26, 0.18);
}
.sty__av--a .sty__in { background: linear-gradient(150deg, #b98b72, #8c5f4a); }
.sty__av--b .sty__in { background: linear-gradient(150deg, #7d8778, #545e52); }
.sty__av--c .sty__in { background: linear-gradient(150deg, #8f7f9a, #5f5168); }
.sty__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.sty__ring circle { fill: none; stroke-width: 1.6; }
.sty__ring-base { stroke: var(--line); }
.sty__ring-on { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 116.3; stroke-dashoffset: 116.3; }
.sty__t { display: grid; min-width: 0; }
.sty__name { font-size: 13px; font-weight: 520; transition: font-weight 0.3s ease; white-space: nowrap; }
.sty__role { font-size: 10px; color: var(--muted); white-space: nowrap; }
.sty[aria-checked="true"] { background: var(--well); }
.sty[aria-checked="true"] .sty__name { font-weight: 680; }

/* ---- the days ---- */
.days {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 3px;
  border-radius: 13px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px rgba(24, 22, 26, 0.035), inset 0 1px 2px rgba(24, 22, 26, 0.04);
}
.days__hl {
  position: absolute; left: 0; top: 3px;
  height: calc(100% - 6px);
  border-radius: 10px;
  background: linear-gradient(180deg, #2a2629, var(--ink));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(24, 22, 26, 0.2), 0 6px 12px -6px rgba(24, 22, 26, 0.45);
}
.day {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 5px 0 6px;
  border-radius: 10px;
  transition: color 0.3s ease;
}
.day__w { font-size: 10px; color: var(--muted); font-weight: 520; transition: color 0.3s ease; }
.day__n { font-size: 14px; font-weight: 600; line-height: 1.1; }
.day__bar { width: 18px; height: 2px; border-radius: 2px; background: rgba(24, 22, 26, 0.08); overflow: hidden; margin-top: 2px; }
.day__bar span { display: block; height: 100%; width: 50%; border-radius: inherit; background: var(--accent); opacity: 0.75; }
.day[aria-checked="true"] { color: #fff; }
.day[aria-checked="true"] .day__w { color: rgba(255, 255, 255, 0.6); }
.day[aria-checked="true"] .day__bar { background: rgba(255, 255, 255, 0.16); }
.day[aria-checked="true"] .day__bar span { background: #f0b394; opacity: 1; }

/* ---- the rail: the day's timeline slides under the fixed haircut block ---- */
.rail {
  position: relative;
  padding-top: 25px;
  touch-action: pan-y;
}
.rail__view {
  position: relative;
  height: 62px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--well);
  box-shadow: inset 0 0 0 1px rgba(24, 22, 26, 0.04), inset 0 1px 3px rgba(24, 22, 26, 0.05);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 87%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 87%, transparent 100%);
}
.rail.is-dragging .rail__view { cursor: grabbing; }
.rail__track { position: absolute; left: 0; top: 0; height: 100%; }
.rail__lane {
  position: absolute; left: 0; right: 0; top: 10px; height: 28px;
  background-image: repeating-linear-gradient(90deg, rgba(24, 22, 26, 0.06) 0 1px, transparent 1px var(--q));
}
.busy {
  position: absolute; top: 0; height: 100%;
  border-radius: 7px;
}
.busy__face {
  position: absolute; inset: 0;
  border-radius: inherit;
  background:
    repeating-linear-gradient(135deg, rgba(24, 22, 26, 0.07) 0 1px, transparent 1px 5px),
    var(--taken);
  box-shadow: inset 0 0 0 1px rgba(24, 22, 26, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.rail__ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; }
.tick { position: absolute; top: 0; width: 1px; height: 3px; background: rgba(24, 22, 26, 0.14); }
.tick--h { height: 6px; background: rgba(24, 22, 26, 0.3); }
.tick__l {
  position: absolute; top: 7px; left: 0;
  transform: translateX(-50%);
  font-size: 9.5px; font-weight: 540; color: var(--muted);
  white-space: nowrap;
}

/* the haircut block, fixed in the middle of the rail */
.lens {
  position: absolute;
  top: calc(25px + 7px);
  height: 34px;
  pointer-events: none;
}
.lens__shadow {
  position: absolute; left: 8%; right: 8%; bottom: -5px; height: 12px;
  border-radius: 50%;
  background: rgba(156, 66, 32, 0.45);
  filter: blur(7px);
}
/* the bracket on the tick row: the quarters the service takes */
.lens__span {
  position: absolute; left: 1px; right: 1px; bottom: -8px; height: 4px;
  border: 1.5px solid var(--accent);
  border-top: 0;
  border-radius: 0 0 3px 3px;
  opacity: 0.85;
  transition: opacity 0.25s ease, border-color 0.25s ease;
}
.lens.is-clash .lens__span { border-color: var(--accent); border-style: dashed; opacity: 0.6; }
.lens.is-narrow .lens__grip { display: none; }
.lens.is-narrow .lens__txt { font-size: 10px; }
.lens__body {
  position: absolute; inset: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  gap: 5px;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(180deg, #d76a3e 0%, var(--accent) 55%, #b04d26 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 0 0 1px rgba(120, 44, 16, 0.35),
    inset 0 -2px 3px rgba(120, 44, 16, 0.25),
    0 1px 2px rgba(120, 44, 16, 0.3);
  transition: color 0.2s ease;
}
.lens__sheen {
  position: absolute; left: 0; right: 0; top: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
  pointer-events: none;
}
.lens__grip { position: absolute; top: 50%; width: 1.5px; height: 12px; margin-top: -6px; border-radius: 2px; background: rgba(255, 255, 255, 0.45); }
.lens__grip--l { left: 5px; }
.lens__grip--r { right: 5px; }
.lens__txt { position: relative; font-size: 10.5px; font-weight: 640; letter-spacing: 0.01em; white-space: nowrap; }
.lens__tick { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; opacity: 0; }
.lens__tick path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 22; stroke-dashoffset: 22; }
.lens.is-clash .lens__body {
  color: var(--accent-deep);
  background:
    repeating-linear-gradient(135deg, rgba(196, 89, 47, 0.22) 0 1px, transparent 1px 5px),
    rgba(247, 230, 220, 0.92);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.lens.is-clash .lens__grip { background: rgba(196, 89, 47, 0.5); }
.lens.is-clash .lens__sheen { opacity: 0; }

/* the tag over the block: the start and the end */
.tag {
  position: absolute; left: 50%; top: 0;
  pointer-events: none;
}
.tag__in {
  position: relative;
  display: block;
  transform: translateX(-50%);
  padding: 3px 8px 4px;
  border-radius: 8px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 1px 2px rgba(24, 22, 26, 0.2), 0 6px 12px -6px rgba(24, 22, 26, 0.4);
}
.tag__in::after {
  content: "";
  position: absolute; left: 50%; bottom: -3px;
  width: 7px; height: 7px;
  margin-left: -3.5px;
  background: var(--ink);
  border-radius: 1px;
  transform: rotate(45deg);
}

/* ---- the open gaps ---- */
.gaps { display: grid; gap: 6px; }
.gaps__label { font-size: 11px; color: var(--muted); font-weight: 520; }
.gaps__row { position: relative; display: flex; gap: 6px; height: 28px; }
.chip {
  position: relative;
  flex: none;
  height: 28px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12px; font-weight: 580;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 1px rgba(24, 22, 26, 0.04);
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.chip.is-on { background: var(--accent-soft); color: var(--accent-deep); box-shadow: inset 0 0 0 1px rgba(196, 89, 47, 0.45); }
.gaps__none { font-size: 12px; color: var(--muted); line-height: 28px; white-space: nowrap; }

/* ---- the foot ---- */
.foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 2px; }
.sum { display: grid; gap: 1px; min-width: 0; }
.sum__top { font-size: 11px; color: var(--muted); white-space: nowrap; }
.sum__time { font-size: 15px; font-weight: 640; white-space: nowrap; }
.go { flex: none; width: 164px; height: 44px; border-radius: 999px; }
.go__face {
  position: relative;
  display: grid; place-items: center;
  width: 100%; height: 100%;
  border-radius: inherit;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(180deg, #2b2729, var(--ink));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 0 1px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(24, 22, 26, 0.2), 0 10px 18px -10px rgba(24, 22, 26, 0.6);
  transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}
.go__sheen {
  position: absolute; top: 0; bottom: 0; left: -40%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  pointer-events: none;
}
.go__beam {
  position: absolute; inset: -60%;
  opacity: 0;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(240, 179, 148, 0.9) 85%, transparent 100%);
}
.go__labels { position: relative; display: grid; }
.go__label { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.go__tick { width: 15px; height: 15px; }
.go__tick path { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 22; stroke-dashoffset: 22; }
.pick.is-busy .go__face::after {
  content: "";
  position: absolute; inset: 1.5px;
  border-radius: inherit;
  background: linear-gradient(180deg, #2b2729, var(--ink));
}
.pick.is-busy .go__labels { z-index: 1; }
.pick.is-booked .go__face { background: linear-gradient(180deg, #fff, #f6f2ee); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(24, 22, 26, 0.06), 0 10px 18px -12px rgba(24, 22, 26, 0.3); }
.pick.is-full .go__face { background: var(--well); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.pick.is-full .go { cursor: default; }
.pick.is-full .tag { opacity: 0.3; transition: opacity 0.3s ease; }

@media (hover: hover) {
  .sty:hover { background: var(--well); }
  .day:not([aria-checked="true"]):hover .day__n { color: var(--accent-deep); }
  .chip:not(.is-on):hover { box-shadow: inset 0 0 0 1px #d8d1c9, 0 3px 6px -3px rgba(24, 22, 26, 0.18); }
  .pick:not(.is-full) .go:hover .go__sheen { left: 110%; transition: left 0.7s ease; }
}
.sty:active .sty__av, .chip:active { scale: 0.96; }

/* 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.25));
}
.ghost path { fill: var(--ink); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }

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

/* narrow screens: a quarter of an hour takes less room, the names tighten */
@media (max-width: 420px) {
  :root { --q: 16px; }
  .sty { gap: 6px; padding: 5px 4px; }
  .sty__name { font-size: 12px; }
  .go { width: 152px; }
  .go__label { font-size: 12.5px; }
}
/* the phone box is low and wide (341 by 410): everything a little tighter */
@media (max-height: 560px) {
  .pick { border-radius: 20px; gap: 8px; }
  .mark { width: 30px; height: 30px; border-radius: 10px; }
  .head__svc { font-size: 14.5px; }
  .sty { padding: 3px 4px; }
  .sty__av { width: 28px; height: 28px; }
  .sty__in { width: 22px; height: 22px; font-size: 9px; }
  .day { padding: 3px 0 4px; }
  .rail { padding-top: 23px; }
  .rail__view { height: 56px; }
  .rail__lane { top: 8px; height: 26px; }
  .lens { top: calc(23px + 5px); height: 32px; }
  .rail__ticks { height: 20px; }
  .gaps { gap: 4px; }
  .go { height: 40px; }
}
