/* =========================================================
   MS AI Store — Thème Hiver / Noël (page d'accueil uniquement)
   Version Allégée & Ultra-Fluide (Hardware-accelerated)
   ========================================================= */

:root {
  --w-red:        #E11D48;
  --w-red-dark:   #B91C1C;
  --w-green:      #16A34A;
  --w-green-dark: #14532D;
  --w-gold:       #FBBF24;
  --w-ice:        #BAE6FD;
  --w-ice-2:      #7DD3FC;
  --w-night:      #020617;
  --w-night-2:    #0B1E4A;
  --w-snow:       #F8FAFC;
}

/* ---------- Canvas neige (plein écran) ---------- */
#winterSnow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 899;
}

/* ---------- Navbar : guirlande lumineuse + couleurs ---------- */
.winter .navbar { overflow: visible; }

.w-garland {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -11px;
  height: 18px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='12' viewBox='0 0 34 12'%3E%3Cpath d='M0 1 Q17 11 34 1' fill='none' stroke='%23334155' stroke-width='1.3'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 34px 12px;
  display: flex;
  justify-content: space-around;
}

.w-bulb {
  position: relative;
  width: 7px;
  height: 11px;
  margin-top: 5px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--c, var(--w-red));
  box-shadow: 0 0 4px var(--c, var(--w-red));
  animation: wBulb 2.2s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  will-change: opacity;
}
.w-bulb::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 1.5px;
  width: 4px;
  height: 3px;
  border-radius: 1px;
  background: #475569;
}

@keyframes wBulb {
  0%, 100% { opacity: 0.95; }
  50%      { opacity: 0.4; }
}

.winter .nav-link.active {
  background: linear-gradient(135deg, #0EA5E9 0%, #2563EB 100%);
  box-shadow: 0 2px 16px rgba(14,165,233,.35);
}
.winter .nav-cta {
  background: linear-gradient(135deg, var(--w-red) 0%, var(--w-red-dark) 100%);
  box-shadow: 0 2px 16px rgba(225,29,72,.35);
  position: relative;
}
.winter .nav-cta:hover { box-shadow: 0 6px 28px rgba(225,29,72,.5); }

/* Bonnet de Père Noël sur le logo */
.w-hat {
  position: absolute;
  top: -15px;
  left: -11px;
  width: 30px;
  height: auto;
  transform: rotate(-22deg);
  transform-origin: 70% 90%;
  z-index: 2;
  pointer-events: none;
  animation: wHat 5s ease-in-out infinite;
  will-change: transform;
}
.nav-logo:hover .w-hat { animation-duration: 1.2s; }
@keyframes wHat {
  0%, 100% { transform: rotate(-22deg); }
  50%      { transform: rotate(-12deg); }
}

/* ---------- HERO : ciel d'hiver nocturne ---------- */
.winter .hero-bg {
  background:
    radial-gradient(ellipse 60% 45% at 78% 8%, rgba(56,189,248,.18) 0%, transparent 60%),
    linear-gradient(180deg, var(--w-night) 0%, var(--w-night-2) 42%, #1E3A8A 72%, #4060A8 100%);
}
.winter .hero-grid,
.winter #heroCanvas { display: none !important; }

.winter .hero-orb-1 { background: radial-gradient(circle, rgba(56,189,248,.15) 0%, transparent 70%); }
.winter .hero-orb-2 { background: radial-gradient(circle, rgba(225,29,72,.12) 0%, transparent 70%); }
.winter .hero-orb-3 { background: radial-gradient(circle, rgba(22,163,74,.12) 0%, transparent 70%); }

/* Couches décoratives */
.w-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* Étoiles scintillantes */
.w-star {
  position: absolute;
  width: var(--s, 2px);
  height: var(--s, 2px);
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
}
.w-star.twinkle {
  animation: wTwinkle var(--t, 3.5s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
  will-change: opacity;
}
@keyframes wTwinkle {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 0.95; }
}

/* Aurore boréale optimisée */
.w-aurora {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 55%;
  opacity: .5;
  filter: blur(28px);
  pointer-events: none;
  contain: strict;
}
.w-aurora span {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.w-aurora span:nth-child(1) {
  width: 55%; height: 45%; left: 5%; top: 25%;
  background: linear-gradient(90deg, transparent, rgba(52,211,153,.55), rgba(34,211,238,.4), transparent);
  animation: wAurora1 16s ease-in-out infinite alternate;
}
.w-aurora span:nth-child(2) {
  width: 50%; height: 40%; left: 35%; top: 15%;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,.45), rgba(56,189,248,.45), transparent);
  animation: wAurora2 20s ease-in-out infinite alternate;
}
@keyframes wAurora1 {
  0%   { transform: translateX(-4%) scaleY(.85); }
  100% { transform: translateX(4%)  scaleY(1.1); }
}
@keyframes wAurora2 {
  0%   { transform: translateX(4%) scaleY(1.1); }
  100% { transform: translateX(-4%) scaleY(.9); }
}

/* Lune */
.w-moon {
  position: absolute;
  top: 15%;
  right: 9%;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFFFFF 0%, #F1F5F9 45%, #CBD5E1 100%);
  box-shadow: 0 0 35px 8px rgba(186,230,253,.22);
}
.w-moon::before,
.w-moon::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(148,163,184,.25);
}
.w-moon::before { width: 17px; height: 17px; top: 24px; left: 47px; }
.w-moon::after  { width: 10px; height: 10px; top: 52px; left: 26px; }

/* Traîneau du Père Noël (avec rennes et cadeaux) */
.w-sleigh {
  position: absolute;
  top: 19%;
  left: 0;
  width: 290px;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
  animation: wSleighFly 28s linear infinite;
  animation-delay: 1.5s;
  transform: translate3d(-380px, 40px, 0) rotate(-5deg);
}
.w-sleigh-inner {
  animation: wSleighBob 2.6s ease-in-out infinite;
  will-change: transform;
}
.w-sleigh svg { width: 100%; height: auto; display: block; overflow: visible; }
.w-sleigh .rd { animation: wGallop .6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; will-change: transform; }
.w-sleigh .rd:nth-of-type(2) { animation-delay: -.2s; }
.w-sleigh .rd:nth-of-type(3) { animation-delay: -.4s; }

@keyframes wSleighFly {
  0%   { transform: translate3d(-380px, 35px, 0) rotate(-5deg); }
  50%  { transform: translate3d(calc(100vw + 50px), -25px, 0) rotate(-2deg); }
  100% { transform: translate3d(calc(100vw + 50px), -25px, 0) rotate(-2deg); }
}
@keyframes wSleighBob {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -8px, 0); }
}
@keyframes wGallop {
  from { transform: translateY(0) rotate(-2deg); }
  to   { transform: translateY(-3px) rotate(3deg); }
}

/* Boules de Noël suspendues */
.w-orn {
  position: absolute;
  top: 0;
  left: var(--x);
  width: 2px;
  height: var(--len, 120px);
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(226,232,240,.7));
  transform-origin: top center;
  animation: wSwing var(--sp, 4.5s) ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
  z-index: 1;
  will-change: transform;
}
.w-orn i {
  position: absolute;
  bottom: -28px;
  left: 50%;
  width: var(--sz, 28px);
  height: var(--sz, 28px);
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, rgba(255,255,255,.85) 0%, rgba(255,255,255,0) 28%),
    radial-gradient(circle at 50% 50%, var(--c) 0%, var(--c2, var(--c)) 100%);
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.w-orn i::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 6px;
  border-radius: 2px;
  background: #FDE68A;
}
.w-orn i::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 44%;
  height: 2.5px;
  background: rgba(255,255,255,.55);
}
.w-orn.star i {
  border-radius: 0;
  background: none;
  box-shadow: none;
  width: auto;
  height: auto;
  font-size: var(--sz, 28px);
  line-height: 1;
  bottom: -24px;
  color: var(--w-gold);
  font-style: normal;
}
.w-orn.star i::before, .w-orn.star i::after { display: none; }

@keyframes wSwing {
  from { transform: rotate(-5deg); }
  to   { transform: rotate(5deg); }
}

/* Collines enneigées + sapins */
.w-hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 190px;
  z-index: 1;
  pointer-events: none;
}
.w-hills svg { width: 100%; height: 100%; display: block; }
.w-hills .tw   { animation: wTreeLight 2s ease-in-out infinite; }
.w-hills .tw2  { animation: wTreeLight 2s ease-in-out infinite; animation-delay: -1s; }
.w-hills .tstar{ animation: wTreeStar 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

@keyframes wTreeLight { 0%,100% { opacity: 0.95; } 50% { opacity: .25; } }
@keyframes wTreeStar  { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }

/* ---------- Contenu du hero en version hiver ---------- */
.winter .hero-content { z-index: 3; }

.winter .hero-badge {
  background: rgba(255,255,255,.08);
  border-color: rgba(186,230,253,.35);
  color: #E0F2FE;
  backdrop-filter: blur(8px);
}

.w-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: fit-content;
  margin: -8px auto 26px;
  padding: 8px 14px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(225,29,72,.22), rgba(22,163,74,.22));
  border: 1px solid rgba(255,255,255,.18);
  color: #F8FAFC;
  font-size: .82rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}
.w-countdown .w-cd-box {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(2,6,23,.45);
  font-variant-numeric: tabular-nums;
}
.w-countdown b { font-family: var(--font-display); font-size: 1rem; color: var(--w-gold); }
.w-countdown small { font-size: .68rem; color: #CBD5E1; }

.winter .hero-title { color: #FFFFFF; text-shadow: 0 4px 20px rgba(14,165,233,.25); }
.winter .hero .gradient-text {
  background: linear-gradient(90deg, #FFFFFF 0%, var(--w-ice) 30%, #FCA5A5 60%, var(--w-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.winter .hero-subtitle { color: #CBD5E1; }

.winter .hero-stats {
  position: relative;
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
}
.winter .stat-number {
  background: linear-gradient(135deg, #FFFFFF, var(--w-ice-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.winter .stat-suffix  { color: var(--w-gold); }
.winter .stat-label   { color: #CBD5E1; }
.winter .stat-divider { background: rgba(255,255,255,.18); }

.winter #heroApiBtn::before { bottom: auto; opacity: 1; transition: none; }
.winter .hero .btn { position: relative; }
.winter #heroApiBtn {
  background: linear-gradient(135deg, var(--w-red) 0%, var(--w-red-dark) 100%) !important;
  box-shadow: 0 6px 20px rgba(225,29,72,.38);
}
.winter #heroApiBtn:hover { box-shadow: 0 8px 28px rgba(225,29,72,.5); }
.winter .hero .btn-secondary {
  background: rgba(255,255,255,.08);
}
.winter .hero .btn-secondary:hover { background: rgba(255,255,255,.16); }

.winter .brand-label { color: #CBD5E1; }
.winter .hero .brand-pill {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
  color: #E2E8F0;
}
.winter .hero .brand-pill:hover {
  background: rgba(225,29,72,.25);
  border-color: rgba(252,165,165,.5);
  color: #fff;
}

.winter .hero { padding-bottom: 180px; }
.winter .hero-scroll { bottom: 18px; }

/* ---------- Bouton activer/désactiver la neige ---------- */
.w-toggle {
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: 901;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(14,165,233,.35);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(14,165,233,.2);
  transition: transform .2s ease, opacity .2s ease;
}
.w-toggle:hover { transform: scale(1.08); }
.w-toggle.off { opacity: .55; filter: grayscale(1); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .w-moon { width: 60px; height: 60px; top: 13%; right: 6%; }
  .w-moon::before { width: 12px; height: 12px; top: 16px; left: 32px; }
  .w-moon::after  { width: 8px; height: 8px; top: 36px; left: 16px; }
  .w-sleigh { width: 210px; top: 14%; }
  .w-orn.hide-sm { display: none; }
  .w-hills { height: 140px; }
  .winter .hero { padding-bottom: 140px; }
}
@media (max-width: 560px) {
  .w-countdown { font-size: .74rem; gap: 5px; }
  .w-countdown .w-cd-box { padding: 2px 6px; }
  .w-garland { left: 10px; right: 10px; }
}

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .w-star, .w-aurora span, .w-moon, .w-orn, .w-bulb, .w-hat,
  .w-hills * { animation: none !important; }
  .w-sleigh { display: none; }
}
