@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Class colour scheme */
  --color-black: #000000;
  --color-tan: #86745c;
  --color-light-tan: #c2baab;
  --color-dark-tan: #6a5c48;
  --color-white: #ffffff;
  --color-black-63: rgba(0, 0, 0, 0.63);
  --color-black-80: rgba(0, 0, 0, 0.8);
  --color-black-88: rgba(0, 0, 0, 0.88);
  --color-gold: #b19977;
  --color-accent: #b19977;
  --color-accent-light: #c2baab;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --globe: min(58vh, 78vw, 620px);

  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

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

html { height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }

body {
  margin: 0;
  min-height: 100%;
  color: var(--color-white);
  font-family: var(--sans);
  line-height: 1.45;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, var(--color-dark-tan) 0%, transparent 70%),
    linear-gradient(var(--color-black-88), var(--color-black-88)),
    var(--color-tan);
  background-color: var(--color-black);
  overflow-x: hidden;
}

.snowfall {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2.5vh, 1.75rem);
  padding: clamp(1rem, 4vh, 3rem) 1rem clamp(3rem, 7vh, 4.5rem);
  text-align: center;
}

.title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, min(5vw, 6vh), 3.4rem);
  line-height: 1.1;
  color: var(--color-accent-light);
}

/* ---------- Snow globe ---------- */
.globe-wrap {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.globe {
  position: relative;
  width: var(--globe);
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  color: var(--color-white);
  background:
    radial-gradient(circle at 50% 38%, rgba(194, 186, 171, 0.22), rgba(106, 92, 72, 0.35) 62%, var(--color-black-63) 100%);
  box-shadow:
    inset 0 0 0 3px rgba(194, 186, 171, 0.55),
    inset 0 -30px 60px var(--color-black-63),
    0 30px 80px var(--color-black-80);
  display: grid;
  place-items: center;
  /* keep the base tucked under the glass */
  margin-bottom: calc(var(--globe) * -0.09);
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.globe:focus-visible {
  outline: 4px solid var(--color-gold);
  outline-offset: 6px;
}

.globe__snow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.globe__shine {
  position: absolute;
  top: 9%;
  left: 16%;
  width: 26%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.35), transparent 70%);
  transform: rotate(-32deg);
  pointer-events: none;
}

.globe__count {
  position: relative;
  font-family: var(--serif);
  font-weight: 600;
  font-size: calc(var(--globe) * 0.42);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--color-white);
  text-shadow: 0 4px 24px var(--color-black-63);
  /* sit a touch above centre, like a figure on a snow globe mound */
  transform: translateY(-4%);
}
.globe__count.is-word { font-size: calc(var(--globe) * 0.2); }

.base {
  position: relative;
  z-index: 1;
  width: calc(var(--globe) * 0.86);
  height: calc(var(--globe) * 0.24);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: calc(var(--globe) * 0.035);
  background: linear-gradient(var(--color-tan), var(--color-dark-tan) 70%);
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
  border-radius: 0 0 10px 10px;
  box-shadow: inset 0 6px 0 rgba(0, 0, 0, 0.25);
}

.base__plaque {
  background: var(--color-gold);
  color: var(--color-black);
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1rem, calc(var(--globe) * 0.055), 2rem);
  line-height: 1;
  padding: 0.4em 1.1em 0.45em;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px var(--color-light-tan);
  white-space: nowrap;
}

.due-line {
  margin: 0;
  font-size: clamp(1rem, min(2.4vw, 3vh), 1.6rem);
  color: var(--color-light-tan);
  max-width: 40ch;
}
.due-line strong { color: var(--color-white); font-weight: 600; }

.hint {
  position: fixed;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-light-tan);
  opacity: 0.75;
}
:fullscreen .hint { display: none; }

@media (hover: none) {
  .hint { font-size: 0.8rem; }
}
