/* THE SEASONS — the Foundry's dress-up (js/tricks/seasons.js, js/lib/season-decor.js).
   html.season-spooky (October) · html.season-winter (December) · html.season-visit (a flip of the Break Room calendar) */

/* the "visiting" pill */
.season-pill {
  position: fixed; z-index: 66; left: 50%; top: calc(var(--head-h) + 10px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border-radius: 99px; white-space: nowrap;
  background: var(--outline); color: var(--cream); border: 3px solid var(--molten); box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  font: 700 .92rem/1 var(--font-display); animation: pop-in .4s var(--spring);
}
html.season-spooky .season-pill { border-color: var(--violet); }
html.season-winter .season-pill { border-color: #8FD3FF; }
.season-pill button { min-height: 34px; padding: 6px 14px; border-radius: 99px; border: 2px solid var(--outline); background: var(--cream); color: var(--outline); font: inherit; cursor: pointer; }
.season-pill button:hover { background: var(--molten); }

/* ── SPOOKY FOUNDRY (October) ───────────────────────────────────────────────── */
html.season-spooky .roof-orb svg { filter: sepia(1) saturate(6) hue-rotate(-52deg); }
html.season-spooky .roof-glow { filter: hue-rotate(-30deg) saturate(1.4); }
html.season-spooky .roof-pigeon svg { filter: brightness(.32) saturate(0) contrast(1.3); }

/* cobwebs in the corners of every floor */
.sz-web { position: absolute; z-index: 3; top: 0; width: clamp(90px, 11vw, 150px); color: rgba(235, 238, 255, .38); pointer-events: none; }
.sz-web svg { display: block; width: 100%; height: auto; }
.sz-web-l { left: clamp(0px, 4.5vw, 64px); }
.sz-web-r { right: 0; transform: scaleX(-1); }
.sz-web-small { width: clamp(56px, 6vw, 84px); opacity: .7; }
@media (max-width: 760px) { .sz-web-l { left: 0; } }

/* bats around the moon */
.sz-bats { position: absolute; left: 47%; top: 16%; z-index: 2; width: 0; height: 0; pointer-events: none; }
.sz-bat { position: absolute; left: -22px; top: -11px; width: 44px; animation: sz-bat-loop 9s ease-in-out infinite; }
.sz-bat svg { display: block; width: 100%; height: auto; }
.sz-bat .sz-wing { transform-box: fill-box; animation: sz-flap .18s ease-in-out infinite alternate; }
.sz-bat .sz-wing-l { transform-origin: 100% 60%; }
.sz-bat .sz-wing-r { transform-origin: 0% 60%; }
.sz-bat-2 { width: 34px; animation-duration: 11s; animation-delay: -4s; }
.sz-bat-3 { width: 28px; animation-duration: 13s; animation-delay: -8s; }
@keyframes sz-flap { to { transform: scaleY(.35) rotate(8deg); } }
@keyframes sz-bat-loop {
  0% { transform: translate(-150px, 30px) scale(.8); }
  25% { transform: translate(-30px, -80px) scale(1); }
  50% { transform: translate(140px, -10px) scale(.9) scaleX(-1); }
  75% { transform: translate(40px, 90px) scale(1.1) scaleX(-1); }
  100% { transform: translate(-150px, 30px) scale(.8); }
}

/* the pumpkin on the rooftop fan (Jack-o'-Lantern) */
.roof-pumpkin, .roof-snow {
  position: absolute; z-index: 3; left: 9%; width: 11%; padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.roof-pumpkin { top: 72%; aspect-ratio: 100 / 92; animation: sz-drop-in .6s var(--spring) both; }
.roof-pumpkin svg, .roof-snow svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 100%; }
.roof-pumpkin:hover svg, .roof-snow:hover svg { transform: scale(1.05, .96); transition: transform .3s var(--spring); }
.roof-pumpkin.is-poke svg, .roof-snow.is-poke svg { animation: sz-squash .45s var(--spring); }
.roof-pumpkin .pk-face path { fill: #3A1A00; opacity: 0; transition: opacity .2s, fill .4s; }
.roof-pumpkin[data-step="1"] .pk-eyes, .roof-pumpkin[data-step="2"] .pk-eyes, .roof-pumpkin[data-step="2"] .pk-nose,
.roof-pumpkin[data-step="3"] .pk-face path { opacity: 1; }
.roof-pumpkin .pk-glow { opacity: 0; transition: opacity .6s; }
.roof-pumpkin.is-lit .pk-glow { opacity: .85; animation: sz-flicker 1.4s ease-in-out infinite; }
.roof-pumpkin.is-lit .pk-face path { fill: #FFE07A; }
.roof-pumpkin.is-lit svg { filter: drop-shadow(0 0 12px rgba(255, 170, 40, .75)); }
@keyframes sz-flicker { 0%, 100% { opacity: .85; } 30% { opacity: .6; } 55% { opacity: 1; } 70% { opacity: .72; } }
@keyframes sz-squash { 30% { transform: scale(1.12, .84); } 60% { transform: scale(.94, 1.08); } }
@keyframes sz-drop-in { from { transform: translateY(-60%) scale(.6); opacity: 0; } }

/* the spider that drops in from the header */
.sz-spider { position: fixed; z-index: 49; top: var(--head-h); width: 38px; height: 0; pointer-events: none; }
.sz-thread { position: absolute; left: 50%; top: 0; width: 1.5px; height: 0; background: rgba(220, 225, 255, .55); transition: height 2.2s cubic-bezier(.3, .7, .3, 1); }
.sz-spider-body {
  position: absolute; left: 0; top: -44px; width: 38px; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto;
  transition: transform 2.2s cubic-bezier(.3, .7, .3, 1); transform-origin: 50% 0;
}
.sz-spider-body svg { display: block; width: 100%; height: auto; }
.sz-spider.is-down .sz-thread { height: 110px; }
.sz-spider.is-down .sz-spider-body { transform: translateY(150px); animation: sz-sway 2.6s ease-in-out 2.2s infinite; }
.sz-spider.is-scurry .sz-thread, .sz-spider.is-scurry .sz-spider-body { transition-duration: .5s; }
.sz-spider-body .sz-legs-a, .sz-spider-body .sz-legs-b { transform-box: fill-box; transform-origin: 50% 50%; }
.sz-spider.is-down .sz-legs-a { animation: sz-wiggle .4s ease-in-out infinite alternate; }
@keyframes sz-sway { 0%, 100% { transform: translateY(150px) rotate(-6deg); } 50% { transform: translateY(150px) rotate(6deg); } }
@keyframes sz-wiggle { to { transform: rotate(6deg); } }
@media print { .sz-spider, .sz-snow, .season-pill { display: none !important; } }

/* ── SNOW DAY (December) ───────────────────────────────────────────────────── */
/* snow on the header and the roof */
html.season-winter .site-head::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -11px; height: 14px; pointer-events: none;
  background: linear-gradient(#F4F8FF, #F4F8FF) 0 0 / 100% 5px no-repeat,
              radial-gradient(ellipse 9px 7px at 50% 4px, #F4F8FF 98%, transparent) 0 0 / 23px 14px repeat-x,
              radial-gradient(ellipse 6px 9px at 50% 4px, #E9F2FF 98%, transparent) 11px 0 / 41px 14px repeat-x;
  filter: drop-shadow(0 2px 0 rgba(13, 17, 32, .3));
}
html.season-winter .rp-cap { position: relative; }
html.season-winter .rp-cap::after {
  content: ''; position: absolute; left: -2px; right: -2px; top: -10px; height: 16px; border-radius: 10px 10px 4px 4px;
  background: radial-gradient(circle at 18px 100%, #F4F8FF 10px, transparent 10.5px) 0 0 / 46px 16px repeat-x, linear-gradient(#F4F8FF, #E3EEFF);
  border: 3px solid var(--outline); border-bottom: 0;
}
html.season-winter .roof-chimney::after {
  content: ''; position: absolute; left: 3%; right: 3%; top: 1.6%; height: 4%; border-radius: 40% 40% 20% 20%;
  background: #F4F8FF; border: 3px solid var(--outline); pointer-events: none;
}
html.season-winter .roof-orb svg { filter: saturate(.6) brightness(1.08) hue-rotate(160deg); }

/* icicles along the top of every floor */
.sz-ice {
  position: absolute; z-index: 3; left: 0; right: 0; top: 0; height: 26px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 26'%3E%3Cpath d='M0 0 H120 V4 Q114 4 112 8 L109 22 L106 8 Q102 4 96 6 L93 14 L90 6 Q84 3 76 6 L72 24 L68 6 Q60 3 52 6 L49 12 L46 6 Q38 3 30 6 L27 20 L24 6 Q16 3 10 6 L7 13 L4 5 Q2 4 0 4 Z' fill='%23E9F4FF' stroke='%230D1120' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0 / 120px 26px repeat-x;
  filter: drop-shadow(0 2px 4px rgba(150, 200, 255, .35));
}

/* the snow pile on the rooftop fan (Snow Day) */
.roof-snow { top: 67%; aspect-ratio: 100 / 120; animation: sz-drop-in .6s var(--spring) both; }
.roof-snow .sn-legs, .roof-snow .sn-arms, .roof-snow .sn-head, .roof-snow .sn-face { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; transform: scale(.3); transition: opacity .2s, transform .45s var(--spring); }
.roof-snow[data-step="1"] .sn-legs, .roof-snow[data-step="2"] .sn-legs, .roof-snow[data-step="3"] .sn-legs,
.roof-snow[data-step="2"] .sn-head, .roof-snow[data-step="3"] .sn-head,
.roof-snow[data-step="3"] .sn-arms, .roof-snow[data-step="3"] .sn-face { opacity: 1; transform: none; }

/* gentle snowfall over the whole page */
.sz-snow { position: fixed; inset: 0; z-index: 64; pointer-events: none; overflow: hidden; }
.sz-snow i {
  position: absolute; top: -12px; border-radius: 50%; background: #F4F8FF; box-shadow: 0 0 4px rgba(255, 255, 255, .8);
  animation: sz-fall linear infinite, sz-drift ease-in-out infinite alternate;
}
@keyframes sz-fall { to { transform: translateY(calc(100vh + 24px)); } }
@keyframes sz-drift { to { margin-left: 30px; } }

/* calm mode: everything stays put */
html.calm .sz-bat, html.calm .sz-bat .sz-wing, html.calm .roof-pumpkin.is-lit .pk-glow, html.calm .sz-spider.is-down .sz-spider-body,
html.calm .sz-spider.is-down .sz-legs-a, html.calm .roof-pumpkin, html.calm .roof-snow, html.calm .roof-pumpkin.is-poke svg, html.calm .roof-snow.is-poke svg { animation: none; }
html.calm .sz-snow { display: none; }
html.calm .sz-spider-body, html.calm .sz-thread { transition: none; }
@media (prefers-reduced-motion: reduce) { .sz-snow { display: none; } .sz-bat, .sz-bat .sz-wing { animation: none; } }
