:root {
  --page: #000000;          /* the page behind the card */
  --glass: #0d1117;         /* the dark glass of the card */
  --ink: #eef2f8;           /* the main text */
  --muted: #8a93a3;         /* labels and secondary text */
  --line: #ffffff14;        /* hairlines */
  --accent: #b9d3ff;        /* the single cold accent: the halo, the picked day, the percentage */
}

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

html, body { height: 100%; }

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

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2vh 3vw;
  font-size: clamp(8px, min(2.9vw, 2.3vh), 15px);
}

.card {
  position: relative;
  width: 25em;
  padding: 1.6em 1.6em 1.4em;
  border-radius: 1.6em;
  background:
    radial-gradient(120% 70% at 50% 0%, #ffffff0d, transparent 60%),
    linear-gradient(180deg, #121823, var(--glass));
  box-shadow:
    0 0 0 1px #ffffff12 inset,
    0 1px 0 #ffffff1f inset,
    0 2.4em 4em -1.6em #000,
    0 0.6em 1.4em -0.6em #0008;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}

.card__rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(140deg, #ffffff22, transparent 30%, transparent 70%, #b9d3ff14);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  padding: 1px;
}

/* ---- header ---- */
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  font-size: 0.86em;
  font-weight: 560;
  letter-spacing: 0.01em;
}
.head__app { display: flex; align-items: center; gap: 0.45em; }
.head__mark { width: 1.05em; height: 1.05em; fill: var(--accent); }
.head__place { color: var(--muted); font-weight: 480; margin-left: 0.2em; }
.head__date { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---- the rolling lines ---- */
.roll {
  position: relative;
  display: inline-grid;
  overflow: hidden;
  vertical-align: bottom;
  line-height: 1.25;
}
.roll__line { grid-area: 1 / 1; display: block; white-space: nowrap; }

/* ---- the moon ---- */
.sky {
  position: relative;
  display: grid;
  place-items: center;
  height: 12.4em;
  margin: 0.9em 0 0.4em;
}
.halo {
  position: absolute;
  width: 15em;
  height: 15em;
  border-radius: 50%;
  background: radial-gradient(closest-side, #b9d3ff2e, #b9d3ff0d 55%, transparent 72%);
  pointer-events: none;
}
.moon {
  position: relative;
  width: 11.6em;
  height: 11.6em;
  overflow: visible;
  filter: drop-shadow(0 0.6em 1.6em #00000080);
}
.moon__shade { opacity: 0.075; }
.moon__ring { fill: none; stroke: #ffffff10; stroke-width: 1; }

/* ---- reading ---- */
.read { text-align: center; }
.read__name {
  font-size: 1.5em;
  font-weight: 620;
  font-stretch: 108%;
  letter-spacing: -0.015em;
}
.read__light {
  margin-top: 0.15em;
  font-size: 0.92em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.read__pct { color: var(--accent); font-weight: 620; display: inline-block; min-width: 1.9em; text-align: right; }
.read__unit { color: var(--accent); font-weight: 620; }

/* ---- rise and set ---- */
.times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 1.05em;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.times__item { padding: 0.7em 0.2em; text-align: center; }
.times__item + .times__item { border-left: 1px solid var(--line); }
.times dt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  font-size: 0.74em;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 560;
}
.times dt svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.times dd { margin-top: 0.15em; font-size: 1.12em; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- the seven days ---- */
.week {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 1em;
  padding: 0.3em;
  border-radius: 1.1em;
  background: #ffffff08;
  cursor: grab;
  touch-action: pan-y;
  outline: none;
}
.week:active { cursor: grabbing; }
.week:focus-visible { box-shadow: 0 0 0 2px #b9d3ff66; }
.week__pick {
  position: absolute;
  top: 0.3em;
  bottom: 0.3em;
  left: 0.3em;
  border-radius: 0.85em;
  background: #b9d3ff17;
  box-shadow: 0 0 0 1px #b9d3ff40 inset, 0 0.4em 1em -0.4em #b9d3ff30;
  pointer-events: none;
}
.day {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: inherit;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.3em;
  padding: 0.45em 0 0.4em;
  font-size: 0.72em;
  color: var(--muted);
  font-weight: 560;
  transition: color 0.3s;
}
.day.is-on { color: var(--ink); }
.day svg { width: 1.9em; height: 1.9em; }
.day .d-shade { fill: #ffffff1c; }
.day .d-lit { fill: #dfe5ee; }

@media (hover: hover) {
  .day:hover { color: var(--ink); }
}

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

@media (prefers-reduced-motion: reduce) {
  .day { transition: none; }
}
