/* Christmas look - only active while christmas.js puts the "xm" class on <html>. */
:root.xm.xm.xm {
  --bg: #08101e; --surface: #0f1a2e; --ink: #eef3fb; --muted: #9fb0c8; --line: #22324f;
  --gold: #e8c46a; --gold-soft: #2a2412;
  --accent: #e8c46a; --accent-soft: #2a2412; --accent-ink: #1a1306;
  --xm-red: #e5484d; --xm-green: #6fd08f;
  color-scheme: dark;
}
html.xm { background: radial-gradient(120% 80% at 70% 0%, #1b2d52 0%, #0c1629 48%, #060b15 100%) fixed; }
html.xm body, html.xm body.vc { background: transparent; }
html.xm .top { position: relative; background: color-mix(in srgb, #08101e 82%, transparent); border-bottom-color: #22324f; }
html.xm .theme-btn { display: none; }               /* the winter night is always dark */
html.xm ::selection { background: #e8c46a; color: #1a1306; }
html.xm a { text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); }

/* headings: a soft frosty glow, the same fonts as always */
html.xm .display { color: #fff8ea; text-shadow: 0 0 22px rgba(232,196,106,.35), 0 0 46px rgba(120,170,255,.22); }
html.xm h2 { text-shadow: 0 0 16px rgba(232,196,106,.22); }
html.xm .eyebrow { color: var(--xm-green); }
html.xm .btn:not(.ghost) { box-shadow: 0 0 0 1px rgba(232,196,106,.35), 0 8px 28px -10px rgba(232,196,106,.6); }
html.xm .btn:not(.ghost):hover { box-shadow: 0 0 0 1px rgba(255,220,140,.6), 0 10px 34px -8px rgba(232,196,106,.85); }
/* a little red ribbon on the main button */
html.xm .btn:not(.ghost) { position: relative; }
html.xm .hero .btn:not(.ghost)::after { content: ""; position: absolute; right: 14px; top: -7px; width: 14px; height: 14px; border-radius: 3px;
  background: var(--xm-red); transform: rotate(45deg); box-shadow: 0 0 0 2px #08101e; }

/* the snowflake switch next to the menu / chat buttons */
.xm-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #dfeaff; cursor: pointer; }
.xm-btn svg { width: 22px; height: 22px; transition: transform .4s ease; }
.xm-btn:hover svg { transform: rotate(60deg); }
.xm-btn.is-off svg { opacity: .45; }
html.xm .xm-btn svg { filter: drop-shadow(0 0 6px rgba(170,205,255,.8)); }
.xm-btn:focus-visible { outline: 2px solid #e8c46a; outline-offset: 2px; }

/* string lights hanging under the top bar */
.xm-lights { position: absolute; left: 0; right: 0; top: 100%; height: 34px; overflow: hidden; pointer-events: none; z-index: 2; }
.xm-lights svg { display: block; }
.xm-bulb { animation: xm-twinkle 2.4s ease-in-out infinite; filter: drop-shadow(0 0 5px currentColor); }
.xm-bulb.b0 { color: #ffcf5a; } .xm-bulb.b1 { color: #ff5b5b; animation-delay: .6s; } .xm-bulb.b2 { color: #62d68a; animation-delay: 1.2s; } .xm-bulb.b3 { color: #6cc2ff; animation-delay: 1.8s; }
@keyframes xm-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------------------------------------------------------------- the winter night (behind the page) */
.xm-sky, .xm-moon, .xm-aurora, .xm-hills { position: fixed; pointer-events: none; z-index: -1; }
.xm-sky { inset: 0; }
.xm-stars { position: absolute; left: 0; top: 0; width: 1px; height: 1px; border-radius: 50%; animation: xm-stars 6s ease-in-out infinite; }
@keyframes xm-stars { 50% { opacity: .55; } }
.xm-moon { top: clamp(70px, 10vh, 120px); right: clamp(16px, 9vw, 160px); width: clamp(80px, 11vw, 150px); aspect-ratio: 1; }
.xm-moon i { position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #ffffff 0%, #eef2fb 50%, #c8d3e8 100%);
  box-shadow: 0 0 60px 18px rgba(220,232,255,.18), 0 0 140px 50px rgba(120,170,255,.12); }
.xm-moon i::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 30% 60%, rgba(150,165,195,.3) 0 9%, transparent 10%), radial-gradient(circle at 62% 40%, rgba(150,165,195,.25) 0 7%, transparent 8%); }
.xm-aurora { left: -10%; right: -10%; top: 0; height: 55vh; opacity: .55; }
.xm-aurora i { position: absolute; inset: 0; filter: blur(30px);
  background: radial-gradient(40% 30% at 25% 30%, rgba(90,220,170,.22), transparent 70%), radial-gradient(35% 25% at 60% 20%, rgba(110,150,255,.2), transparent 70%);
  animation: xm-aurora 40s ease-in-out infinite alternate; }
.xm-aurora i + i { animation-duration: 55s; animation-direction: alternate-reverse; opacity: .7; }
@keyframes xm-aurora { to { transform: translateX(10%) translateY(4%); } }
/* the footer becomes a snowy village: the scene sits on top, the links below on solid night ground */
html.xm footer.xm-foot { --xm-gh: clamp(110px, 14vw, 200px); position: relative; border-top: 0; background: #0a1322;
  margin-top: calc(var(--xm-gh) + 24px); padding-top: 32px; }
.xm-ground { position: absolute; left: 0; right: 0; bottom: calc(100% - 2px); height: var(--xm-gh); pointer-events: none; }
.xm-ground svg { width: 100%; height: 100%; display: block; }
html.xm footer.xm-foot, html.xm footer.xm-foot a { color: #b9c6db; }
.xm-win { fill: #ffd27a; animation: xm-win 7s ease-in-out infinite; }
.xm-win:nth-of-type(2) { animation-delay: 2.3s; }
@keyframes xm-win { 0%, 100% { fill: #ffd27a; } 50% { fill: #ffb64a; } }

/* in front of the page, never in the way of a click */
.xm-snow, .xm-sleigh { position: fixed; pointer-events: none; }
.xm-snow { inset: 0; z-index: 30; overflow: hidden; }
.xm-flake { position: absolute; top: -12px; border-radius: 50%; background: #fff; animation: xm-fall var(--dur) linear infinite; }
@keyframes xm-fall { 0% { transform: translate(0, -2vh); } 50% { transform: translate(calc(var(--sway) / 2), 50vh); } 100% { transform: translate(var(--sway), 104vh); } }
.xm-sleigh { left: 0; top: 0; width: clamp(140px, 15vw, 220px); z-index: 1; opacity: 0; }
.xm-sleigh.go { animation: xm-ride 12s linear forwards; }
.xm-sleigh svg { display: block; filter: drop-shadow(0 0 1px rgba(220,232,255,.5)); }
.xm-deer { animation: xm-gallop .5s ease-in-out infinite alternate; }
.xm-deer.d2 { animation-delay: .25s; }
.xm-nose { animation: xm-nose 1.2s ease-in-out infinite; }
@keyframes xm-ride { 0% { transform: translate(110vw, calc(var(--sy) + 6vh)); opacity: 0; } 8% { opacity: .9; }
  50% { transform: translate(45vw, var(--sy)); } 92% { opacity: .9; } 100% { transform: translate(-25vw, calc(var(--sy) - 6vh)); opacity: 0; } }
@keyframes xm-gallop { to { transform: translateY(-3px); } }
@keyframes xm-nose { 50% { opacity: .35; } }

/* the web chat: the colours, a quiet sky and light snow behind the messages */
html.xm-chat .xm-moon { top: 58px; right: 18px; width: 60px; opacity: .55; }
html.xm-chat .xm-snow { z-index: 0; }
html.xm-chat .vc-top { position: relative; background: color-mix(in srgb, #08101e 85%, transparent); }

/* phones: a lighter scene */
@media (max-width: 700px) {
  .xm-aurora { opacity: .4; }
}
/* visitors who asked for less motion get the still scene */
html.xm-calm .xm-stars, html.xm-calm .xm-aurora i, html.xm-calm .xm-bulb, html.xm-calm .xm-win { animation: none; }
html.xm-calm .xm-snow, html.xm-calm .xm-sleigh { display: none; }
@media print { .xm-sky, .xm-moon, .xm-aurora, .xm-hills, .xm-snow, .xm-sleigh, .xm-lights { display: none !important; } }
