:root {
  --fondo: #f2f2f2;
  --telefono: #ffffff;
  --inchiostro: #111113;
  --grigio: #8a8a90;
  --linea: rgba(17, 17, 19, 0.08);
  --vetro: rgba(250, 250, 251, 0.86);
  --tessera: #f1f1f3;
  --accento: #ff5a36;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

/* the phone: everything inside is measured on its height (cqh), so it scales as one piece */
.phone {
  position: relative;
  height: min(88vh, 620px, calc((100vw - 32px) / 0.49));
  aspect-ratio: 0.49;
  container-type: size;
  border-radius: 7.4cqh;
  padding: 1.1cqh;
  background: var(--telefono);
  border: 1px solid var(--linea);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4.5cqh 9cqh -4cqh rgba(0, 0, 0, 0.22);
  user-select: none;
  -webkit-user-select: none;
}

.screen {
  position: relative;
  height: 100%;
  border-radius: 6.4cqh;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 85% 105%, rgba(255, 90, 54, 0.2), rgba(255, 90, 54, 0) 60%),
    radial-gradient(90% 60% at 0% 0%, rgba(255, 196, 160, 0.28), rgba(255, 196, 160, 0) 70%),
    linear-gradient(180deg, #f7f5f2, #efece8);
  touch-action: none;
}

.wall {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 15cqh;
  transform-origin: 50% 30%;
}
.wall__date { font-size: 2.3cqh; font-weight: 500; color: rgba(17, 17, 19, 0.55); letter-spacing: 0.01em; }
.wall__time {
  font-size: 15cqh;
  line-height: 1;
  font-weight: 300;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-top: 0.6cqh;
}

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 19, 0.18);
  opacity: 0;
  pointer-events: none;
}

/* the drawer: as tall as the screen, parked above it with only its grip showing */
.drawer {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--vetro);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border-bottom-left-radius: 4cqh;
  border-bottom-right-radius: 4cqh;
  box-shadow: 0 0.2cqh 0 rgba(17, 17, 19, 0.06), 0 2cqh 4cqh -2.4cqh rgba(0, 0, 0, 0.25);
  will-change: transform;
  z-index: 2;
}
/* the same glass above the drawer, so pulling past the bottom never shows a gap */
.drawer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 100%;
  height: 60%;
  background: var(--vetro);
}

.drawer__inner {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 6.4cqh 2.4cqh 0;
}

.drawer__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 0.6cqh 1.4cqh;
}
.drawer__title { font-size: 3.1cqh; font-weight: 650; letter-spacing: -0.01em; }
.drawer__count { color: var(--accento); font-variant-numeric: tabular-nums; margin-left: 0.4cqh; }
.drawer__clear {
  font: inherit;
  font-size: 2cqh;
  font-weight: 550;
  color: var(--grigio);
  background: rgba(17, 17, 19, 0.05);
  border: 0;
  border-radius: 99px;
  padding: 0.7cqh 1.5cqh;
  cursor: pointer;
}

.list { list-style: none; }

.note {
  position: relative;
  display: flex;
  gap: 1.5cqh;
  align-items: flex-start;
  padding: 1.5cqh 1.6cqh;
  margin-bottom: 1cqh;
  background: #ffffff;
  border-radius: 2.6cqh;
  box-shadow: 0 0 0 1px var(--linea), 0 0.6cqh 1.6cqh -0.8cqh rgba(0, 0, 0, 0.14);
  overflow: hidden;
  cursor: grab;
}
.note__icon {
  flex: none;
  width: 5.4cqh;
  height: 5.4cqh;
  border-radius: 1.5cqh;
  background: var(--tessera);
  display: grid;
  place-items: center;
}
.note__icon svg { width: 3.3cqh; height: 3.3cqh; fill: none; stroke: var(--inchiostro); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.note__body { min-width: 0; flex: 1; }
.note__meta { display: flex; justify-content: space-between; font-size: 1.75cqh; color: var(--grigio); font-weight: 500; }
.note__meta time { font-variant-numeric: tabular-nums; }
.note__title { font-size: 2.15cqh; font-weight: 640; margin-top: 0.2cqh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note__text { font-size: 1.95cqh; color: rgba(17, 17, 19, 0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.note__x {
  position: absolute;
  top: 0.8cqh; left: 0.8cqh;
  width: 2.7cqh; height: 2.7cqh;
  border-radius: 50%;
  border: 0;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(17, 17, 19, 0.12), 0 0.3cqh 0.8cqh rgba(0, 0, 0, 0.14);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  z-index: 1;
}
.note__x svg { width: 1.5cqh; height: 1.5cqh; stroke: var(--inchiostro); stroke-width: 1.6; stroke-linecap: round; }
@media (hover: hover) {
  .note:hover { background: #fcfcfc; }
  .note:hover .note__x, .note.is-hover .note__x { opacity: 1; transform: scale(1); }
  .drawer__clear:hover { color: var(--inchiostro); }
}
.note.is-hover .note__x { opacity: 1; transform: scale(1); }

.empty {
  position: absolute;
  left: 0; right: 0; top: 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2cqh;
  color: var(--grigio);
  font-size: 2.1cqh;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
}
.empty svg { width: 4.4cqh; height: 4.4cqh; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* the grip: the strip of the drawer you can see when it is closed */
.grip {
  position: relative;
  flex: none;
  height: 12.6cqh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1.3cqh;
  padding-bottom: 1.4cqh;
  cursor: grab;
}
.grip__label { font-size: 1.85cqh; font-weight: 560; color: rgba(17, 17, 19, 0.6); font-variant-numeric: tabular-nums; }
.grip__bar {
  display: block;
  width: 5.4cqh;
  height: 0.75cqh;
  border-radius: 99px;
  background: rgba(17, 17, 19, 0.28);
}

.status {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 5.6cqh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6cqh 3.6cqh 0 4.2cqh;
  z-index: 3;
  pointer-events: none;
}
.status__time { font-size: 2.1cqh; font-weight: 640; font-variant-numeric: tabular-nums; }
.status__icons { display: flex; gap: 0.8cqh; align-items: center; }
.status__icons svg { height: 1.55cqh; width: auto; fill: currentColor; }

.ghost {
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px;
  fill: #111; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}
