/* Sandbach Santa Sleigh. Visual system from Codex variation A, logo 01 and the asset kit. */

@font-face {
  font-family: "Lilita One";
  src: url("/fonts/LilitaOne-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito-Variable.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --cream: #FFF9ED;
  --warm: #FFF1D6;
  --evergreen: #183F35;
  --evergreen-soft: #3F5F55;
  --santa-red: #C5372D;
  --santa-red-dark: #A42A21;
  --mint: #DCEBD9;
  --mint-deep: #C7DFC5;
  --navy: #183447;
  --gold: #E3A93B;
  --line: rgba(24, 63, 53, 0.14);
  --radius: 20px;
  --radius-sm: 12px;
  --content: 1180px;
  --shadow: 0 10px 30px rgba(24, 63, 53, 0.12);
  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--evergreen);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 0.75rem; }
h1, h2, h3 { margin: 0; line-height: 1.05; }
button, input, select { font: inherit; color: inherit; }

.wrap { width: min(100% - 32px, var(--content)); margin-inline: auto; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--evergreen); color: #fff; padding: 0.6rem 1rem; border-radius: 999px;
  text-decoration: none; font-weight: 800;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- Type ---------- */

.display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.005em;
  font-size: clamp(2.5rem, 5.6vw, 4.6rem);
  line-height: 0.98;
}
.display--md { font-size: clamp(1.85rem, 3.2vw, 2.6rem); line-height: 1; }
.display--sm { font-size: 1.6rem; }
.red { color: var(--santa-red); }
.lede { font-size: clamp(1.1rem, 1.7vw, 1.3rem); font-weight: 750; margin: 0.8rem 0 0; }
.small { font-size: 0.92rem; color: var(--evergreen-soft); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.45rem;
  border-radius: 999px; border: 2px solid transparent;
  font-weight: 850; font-size: 1.05rem; line-height: 1.1;
  text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--red { background: var(--santa-red); color: #fff; box-shadow: 0 6px 16px rgba(197, 55, 45, 0.28); }
.btn--red:hover { background: var(--santa-red-dark); }
.btn--outline { border-color: var(--evergreen); color: var(--evergreen); background: rgba(255, 249, 237, 0.7); }
.btn--outline:hover { background: #fff; }
.btn--outline-light { border-color: #fff; color: #fff; background: transparent; }
.btn--outline-light:hover { background: rgba(255, 255, 255, 0.1); }
.btn--gold { background: var(--gold); color: var(--evergreen); box-shadow: 0 8px 20px rgba(24, 63, 53, 0.25); }
.btn--text { background: none; color: var(--evergreen); text-decoration: underline; padding-inline: 0.4rem; }
.btn--small { padding: 0.55rem 1rem; font-size: 0.95rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.4rem; }

/* ---------- Cards ---------- */

.card { border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); position: relative; }
.card--mint { background: var(--mint); }
.card--navy {
  color: #fff;
  background:
    radial-gradient(circle at 88% 18%, rgba(227, 169, 59, 0.38), transparent 32%),
    radial-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1.6px) 0 0 / 34px 34px,
    var(--navy);
  overflow: hidden;
}
.card--warm { background: var(--warm); border: 1px solid rgba(197, 55, 45, 0.12); overflow: hidden; }

/* ---------- Preview banner and notes ---------- */

.preview-banner {
  background: var(--gold); color: var(--evergreen);
  text-align: center; font-size: 0.92rem; font-weight: 700;
  padding: 0.45rem 16px;
}

/* While Santa's out: one line to Find Santa, across the top of every other page. */
.live-strip {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--santa-red); color: #fff; text-decoration: none;
  position: relative; z-index: 2;
  min-height: 2.9rem; padding: 0.7rem 16px; font-weight: 700; font-size: 1rem; line-height: 1.2;
  justify-content: center;
}
/* Trimmed to the capitals and baseline, so the words sit in the middle of the bar rather than low in it. */
.live-strip__text, .live-strip__go { text-box: trim-both cap alphabetic; }
/* Room inside the clip for the g's and y's the trim leaves outside, given back so the line stays centred. */
.live-strip__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-block: 0.3em; margin-block: -0.3em; }
.live-strip__go { flex: none; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.live-strip__dot {
  flex: none; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #fff;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .live-strip__dot { animation: none; } }
@media (max-width: 480px) { .live-strip__follow { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }

.preview-note {
  border: 2px dashed var(--gold); background: rgba(227, 169, 59, 0.14);
  border-radius: var(--radius-sm); padding: 0.55rem 0.8rem;
  font-size: 0.92rem;
}

.notice {
  display: inline-block; margin-top: 1rem;
  background: var(--warm); border-left: 4px solid var(--gold);
  padding: 0.6rem 0.9rem; border-radius: 8px; font-weight: 650;
}

/* ---------- Header ---------- */

.site-header { position: relative; z-index: 20; }
.site-header__inner {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center;
  column-gap: 1.25rem; row-gap: 0.6rem; padding-block: 0.9rem;
}
.brand { display: block; flex: none; }
/* The sleigh's own logo is white artwork made for red paint, so on cream it sits on a red badge. */
.brand__badge { display: block; background: var(--santa-red); border-radius: 14px; padding: 7px 12px; box-shadow: 0 4px 14px rgba(197, 55, 45, 0.25); }
.brand__badge img { height: 58px; width: auto; }
.brand__icon { display: none; width: 48px; height: 48px; }
.site-nav { display: flex; align-items: center; justify-content: flex-end; gap: clamp(0.6rem, 2.5vw, 2rem); }

/* The Partnership's credit: a supporter's mark beside ours, set apart by a rule and its own label. */
.supporter {
  display: flex; align-items: center; gap: 0.6rem; margin: 0;
  padding-left: 1.25rem; border-left: 1px solid var(--line);
  color: inherit; text-decoration: none;
}
.supporter__label {
  font-size: 0.72rem; font-weight: 850; line-height: 1.15;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--evergreen-soft);
  max-width: 5.5em;
}
.supporter img { height: 44px; width: auto; max-width: none; }
.brand__icon { max-width: none; }

/* On narrower screens the mark stays beside ours and its label goes; the rule still keeps the two apart. */
@media (max-width: 900px) {
  .supporter { padding-left: 0.9rem; }
  .supporter__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .supporter img { height: 38px; }
}
.site-nav a { white-space: nowrap; }
/* The game's link only fits the header on wider screens; phones find it on the home page instead. */
@media (max-width: 720px) { .site-nav__wide { display: none; } }
.site-nav a:not(.btn) { font-weight: 800; text-decoration: none; padding: 0.4rem 0.1rem; border-bottom: 3px solid transparent; }
.site-nav a:not(.btn):hover,
.site-nav a[aria-current="page"] { border-bottom-color: var(--santa-red); }

@media (max-width: 560px) {
  .brand__badge img { height: 46px; }
}

@media (max-width: 520px) {
  .brand__badge { display: none; }
  .brand__icon { display: block; }
  /* Phones get the Partnership's symbol without its name: there's no room to read the words at this size. */
  .site-header__inner { column-gap: 0.5rem; }
  .brand__icon { width: 44px; height: 44px; }
  .supporter { padding-left: 0.5rem; }
  .supporter img { height: 34px; }
  .site-nav { gap: 0.6rem; }
}
/* Narrower than that, even the symbol would push Donate off the edge (Chrome sets the nav wider than Safari);
   the footer still credits them. */
@media (max-width: 389px) {
  .supporter { display: none; }
}

/* ---------- Hero (home) ---------- */

.hero__game {
  display: inline-block; margin-top: 0.9rem;
  font-weight: 850; color: var(--evergreen); text-decoration: underline;
  text-decoration-color: rgba(24, 63, 53, 0.3); text-decoration-thickness: 1px; text-underline-offset: 5px;
}
.hero__game:hover { text-decoration-color: var(--santa-red); }
.hero__game .icon { width: 1rem; height: 1rem; vertical-align: -0.15em; margin-left: 0.2rem; }

.hero { position: relative; max-width: 1600px; margin: -0.5rem auto 0; }
/* The hero tucks under the header, but not under the live strip. */
body:has(.live-strip:not([hidden])) .hero { margin-top: 0; }
.hero__art img { width: 100%; height: auto; }
.hero__art::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 18%;
  background: linear-gradient(to bottom, rgba(255, 249, 237, 0), var(--cream));
  pointer-events: none;
}
.hero__copy {
  position: absolute; top: clamp(1rem, 3.5vw, 3.2rem);
  left: max(16px, calc((100% - var(--content)) / 2));
  width: min(46%, 560px);
}
.hero__title { font-size: clamp(2.6rem, 5.4vw, 5rem); }
.hero__title .red { white-space: nowrap; }

@media (max-width: 860px) {
  .hero { margin-top: 0; display: flex; flex-direction: column-reverse; }
  .hero__copy { position: static; width: auto; padding: 0.5rem 16px 1.25rem; }
  .hero__art { display: block; overflow: hidden; aspect-ratio: 4 / 3; }
  .hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 100%; transform: scale(1.4); transform-origin: 68% 96%; }
}

/* ---------- Where is Santa (home) ---------- */

.where { position: relative; z-index: 2; margin-top: clamp(-5.5rem, -6vw, -1rem); }
.where__card { padding: clamp(1rem, 2.4vw, 1.6rem); box-shadow: var(--shadow); }
.where__head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.where__pin { width: 44px; flex: none; }
.where__text { flex: 1; min-width: 0; }
.where__open { flex: none; }
.where__map { height: clamp(300px, 42vw, 500px); }

@media (max-width: 640px) {
  .where { margin-top: 0; }
  .where__head { flex-wrap: wrap; }
  .where__open { order: 3; width: 100%; }
}

.status.status--compact { display: block; }
.status--compact .status__headline { font-weight: 850; font-size: 1.15rem; margin: 0.35rem 0 0.1rem; }
.status--compact .status__detail { margin: 0; color: var(--evergreen-soft); font-weight: 650; }
.status--compact .status__updated { margin: 0.2rem 0 0; }

/* ---------- Maps ---------- */

.map {
  position: relative; overflow: hidden;
  border-radius: calc(var(--radius) - 6px);
  background: var(--mint-deep);
  isolation: isolate;
}
.map__fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 2rem; text-align: center; font-weight: 700; }
.map .maplibregl-ctrl-group { border-radius: 12px; box-shadow: 0 2px 10px rgba(24, 63, 53, 0.18); }
.map .maplibregl-ctrl-attrib { font-size: 11px; }
/* The visitor's own spot: a small house where they tapped, under Santa's pin. */
.spot-pin { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #E3A93B; color: var(--evergreen); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(24, 63, 53, 0.35); }
.maplibregl-canvas.is-picking { cursor: crosshair; }
/* Sits close under the street picker it belongs to, closer than the panel's own gap. */
.spot { display: grid; gap: 0.5rem; margin-top: -0.4rem; }
.spot__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.santa-pin { width: 48px; height: 58px; filter: drop-shadow(0 4px 6px rgba(24, 63, 53, 0.35)); }
.santa-pin img { width: 48px; height: 58px; }
/* Parked at a stop: a ring spreads from where he's standing, again and again. */
.santa-pin--parked::before {
  content: ""; position: absolute; left: 50%; bottom: -14px; z-index: -1;
  width: 56px; height: 28px; margin-left: -28px; border-radius: 50%;
  border: 3px solid #E3A93B; background: rgba(227, 169, 59, 0.25);
  animation: parked-ring 1.8s ease-out infinite;
}
@keyframes parked-ring { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.is-parked [data-status-pin] { animation: parked-glow 1.8s ease-in-out infinite; }
@keyframes parked-glow { 50% { filter: drop-shadow(0 0 8px rgba(227, 169, 59, 0.95)); } }
@media (prefers-reduced-motion: reduce) { .santa-pin--parked::before, .is-parked [data-status-pin] { animation: none; } }
.map-overlay { position: absolute; top: 10px; left: 10px; z-index: 2; display: grid; gap: 8px; justify-items: start; }
.map-overlay[hidden] { display: none; }
.map-view, .map-legend {
  display: flex; border-radius: 12px; background: rgba(255, 249, 237, 0.94); box-shadow: 0 2px 10px rgba(24, 63, 53, 0.18);
  font-size: 13px; font-weight: 700; color: #183F35;
}
.map-view { padding: 3px; gap: 2px; }
.map-view button {
  border: 0; border-radius: 9px; padding: 6px 11px; background: transparent; color: inherit;
  font: inherit; cursor: pointer;
}
.map-view button[aria-pressed="true"] { background: #183F35; color: #fff; }
.map-legend { gap: 12px; padding: 6px 10px; pointer-events: none; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend span::before { content: ""; width: 18px; height: 0; border-top: 4px solid #2E7D4F; border-radius: 2px; }
.map-legend__ahead::before { border-top-style: dotted !important; border-top-color: #C5372D !important; }

/* ---------- Duo cards (home) ---------- */

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 2.5vw, 1.75rem); margin-top: clamp(1rem, 2.5vw, 1.75rem); }
@media (max-width: 820px) { .duo { grid-template-columns: 1fr; } }

.street-card { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; min-height: 320px; }
.street-card__sub { font-weight: 700; opacity: 0.9; margin: 0; }
.street-card .search { width: 100%; }

.donate-card { display: flex; align-items: flex-end; gap: 1rem; min-height: 320px; }
.donate-card__text { flex: 1; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; }
.donate-card__text .btn { margin-top: 0.4rem; }
.donate-card__gifts { width: min(40%, 240px); flex: none; align-self: flex-end; margin: 0 -0.5rem -0.5rem 0; }

@media (max-width: 480px) {
  .donate-card { flex-direction: column; align-items: stretch; }
  .donate-card__gifts { width: 150px; align-self: flex-end; margin-top: -3rem; }
}

/* ---------- Where the donations go (home) ---------- */

/* The sleigh game, on the home page. */
.game-promo { margin-top: clamp(1rem, 2.5vw, 1.75rem); }
.game-promo__card {
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; overflow: hidden;
  border-radius: var(--radius); background: #0b1828; color: #f6f1e6;
}
.game-promo__picture { display: block; height: 100%; }
.game-promo__picture img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.game-promo__text { padding: clamp(1.25rem, 3.5vw, 2.25rem); display: grid; gap: 0.75rem; justify-items: start; }
.game-promo__text h2 { color: var(--gold); margin: 0; }
.game-promo__text p { margin: 0; }
.game-promo__kicker { font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: #b9c4cc; }
@media (max-width: 820px) { .game-promo__card { grid-template-columns: 1fr; } }

.giving { margin-top: clamp(2rem, 5vw, 3.5rem); display: grid; justify-items: start; gap: 1rem; }
.giving .lede { margin: 0; }
.giving__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 2.5vw, 1.75rem); width: 100%; margin: 0.5rem 0; }
.giving__item { border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 1.75rem); display: grid; gap: 0.5rem; align-content: start; }
.giving__item h3 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; }
.giving__item p { margin: 0; }
.giving__item--sleigh { background: var(--mint); }
.giving__item--sleigh img { width: 64px; height: 64px; }
.giving__item--groups { background: var(--warm); border: 1px solid rgba(197, 55, 45, 0.12); }
.giving__icon { width: 64px; height: 64px; border-radius: 14px; background: var(--santa-red); color: #fff; display: grid; place-items: center; }
.giving__icon .icon { width: 34px; height: 34px; }
@media (max-width: 720px) { .giving__grid { grid-template-columns: 1fr; } }

/* ---------- Street search ---------- */

.search { position: relative; }
.search__label { display: block; font-weight: 850; font-size: 1.15rem; margin-bottom: 0.5rem; }
.search__box { position: relative; }
.search__icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--evergreen-soft); display: flex; }
.search input {
  width: 100%; padding: 0.85rem 1rem 0.85rem 2.8rem;
  border-radius: 999px; border: 2px solid var(--line); background: #fff;
  font-weight: 650; color: var(--evergreen);
}
.search input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.search__box:has(.search__locate:not([hidden])) input { padding-right: 7.2rem; }
.search__locate {
  position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.8rem;
  border: 0; border-radius: 999px; background: var(--evergreen); color: #fff;
  font: inherit; font-size: 0.9rem; font-weight: 800; cursor: pointer;
}
.search__locate svg { width: 1rem; height: 1rem; }
.search__locate:disabled { opacity: 0.6; cursor: progress; }
.search__locate:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.search__results { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.search__results:empty { display: none; }
.search__results > li > a, .search__results .search__empty {
  display: block; padding: 0.65rem 0.9rem; border-radius: var(--radius-sm);
  background: #fff; color: var(--evergreen); text-decoration: none;
}
.search__results > li > a:hover { box-shadow: 0 0 0 2px var(--santa-red) inset; }
.search__results > li > a strong { display: block; }
.search__results > li > a span { font-size: 0.92rem; color: var(--evergreen-soft); }
/* Nights Santa has already done: still listed, so people know he came, but quieter than the ones to come. */
.search__results > li.search__done > a { opacity: 0.7; }
/* The "not found" line is a sentence, so its link and bold words stay in it. */
.search__results .search__empty { line-height: 1.5; }
.search__empty a { color: var(--santa-red); font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.search--light .search__results > li > a, .search--light .search__results .search__empty { background: rgba(255, 255, 255, 0.95); }
/* The quiet donate line under what was found: a sentence, not another result. */
.search__results .search__give { padding: 0.15rem 0.9rem 0; font-size: 0.9rem; line-height: 1.5; }
.search__results > li.search__give > a {
  display: inline; padding: 0; border-radius: 0; background: none; box-shadow: none;
  color: var(--santa-red); font-weight: 750; text-decoration: underline; text-underline-offset: 3px;
}
.search--light .search__give { color: rgba(255, 255, 255, 0.9); }
.search--light .search__results > li.search__give > a { color: #fff; background: none; }

/* ---------- Page heads ---------- */

.page-head { padding-block: clamp(1.5rem, 4vw, 3rem) 1.5rem; }
.page-head .search { margin-top: 1.5rem; max-width: 720px; }

/* ---------- Find Santa ---------- */

.tracker-head { overflow: hidden; }
.tracker-head__inner { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: end; gap: 1rem; }
.tracker-head__text { padding-block: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 2vw, 1.75rem); }
.tracker-head .display .red { display: block; }
.tracker-head__art { align-self: stretch; }
.tracker-head__art img {
  height: 100%; max-height: 260px; width: 100%; object-fit: cover; object-position: 85% 85%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 30%);
  mask-image: linear-gradient(to right, transparent, #000 30%);
}
@media (max-width: 760px) {
  .tracker-head__inner { grid-template-columns: 1fr; }
  .tracker-head__art { display: none; }
  .tracker-head__text { padding-block: 0.25rem 0.9rem; }
  .tracker-head .display { font-size: 2.1rem; }
  .tracker-head .lede { display: none; }
}

/* While Santa is out (find-santa.js sets .santa-out) the heading shrinks to one line above the map. */
.santa-out .tracker-head__inner { grid-template-columns: 1fr; }
.santa-out .tracker-head__art, .santa-out .tracker-head .lede { display: none; }
.santa-out .tracker-head__text { padding-block: 0.4rem 0.6rem; }
.santa-out .tracker-head .display { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.santa-out .tracker-head .display .red { display: inline; }

.tracker { padding-bottom: 2rem; }
.tracker__card {
  display: grid; grid-template-columns: 360px 1fr; gap: 1rem;
  padding: clamp(0.75rem, 1.6vw, 1rem); box-shadow: var(--shadow);
}
.tracker { --tracker-h: 620px; }
/* While he's out the map fills the window below the header (--tracker-top, measured by find-santa.js), so he's never below the fold. */
.santa-out .tracker { --tracker-h: clamp(440px, calc(100svh - var(--tracker-top, 200px) - 3rem), 780px); }
.tracker__map { order: 2; height: var(--tracker-h); }

.panel {
  order: 1; background: var(--cream); border-radius: calc(var(--radius) - 6px);
  padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem;
  max-height: var(--tracker-h); overflow: auto;
}
.panel__handle { display: none; }
.panel__more { display: flex; flex-direction: column; gap: 0.9rem; }
.panel__title { font-size: 1.05rem; font-weight: 850; margin-top: 0.4rem; }

.status { display: flex; gap: 0.9rem; align-items: flex-start; }
.status__pin { width: 44px; flex: none; }
.status .status__headline { font-family: var(--display); font-weight: 400; font-size: 1.65rem; line-height: 1.05; margin-bottom: 0.35rem; }
.status__detail { margin: 0; }
.status__street { margin: 0.5rem 0 0; font-weight: 850; color: var(--santa-red); font-size: 1.1rem; }
.status__updated { margin: 0.35rem 0 0; font-size: 0.88rem; color: var(--evergreen-soft); }
/* On a static night: directions to where he is parked, or to the stop he is driving to. */
.status__directions { margin-top: 0.6rem; }

/* Asking for a donation once he's been by: a warm note under the status, never in the way of the map. It sticks to
   the bottom of the panel, so on a phone it shows in the half-open sheet however long the status above it runs. */
.donate-nudge {
  position: sticky; bottom: 0; z-index: 1; box-shadow: 0 -6px 14px var(--cream);
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-top: 0.8rem; padding: 0.6rem 0.6rem 0.6rem 0.85rem;
  background: var(--warm); border-left: 4px solid var(--santa-red); border-radius: var(--radius-sm);
}
.donate-nudge p { margin: 0; font-weight: 750; line-height: 1.3; }
.donate-nudge .btn { flex: none; }
/* The game, offered while people wait for Santa: like the donate nudge, quieter. */
.game-nudge { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); background: rgba(24, 63, 53, 0.08); }
.game-nudge[hidden] { display: none; }
.game-nudge p { margin: 0; font-weight: 750; line-height: 1.3; }
.game-nudge .btn { flex: none; }
[data-tone="stale"] .status__updated, [data-tone="offline"] .status__updated { color: #8A5A00; font-weight: 700; }

.progress { display: grid; gap: 0.35rem; }
.progress__track { height: 10px; border-radius: 999px; background: var(--mint); overflow: hidden; }
.progress__bar { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--santa-red), #E25A48); transition: width 0.6s ease; }
.progress__label { font-size: 0.88rem; font-weight: 700; color: var(--evergreen-soft); }

.field { display: grid; gap: 0.35rem; }
.field__label { font-weight: 850; }
.field select {
  width: 100%; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: #fff; font-weight: 650;
}

.hint { margin: 0; font-size: 0.92rem; color: var(--evergreen-soft); }

.street-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.street-list li {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 0.6rem; border-radius: 10px; font-weight: 650;
}
.street-list li::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none;
  border: 2px solid var(--evergreen-soft); background: transparent;
}
.street-list li.is-done { color: var(--evergreen-soft); text-decoration: line-through; text-decoration-color: rgba(24, 63, 53, 0.35); }
.street-list li.is-done::before { background: var(--evergreen-soft); }
.street-list li.is-current { background: #fff; color: var(--santa-red); font-weight: 850; box-shadow: 0 2px 8px rgba(24, 63, 53, 0.08); }
.street-list li.is-current::before { border-color: var(--santa-red); background: var(--santa-red); box-shadow: 0 0 0 4px rgba(197, 55, 45, 0.18); }
.street-list li.is-mine::after { content: "Your street"; margin-left: auto; flex: none; white-space: nowrap; line-height: 1.5; font-size: 0.75rem; font-weight: 850; color: var(--evergreen); background: var(--gold); padding: 0.1rem 0.6rem; border-radius: 999px; }

@media (max-width: 900px) {
  .tracker { width: 100%; padding-bottom: 0; }
  .tracker__card { display: block; position: relative; padding: 0; border-radius: 0; box-shadow: none; }
  /* --tracker-top is measured by find-santa.js, so the map and sheet end at the bottom of the screen. */
  .tracker__map { min-height: 0; height: max(440px, calc(100svh - var(--tracker-top, 120px))); border-radius: 0; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
    max-height: 44%; border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -8px 30px rgba(24, 63, 53, 0.2);
    padding-top: 1.6rem; padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); transition: max-height 0.3s ease;
    /* A swipe that runs off the end of the list stops here, rather than dragging the page and the map with it. */
    overscroll-behavior: contain; touch-action: pan-y;
  }
  .panel.is-open { max-height: 86%; }
  .panel__handle {
    display: block; position: absolute; top: 0; left: 0; right: 0; height: 1.6rem;
    border: 0; background: transparent; cursor: pointer;
  }
  .panel__handle::before {
    content: ""; position: absolute; left: 50%; top: 0.6rem; transform: translateX(-50%);
    width: 44px; height: 5px; border-radius: 999px; background: var(--line);
  }
  .page-tracker .site-footer { display: none; }
  /* The map and sheet fill the screen, so the page itself has nothing to scroll or bounce. */
  html:has(.page-tracker), .page-tracker { overscroll-behavior-y: none; }
}

/* ---------- Routes page ---------- */

.nights { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 1.25rem; padding-bottom: 3rem; align-items: start; }
.night { background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.5rem; scroll-margin-top: 1rem; }
.night:target { box-shadow: 0 0 0 3px var(--gold); }
.night__when { margin: 0; font-weight: 850; color: var(--santa-red); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem; }
.night__host { font-family: var(--display); font-weight: 400; font-size: 1.7rem; }
.night__area { margin: 0; font-weight: 700; color: var(--evergreen-soft); }
.chips { list-style: none; margin: 0.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { background: var(--mint); border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.88rem; font-weight: 700; }
.night__nearby { margin-top: 0.6rem; }
.night__nearby summary { cursor: pointer; font-weight: 800; color: var(--evergreen-soft); font-size: 0.92rem; }
.night__nearby summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.night__nearby .chips { margin-top: 0.5rem; }
/* Finished sleigh rides fold away below the rest, so the first card is always tonight's or the next. */
.nights__past { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1.25rem; }
.nights__past summary { cursor: pointer; font-family: var(--display); font-size: 1.5rem; color: var(--evergreen); }
.nights__past summary span { font-family: var(--body); font-size: 1rem; color: var(--evergreen-soft); }
.nights__past summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.nights__past-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 1.25rem; margin-top: 1rem; align-items: start; }
.nights__past .night { background: var(--cream); }
.chips--quiet .chip { background: transparent; box-shadow: 0 0 0 1px var(--line) inset; font-weight: 600; }
.night__actions { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: auto; padding-top: 0.6rem; flex-wrap: wrap; }
.night__nomap { font-weight: 750; color: var(--evergreen-soft); }
.night__link { font-size: 0.88rem; color: var(--evergreen-soft); }
.night__map { height: 300px; margin-top: 0.4rem; }
.night__static { margin: 0; color: var(--evergreen-soft); }
.night__half { margin: 0.4rem 0 0; font-size: 0.95rem; font-weight: 850; }
.stops { margin: 0; padding-left: 1.4rem; display: grid; gap: 0.2rem; }
.stops span { display: block; color: var(--evergreen-soft); }

/* ---------- Footer ---------- */

.site-footer { margin-top: clamp(2rem, 5vw, 4rem); background: var(--evergreen); color: #fff; padding-block: 2rem 1.5rem; }
.partners { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.partners__title { font-family: var(--body); font-size: 0.85rem; font-weight: 850; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }
.partners__logo { background: #fff; border-radius: var(--radius-sm); padding: 0.4rem 0.8rem; }
.partners__logo img { width: 170px; }
.site-footer__bottom { display: flex; align-items: center; gap: 1rem; padding-top: 1.5rem; flex-wrap: wrap; }
.site-footer__bottom p { margin: 0; flex: 1; min-width: 220px; }
.site-footer__logo { width: 183px; height: auto; }
.site-footer__social { font-weight: 800; }
.site-footer__small { margin: 1.25rem 0 0; font-size: 0.8rem; opacity: 0.75; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Ask for a street ---------- */

.ask { padding-block: 1rem 3rem; }
.ask__card { max-width: 720px; display: grid; gap: 0.5rem; padding: clamp(1.25rem, 4vw, 2rem); }
.ask__card h2 { margin: 0; }
.ask__card > p { margin: 0 0 0.5rem; }
.ask__label { font-weight: 850; margin-top: 0.4rem; }
.ask__label span { font-weight: 600; color: var(--evergreen-soft); }
.ask__card input, .ask__card textarea {
  width: 100%; padding: 0.75rem 1rem; border-radius: var(--radius-sm); border: 2px solid var(--line);
  background: #fff; font: inherit; font-weight: 600; color: var(--evergreen); resize: vertical;
}
.ask__card input:focus-visible, .ask__card textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.ask__small { font-size: 0.88rem; color: var(--evergreen-soft); }
.ask__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ask__card .btn { justify-self: start; margin-top: 0.4rem; }
.ask__result { margin: 0; font-weight: 750; }
.ask__result:empty { display: none; }
.ask__result.is-problem { color: var(--santa-red-dark); }
.ask__card { position: relative; }
