:root {
  --paper: #ffffff;
  --ink: #121315;
  --soft: #7a7b80;
  --faint: rgba(18, 19, 21, .12);
  --accent: #c8502a;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.stay {
  width: min(330px, 88vw);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  user-select: none;
  -webkit-user-select: none;
}
.stay.is-waiting { visibility: hidden; }

/* the label over the number: a word that can swap for a short note at a limit */
.stay__label {
  position: relative;
  height: 1.4em;
  overflow: hidden;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--soft);
}
.stay__label span { position: absolute; inset: 0; white-space: nowrap; }
.stay__label span.is-limit { color: var(--accent); }

.stay__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  margin-top: clamp(2px, 1vh, 6px);
}
.stay__btn {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  border-radius: 999px;
  touch-action: manipulation;
}
.stay__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
/* the round face: the CSS press lives here, GSAP moves only the svg inside */
.stay__btn-in {
  display: grid;
  place-items: center;
  width: clamp(40px, 7vh, 44px);
  height: clamp(40px, 7vh, 44px);
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--faint), 0 6px 14px -10px rgba(18, 19, 21, .35);
  background: var(--paper);
  transition: transform .5s cubic-bezier(.34, 1.8, .5, 1), box-shadow .25s ease;
}
.stay__btn svg { width: 100%; height: 100%; display: block; }
.stay__btn path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.stay__btn.is-pressed .stay__btn-in { transform: scale(.92); transition-duration: .08s; }
.stay__btn[aria-disabled="true"] { color: rgba(18, 19, 21, .3); cursor: default; }
@media (hover: hover) {
  .stay__btn:not([aria-disabled="true"]):hover .stay__btn-in { box-shadow: 0 0 0 1px rgba(18, 19, 21, .32), 0 8px 18px -10px rgba(18, 19, 21, .4); }
}

.stay__value {
  display: flex;
  justify-content: center;
  align-items: center;
  justify-self: center;
  min-width: 2.2em;
  padding: 0 14px;
  height: clamp(60px, 13vh, 76px);
  outline: none;
  border-radius: 12px;
}
.stay__value:focus-visible { box-shadow: 0 0 0 1.5px var(--accent); }

/* a slot: every text that rolls lives in one, all its spans in the same grid cell; the clip leaves room for the overshoot */
.stay__slot {
  position: relative;
  display: inline-grid;
  clip-path: inset(-.08em -.5em);
  white-space: nowrap;
}
.stay__slot > span { grid-area: 1 / 1; will-change: transform; }
.stay__slot--num {
  font-size: clamp(54px, 12vh, 68px);
  line-height: 1;
  font-weight: 340;
  font-variation-settings: 'wdth' 100;
  letter-spacing: -.03em;
  justify-items: center;
}
.stay__slot--num > span { justify-self: center; }

.stay__track {
  display: block;
  width: 100%;
  height: 30px;
  margin-top: clamp(10px, 2.6vh, 18px);
  overflow: visible;
  cursor: pointer;
  touch-action: none;
}
.stay__rest { fill: none; stroke: var(--faint); stroke-width: 1; }
.stay__fill { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; }
.stay__start { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; }
.stay__end { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.stay__tick { stroke: rgba(18, 19, 21, .22); stroke-width: 1; stroke-linecap: round; }
.stay__tick.is-on { stroke: var(--accent); }

.stay__dates {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}
.stay__date { display: flex; flex-direction: column; gap: 3px; }
.stay__date--out { align-items: flex-end; text-align: right; }
.stay__small { font-size: 11px; font-weight: 500; color: var(--soft); letter-spacing: .02em; }
.stay__day {
  display: inline-flex;
  gap: .28em;
  font-size: 15px;
  font-weight: 560;
}
.stay__day .stay__slot > span { justify-self: start; }
.stay__date--out .stay__slot > span { justify-self: end; }

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