:root {
  --bg: #f7f3ef;
  --ink: #1d1719;
  --soft: rgba(29, 23, 25, 0.55);
  --empty: #e3dcd7;
  --accent: #e0567a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: 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 {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 16px;
}

.cy { --heat: 0; display: flex; flex-direction: column; align-items: center; }

/* the ring is the slider: dragging or moving along it picks the day */
.cy__ring {
  position: relative;
  width: min(300px, 64vh, 86vw);
  aspect-ratio: 1;
  border-radius: 50%;
  outline: none;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.cy__ring.is-dragging { cursor: grabbing; }
.cy__ring:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.cy__ring svg { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }
/* a soft light behind the ring, stronger the more fertile the day is */
.cy__glow { position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 26%, transparent), transparent); opacity: calc(0.25 + var(--heat) * 0.75); transform: scale(calc(0.9 + var(--heat) * 0.14)); }

.cy__seg { stroke-width: 8.500; stroke-linecap: round; }
.cy__seg.is-plain { stroke: var(--empty); }
.cy__seg.is-period { stroke: var(--accent); }
.cy__seg.is-fertile { stroke: color-mix(in srgb, var(--accent) 38%, var(--bg)); }
.cy__seg.is-ovulation { stroke: var(--accent); }

/* a short mark inside the ring keeps today in sight while the knob is elsewhere */
.cy__today { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; opacity: 0; }
.cy__knob-halo { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.cy__knob-dot { fill: #ffffff; stroke: rgba(29, 23, 25, 0.1); stroke-width: 1; filter: drop-shadow(0 3px 5px rgba(29, 23, 25, 0.18)); }
.cy__knob-core { fill: var(--ink); }

.cy__mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.cy__day-label { font-size: 12px; line-height: 16px; font-weight: 640; letter-spacing: 0.04em; text-transform: uppercase; color: var(--soft); }
.cy__num { font-size: clamp(44px, 15vh, 64px); line-height: 1; font-weight: 400; letter-spacing: -0.045em; font-variation-settings: "wght" var(--w, 560), "wdth" 92; margin: 2px 0 4px; }
.cy__phase { display: block; height: 20px; overflow: hidden; font-size: 14px; line-height: 20px; font-weight: 700; font-stretch: 106%; color: color-mix(in srgb, var(--accent) 86%, #1d1719); }
.cy.is-plain .cy__phase { color: var(--ink); }
.cy__phase span, .cy__hint span { display: block; }
.cy__hint { display: block; height: 17px; overflow: hidden; margin-top: 1px; font-size: 12px; line-height: 17px; font-weight: 560; color: var(--soft); white-space: nowrap; }

.cy__legend { display: flex; gap: 16px; margin-top: clamp(4px, 2vh, 14px); list-style: none; font-size: 11.5px; line-height: 16px; font-weight: 600; color: var(--soft); }
.cy__legend li { display: flex; align-items: center; gap: 6px; }
.cy__legend i { width: 14px; height: 5px; border-radius: 3px; }
.cy__legend .is-period { background: var(--accent); }
.cy__legend .is-fertile { background: color-mix(in srgb, var(--accent) 38%, var(--bg)); }
.cy__legend .is-ovulation { width: 5px; height: 13px; background: var(--accent); }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #1d1719;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(29, 23, 25, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

/* on a large screen the ring is drawn bigger, so the poster and the preview video are not a small ring in a big room */
@media (min-width: 900px) and (min-height: 680px) {
  .cy { zoom: 1.7; }
}
