/* ==========================================================================
   IzenRide – décoration de fin d'année
   Activée par assets/js/noel.js (classe « noel » sur <html>) du 1er décembre au 6 janvier,
   chaque année. Sans JavaScript, rien ne s'affiche.
   Couleurs : uniquement la charte (noir, bleus de marque, blanc) ; le rouge reste réservé
   à la sécurité. Valeurs absentes de site.css reprises de tokens.json (charte v1.0).
   ========================================================================== */
html.noel{
  --noel-elevated:#181A21;   /* color.bg.elevated */
  --noel-overlay:#07122A;    /* color.bg.overlay (toasts) */
  --noel-strong:#2A2E37;     /* color.line.strong */
  --noel-brand-night:#0A1735;/* color.brand.night */
  --noel-metal-1:#5D6370;    /* bordure métal du cadre d'appareil (CHARTE §6) */
  --noel-metal-2:#24272E;
  --noel-metal-3:#101114;
}

/* Remplissages et dégradés des dessins (SVG) */
.nf-ink{fill:var(--ink)}.nf-mute{fill:var(--mute)}.nf-glow{fill:var(--glow)}.nf-sig{fill:var(--signal)}.nf-trail{fill:var(--trail)}
.nf-night{fill:var(--night)}
.nf-mont{fill:color-mix(in srgb,var(--signal) 9%,var(--deck))}.nf-sapin{fill:color-mix(in srgb,var(--signal) 22%,var(--deck))}.nf-raised{fill:var(--asphalt)}.nf-panel{fill:var(--deck)}.nf-elev{fill:var(--noel-elevated)}.nf-strong{fill:var(--noel-strong)}
.st-ink{stop-color:var(--ink)}.st-mute{stop-color:var(--mute)}.st-glow{stop-color:var(--glow)}.st-sig{stop-color:var(--signal)}.st-trail{stop-color:var(--trail)}
.st-action{stop-color:var(--action)}.st-night{stop-color:var(--noel-brand-night)}.st-strong{stop-color:var(--noel-strong)}
.st-metal1{stop-color:var(--noel-metal-1)}.st-metal2{stop-color:var(--noel-metal-2)}.st-metal3{stop-color:var(--noel-metal-3)}
.noel-defs{position:absolute;width:0;height:0;overflow:hidden}

/* ---------- Guirlande lumineuse sous l'en-tête : fil de micro-LED ---------- */
.noel-guirlande{position:absolute;left:0;right:0;top:100%;height:44px;pointer-events:none}
.noel-guirlande svg{position:absolute;left:0;top:-1px;overflow:visible}
.noel-fil-fin{fill:none;stroke:var(--mute);stroke-opacity:.45;stroke-width:.8}
.noel-scintille{animation:noel-scintille-doux var(--d,3s) ease-in-out var(--t,0s) infinite}
@keyframes noel-scintille-doux{0%,100%{opacity:1}50%{opacity:.45}}
@keyframes noel-scintille{0%,100%{opacity:1}50%{opacity:.3}}

/* ---------- Boules suspendues (grands écrans, dans les marges) ---------- */
.noel-boules{position:absolute;left:0;right:0;top:100%;height:0;pointer-events:none}
.noel-boule{position:absolute;top:0;transform-origin:50% 0;animation:noel-balance var(--d,5s) ease-in-out var(--t,0s) infinite alternate}
.noel-boule svg{display:block;overflow:visible}
@keyframes noel-balance{from{transform:rotate(-5deg)}to{transform:rotate(5deg)}}
.noel-ficelle{stroke:var(--mute);stroke-opacity:.55;stroke-width:1}
.noel-flocon{fill:none;stroke:var(--ink);stroke-opacity:.62;stroke-width:1.3;stroke-linecap:round}

/* ---------- Neige ---------- */
.noel-neige{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:40}

/* ---------- Paysage d'hiver au-dessus du pied de page ---------- */
.noel-paysage{position:relative;height:clamp(120px,14vw,210px);pointer-events:none}
.noel-paysage svg{position:absolute;inset:0;width:100%;height:100%}
html.noel footer{border-top-color:transparent}
.noel-route{fill:none;stroke:var(--line);stroke-width:8;stroke-linecap:round}
.noel-ligne{fill:none;stroke:var(--ink);stroke-opacity:.42;stroke-width:1.3;stroke-dasharray:9 12}
.noel-neige-branche{fill:none;stroke:var(--ink);stroke-opacity:.82;stroke-width:2;stroke-linecap:round}
.noel-lumiere,.noel-etoile{animation:noel-scintille var(--d,2.8s) ease-in-out var(--t,0s) infinite}

/* ---------- Carte de vœux et bouton des animations ---------- */
.noel-coin{position:fixed;left:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:55;display:flex;flex-direction:column;align-items:flex-start;gap:10px;max-width:min(330px,calc(100vw - 32px))}
.noel-carte{position:relative;padding:18px 52px 18px 18px;border-radius:var(--r-lg,16px);background:var(--noel-overlay);border:1px solid color-mix(in srgb,var(--signal) 48%,transparent);box-shadow:0 18px 40px -15px #000;color:var(--ink);font:400 .95rem/1.5 var(--body);animation:noel-entree .3s cubic-bezier(.2,.8,.2,1) both}
.noel-carte b{display:flex;align-items:center;gap:10px;font:600 1.15rem/1.2 var(--body);margin-bottom:8px}
.noel-carte b svg{width:20px;height:20px;color:var(--glow);flex:none}
.noel-carte p{margin:0}
.noel-carte .noel-astuce{margin-top:6px;color:var(--mute)}
.noel-carte a{color:var(--glow)}
.noel-fermer{position:absolute;top:4px;right:4px;width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:var(--r-md,12px);background:transparent;color:var(--mute);cursor:pointer}
.noel-fermer:hover{color:var(--ink)}
.noel-bouton{width:44px;height:44px;display:grid;place-items:center;border-radius:var(--r-md,12px);background:#000;border:1px solid var(--noel-strong);color:var(--glow);cursor:pointer;transition:transform .15s,border-color .15s}
.noel-bouton:hover{border-color:var(--mute);transform:translateY(-2px)}
.noel-bouton[aria-pressed="false"]{color:var(--mute)}
.noel-bouton svg,.noel-fermer svg{width:20px;height:20px}
.noel-bouton:focus-visible,.noel-fermer:focus-visible,.noel-carte a:focus-visible{outline:2px solid var(--glow);outline-offset:3px}
@keyframes noel-entree{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@media (max-width:600px){.noel-carte{font-size:.9rem;padding:14px 48px 14px 14px}.noel-carte b{font-size:1.05rem}.noel-carte .noel-astuce{display:none}}

/* ---------- Pause demandée par le bouton ---------- */
html.noel-pause .noel-scintille,html.noel-pause .noel-boule,html.noel-pause .noel-lumiere,html.noel-pause .noel-etoile{animation-play-state:paused}
html.noel-pause .noel-neige{display:none}

/* ---------- « Réduire les animations » : décor fixe ---------- */
@media (prefers-reduced-motion:reduce){
  .noel-scintille,.noel-boule,.noel-lumiere,.noel-etoile,.noel-carte{animation:none}
  .noel-neige{display:none}
  .noel-bouton:hover{transform:none}
}

@media print{.noel-guirlande,.noel-boules,.noel-neige,.noel-paysage,.noel-coin{display:none}}
