/* CliffTracker: a snowy night in the neighbourhood. */

:root {
  --night: #0b1a33;
  --night-2: #12284d;
  --card: #fffaf0;
  --card-ink: #2a1d14;
  --muted: #6b5a4a;
  --red: #c8102e;
  --red-dark: #8f0b20;
  --green: #1e6b3a;
  --green-light: #2f9455;
  --gold: #f2c14e;
  --snow: #f4f8ff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-display: "Mountains of Christmas", "Comic Sans MS", cursive;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-script: "Dancing Script", "Brush Script MT", cursive;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--snow);
  background:
    radial-gradient(ellipse at 20% -10%, #24467e 0%, transparent 55%),
    radial-gradient(ellipse at 90% 10%, #1b3a6b 0%, transparent 45%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 70%, #1a3560 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

a { color: var(--gold); }

#snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* ---- String of fairy lights across the top ---- */
.lights {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  height: 44px;
  padding: 0 6px;
  margin: 0;
  list-style: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 22px at 50% 0, transparent 20px, #2b3a2b 21px, #2b3a2b 23px, transparent 24px) repeat-x;
  background-size: 52px 30px;
}
.lights li {
  position: relative;
  flex: 0 0 auto;
  width: 12px;
  height: 22px;
  margin-top: 14px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 4px 18px 3px var(--c);
  animation: twinkle 2.4s infinite ease-in-out;
}
.lights li::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 3px;
  width: 6px;
  height: 7px;
  border-radius: 2px;
  background: #3a3a3a;
}
.lights li:nth-child(4n + 1) { --c: #ff4d5e; }
.lights li:nth-child(4n + 2) { --c: #ffd447; animation-delay: 0.6s; }
.lights li:nth-child(4n + 3) { --c: #4de38a; animation-delay: 1.2s; }
.lights li:nth-child(4n + 4) { --c: #5bc8ff; animation-delay: 1.8s; }
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; box-shadow: 0 4px 8px 0 var(--c); }
}

/* ---- Header ---- */
.site-header {
  text-align: center;
  padding: 18px 0 8px;
}
.site-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 9vw, 4.6rem);
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 18px rgba(242, 193, 78, 0.55), 0 3px 0 var(--red-dark);
}
.site-header h1 a { color: inherit; text-decoration: none; }
.site-header .tagline {
  margin: 8px 0 0;
  font-size: 1.05rem;
  color: #cfe0ff;
}

/* ---- Cards ---- */
.card {
  background: var(--card);
  color: var(--card-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-top: 22px;
  position: relative;
}
.card h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.1;
  color: var(--red);
}
.card.candy {
  border: 6px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    repeating-linear-gradient(45deg, var(--red) 0 14px, #fff 14px 28px) border-box;
}

/* ---- Tonight's spot ---- */
.tonight {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}
.tonight .elf {
  width: 90px;
  height: 90px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
  animation: bob 3s infinite ease-in-out;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-6px) rotate(4deg); }
}
.tonight .label {
  margin: 0;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--green);
}
.tonight .street {
  margin: 2px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.05;
  color: var(--red);
  overflow-wrap: anywhere;
}
.tonight .meta { margin: 0; color: var(--muted); }
.tonight .note {
  margin: 10px 0 0;
  padding: 10px 14px;
  background: #fff1d6;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
}

.countdown {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  margin-top: 18px;
  color: #dce8ff;
  text-align: center;
}
.countdown strong {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--gold);
}

/* ---- Map ---- */
.map-wrap {
  margin-top: 22px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 4px solid var(--gold);
}
#map {
  height: min(60vh, 520px);
  min-height: 320px;
  background: #dfe7f2;
}
.elf-pin {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 6px rgba(242, 193, 78, 0.35), 0 6px 14px rgba(0, 0, 0, 0.4);
  animation: glow 2s infinite ease-in-out;
}
.elf-pin img { width: 50px; height: 50px; }
.mini-cliff { width: 1.5em; height: 1.5em; vertical-align: -0.35em; }

/* ---- Meet Cliff ---- */
.meet {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}
.meet-art {
  display: block;
  width: 100%;
  max-width: 190px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25));
}
.meet-text p { margin: 0 0 10px; font-size: 1.1rem; }

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(242, 193, 78, 0.3), 0 6px 14px rgba(0, 0, 0, 0.4); }
  50% { box-shadow: 0 0 0 14px rgba(242, 193, 78, 0), 0 6px 14px rgba(0, 0, 0, 0.4); }
}
.trail-pin {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: 14px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid #fff;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.leaflet-popup-content { font-family: var(--font-body); font-size: 15px; }
.leaflet-popup-content strong { color: var(--red); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #e0233f, var(--red-dark));
  box-shadow: 0 4px 0 #5e0715, 0 8px 18px rgba(0, 0, 0, 0.3);
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #5e0715; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn.green { background: linear-gradient(180deg, var(--green-light), var(--green)); box-shadow: 0 4px 0 #0f3d20, 0 8px 18px rgba(0, 0, 0, 0.3); }
.btn.ghost { background: transparent; color: var(--card-ink); box-shadow: inset 0 0 0 2px #d8c8b4; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 0.95rem; }
.btn[disabled] { opacity: 0.6; cursor: wait; }

.santa-cta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}
.santa-cta .big-emoji { font-size: 3.6rem; line-height: 1; }
.santa-cta p { margin: 0 0 12px; }

/* ---- Trail list ---- */
.trail { list-style: none; margin: 0; padding: 0; }
.trail li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed #e2d4c0;
}
.trail li:last-child { border-bottom: 0; }
.trail .night {
  flex: 0 0 auto;
  min-width: 7.5em;
  font-weight: 800;
  color: var(--green);
}
.trail .where { font-weight: 700; overflow-wrap: anywhere; }
.trail button {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--red);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.empty { color: var(--muted); font-style: italic; }

.site-footer {
  margin-top: 30px;
  text-align: center;
  font-size: 0.95rem;
  color: #b9cbe8;
}
.site-footer p { margin: 6px 0; }

/* ---- Forms ---- */
label { display: block; font-weight: 800; margin: 12px 0 4px; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
input, textarea, select {
  width: 100%;
  font: inherit;
  padding: 11px 13px;
  border: 2px solid #ddcdb6;
  border-radius: 12px;
  background: #fff;
  color: var(--card-ink);
}
input:focus, textarea:focus { outline: none; border-color: var(--green-light); box-shadow: 0 0 0 3px rgba(47, 148, 85, 0.2); }
textarea { resize: vertical; min-height: 84px; }
.row { display: grid; grid-template-columns: 1fr 110px; gap: 12px; }
.error { color: var(--red); font-weight: 700; min-height: 1.4em; margin: 10px 0 0; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .card { padding: 18px; }
  .tonight { grid-template-columns: 1fr; text-align: center; gap: 6px; }
  .santa-cta { grid-template-columns: 1fr; text-align: center; }
  .meet { grid-template-columns: 1fr; text-align: center; }
  .tonight .elf { margin: 0 auto; }
  .trail .night { min-width: 6.5em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
