:root {
  --night-0: #050a18;
  --night-1: #0a1430;
  --night-2: #13254a;
  --ink: #eef3ff;
  --muted: #a8b6d6;
  --gold: #f2c46d;
  --gold-2: #d9a441;
  --red: #e2453c;
  --green: #6bb792;
  --card: rgba(255, 255, 255, .055);
  --card-2: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .12);
  --radius: 20px;
  --serif: "Noto Serif Display", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--night-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; background:
    radial-gradient(45% 30% at 12% 2%, rgba(31, 214, 160, .16), transparent 70%),
    radial-gradient(50% 32% at 92% 6%, rgba(91, 108, 255, .16), transparent 70%),
    radial-gradient(40% 30% at 50% 20%, rgba(194, 81, 255, .07), transparent 70%),
    radial-gradient(120% 80% at 50% 0%, var(--night-2) 0%, var(--night-1) 45%, var(--night-0) 100%);
}

button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 10px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- background layers ---------- */
#sky, .sky-stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

header, main, footer { position: relative; z-index: 1; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1180px; margin: 0 auto; padding: 18px 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { font-size: 1.4rem; filter: drop-shadow(0 0 10px rgba(107, 183, 146, .6)); }
.brand .dim { color: var(--muted); font-weight: 500; }
.toggles { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(20, 32, 64, .85); font-size: .85rem; font-weight: 600;
  transition: background .2s, transform .15s;
}
.chip:hover { background: var(--card-2); }
.chip:active { transform: scale(.96); }
.chip.off .ico, .chip[aria-pressed="false"] .ico { filter: grayscale(1); opacity: .6; }

/* ---------- hero ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center;
  min-height: calc(100vh - 80px); padding: 10px 0 40px;
}

.globe-stage { display: flex; flex-direction: column; align-items: center; }
.globe-wrap {
  width: min(460px, 100%); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  will-change: transform; border-radius: 50% 50% 18px 18px;
}
.globe-wrap:active { cursor: grabbing; }
#globe { display: block; width: 100%; height: auto; aspect-ratio: 440 / 520; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .9rem; animation: nudge 3s ease-in-out 4; }
@keyframes nudge { 0%, 100% { transform: translateY(0); opacity: .75; } 50% { transform: translateY(-3px); opacity: 1; } }

.countdown-panel { display: flex; flex-direction: column; gap: 22px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; font-weight: 700; color: var(--green); }
.title { margin: 0; font-family: var(--sans); font-weight: 800; font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.02; letter-spacing: -.03em; }
.title em {
  display: block; font-family: var(--serif); font-weight: 700; font-style: italic; letter-spacing: -.01em;
  background: linear-gradient(100deg, #ffe6a6 0%, var(--gold) 40%, #ff9a7a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.title.big { font-size: clamp(2.8rem, 7vw, 5rem); }
.title { overflow-wrap: anywhere; }
.lead { font-size: 1.15rem; color: var(--muted); margin: 10px 0 0; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.tile {
  position: relative; padding: 18px 8px 14px; border-radius: var(--radius); text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 20px 40px -20px rgba(0, 0, 0, .6);
  overflow: hidden;
}
.tile:first-child { background: linear-gradient(180deg, rgba(226, 69, 60, .35), rgba(226, 69, 60, .1)); border-color: rgba(255, 140, 120, .35); }
.tile::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .25); }
.val {
  position: relative; height: 1.1em; overflow: hidden;
  font-size: clamp(2rem, 4.4vw, 3.4rem); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.roll { position: absolute; inset: 0; display: block; }
.roll.out { animation: rollOut .42s cubic-bezier(.5, 0, .3, 1) forwards; }
.roll.in { animation: rollIn .42s cubic-bezier(.5, 0, .3, 1) forwards; }
@keyframes rollOut { to { transform: translateY(-100%); opacity: 0; } }
@keyframes rollIn { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.unit { margin-top: 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; }

.sleeps { margin: 14px 0 0; color: var(--muted); font-weight: 600; }

.banner {
  margin: 0; padding: 14px 18px; border-radius: 14px; font-weight: 700;
  background: linear-gradient(90deg, rgba(226, 69, 60, .35), rgba(242, 196, 109, .25)); border: 1px solid rgba(242, 196, 109, .4);
  animation: glow 2.4s ease-in-out 5;
}
@keyframes glow { 50% { box-shadow: 0 0 30px rgba(242, 196, 109, .35); } }

.spirit-head { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.spirit-head span:last-child { color: var(--gold); font-variant-numeric: tabular-nums; }
.spirit-bar { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; border: 1px solid var(--line); }
.spirit-bar span {
  display: block; height: 100%; border-radius: inherit; transition: width 1s linear;
  position: relative; overflow: hidden; box-shadow: 0 0 16px rgba(226, 69, 60, .6);
}
.spirit-bar span::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -28.28px; right: 0;
  background: repeating-linear-gradient(-45deg, var(--red) 0 10px, #fff 10px 20px);
  animation: candy 1.2s linear 5;
}
@keyframes candy { to { transform: translateX(28.28px); } }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 14px; border: 1px solid var(--line);
  font-weight: 700; transition: transform .15s, background .2s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, #f05a4f, #c7322a); border-color: rgba(255, 160, 140, .4); box-shadow: 0 10px 24px -10px rgba(226, 69, 60, .8); }
.btn.primary:hover { box-shadow: 0 14px 30px -10px rgba(226, 69, 60, 1); }
.btn.ghost { background: var(--card); }
.btn.ghost:hover { background: var(--card-2); }

/* ---------- cards ---------- */
.card h2 { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 700; font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-bottom: 60px; }
.card {
  padding: 28px; border-radius: 24px; background: rgba(14, 24, 50, .82); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px;
}
.card h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.card p { margin: 0; }

/* donations */
.card.give {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(242, 196, 109, .16), transparent 60%),
    rgba(14, 24, 50, .82);
  border-color: rgba(242, 196, 109, .35);
}
.card.give::after { /* a soft gold ribbon across the corner */
  content: ""; position: absolute; top: 18px; right: -46px; width: 160px; height: 10px; transform: rotate(40deg);
  background: linear-gradient(90deg, var(--gold-2), var(--gold), var(--gold-2)); opacity: .55; pointer-events: none;
}
.card.give h2 { color: var(--gold); }
.give-eyebrow { font-size: .75rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--green); margin-bottom: -6px !important; }
.causes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cause {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px;
  color: var(--ink); text-decoration: none; background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  transition: transform .15s, background .2s, border-color .2s;
}
.cause:hover { background: rgba(242, 196, 109, .09); border-color: rgba(242, 196, 109, .5); transform: translateY(-2px); }
.cause:active { transform: scale(.98); }
.cause-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-size: 1.4rem; background: rgba(0, 0, 0, .25); }
.cause-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cause-body strong { font-weight: 800; }
.cause-body span { color: var(--muted); font-size: .86rem; line-height: 1.35; }
.cause-go {
  flex: none; padding: 8px 12px; border-radius: 12px; font-weight: 800; font-size: .88rem; white-space: nowrap;
  background: linear-gradient(180deg, #f05a4f, #c7322a); box-shadow: 0 8px 18px -10px rgba(226, 69, 60, .9);
}

.music-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spotify-frame { border-radius: 12px; overflow: hidden; min-height: 152px; background: rgba(0, 0, 0, .25); }
.spotify-frame iframe { display: block; border: 0; }
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; opacity: .35; transition: opacity .3s; }
.eq i { width: 4px; height: 6px; border-radius: 2px; background: var(--green); }
.eq.on { opacity: 1; }
.eq.on i { animation: eq .9s ease-in-out infinite; }
.eq.on i:nth-child(2) { animation-delay: -.3s; }
.eq.on i:nth-child(3) { animation-delay: -.6s; }
.eq.on i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { height: 6px; } 50% { height: 22px; } }

/* ---------- FAQ ---------- */
.faq { padding: 10px 0 60px; }
.faq-title { margin: 0 0 22px; text-align: center; font-family: var(--sans); font-weight: 800; font-size: clamp(1.7rem, 3.2vw, 2.4rem); letter-spacing: -.02em; }
.faq-title em { font-family: var(--serif); font-style: italic; color: var(--gold); }
.faq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.faq-item { padding: 22px; border-radius: 20px; background: rgba(14, 24, 50, .7); border: 1px solid var(--line); }
.faq-item h3 { margin: 0 0 8px; font-size: 1.05rem; line-height: 1.3; }
.faq-item p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .95rem; }
.faq-item strong { color: var(--ink); }
.faq a, .footer a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(242, 196, 109, .4); }
.faq a:hover, .footer a:hover { text-decoration-color: var(--gold); }
.noscript { position: relative; z-index: 1; max-width: 640px; margin: 0 auto 20px; padding: 14px 18px; border-radius: 14px; background: var(--card-2); text-align: center; }

/* ---------- footer ---------- */
.footer { text-align: center; padding: 20px 20px 40px; color: var(--muted); }
.footer p { margin: 4px 0; }
.unicorn-btn { background: none; border: 0; font-size: 1.2rem; padding: 2px 4px; transition: transform .2s; }
.unicorn-btn:hover { transform: rotate(-15deg) scale(1.3); }

/* ---------- toast & easter egg ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, calc(100% + 40px)); opacity: 0; visibility: hidden;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px; font-weight: 600;
  background: rgba(15, 25, 50, .96); border: 1px solid var(--line);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .6); transition: transform .35s cubic-bezier(.3, 1.4, .5, 1), opacity .25s, visibility .35s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

.unicorn { position: fixed; left: 0; z-index: 40; font-size: 64px; pointer-events: none; filter: drop-shadow(0 0 14px rgba(255, 159, 243, .8)); }

/* ---------- Christmas day ---------- */
body.is-xmas .tiles { display: none; }
body.is-xmas .title.big em { animation: shimmer 3s linear 4; background-size: 200% auto; }
@keyframes shimmer { to { background-position: 200% center; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 18px; padding-top: 0; text-align: center; }
  .countdown-panel { align-items: stretch; }
  .actions { justify-content: center; }
  .globe-wrap { width: min(400px, 92%); }
  .cards { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .topbar { padding: 14px 16px; }
  main { padding: 0 16px; }
  .brand .dim { display: none; }
  .chip .lbl { display: none; }
  .tiles { gap: 8px; }
  .tile { padding: 14px 4px 10px; border-radius: 14px; }
  .unit { font-size: .6rem; letter-spacing: .08em; }
  .card { padding: 20px; }
  .faq-grid { grid-template-columns: 1fr; }
  .faq-item { padding: 18px; }
  .cause { gap: 10px; padding: 10px 12px; }
  .cause-ico { width: 38px; height: 38px; font-size: 1.2rem; }
  .cause-go { padding: 7px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
