/* Christmas theme. Loaded on top of site.css only while the season is on (html.xmas).
   Same dark room and neon sign: a string of neon bulbs under the top bar, light snow over the wall,
   candy-cane section bars, snow caps on the cards and a green neon for small accents. */
html.xmas {
  --xred: #ff3b4f;
  --xgreen: #34f59a;
  --xgold: #ffc94a;
  --xice: #8fdcff;
  --snow: #f3f6f8;
}

/* String lights hanging from the top bar. Four colour groups, each flickering on its own beat. */
html.xmas header.top::after,
html.xmas header.top::before,
html.xmas header.top .wrap::before,
html.xmas header.top .wrap::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1.4rem; height: 1.4rem; pointer-events: none;
}
html.xmas header.top::after {
  background:
    radial-gradient(ellipse 1.3rem 0.5rem at 1.25rem -0.15rem, transparent 92%, #5a4446 94% 100%, transparent) 0 0 / 2.5rem 100% repeat-x,
    radial-gradient(ellipse 0.34rem 0.5rem at 1.25rem 0.82rem, var(--xred) 92%, transparent) 0 0 / 10rem 100% repeat-x;
  filter: drop-shadow(0 0 0.3rem rgba(255, 59, 79, 0.9));
}
html.xmas header.top::before { background: radial-gradient(ellipse 0.34rem 0.5rem at 3.75rem 0.82rem, var(--xgreen) 92%, transparent) 0 0 / 10rem 100% repeat-x; filter: drop-shadow(0 0 0.3rem rgba(52, 245, 154, 0.9)); }
html.xmas header.top .wrap::before { background: radial-gradient(ellipse 0.34rem 0.5rem at 6.25rem 0.82rem, var(--xgold) 92%, transparent) 0 0 / 10rem 100% repeat-x; filter: drop-shadow(0 0 0.3rem rgba(255, 201, 74, 0.9)); }
html.xmas header.top .wrap::after { background: radial-gradient(ellipse 0.34rem 0.5rem at 8.75rem 0.82rem, var(--xice) 92%, transparent) 0 0 / 10rem 100% repeat-x; filter: drop-shadow(0 0 0.3rem rgba(143, 220, 255, 0.9)); }

/* Santa hat on the logo */
html.xmas .brand { position: relative; }
html.xmas .brand::before {
  content: ""; position: absolute; left: 0.55rem; top: -0.55rem; width: 1.9rem; height: 1.5rem; pointer-events: none;
  transform: rotate(-14deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 32'%3E%3Cpath d='M4 24 C8 10 18 2 30 6 C34 8 36 14 35 20 L30 16 C28 20 30 24 32 25 Z' fill='%23e62e43'/%3E%3Cpath d='M6 20 C12 18 22 18 32 21' stroke='%23b01e30' stroke-width='1' fill='none' opacity='.5'/%3E%3Crect x='1' y='21' width='34' height='8' rx='4' fill='%23f3f6f8'/%3E%3Ccircle cx='33' cy='25' r='4.5' fill='%23f3f6f8'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 0.1rem 0.15rem rgba(0, 0, 0, 0.5));
}

/* Snow falling over the brick wall: bigger flakes, two layers drifting at different speeds */
html.xmas .hero picture { position: relative; overflow: hidden; }
html.xmas .hero picture::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.95) 0 3px, transparent 4.5px),
    radial-gradient(circle at 70% 10%, rgba(255,255,255,.85) 0 2px, transparent 3.5px),
    radial-gradient(circle at 45% 75%, rgba(255,255,255,.9) 0 4px, transparent 5.5px),
    radial-gradient(circle at 85% 55%, rgba(255,255,255,.75) 0 2px, transparent 3.5px),
    radial-gradient(circle at 10% 85%, rgba(255,255,255,.8) 0 3px, transparent 4.5px),
    radial-gradient(circle at 60% 45%, rgba(255,255,255,.7) 0 2.5px, transparent 4px),
    radial-gradient(circle at 35% 15%, rgba(255,255,255,.9) 0 3.5px, transparent 5px),
    radial-gradient(circle at 90% 90%, rgba(255,255,255,.8) 0 2.5px, transparent 4px);
  background-size: 23rem 19rem, 17rem 29rem, 31rem 23rem, 13rem 37rem, 29rem 17rem, 19rem 13rem, 37rem 31rem, 11rem 21rem;
}
/* Snowman peeking in from the bottom-left corner of the wall */
html.xmas .hero .intro { position: relative; }
/* keep the jiggling presents and leaning snowman from poking past the screen edge (that flashed a side scroll bar) */
html.xmas .hero { overflow-x: clip; }
html.xmas .hero .intro::before {
  content: ""; position: absolute; left: 0; bottom: 100%; z-index: 2; pointer-events: none;
  width: clamp(5.5rem, 11vw, 11rem); aspect-ratio: 120 / 170;
  background: url("/img/xmas-snowman.svg") no-repeat left bottom / contain;
  filter: drop-shadow(0 0 0.6rem rgba(0, 0, 0, 0.45));
}
/* a soft frosty fade where the wall meets the page */
html.xmas .hero picture::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18%; z-index: 1; pointer-events: none;
  background: linear-gradient(transparent, rgba(220, 235, 245, 0.10) 60%, rgba(18, 12, 13, 0.85));
}

/* Greeting above the title */
html.xmas .hero .intro .wrap::before {
  content: "\2744\FE0E  Happy Holidays from New Hope  \2744\FE0E";
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--xgreen); text-shadow: 0 0 0.6rem rgba(52, 245, 154, 0.6);
  padding: 0.35rem 0.9rem; border: 1px solid rgba(52, 245, 154, 0.45); border-radius: 999px;
}

/* Candy-cane section bars */
html.xmas .head .bar {
  width: 5rem; height: 0.3rem;
  background: repeating-linear-gradient(135deg, var(--xred) 0 0.35rem, var(--snow) 0.35rem 0.7rem);
  box-shadow: 0 0 0.75rem rgba(255, 59, 79, 0.55);
}

/* Snow caps on the cards */
html.xmas :is(.ipcard, .member, .discord) { position: relative; }
html.xmas :is(.ipcard, .member, .discord)::before {
  content: ""; position: absolute; left: -0.3rem; right: -0.3rem; top: -1.25rem; height: 2.6rem; z-index: 1; pointer-events: none;
  background: url("/img/xmas-snowcap.svg") no-repeat center top / 100% 100%;
  filter: drop-shadow(0 0.15rem 0.25rem rgba(0, 0, 0, 0.45));
}
html.xmas .discord { overflow: visible; }
html.xmas .discord img { border-radius: 12px 12px 0 0; }

/* Small accents in green */
html.xmas ol.steps li::marker { color: var(--xgreen); }
html.xmas .label { color: #bfb0ab; }
html.xmas .feature h3::before { content: "\2744\FE0E"; color: var(--xice); margin-right: 0.45rem; font-size: 0.85em; text-shadow: 0 0 0.5rem rgba(143, 220, 255, 0.6); }
html.xmas .rank.owner { border-color: var(--xred); color: #ff7d8b; }
html.xmas footer .wrap::before { content: "Merry Christmas from the New Hope staff."; width: 100%; color: var(--xgreen); font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; }

@media (prefers-reduced-motion: no-preference) {
  html.xmas .hero picture::after { animation: nh-snow 20s linear infinite; }
  html.xmas header.top::after { animation: nh-flick 1.9s steps(1, end) infinite; }
  html.xmas header.top::before { animation: nh-flick 2.6s steps(1, end) -0.7s infinite; }
  html.xmas header.top .wrap::before { animation: nh-flick 2.2s steps(1, end) -1.3s infinite reverse; }
  html.xmas header.top .wrap::after { animation: nh-flick 3.1s steps(1, end) -0.4s infinite; }
  html.xmas .hero .intro::before { animation: nh-wave 4s ease-in-out infinite; transform-origin: left bottom; }
}
@keyframes nh-snow {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 1rem 19rem, -1rem 29rem, 2rem 23rem, -1rem 37rem, 1rem 17rem, 0 13rem, -2rem 31rem, 1rem 21rem; }
}
/* flicker: mostly on, with quick dips like old Christmas bulbs */
@keyframes nh-flick {
  0%, 100% { opacity: 1; }
  18% { opacity: 0.25; }
  24% { opacity: 1; }
  52% { opacity: 0.15; }
  56% { opacity: 1; }
  60% { opacity: 0.4; }
  64% { opacity: 1; }
}
/* the snowman leans in for a peek, then settles back */
@keyframes nh-wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  70% { transform: rotate(5deg); }
  80% { transform: rotate(-2deg); }
  90% { transform: rotate(3deg); }
}

/* A pile of presents in the bottom-right corner of the wall */
html.xmas .hero .intro::after {
  content: ""; position: absolute; right: 0; bottom: 100%; z-index: 2; pointer-events: none;
  width: clamp(7.5rem, 15vw, 15rem); aspect-ratio: 200 / 120;
  background: url("/img/xmas-presents.svg") no-repeat right bottom / contain;
  filter: drop-shadow(0 0 0.6rem rgba(0, 0, 0, 0.45));
}
@media (prefers-reduced-motion: no-preference) {
  html.xmas .hero .intro::after { animation: nh-jiggle 5s ease-in-out 1.5s infinite; transform-origin: center bottom; }
}
/* every few seconds the presents give a little jiggle, like something inside wants out */
@keyframes nh-jiggle {
  0%, 80%, 100% { transform: rotate(0deg); }
  84% { transform: rotate(-2deg); }
  88% { transform: rotate(2deg); }
  92% { transform: rotate(-1deg); }
}
