: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);
}

main {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 88px 24px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  color: var(--cream);
  font-family: var(--body);
}

/* Background: bokeh lights and two out-of-focus baubles */
.decor {
  position: absolute;
  inset: 0;
  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 empty band below the countdown, left to right, then waits briefly off-screen */
.sleigh {
  position: absolute;
  bottom: 17%;
  left: 0;
  width: min(520px, 80vw);
  color: var(--gold-light);
  opacity: 0.22;
  filter: blur(2px);
  transform: translate(-100%, 0);
  animation: fly 20s linear infinite;
}
.sleigh svg {
  display: block;
  width: 100%;
  height: auto;
}
@keyframes fly {
  0% { transform: translate(-100%, 30px); }
  46% { transform: translate(calc(50vw - 50%), -10px); }
  92%, 100% { transform: translate(100vw, -50px); }
}
@media (prefers-reduced-motion: reduce) {
  .sleigh {
    animation: none;
    left: 50%;
    transform: translateX(-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;
}

/* Hero */
.hero {
  position: relative;
  margin-top: 4vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 1100px;
  text-align: center;
}

.title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

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) .eyebrow,
:lang(zh) .tile .label {
  letter-spacing: 0.12em;
}

.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 */
footer {
  position: relative;
  margin-top: auto;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}
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;
}

.copyright {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(246, 239, 224, 0.26);
}
