:root {
  --fondo: #ffffff;
  --inchiostro: #15171a;
  --crema: #f5f1e8;
  --salvia: #2d5a4c;
  --cotto: #c25a3c;
  --oro: #ecd3a0;
  --carta: #fbf8f2;
  --grigio: #8b8a90;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.frame {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(340px, 94vw);
  padding: 22px 0;
}

/* the pill: the button for GSAP (scale), the layers inside for CSS */
.x {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 62px;
  padding: 0 26px 0 15px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--crema);
  font: inherit;
  font-size: 16px;
  font-weight: 580;
  font-variation-settings: "wdth" 100;
  letter-spacing: -0.005em;
  cursor: pointer;
  isolation: isolate;
  max-width: 94vw;
  -webkit-tap-highlight-color: transparent;
}
.x:focus-visible { outline: 2px solid var(--salvia); outline-offset: 4px; }

.x__skin, .x__glow, .x__fill, .x__sheen, .x__beam {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.x__skin {
  z-index: -5;
  background: linear-gradient(180deg, #25282c 0%, var(--inchiostro) 58%, #0e1012 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 1px 1px rgba(21, 23, 26, 0.16),
    0 6px 14px -6px rgba(21, 23, 26, 0.3),
    0 24px 42px -22px rgba(21, 23, 26, 0.55);
}
.x__glow {
  z-index: -4;
  overflow: hidden;
  opacity: 0;
  background: radial-gradient(120px 80px at var(--gx, 50%) var(--gy, 50%), rgba(255, 238, 210, 0.16), transparent 70%);
}
/* the green that fills the pill from the calendar side once the night is booked */
.x__fill {
  z-index: -3;
  background:
    radial-gradient(140% 120% at 0% 0%, rgba(255, 255, 255, 0.12), transparent 55%),
    linear-gradient(180deg, #3a6d5d 0%, var(--salvia) 55%, #1f4337 100%);
  box-shadow: inset 0 1px 0 rgba(220, 255, 236, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  clip-path: inset(0% 100% 0% 0% round 999px);
}
.x__sheen {
  z-index: -2;
  overflow: hidden;
  opacity: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 246, 225, 0.26) 48%, transparent 64%);
  background-size: 260% 100%;
  background-position: 120% 0;
}
/* the beam that runs round the edge while the hotel checks the room: a conic light cut to a 1.5px ring */
.x__beam {
  z-index: -1;
  inset: -1px;
  padding: 1.5px;
  opacity: 0;
  background: conic-gradient(from var(--a, 0deg), transparent 0deg, transparent 230deg, rgba(236, 211, 160, 0.2) 290deg, #fff3d8 338deg, rgba(236, 211, 160, 0.4) 350deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}

/* ---- the little desk calendar: paper tile, terracotta band, split-flap day ---- */
.cal {
  position: relative;
  flex: none;
  display: grid;
  grid-template-rows: 11px 1fr;
  width: 32px;
  height: 36px;
  border-radius: 7px;
  background: linear-gradient(180deg, #fff, var(--carta) 70%, #efe9de);
  color: var(--inchiostro);
  box-shadow:
    inset 0 0 0 0.5px rgba(80, 60, 40, 0.2),
    0 1px 1px rgba(0, 0, 0, 0.35),
    0 4px 8px -3px rgba(0, 0, 0, 0.45);
}
.cal__rings {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: -2.5px;
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  pointer-events: none;
}
.cal__rings i {
  width: 2.5px;
  height: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, #6c6f74, #d8dbe0 50%, #7d8085);
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.4);
}
.cal__band {
  position: relative;
  overflow: hidden;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #d2694a, var(--cotto) 60%, #a94a30);
  box-shadow: inset 0 -0.5px 0 rgba(0, 0, 0, 0.25);
}
.cal__wd {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 1px;
  font-size: 6.6px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff4ea;
  font-variation-settings: "wdth" 112;
}
.cal__wd[data-wd="b"] { opacity: 0; }
.cal__face {
  position: relative;
  perspective: 70px;
}
.half {
  position: absolute;
  left: 2px;
  right: 2px;
  height: 50%;
  overflow: hidden;
  backface-visibility: hidden;
}
.half b {
  display: block;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.03em;
  font-variation-settings: "wdth" 108;
  font-variant-numeric: tabular-nums;
}
.half--top { top: 0.5px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #fff, #f6f2ea); }
.half--bot { bottom: 0.5px; border-radius: 0 0 4px 4px; background: linear-gradient(180deg, #f1ece2, #faf7f1); }
.half--bot b { margin-top: -12px; }
.half--top b { margin-top: -0.5px; }
.half--fly { z-index: 2; }
.half--top.half--fly { transform-origin: 50% 100%; }
.half--bot.half--fly { transform-origin: 50% 0%; }
.half__shade {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.half--top .half__shade { background: linear-gradient(0deg, rgba(40, 30, 20, 0.35), rgba(40, 30, 20, 0.08)); }
.half--bot .half__shade { background: linear-gradient(180deg, rgba(40, 30, 20, 0.3), rgba(40, 30, 20, 0.05)); }
.cal__hinge {
  position: absolute;
  z-index: 4;
  left: 2px;
  right: 2px;
  top: calc(50% - 0.25px);
  height: 0.5px;
  background: rgba(60, 45, 30, 0.3);
  pointer-events: none;
}

/* ---- labels ---- */
.x__labels {
  position: relative;
  display: block;
  height: 22px;
  overflow: hidden;
}
.x__label {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  width: max-content;
  height: 22px;
  line-height: 22px;
  white-space: nowrap;
  opacity: 0;
}
.x__label[data-l="idle"] { opacity: 1; }
.x__sep { margin: 0 0.42em; opacity: 0.5; }
.x__plus { color: var(--oro); font-weight: 650; }

/* ---- the line below: two lines that roll into each other ---- */
.note {
  position: relative;
  margin: 0;
  height: 18px;
  width: 100%;
  font-size: 13px;
  line-height: 18px;
  font-weight: 460;
  color: var(--grigio);
  overflow: hidden;
}
.note__line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  white-space: nowrap;
}
.note__line b { font-weight: 620; color: var(--salvia); }
.note__line[data-note="done"] { opacity: 0; }

@media (max-width: 400px) {
  .x { height: 58px; font-size: 15px; padding: 0 22px 0 13px; gap: 11px; }
  .note { font-size: 12px; }
}
