:root {
  --bg: #08090c;
  --accent: #7a6bff; /* the colour of the busy days */
  --card: #111318;
  --card-hi: #171a21;
  --cell: #1d2029;
  --ink: #f2f3f7;
  --muted: #7d8391;
  --edge: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(70vw 60vh at 50% 0%, rgba(122, 107, 255, 0.09), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

/* ---- the card ---- */
.card {
  position: relative;
  width: min(730px, calc(100vw - 24px));
  padding: clamp(14px, 3.4vh, 24px) clamp(14px, 4vw, 26px) clamp(12px, 3vh, 20px);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  box-shadow:
    0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 30px 60px -24px rgba(0, 0, 0, 0.9),
    0 40px 90px -40px rgba(122, 107, 255, 0.28);
}
/* a faint light on the top edge of the card */
.card__sheen {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  pointer-events: none;
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  line-height: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 620;
  font-stretch: 108%;
  letter-spacing: -0.005em;
}
.brand__mark { width: 16px; height: 16px; fill: var(--accent); }
.head__range {
  padding: 3px 10px;
  border-radius: 99px;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  box-shadow: inset 0 0 0 1px var(--edge);
  background: rgba(255, 255, 255, 0.03);
}

.total {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: clamp(8px, 2.6vh, 18px);
}
.total__n {
  font-size: clamp(30px, min(9vw, 8vh), 54px);
  line-height: 0.95;
  font-weight: 640;
  font-stretch: 112%;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.total__label {
  color: var(--muted);
  font-size: 12px;
  line-height: 14px;
  font-weight: 480;
  padding-bottom: 2px;
  max-width: 96px;
}
.total__delta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px 4px 7px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #cfc9ff;
  background: rgba(122, 107, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(122, 107, 255, 0.3);
}
.total__delta svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the heatmap ---- */
.map {
  position: relative;
  margin-top: clamp(8px, 2.4vh, 18px);
  touch-action: none;
}
.map__svg { display: block; overflow: visible; cursor: crosshair; }
.map__months text, .map__days text {
  fill: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.map__cursor {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.4;
  opacity: 0;
  pointer-events: none;
}

/* the glass label that follows the day under the pointer */
.tip {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 11px 8px;
  border-radius: 11px;
  white-space: nowrap;
  font-size: 12px;
  line-height: 15px;
  color: var(--muted);
  background: rgba(30, 33, 43, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 24px -8px rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 3;
}
.tip b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- the foot ---- */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: clamp(8px, 2.2vh, 16px);
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}
.streak {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 7px;
  margin-left: -7px;
  border: 0;
  border-radius: 99px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.streak svg { width: 13px; height: 13px; fill: var(--accent); }
.streak b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.streak.is-lit { background: rgba(255, 255, 255, 0.07); color: var(--ink); }
.streak:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.legend { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--cell); }
.legend i:first-of-type { margin-left: 4px; }
.legend i:last-of-type { margin-right: 4px; }
.legend i:nth-of-type(2) { background: color-mix(in srgb, var(--accent) 30%, var(--cell)); }
.legend i:nth-of-type(3) { background: color-mix(in srgb, var(--accent) 55%, var(--cell)); }
.legend i:nth-of-type(4) { background: color-mix(in srgb, var(--accent) 80%, var(--cell)); }
.legend i:nth-of-type(5) { background: var(--accent); }

@media (max-width: 420px) {
  .legend { font-size: 11px; }
}
