/* Crystal Homes - winter + Christmas layer (v2)
   NO brand colours are overridden: your existing theme stays exactly as it is.
   Everything is scoped to html.winter. Load AFTER style.css and style.additions.css. */

html.winter{--w-accent:#fff}

/* ---------- page-wide snow canvas (flakes are drawn in winter.js) ---------- */
html.winter #winterSnow{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:50}

/* ---------- scroll progress "festive light" bar ---------- */
html.winter .w-progress{position:fixed;top:0;left:0;right:0;height:3px;z-index:10000;pointer-events:none;
  transform-origin:0 50%;transform:scaleX(0);
  background:linear-gradient(90deg,#d62839,#f4c430,#2e9e5b,#ffffff);box-shadow:0 0 10px rgba(255,255,255,.6)}

/* ---------- Christmas lights under the nav ---------- */
html.winter .nav::after{content:"";position:absolute;left:0;right:0;bottom:-9px;height:10px;pointer-events:none;z-index:5;
  background:
   radial-gradient(circle at 5px 5px,#d62839 3.5px,transparent 4.5px) 0 0/112px 10px repeat-x,
   radial-gradient(circle at 5px 5px,#f4c430 3.5px,transparent 4.5px) 28px 0/112px 10px repeat-x,
   radial-gradient(circle at 5px 5px,#2e9e5b 3.5px,transparent 4.5px) 56px 0/112px 10px repeat-x,
   radial-gradient(circle at 5px 5px,#3aa0ff 3.5px,transparent 4.5px) 84px 0/112px 10px repeat-x;
  filter:drop-shadow(0 0 4px rgba(255,255,255,.55));animation:wTwinkle 1.8s ease-in-out infinite alternate}
@keyframes wTwinkle{from{opacity:.55}to{opacity:1}}

/* ---------- Santa hat on the logo ---------- */
html.winter .brand a{position:relative;display:inline-block}
html.winter .w-hat{position:absolute;top:-14px;left:-10px;width:36px;height:auto;transform-origin:20% 90%;transform:rotate(-14deg);pointer-events:none;z-index:6}

/* ---------- snow drifting off the top edge of every section / footer ---------- */
html.winter section,html.winter footer{position:relative}
html.winter section::before,html.winter footer::before{content:"";position:absolute;left:0;right:0;top:0;height:14px;z-index:1;pointer-events:none;
  background:radial-gradient(circle at 14px 0,rgba(255,255,255,.95) 13px,transparent 14px) 0 0/28px 14px repeat-x}

/* ---------- project cards: snow cap + frost shine that follows the cursor ---------- */
html.winter .project-card,html.winter .emi-card{position:relative}
html.winter .project-card::before{content:"";position:absolute;left:0;right:0;top:0;height:12px;z-index:3;pointer-events:none;
  background:radial-gradient(circle at 12px 0,#fff 11px,transparent 12px) 0 0/24px 12px repeat-x}
html.winter .project-card::after,html.winter .emi-card::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:2;
  background:radial-gradient(260px circle at var(--mx,50%) var(--my,50%),rgba(255,255,255,.22),transparent 60%);opacity:0;transition:opacity .3s}
html.winter .project-card:hover::after,html.winter .emi-card:hover::after{opacity:1}

/* ---------- cursor trail + click burst ---------- */
.w-spark{position:fixed;left:0;top:0;pointer-events:none;z-index:10002;color:#fff;font-size:14px;line-height:1;
  text-shadow:0 0 6px rgba(160,210,255,.95);will-change:transform,opacity}

/* ---------- Christmas greeting ---------- */
.w-toast{position:fixed;left:16px;bottom:64px;max-width:320px;z-index:10001;color:#fff;
  background:rgba(11,18,32,.94);border:1px solid rgba(255,255,255,.2);border-left:3px solid var(--w-accent,#fff);
  border-radius:16px;padding:14px 40px 14px 16px;box-shadow:0 14px 34px rgba(0,0,0,.35);opacity:0}
.w-toast b{display:block;font-size:15px;margin-bottom:2px}
.w-toast span{font-size:13px;color:#cbd5e1}
.w-toast button{position:absolute;top:6px;right:8px;background:none;border:0;color:#fff;font-size:20px;cursor:pointer;line-height:1}

/* ---------- on/off toggle ---------- */
.w-toggle{position:fixed;left:16px;bottom:16px;width:40px;height:40px;border-radius:50%;z-index:10001;cursor:pointer;
  border:1px solid rgba(255,255,255,.35);background:rgba(11,18,32,.9);color:#fff;font-size:18px;line-height:1}
.w-toggle[aria-pressed="false"]{opacity:.55}
.w-toggle:focus-visible{outline:2px solid var(--w-accent,#fff);outline-offset:3px}

/* ---------- switched off by the visitor ---------- */
html.winter.winter-off #winterSnow,html.winter.winter-off .w-progress,html.winter.winter-off .w-hat,
html.winter.winter-off .w-toast,html.winter.winter-off .w-spark,html.winter.winter-off .w-chip{display:none!important}
html.winter.winter-off .nav::after,html.winter.winter-off section::before,html.winter.winter-off footer::before,
html.winter.winter-off .project-card::before,html.winter.winter-off .project-card::after,
html.winter.winter-off .emi-card::after{display:none}

@media (max-width:820px){.w-toggle{bottom:76px}.w-toast{bottom:124px;left:12px;right:12px;max-width:none}}
@media (prefers-reduced-motion:reduce){html.winter #winterSnow,.w-spark{display:none}html.winter .nav::after{animation:none}}
