/* Self-hosted Fraunces + Jost (latin / latin-ext only, opsz 144). Removes the
   render-blocking fonts.googleapis.com round-trip that delayed #headline LCP.
   Preload of fraunces-italic-latin.woff2 in index.html starts the LCP face
   in parallel with this stylesheet. Noto Serif SC for zh stays on Google Fonts
   and is injected from script.js only when Chinese is active. */
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/fraunces-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/fraunces-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/fraunces-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/fraunces-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/jost-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/jost-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --pine: #0f2a1f;
  --pine-light: #1d4a35;
  --cream: #f6efe0;
  --gold: #e9c46a;
  --gold-light: #f4dc9a;
  --ribbon: #a8202e;
  --display: "Fraunces", Georgia, serif;
  --body: "Jost", Futura, "Century Gothic", sans-serif;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  background: var(--pine);
}

/* Three stacked rows: the hero block is centred in the free space, the reserved
   sleigh band sits underneath it, and the credit line is the last row so it is
   anchored to the bottom of the viewport. --santa-band is the height the sleigh
   animation needs, so the footer never overlaps it. */
main {
  --santa-band: clamp(120px, 17vh, 160px);
  position: relative;
  /* Clip sideways for the off-screen baubles, but let the page grow and scroll on
     short viewports instead of clipping the footer text. */
  overflow-x: clip;
  overflow-y: visible;
  min-height: 100vh;
  min-height: 100svh;
  box-sizing: border-box;
  padding: 88px 24px 0;
  display: grid;
  grid-template-rows: minmax(min-content, 1fr) var(--santa-band) auto;
  justify-items: center;
  color: var(--cream);
  font-family: var(--body);
}

/* Background: bokeh lights and two out-of-focus baubles.
   Clipped to the page box so the oversized glow never adds scroll height. */
.decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Bokeh as radial gradients rather than filter: blur, which Safari clips to a visible rectangle */
.bokeh {
  position: absolute;
  border-radius: 50%;
}
.b1 { top: 4%; left: 2%; width: 300px; height: 300px; background: radial-gradient(circle, rgba(233, 196, 106, 0.16), transparent 65%); }
.b2 { top: 12%; right: 5%; width: 220px; height: 220px; background: radial-gradient(circle, rgba(244, 220, 154, 0.22), transparent 65%); }
.b3 { bottom: 10%; left: 10%; width: 180px; height: 180px; background: radial-gradient(circle, rgba(244, 220, 154, 0.18), transparent 65%); }
.b4 { bottom: 0; right: 12%; width: 380px; height: 380px; background: radial-gradient(circle, rgba(192, 57, 43, 0.14), transparent 65%); }
.glow { top: 46%; left: 48%; width: 900px; height: 900px; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(29, 74, 53, 0.75), transparent 60%); }

/* Santa's sleigh: flies across the reserved band below the content, left to right, then waits briefly off-screen.
   The band is its own grid row, so it never overlaps the hero or the closing line. */
.santa-band {
  grid-row: 2;
  justify-self: stretch;
  align-self: end;
  position: relative;
  width: 100%;
  min-height: var(--santa-band);
  overflow: hidden;
}
.sleigh {
  position: absolute;
  top: 50%;
  left: 0;
  width: min(520px, 80vw);
  color: var(--gold-light);
  opacity: 0.22;
  filter: blur(2px);
  transform: translate(-100%, -50%);
  animation: fly 20s linear infinite;
}
.sleigh svg {
  display: block;
  width: 100%;
  height: auto;
}
@keyframes fly {
  0% { transform: translate(-100%, -50%); }
  46% { transform: translate(calc(50vw - 50%), -50%); }
  92%, 100% { transform: translate(100vw, -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .sleigh {
    animation: none;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

.bauble {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bauble .string {
  width: 2px;
  background: #c9a14a;
}
.bauble .ball {
  border-radius: 50%;
}

.bauble-red {
  right: 7%;
  filter: blur(5px);
  opacity: 0.85;
}
.bauble-red .string { height: 120px; }
.bauble-red .cap {
  width: 28px;
  height: 18px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(90deg, #8a6a2a, var(--gold-light) 45%, #b8913e);
}
.bauble-red .ball {
  width: 190px;
  height: 190px;
  margin-top: -4px;
  background: radial-gradient(circle at 34% 30%, #ff9a8a 0%, #c0392b 22%, #8c1c2b 58%, #3a0a10 100%);
  box-shadow: inset -18px -24px 40px rgba(0, 0, 0, 0.35), 0 0 60px rgba(192, 57, 43, 0.35);
}

.bauble-gold {
  left: 9%;
  filter: blur(11px);
  opacity: 0.55;
}
.bauble-gold .string { height: 220px; }
.bauble-gold .cap {
  width: 32px;
  height: 20px;
  border-radius: 3px;
  background: #c9a14a;
}
.bauble-gold .ball {
  width: 218px;
  height: 218px;
  margin-top: -2px;
  background: radial-gradient(circle at 34% 30%, #fff1c4 0%, var(--gold) 25%, #a67c2e 65%, #3d2a0a 100%);
}

/* Language switch */
.lang-switch {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(233, 196, 106, 0.35);
  border-radius: 999px;
}
.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 36px;
  box-sizing: border-box;
  padding: 0 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.lang-switch a[aria-current="true"] {
  background: var(--gold);
  color: var(--pine);
}
.lang-switch a:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.version-tag-button:focus-visible,
.version-tag-changelog:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Hero block: optically centred in the free space above the sleigh band */
.hero {
  grid-row: 1;
  position: relative;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 1100px;
  text-align: center;
}

/* Date reads as a quiet caption above the headline on every viewport: small,
   muted, wide-tracked, with real breathing room so it never competes with
   "Bijna Kerst". Markup order is date-then-headline, so no reorder rules. */
.title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(246, 239, 224, 0.5);
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: clamp(48px, 8.5vw, 112px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* Chinese: Fraunces has no CJK glyphs, and a slanted fallback looks wrong, so use an upright serif */
:lang(zh) h1,
:lang(zh) .christmas,
:lang(zh) footer > p {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-style: normal;
  letter-spacing: 0.04em;
}
:lang(zh) h1 {
  font-weight: 700;
}
:lang(zh) .tile .label {
  letter-spacing: 0.12em;
}
/* Chinese glyphs are already wide; keep the caption feel without the
   Latin tracking, which reads as gaps between CJK characters. */
:lang(zh) .eyebrow {
  letter-spacing: 0.16em;
}

.countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.weeks {
  margin: 0;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.4;
  color: rgba(246, 239, 224, 0.9);
  text-wrap: balance;
}
.weeks strong {
  font-weight: 600;
  color: var(--gold);
}

.ribbon-row {
  position: relative;
  width: 100%;
}
.ribbon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 22px;
  transform: translate(-50%, -50%);
  background: var(--ribbon);
  border-top: 1px solid rgba(233, 196, 106, 0.7);
  border-bottom: 1px solid rgba(233, 196, 106, 0.7);
}

.tiles {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  width: 100%;
}
.tile {
  flex: 1 1 140px;
  max-width: 196px;
  box-sizing: border-box;
  padding: 22px 12px 20px;
  border: 1px solid rgba(233, 196, 106, 0.55);
  border-radius: 16px;
  background: var(--pine);
  box-shadow: 0 12px 28px rgba(4, 16, 10, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.tile .value {
  font-family: var(--display);
  font-weight: 500;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: clamp(48px, 6vw, 76px);
  line-height: 0.9;
  font-variant-numeric: lining-nums tabular-nums;
}
.tile .label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.christmas {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(32px, 4.5vw, 52px);
  color: var(--gold);
}

/* Closing line; reserves two lines so switching language doesn't shift the page.
   Sits in the bottom band, under the sleigh's flight path. */
/* Closing line + credit; the last row of the page, anchored to the bottom edge.
   Reserves two lines so switching language doesn't shift the page. */
footer {
  grid-row: 3;
  position: relative;
  justify-self: stretch;
  align-self: end;
  box-sizing: border-box;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(8px, 1.6vh, 16px) 0 clamp(10px, 1.6vh, 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(14px, 2.4vh, 32px);
}
footer > p {
  margin: 0;
  min-height: 3em;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 18px;
  line-height: 1.5;
  text-align: center;
  color: rgba(246, 239, 224, 0.72);
  text-wrap: balance;
}

/* Short viewports (small laptops in landscape): trim the surrounding space before
   the hero shrinks, so the block still reads as centred above the sleigh band. */
@media (max-height: 780px) {
  main {
    --santa-band: 120px;
    padding: 64px 24px 10px;
  }
  .hero {
    gap: 26px;
  }
  .countdown {
    gap: 18px;
  }
  footer {
    gap: 18px;
  }
  footer > p {
    min-height: 0;
    font-size: 16px;
  }
}

@media (max-height: 620px) {
  main {
    padding: 48px 20px 0;
  }
  .hero {
    gap: 18px;
  }
  .tile {
    padding: 14px 10px 12px;
  }
  .santa-band {
    min-height: 120px;
  }
  footer {
    padding-bottom: 8px;
  }
  footer > p {
    font-size: 15px;
  }
}

/* Narrow phones: the tiles wrap to two rows, so tighten the vertical rhythm too. */
@media (max-width: 480px) {
  main {
    /* The date is the first element now, so it has to clear the language pill
       itself rather than the headline doing it. */
    padding: 86px 18px 0;
  }
  .hero {
    gap: 28px;
  }
  footer {
    gap: 16px;
  }

  /* Slightly tighter eyebrow rhythm on narrow phones; still a caption, still
     clearly separated from the language pill. */
  .title-group {
    gap: 14px;
  }
}

/* Very narrow phones: the date string is long enough to wrap at 0.26em tracking,
   which costs a whole extra line. Tighten the tracking so it stays one line and
   keeps reading as a wide-tracked caption. */
@media (max-width: 400px) {
  .eyebrow {
    letter-spacing: 0.16em;
  }
}

/* Short phones (e.g. 360x640): the date now sits above the headline, so the
   top padding must still clear the pill; reclaim space from the surrounding
   rhythm instead — proportionally, not by shrinking any text. */
@media (max-width: 480px) and (max-height: 720px) {
  main {
    padding-top: 82px;
    /* The sleigh renders 67px tall at these widths, so the reserved band can be
       much smaller here without clipping it. */
    --santa-band: 76px;
  }
  .hero {
    gap: 18px;
  }
  .countdown {
    gap: 12px;
  }
  footer {
    gap: 10px;
  }
}

.copyright {
  font-size: 9px;
  letter-spacing: 0.08em;
  /* 0.55 alpha keeps ~5:1 contrast on the pine background; 0.26 was ~2.2:1 */
  color: rgba(246, 239, 224, 0.55);
}
