/* Halloween — same ozdoby sezonowe (lib/seasonal.js). Kolory marki (pomarańcz + nocny fiolet) są stałe w meta.ejs/app.css,
   więc po sezonie wystarczy usunąć ten plik i halloween.js — wygląd zostaje, znikają tylko ozdoby.
   Zasady: nic nie zasłania treści (ozdoby leżą POD kartami, z-index -1), nic nie miga w kółko, nietoperze przelatują raz na sesję.
   Wszystko jest pod :root:not(.season-off), więc przycisk „ukryj ozdoby” wyłącza całość. */

/* Ciepła łuna „latarni” u góry strony — delikatnie mocniejsza niż stałe tło marki. */
:root:not(.season-off) body {
  background-image:
    radial-gradient(56rem 24rem at 86% -7rem, color-mix(in srgb, var(--nv-brand) 22%, transparent), transparent 70%),
    radial-gradient(48rem 22rem at 4% -8rem, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 70%);
}

/* Dynia przy logo: mały, statyczny kafel; świeci tylko po najechaniu na logo. */
:root:not(.season-off) .nv-nav__brand::after {
  content: ""; inline-size: 16px; block-size: 16px; margin-inline-start: 6px; flex: none; transition: filter .3s, transform .3s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 7c.6-2.6 2.4-4 4.6-4' stroke='%2315803d' stroke-width='2.4' fill='none' stroke-linecap='round'/%3E%3Cellipse cx='16' cy='19' rx='13' ry='11' fill='%23f97316'/%3E%3Cpath d='M10.5 9.5c-2 2.6-3 5.6-3 9.5s1 7 3 9.5M21.5 9.5c2 2.6 3 5.6 3 9.5s-1 7-3 9.5' stroke='%23c2410c' stroke-width='1.1' fill='none' opacity='.7'/%3E%3Cpath d='M9.5 16.5l3.5 1.8-3.5 1.7zM22.5 16.5l-3.5 1.8 3.5 1.7zM10.5 23q5.5 4 11 0l-1.8.9-1.8-.9-1.9.9-1.8-.9-1.9.9z' fill='%23fde68a'/%3E%3C/svg%3E") center / contain no-repeat;
}
:root:not(.season-off) .nv-nav__brand:hover::after { filter: drop-shadow(0 0 5px #fb923c); transform: rotate(-8deg); }

/* Pajęczyna w prawym górnym rogu (pod treścią, tylko szerokie ekrany) i pająk, który lekko się kołysze. */
.season-web { position: fixed; inset-block-start: 0; inset-inline-end: 0; z-index: -1; pointer-events: none; inline-size: 170px; block-size: 170px; opacity: .22;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23a1a1aa' stroke-width='.55' stroke-linecap='round'%3E%3Cpath d='M100 0 8 100M100 0 38 100M100 0 0 22M100 0 66 100M100 0 0 56'/%3E%3Cpath d='M82 0q4 12 18 18M64 0q6 26 36 36M44 0q9 42 56 56M24 0q12 58 76 76'/%3E%3C/svg%3E") no-repeat top right / contain; }
.season-spider { position: fixed; inset-block-start: 0; inset-inline-end: 58px; z-index: -1; pointer-events: none; display: grid; justify-items: center;
  transform-origin: 50% 0; animation: season-sway 7s ease-in-out infinite; color: var(--nv-color-text-tertiary, #888); opacity: .7; }
.season-spider::before { content: ""; inline-size: 1px; block-size: var(--thread, 80px); background: color-mix(in srgb, currentColor 45%, transparent); }
.season-spider svg { inline-size: 18px; block-size: 18px; margin-block-start: -1px; }
@keyframes season-sway { 0%, 100% { transform: rotate(3deg); } 50% { transform: rotate(-3deg); } }

/* Nietoperze (sylwetki SVG, nie emoji): przelatują raz przez górę ekranu i znikają. */
.season-bat { position: fixed; inset: 0 auto auto 0; z-index: -1; pointer-events: none; color: color-mix(in srgb, var(--nv-color-text, #222) 70%, var(--brand-2));
  opacity: 0; animation: season-fly var(--d, 9s) cubic-bezier(.45, .05, .55, .95) var(--delay, 0s) 1 forwards; }
.season-bat svg { display: block; inline-size: var(--s, 22px); block-size: auto; animation: season-flap .28s ease-in-out infinite alternate; }
@keyframes season-flap { from { transform: scaleY(1); } to { transform: scaleY(.55); } }
@keyframes season-fly {
  0%   { opacity: 0; transform: translate(-6vw, var(--y, 14vh)); }
  8%   { opacity: .55; }
  50%  { transform: translate(48vw, calc(var(--y, 14vh) - 5vh)); }
  92%  { opacity: .55; }
  100% { opacity: 0; transform: translate(104vw, calc(var(--y, 14vh) + 2vh)); }
}

@media (max-width: 64rem) { .season-web, .season-spider { display: none; } }
.season-off .season-bat, .season-off .season-web, .season-off .season-spider { display: none; }
@media (prefers-reduced-motion: reduce) { .season-bat { display: none; } .season-spider { animation: none; } }

/* Przycisk ukrycia/pokazania ozdób — mały przycisk Niveus w rogu. */
.season-toggle.nv-button { position: fixed; inset-block-end: 14px; inset-inline-end: 14px; z-index: 15; } /* pod paskiem „Zapisz zmiany” */
.season-toggle svg { inline-size: 18px; block-size: 18px; }
.season-off .season-toggle { opacity: .6; }
.season-off .season-toggle svg { filter: grayscale(1); }
/* Na telefonie przycisk zasłaniałby treść, a ozdób jest tam mało (dynia przy logo, nietoperze raz na sesję). */
@media (max-width: 40rem) { .season-toggle.nv-button { display: none; } }
@media print { .season-bat, .season-toggle, .season-web, .season-spider { display: none !important; } }
