/* The time wheel: an alarm time on a black page, with two wheels on a drum under it. The number in the middle band
   is white, the others grey, fading as they turn away. */
:root {
  --page: #000000;          /* the page */
  --ink: #ffffff;           /* the time, the number in the band */
  --muted: #8d8d96;
  --band: #1b1b1f;          /* the band in the middle */
  --far: #5c5c64;           /* the numbers away from the band */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Manrope Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.alarm {
  display: grid;
  justify-items: center;
  width: min(320px, 100%);
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------------------------------------------------------------- the time */
.alarm__label {
  margin: 0;
  font-size: 15px;
  font-weight: 560;
  color: var(--muted);
}

.alarm__time {
  margin: 6px 0 0;
  font-size: clamp(58px, 19vw, 76px);
  font-weight: 260;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.alarm__colon {
  display: inline-block;
  margin: 0 0.02em;
  translate: 0 -0.06em;
}

.alarm__in {
  height: 22px;
  margin: 12px 0 30px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.alarm__in span {
  display: block;
}

/* ---------------------------------------------------------------- the wheels */
.wheels {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  height: 264px;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  touch-action: none;
}

.wheels__band {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 23px);
  height: 46px;
  border-radius: 14px;
  background: var(--band);
}

.wheels__colon {
  position: relative;
  font-size: 26px;
  font-weight: 700;
  translate: 0 -2px;
}

/* a wheel: the numbers sit on a drum, turned and pushed out by the script */
.wheel {
  position: relative;
  height: 100%;
  outline: none;
  cursor: grab;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
}

.wheel:active {
  cursor: grabbing;
}

.wheel span {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 23px);
  height: 46px;
  font-size: 27px;
  line-height: 46px;
  font-variant-numeric: tabular-nums;
  backface-visibility: hidden;
  will-change: transform;
}

/* the keyboard's ring: on the band, under the wheel in focus */
.wheel:focus-visible::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: calc(50% - 23px);
  height: 46px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--ink);
}
