/* Snooze button */
:root {
  --fondo: #000000;
  --testo: #f4f1ea;            /* the warm white of the clock */
  --tenue: rgba(244, 241, 234, 0.5);
  --ambra: #ffb35c;            /* the one accent: the amber of the alarm */
  --ambra-scura: #e8913a;
  --inchiostro: #1b1206;       /* the text on the amber pill */
  --grafite: #1c1b19;          /* the pill while it is snoozed */
  --grafite-bordo: rgba(255, 255, 255, 0.09);
}

* { box-sizing: border-box; margin: 0; }
html { font-size: clamp(14px, min(2.1vw, 3.6vh), 22px); }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.stage { height: 100vh; display: grid; place-items: center; padding: 1rem; }
.alarm { display: grid; justify-items: center; gap: 1.5rem; padding: 1.2rem 1rem; max-width: 94vw; }

/* ---- the clock above ---- */
.clock { display: grid; justify-items: center; gap: .35rem; }
.clock__sub { font-size: .78rem; letter-spacing: .02em; color: var(--tenue); height: 1.25em; overflow: hidden; }
.clock__time {
  display: flex; align-items: flex-start;
  font-size: min(4.6rem, 15vw, 16vh); line-height: 1; font-weight: 520;
  font-variation-settings: 'wdth' 112; letter-spacing: -.02em;
  font-variant-numeric: lining-nums;
  --t: .12em;                 /* where the digit starts inside its line */
  --h: .8em;                  /* the window of each digit: as tall as the digit, so a rolling digit never shows outside the row */
}
/* one window per character: the digits roll inside */
.cifra { display: inline-block; height: var(--h); overflow: hidden; position: relative; }
.cifra__strip { display: flex; flex-direction: column; }
.cifra__strip { margin-top: calc(-1 * var(--t)); }
.cifra__strip span { height: 1em; line-height: 1; display: block; text-align: center; }
.cifra--colon { width: .3em; }

/* a rolling stack of words: GSAP moves the stack, the window hides the rest */
.roll { display: flex; flex-direction: column; }
.roll > span { height: 1.25em; line-height: 1.25em; white-space: nowrap; text-align: center; }

.row { display: flex; align-items: center; gap: .9rem; }

/* ---- the pill: GSAP scales the background layer, the label lives above it ---- */
.pill {
  position: relative; display: inline-flex; align-items: center; gap: .6rem;
  height: 3.3rem; width: min(13.6rem, 64vw); padding: 0 1.5rem 0 1.05rem; border-radius: 999px;
  color: var(--inchiostro); isolation: isolate; outline: none;
}
.pill__bg {
  position: absolute; inset: 0; border-radius: inherit; z-index: -2;
  background: linear-gradient(180deg, #ffc37a, var(--ambra) 55%, var(--ambra-scura));
  box-shadow: 0 14px 30px -14px rgba(255, 160, 70, .55), 0 2px 6px -2px rgba(255, 160, 70, .35), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.pill__dark {
  position: absolute; inset: 0; border-radius: inherit; z-index: -2; opacity: 0;
  background: linear-gradient(180deg, #24221f, var(--grafite));
  box-shadow: inset 0 0 0 1px var(--grafite-bordo), 0 14px 30px -16px rgba(255, 179, 92, .18);
}
.pill__gloss {
  position: absolute; inset: 1px 1px 52% 1px; border-radius: 999px 999px 40% 40% / 999px 999px 60% 60%; z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0)); pointer-events: none;
}
.pill:focus-visible .pill__bg { outline: 2px solid var(--testo); outline-offset: 3px; }
.pill__ring { position: relative; width: 1.45rem; height: 1.45rem; flex: none; }
.pill__ring svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ring__track { fill: none; stroke: currentColor; stroke-width: 1.6; opacity: .22; }
.ring__run { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 1 1; }
.ring__bell { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.zed { position: absolute; left: 62%; top: -62%; width: .62rem; height: .74rem; opacity: 0; pointer-events: none; }
.zed path { fill: none; stroke: var(--ambra); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; }
.pill__text {
  flex: 1; text-align: center;
  height: 1.25em; overflow: hidden; font-size: 1rem; font-weight: 640;
  font-variation-settings: 'wdth' var(--w, 100); display: block;
}
.pill__text b { font-weight: inherit; display: inline-block; vertical-align: top; min-width: .62em; text-align: center; font-variant-numeric: tabular-nums; }

.stop {
  height: 3.3rem; padding: 0 1.25rem; border-radius: 999px; font-size: .95rem; font-weight: 560;
  color: var(--tenue); box-shadow: inset 0 0 0 1px var(--grafite-bordo); outline: none;
  transition: color .25s, box-shadow .25s, background-color .25s;
}
.stop:focus-visible { box-shadow: inset 0 0 0 1px var(--testo); color: var(--testo); }
@media (hover: hover) {
  .stop:hover { color: var(--testo); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); background-color: rgba(255, 255, 255, .04); }
}
.stop:active { background-color: rgba(255, 255, 255, .07); }

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

@media (max-width: 420px) {
  .alarm { gap: 1.1rem; }
  .row { gap: .6rem; }
  .pill { padding: 0 1.2rem 0 .9rem; }
  .stop { padding: 0 1rem; }
}
