/* Bubble Dare — the Christmas page (/christmas/), on top of site.css.
   The hero is always the game's night street, in light mode too; the rest follows
   the site's light and dark colours. */

.xmas {
  --night-0: #11122b;
  --night: #1b1b3e;      /* the game's night sky, sampled from the hero render */
  --dusk-snow: #545787;  /* the snowy road at the bottom of the render */
  --snow: #f4f6ff;
  --hood: #c0493c;       /* a Yule Lad's hood (LAD_HOOD in the game's scenery.gd) */
  --beard: #f1ece2;
  --gold: #ffc84a;       /* a gold bubble hung like a bauble */
  --gold-edge: #d89a18;
}
@media (prefers-color-scheme: dark) {
  .xmas { --hood: #e0705f; --gold: #ffd36b; }
}

/* ---------- Header over the night hero ---------- */
.xmas .site-header { color: var(--snow); }
.xmas .site-header .nav a { color: var(--snow); }
.xmas .site-header .nav a:hover { background: rgb(255 255 255 / 0.12); }

/* ---------- Hero ---------- */
.xm-hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 120px 0 0;
  color: var(--snow);
  background: linear-gradient(180deg, var(--night-0) 0%, var(--night) 100%);
}
/* Snow falling over the whole scene: two tiled layers, each moving a whole number
   of tiles per loop so it never jumps. The one moving thing on the page. */
.xm-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  --f1: rgb(255 255 255 / 0.85);
  --f2: rgb(255 255 255 / 0.5);
  background-image:
    radial-gradient(circle at 7% 12%, var(--f1) 0 1.7px, transparent 2.3px),
    radial-gradient(circle at 38% 31%, var(--f1) 0 1.4px, transparent 2px),
    radial-gradient(circle at 71% 8%, var(--f1) 0 1.9px, transparent 2.5px),
    radial-gradient(circle at 89% 57%, var(--f1) 0 1.5px, transparent 2.1px),
    radial-gradient(circle at 23% 74%, var(--f1) 0 1.8px, transparent 2.4px),
    radial-gradient(circle at 56% 88%, var(--f1) 0 1.3px, transparent 1.9px),
    radial-gradient(circle at 15% 45%, var(--f2) 0 1px, transparent 1.5px),
    radial-gradient(circle at 48% 9%, var(--f2) 0 1.1px, transparent 1.6px),
    radial-gradient(circle at 82% 28%, var(--f2) 0 0.9px, transparent 1.4px),
    radial-gradient(circle at 63% 62%, var(--f2) 0 1.1px, transparent 1.6px),
    radial-gradient(circle at 31% 93%, var(--f2) 0 1px, transparent 1.5px);
  background-size: 430px 470px, 430px 470px, 430px 470px, 430px 470px, 430px 470px, 430px 470px,
                   250px 290px, 250px 290px, 250px 290px, 250px 290px, 250px 290px;
  animation: snowfall 34s linear infinite;
}
/* the big flakes fall one tile per loop, the small ones two: no jump at the seam */
@keyframes snowfall {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: 40px 470px, 40px 470px, 40px 470px, 40px 470px, 40px 470px, 40px 470px,
                              0 580px, 0 580px, 0 580px, 0 580px, 0 580px; }
}
@media (prefers-reduced-motion: reduce) { .xm-hero::after { animation: none; } }

.xm-hero-text { position: relative; z-index: 4; padding-bottom: 8px; }
.xm-when {
  font-family: var(--font); font-weight: 700; font-size: 1.05rem;
  color: var(--gold); margin: 0 0 10px;
}
.xm-hero h1 {
  font-size: clamp(2.8rem, 8.5vw, 6rem); line-height: 0.98; letter-spacing: -0.025em;
  max-width: 11ch; margin-bottom: 0.3em;
}
.xm-lead { font-size: 1.2rem; max-width: 46ch; color: rgb(244 246 255 / 0.82); }
.xm-hero .cta-row { margin-top: 22px; }
.xm-hero .btn-primary { box-shadow: 0 8px 22px rgb(0 0 0 / 0.35); }
.xm-btn-ghost { border-color: rgb(244 246 255 / 0.35); color: var(--snow); }
.xm-btn-ghost:hover { background: rgb(255 255 255 / 0.1); }
@media (max-width: 860px) {
  .xm-hero-text { text-align: left; }
  .xm-hero .cta-row { justify-content: flex-start; }
}

/* The street, rendered by the game. It sits under the sky the text is set on, and its
   snowy road runs into the page below. */
.xm-street { display: block; position: relative; z-index: 2; margin-top: clamp(-90px, -7vw, -20px); }
.xm-street img { width: 100%; height: auto; }
.xm-street::after {
  content: ""; display: block; height: 56px;
  background: linear-gradient(180deg, var(--dusk-snow), var(--bg));
}
.xm-street img {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22%);
}

/* ---------- What the season brings ---------- */
.xm-season { padding-top: 40px; }
.xm-list {
  list-style: none; margin: 28px 0 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 34px 48px;
}
@media (max-width: 760px) { .xm-list { grid-template-columns: 1fr; gap: 26px; } }
.xm-list li { display: grid; grid-template-columns: 52px 1fr; gap: 18px; align-items: start; }
.xm-list svg { width: 52px; height: 52px; }
.xm-list h3 { margin-bottom: 0.25em; }
.xm-list p { margin: 0; color: var(--ink-soft); max-width: 52ch; }
.xm-note { color: var(--ink-soft); font-size: 0.95rem; margin-top: 30px; }

/* the little icons, drawn like the game's own shapes */
.w-dead { stroke: var(--wire); }
.w-snow { stroke: #ffffff; filter: drop-shadow(0 0 0.6px var(--wire)); }
.w-live { stroke: var(--gold-edge); }
.w-spark { stroke: var(--gold); }
.i-tree { fill: #2f6b4a; }
.i-trunk { fill: var(--pole); }
.i-red { fill: var(--hood); }
.i-gold { fill: var(--gold); }
.i-blue { fill: #6fb7ff; }
.i-skin { fill: #f2c7a5; }
.i-ink { fill: #2b2f4a; }
.i-beard { fill: var(--beard); stroke: #d8d0c2; stroke-width: 1; }
.i-string { stroke: var(--ink-soft); }
.i-cap { fill: #b9bfd0; }
.i-shine { fill: #fff6d8; }

/* ---------- The Yule Lads' calendar ---------- */
.xm-lads { background: var(--surface-2); }
.xm-chart {
  --step: 11px;           /* one Yule Lad */
  --dot: 4.2px;
  margin: 8px 0 26px;
}
.xm-days {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(37, minmax(0, 1fr)); gap: 0 2px;
  align-items: stretch; position: relative;
}
.xm-days li {
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  position: relative; padding-top: calc(13 * var(--step) + 46px);
}
.xm-days .lads { position: absolute; bottom: calc(0.72rem + 13px); left: 0; }
/* A column of Yule Lads, one dot each: a red hood with a white beard. */
.xm-days .lads {
  display: block; width: 100%;
  height: calc(var(--n) * var(--step));
  background:
    radial-gradient(circle at 50% 70%, var(--beard) 0 calc(var(--dot) * 0.42), transparent calc(var(--dot) * 0.42 + 0.6px)) center bottom / 100% var(--step) repeat-y,
    radial-gradient(circle at 50% 55%, var(--hood) 0 var(--dot), transparent calc(var(--dot) + 0.6px)) center bottom / 100% var(--step) repeat-y;
}
/* the empty nights still show where the ground is */
.xm-days li::after {
  content: ""; order: 2; width: 100%; height: 3px; border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 14%, transparent);
  margin-top: 4px;
}
.xm-days .day {
  order: 3; font-family: var(--font); font-weight: 700; font-size: 0.72rem;
  color: var(--ink-soft); margin-top: 6px; line-height: 1; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.xm-days .peak .day, .xm-days .daily .day { color: var(--ink); }
/* A gold bauble on its string over a Christmas daily. */
.xm-days::before {
  content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 0;
  border-top: 1.5px solid color-mix(in srgb, var(--ink) 30%, transparent);
  pointer-events: none;
}
.xm-days .daily::before {
  content: ""; position: absolute; top: 3px; left: 50%;
  width: 14px; height: 32px; translate: -50% 0;
  background:
    radial-gradient(circle at 38% 72%, #fff6d8 0 1.6px, transparent 2.2px),
    radial-gradient(circle at 50% 78%, var(--gold) 0 6px, var(--gold-edge) 6.5px 7px, transparent 7.5px),
    linear-gradient(var(--ink-soft), var(--ink-soft)) center top / 1.5px 20px no-repeat;
}
.xm-months {
  display: grid; grid-template-columns: repeat(37, minmax(0, 1fr)); gap: 0 2px; margin-top: 10px;
  font-family: var(--font); font-weight: 700; font-size: 0.9rem; color: var(--ink-soft);
}
.xm-months span { border-top: 2px solid var(--line); padding-top: 6px; }
.xm-months span:first-child { grid-column: 1 / span 31; }
.xm-months span:last-child { grid-column: 32 / span 6; }

@media (max-width: 700px) {
  .xm-chart { --step: 8px; --dot: 3.1px; }
  .xm-days { gap: 0 1px; }
  .xm-days li { padding-top: calc(13 * var(--step) + 38px); }
  .xm-days li:not(.k) .day { visibility: hidden; }
  .xm-days .daily::before { width: 10px; height: 26px; background:
    radial-gradient(circle at 50% 80%, var(--gold) 0 4.4px, var(--gold-edge) 4.8px 5.2px, transparent 5.6px),
    linear-gradient(var(--ink-soft), var(--ink-soft)) center top / 1.2px 17px no-repeat; }
}

.xm-dailies { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 760px; }
.xm-dailies li {
  display: grid; grid-template-columns: 7.5em 1fr; gap: 2px 16px; align-items: baseline;
}
.xm-dailies .d { font-family: var(--font); font-weight: 800; color: var(--gold-edge); grid-row: span 2; }
@media (prefers-color-scheme: dark) { .xm-dailies .d { color: var(--gold); } }
.xm-dailies b { font-family: var(--font); }
.xm-dailies li > span:last-child { color: var(--ink-soft); }
@media (max-width: 560px) {
  .xm-dailies li { grid-template-columns: 1fr; }
  .xm-dailies .d { grid-row: auto; }
}

/* ---------- Screenshots ---------- */
.xm-grid { margin-top: 28px; gap: 28px 18px; }
.xm-grid figure { margin: 0; }
.xm-grid .device { display: block; aspect-ratio: 1080 / 499; }
.xm-grid .device .screen { display: block; }
.xm-grid .device:hover { filter: brightness(1.04); }

/* ---------- Press kit ---------- */
.xm-press-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .xm-press-grid { grid-template-columns: 1fr; gap: 32px; } }
.xm-press p { color: var(--ink-soft); max-width: 60ch; }
.xm-press h3 { margin-top: 1.6em; }
.xm-zip { margin: 6px 0 26px; }
.xm-files { margin: 0; }
.xm-files dt { font-family: var(--font); font-weight: 700; margin-top: 12px; }
.xm-files dd { margin: 2px 0 0; color: var(--ink-soft); }
.xm-files dd a {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px; margin: 4px 4px 0 0;
  border: 1px solid var(--line); border-radius: 10px; text-decoration: none;
  font-family: var(--font); font-weight: 700; color: var(--ink); background: var(--surface);
}
.xm-files dd a:hover { border-color: var(--accent); }
.xm-files dd:last-child a { display: inline; border: 0; background: none; padding: 0; height: auto; text-decoration: underline; font-family: var(--font-body); font-weight: 400; }

.xm-facts {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow);
}
.xm-facts h3 { margin-top: 0; }
.xm-facts dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; }
.xm-facts dt { font-weight: 600; color: var(--ink-soft); font-size: 0.95rem; }
.xm-facts dd { margin: 0; }
@media (max-width: 420px) { .xm-facts dl { grid-template-columns: 1fr; gap: 2px; } .xm-facts dd { margin-bottom: 10px; } }
