:root {
  --red: #b3202c; --pine: #1f5e46; --pine-dark: #15432f; --cream: #fffaf0; --ink: #1d2730;
  --muted: #5b6875; --gold: #f3c74f;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 17px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink);
  background: var(--red) url(texture.svg) repeat; background-size: 160px; }

.hero {
  position: relative; overflow: hidden; text-align: center; color: #fff;
  padding: 64px 20px 56px; text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.hero > * { position: relative; }
.kicker { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--gold); }
.hero h1 { margin: 10px 0 6px; font-size: clamp(34px, 8vw, 60px); line-height: 1.05; }
.date { margin: 0; font-size: 20px; }
.countdown { margin: 8px 0 22px; min-height: 1.5em; color: #ffe9b0; }

/* falling snow over the whole page: a fixed layer behind the content, two layers of dots
   drifting down at different speeds */
.snow { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.snow::before, .snow::after {
  content: ""; position: absolute; inset: -100% 0 0;
  background-image: radial-gradient(2px 2px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(3px 3px at 90px 120px, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 160px 60px, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 60px 170px, #fff 50%, transparent 51%);
  background-size: 200px 200px; opacity: .5; animation: snow 14s linear infinite;
}
.snow::after { background-size: 300px 300px; opacity: .7; animation-duration: 22s; }
@keyframes snow { to { transform: translateY(50%); } }
.hero, main, footer { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .snow::before, .snow::after { animation: none; } }

.button {
  display: inline-block; padding: 12px 26px; border-radius: 999px; font-weight: 600;
  background: var(--pine); color: #fff; text-decoration: none; text-shadow: none;
  border: 2px solid var(--gold); box-shadow: 0 3px 8px rgba(0, 0, 0, .3);
}
.button:hover { filter: brightness(1.1); }
.button.disabled { background: #9aa5ae; border-color: #c4ccd2; cursor: default; filter: none; box-shadow: none; }

main {
  max-width: 680px; margin: 0 auto; padding: 8px 28px 16px; background: var(--cream);
  border-radius: 14px; border: 6px solid var(--pine); box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}
@media (max-width: 720px) { main { margin: 0 10px; padding: 4px 18px 8px; } }
section { margin: 36px 0; }
h2 { font-size: 24px; margin: 0 0 10px; color: var(--pine); }
h2::before { content: "\2744\FE0E  "; color: var(--red); font-size: .8em; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dt { font-weight: 600; }
dd { margin: 0; }
ul { padding-left: 22px; }
.tbd { color: var(--muted); font-style: italic; background: #fff3cd; padding: 0 4px; border-radius: 3px; }
footer { text-align: center; color: #fff; padding: 24px 20px 40px; text-shadow: 0 1px 4px rgba(0, 0, 0, .4); }

/* Easter egg: advent calendar in the footer. 26 small doors (decorative; they wiggle when
   clicked) and a big door 27, the only one that opens. Opening: the door swings on its left
   hinge, then a foil-wrapped chocolate Santa springs forward toward the viewer (scales up
   from inside the compartment over the calendar) and wobbles. Closing reverses the order. */
footer p { margin: 0 0 24px; }
.calendar {
  position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  width: min(420px, 100%); margin: 0 auto; padding: 16px; border-radius: 8px;
  background: #17503a url(scene.svg) 0 0 / 100% 100%;
  box-shadow: 0 0 0 4px var(--gold), 0 0 0 9px #8e1621, 0 12px 30px rgba(0, 0, 0, .5);
  text-shadow: none;
}
/* Doors are die-cut into the picture: only the cut line and the number show. */
.cal-door {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 3px; cursor: default;
  font: 700 18px/1 Georgia, serif; color: #fff; user-select: none;
  text-shadow: 0 0 3px #000, 0 1px 2px #000;
  border: 1.5px solid rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), 0 0 0 1px rgba(0, 0, 0, .2);
}
.cal-door.nope { animation: nope .35s; }
@keyframes nope { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

.advent {
  position: relative; grid-column: 5 / span 2; grid-row: 4 / span 2;
  padding: 0; border: 0; background: none; cursor: pointer; perspective: 500px;
  -webkit-tap-highlight-color: transparent;
}
.advent .compartment {
  position: absolute; inset: 0; border-radius: 6px; background: #2a060b;
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, .8), 0 0 0 3px var(--gold);
}
.advent .door {
  position: absolute; inset: 0; z-index: 3; transform-origin: left center;
  transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3, .7, .4, 1) .35s;
}
/* front: red with a gold dashed "perforation"; back: plain cardboard */
.advent .num, .advent .door::after {
  position: absolute; inset: 0; border-radius: 6px; backface-visibility: hidden;
}
.advent .num {
  /* the door shows its own piece of the picture (size/offset set in app.js) */
  display: grid; place-items: center; background: #17503a url(scene.svg) no-repeat;
  box-shadow: 0 0 0 2px var(--gold), 0 3px 8px rgba(0, 0, 0, .45);
  outline: 1.5px dashed rgba(243, 199, 79, .9); outline-offset: -6px;
}
.advent .num b {
  display: grid; place-items: center; width: 56%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0464f, #8e1621); border: 3px solid var(--gold);
  font: 700 30px/1 Georgia, serif; color: var(--gold); text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .4);
}
.advent .door::after {
  content: ""; transform: rotateY(180deg); background: #d9c49a;
  box-shadow: 0 0 0 3px var(--gold), inset 0 0 10px rgba(0, 0, 0, .25);
}
.advent:hover .door { transform: rotateY(-14deg); }
.advent.open .door { transform: rotateY(-115deg); transition-delay: 0s; }

.advent .choc {
  position: absolute; left: 50%; top: 50%; z-index: 10; pointer-events: none;
  transform: translate(-50%, -50%) scale(.3); opacity: 0;
  transition: transform .3s ease-in, opacity 0s .3s;
}
.advent .wobble { display: block; transform-origin: 50% 90%; }
.advent .choc svg {
  display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4));
  transition: filter .3s;
}
.advent.open .choc {
  pointer-events: auto; opacity: 1; transform: translate(-78%, -62%) scale(1.25);
  transition: transform .6s cubic-bezier(.3, 1.7, .5, 1) .35s, opacity 0s .35s;
}
.advent.open .choc svg { filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .5)); transition-delay: .35s; }
.advent.open .wobble { animation: wobble 2.4s ease-in-out 1s infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.advent .bubble {
  position: absolute; left: -46px; top: -6px; white-space: nowrap; z-index: 1;
  background: #fff; color: var(--red); font: 700 13px/1 system-ui, sans-serif; padding: 6px 9px;
  border-radius: 12px; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); opacity: 0; transition: opacity .15s;
}
.advent .bubble::after {
  content: ""; position: absolute; right: 10px; top: 100%;
  border: 6px solid transparent; border-top-color: #fff; border-right-color: #fff;
}
.advent.open .bubble { opacity: 1; transition: opacity .2s 1s; }
.advent:focus-visible { outline: 3px solid #fff; outline-offset: 5px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .advent .door, .advent .choc, .advent .bubble, .advent .choc svg { transition: none !important; }
  .advent .wobble, .cal-door.nope { animation: none !important; }
}
