/* Skyggefall December layout theme
 * All rules are scoped to html.xmas, so this file is safe to leave
 * in the build year-round. The companion xmas.js toggles the class
 * only when the Europe/Oslo date is in December (or ?xmas=1).
 */

html.xmas {
  --color-bg: #05070b;
  --color-bg-elevated: #0c1016;
  --color-surface: #141a20;
  --color-fg: #ede6d6;
  --color-muted: #9a9284;
  --color-subtle: #6a675e;
  --color-accent: #c4a574;
  --color-accent-fg: #0a0c0e;
  --color-border: #2a2f32;
  --color-mist: #8a9a8e;
  --shadow-border: 0 0 0 1px rgba(196, 165, 116, 0.16);
  --shadow-border-hover: 0 0 0 1px rgba(196, 165, 116, 0.32);
  --xmas-gold: #c4a574;
  --xmas-ember: #8a3b36;
  --xmas-pine: #6f8f78;
  --xmas-aurora-green: rgba(52, 130, 98, 0.2);
  --xmas-aurora-violet: rgba(74, 58, 130, 0.14);
}

html.xmas body {
  position: relative;
  background-color: var(--color-bg);
}

/* Dark winter night + northern lights, behind all page content */
html.xmas body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 42% at 18% -8%, var(--xmas-aurora-green), transparent 62%),
    radial-gradient(ellipse 58% 36% at 82% -4%, var(--xmas-aurora-violet), transparent 58%),
    radial-gradient(ellipse 46% 22% at 50% -6%, rgba(196, 165, 116, 0.07), transparent 55%),
    radial-gradient(ellipse 70% 50% at 50% 115%, rgba(80, 40, 28, 0.18), transparent 60%);
}

html.xmas body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 7, 11, 0.15), transparent 28%, transparent 72%, rgba(5, 7, 11, 0.45));
}

html.xmas .flex.min-h-svh.flex-col,
html.xmas body > .flex {
  position: relative;
  z-index: 1;
}

/* Header: candle-gold rim, frost along the bottom, fairy lights along the top */
html.xmas header {
  border-bottom-color: color-mix(in srgb, var(--xmas-gold) 28%, var(--color-border)) !important;
  box-shadow: 0 1px 0 rgba(237, 230, 214, 0.04);
}

html.xmas header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--xmas-ember) 8%,
    var(--xmas-gold) 18%,
    var(--xmas-pine) 30%,
    var(--xmas-gold) 46%,
    var(--xmas-ember) 62%,
    var(--xmas-gold) 78%,
    var(--xmas-pine) 90%,
    transparent 100%
  );
  opacity: 0.85;
  z-index: 2;
}

html.xmas header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  height: 10px;
  pointer-events: none;
  z-index: 2;
  background-image:
    radial-gradient(circle, #e8c36a 0 2.1px, transparent 2.4px),
    radial-gradient(circle, #b8453d 0 2.1px, transparent 2.4px),
    radial-gradient(circle, #7fa388 0 2.1px, transparent 2.4px);
  background-size: 54px 10px, 54px 10px, 54px 10px;
  background-position: 10px 1px, 28px 3px, 46px 1px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 0 3px rgba(232, 195, 106, 0.55));
  animation: xmas-twinkle 3.6s ease-in-out infinite;
}

html.xmas .xmas-ornament {
  display: inline-flex;
  align-items: center;
  margin-left: -0.15rem;
  margin-right: 0.35rem;
  opacity: 0.9;
  flex-shrink: 0;
}

/* Cards: soft gold edge, faint frost in the corner */
html.xmas article {
  box-shadow: var(--shadow-border), 0 10px 28px rgba(0, 0, 0, 0.35);
}

html.xmas article:hover {
  box-shadow: var(--shadow-border-hover), 0 12px 32px rgba(0, 0, 0, 0.42);
}

html.xmas footer {
  border-top-color: color-mix(in srgb, var(--xmas-gold) 22%, var(--color-border)) !important;
  position: relative;
}

html.xmas footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 80px;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(196, 165, 116, 0.1), transparent 70%);
}

/* Snow layer (injected by xmas.js) */
.xmas-snow {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  overflow: hidden;
}

.xmas-snow span {
  position: absolute;
  top: -12px;
  border-radius: 50%;
  background: #f4f1ea;
  box-shadow: 0 0 6px rgba(244, 241, 234, 0.45);
  animation-name: xmas-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

.xmas-snow--static span {
  animation: none;
  box-shadow: none;
}

@keyframes xmas-fall {
  from {
    transform: translate3d(0, -5vh, 0);
  }
  to {
    transform: translate3d(var(--xmas-drift, 20px), 110vh, 0);
  }
}

@keyframes xmas-twinkle {
  0%,
  100% {
    opacity: 0.7;
    filter: drop-shadow(0 0 2px rgba(232, 195, 106, 0.4));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(232, 195, 106, 0.8));
  }
}

@media (prefers-reduced-motion: reduce) {
  html.xmas header::after,
  .xmas-snow span {
    animation: none !important;
  }
}

@media print {
  html.xmas body::before,
  html.xmas body::after,
  html.xmas header::before,
  html.xmas header::after,
  .xmas-snow,
  html.xmas .xmas-ornament {
    display: none !important;
  }
}
