/* The hotel wake-up call button with the sun rising in the pill */
:root {
  --fondo: #ffffff;
  --notte: #141726;            /* the night of the pill at rest */
  --notte-alta: #232842;
  --alba-alta: #2a2b4f;        /* the dawn: deep blue at the top */
  --alba-bassa: #c9735c;       /* and warm apricot at the bottom */
  --sole: #ffc27a;             /* the sun that rises */
  --sole-caldo: #ff8f5a;
  --testo: #ffffff;
  --tenue: rgba(255, 255, 255, 0.62);
}

* { box-sizing: border-box; margin: 0; }
html { font-size: clamp(14px, min(1.9vw, 3.1vh), 23px); }
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; }

.stage { height: 100vh; display: grid; place-items: center; padding: 1rem; }
.wrap { position: relative; display: grid; place-items: center; padding: 1.4rem 1rem; max-width: 94vw; }

/* ---- the pill: GSAP animates width, scale and y of this element ---- */
.pill {
  position: relative;
  width: 15rem;
  max-width: 90vw;
  height: 3.6rem;
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 18px 30px -18px rgba(20, 23, 38, 0.75),
    0 6px 12px -6px rgba(20, 23, 38, 0.25),
    0 1px 2px rgba(20, 23, 38, 0.18);
}
.pill__night, .pill__dawn, .pill__glow, .pill__light, .pill__grain, .pill__rim {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
}
.pill__night { background: linear-gradient(180deg, var(--notte-alta), var(--notte)); }
.pill__dawn {
  background:
    linear-gradient(180deg, var(--alba-alta) 0%, #4b3d63 58%, var(--alba-bassa) 130%);
  opacity: 0;
}
.pill__glow {
  background: radial-gradient(9rem 5rem at 1.9rem 85%, rgba(255, 178, 110, 0.55), rgba(255, 143, 90, 0.18) 45%, transparent 75%);
  opacity: 0;
}
.pill__light {
  background: radial-gradient(8rem 5rem at var(--lx, 50%) var(--ly, 50%), rgba(255, 255, 255, 0.12), transparent 70%);
  opacity: 0;
}
.pill__grain {
  opacity: 0.18;
  mix-blend-mode: overlay;
  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='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.6'/></svg>");
}
/* the 1px rim that catches the light at the top */
.pill__rim {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

/* ---- the little window on the left ---- */
.slot {
  position: absolute; left: 0.55rem; top: 50%;
  width: 2.5rem; height: 2.5rem; margin-top: -1.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 2;
}
.slot__sky {
  position: absolute; left: 0; right: 0; top: 0; height: 66%;
  overflow: hidden; border-radius: 1.25rem 1.25rem 0 0;
}
.slot__moon, .slot__sun {
  position: absolute; left: 50%; top: 50%;
  width: 1.2rem; height: 1.2rem; margin: -0.6rem 0 0 -0.6rem;
}
.slot__moon svg { width: 100%; height: 100%; fill: #e9e6f5; }
.slot__sun {
  border-radius: 50%;
  margin-top: -0.45rem;
  background: radial-gradient(circle at 38% 34%, #fff1d6, var(--sole) 48%, var(--sole-caldo) 100%);
  box-shadow: 0 0 0.7rem rgba(255, 180, 110, 0.75), 0 0 1.6rem rgba(255, 143, 90, 0.35);
}
.slot__sun svg { width: 100%; height: 100%; }
.slot__tick { fill: none; stroke: #4a2a22; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.slot__horizon {
  position: absolute; left: 0.3rem; right: 0.3rem; top: 66%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
}
/* the warm reflection of the sun under the horizon */
.slot__glint {
  position: absolute; left: 50%; top: calc(66% + 2px); width: 1.3rem; height: 0.32rem; margin-left: -0.65rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 194, 122, 0.75), rgba(255, 143, 90, 0.2) 70%, transparent);
  opacity: 0;
}
.slot__phone { position: absolute; inset: 0; display: grid; place-items: center; }
.slot__phone svg { width: 1.25rem; height: 1.25rem; overflow: visible; }
.slot__phone [data-handset] path { fill: #fff; }
.slot__wave { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }

/* ---- the faces ---- */
.face {
  position: absolute; top: 0; bottom: 0; left: 0;
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0 1.35rem 0 3.65rem;
  white-space: nowrap;
  z-index: 3;
}
.face--rest {
  right: 0; background: none; border: 0; cursor: pointer; border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}
.face--rest:focus-visible { outline: 2px solid var(--sole); outline-offset: -4px; }
.face--wait, .face--set { visibility: hidden; }
.face--set { padding-right: 0.5rem; gap: 0.9rem; }
.face__label { font-size: 1rem; font-weight: 600; font-variation-settings: "wdth" 100; letter-spacing: -0.01em; }
.face__sep { width: 1px; height: 1rem; background: rgba(255, 255, 255, 0.2); }
.face__time { font-size: 0.86rem; color: var(--tenue); font-weight: 520; }
.face__sub { font-size: 0.72rem; color: var(--tenue); font-weight: 500; }
.face--wait { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.08rem; }
.face__stack { display: flex; flex-direction: column; gap: 0.08rem; }

/* the waiting label shines from left to right */
.face__shimmer {
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.55) 30%, #fff 50%, rgba(255, 255, 255, 0.55) 70%) 0 0 / 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-position: var(--sx, 100%) 0;
}

/* the time rolls in, one character at a time */
.digits { display: inline-flex; }
.digits .ch { display: inline-block; overflow: hidden; height: 1.25em; vertical-align: top; }
.digits .ch > span { display: inline-block; }

.cancel {
  height: 2.5rem; padding: 0 1rem;
  border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-size: 0.8rem; font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.cancel:focus-visible { outline: 2px solid var(--sole); outline-offset: 2px; }
@media (hover: hover) {
  .cancel:hover { background: rgba(255, 255, 255, 0.2); }
}

/* the drawn pointer of the autopilot */
.pointer {
  position: absolute; left: 0; top: 0; z-index: 10; width: 1.25rem; height: 1.25rem;
  pointer-events: none; opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}
.pointer svg { width: 100%; height: 100%; fill: #141726; stroke: #fff; stroke-width: 1.3; stroke-linejoin: round; }

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