/* 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.
   Wszystko jest pod :root:not(.season-off), więc przycisk „ukryj motyw” wyłącza całość. */

:root:not(.season-off) { --season-glow: color-mix(in srgb, var(--nv-brand) 30%, transparent); }

/* Mocniejsza „łuna” sezonu nad stałym tłem. */
:root:not(.season-off) body {
  background-image:
    radial-gradient(60rem 26rem at 85% -6rem, var(--season-glow), transparent 70%),
    radial-gradient(50rem 22rem at 5% -8rem, color-mix(in srgb, var(--brand-2) 22%, transparent), transparent 70%);
}

/* Lampion-dynia przy logo: małe SVG z migoczącym światłem. */
:root:not(.season-off) .nv-nav__brand { position: relative; }
:root:not(.season-off) .nv-nav__brand::after {
  content: ""; inline-size: 18px; block-size: 18px; margin-inline-start: 6px; flex: none; animation: season-flicker 3.2s ease-in-out infinite;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 6c1-3 3-4 5-4' stroke='%2316a34a' 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 9c-2 3-3 6-3 10s1 8 3 10M22 9c2 3 3 6 3 10s-1 8-3 10M16 8v22' stroke='%23c2410c' stroke-width='1.2' fill='none'/%3E%3Cpath d='M9 16l4 2-4 2zM23 16l-4 2 4 2zM10 23q6 5 12 0l-2 1-2-1-2 1-2-1-2 1z' fill='%23fde68a'/%3E%3C/svg%3E") center / contain no-repeat;
}
@keyframes season-flicker { 0%, 100% { filter: drop-shadow(0 0 2px #fb923c); } 40% { filter: drop-shadow(0 0 6px #fdba74); } 55% { filter: drop-shadow(0 0 1px #f97316); } 70% { filter: drop-shadow(0 0 5px #fb923c); } }

/* Pajęczyna w rogu z pająkiem, który zjeżdża na nitce (tylko szerokie ekrany, nic nie zasłania). */
.season-web { position: fixed; inset-block-start: 0; inset-inline-end: 0; z-index: 0; pointer-events: none; inline-size: 200px; block-size: 200px; opacity: .3;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23999' stroke-width='.6'%3E%3Cpath d='M100 0 0 100M100 0 30 100M100 0 0 30M100 0 60 100M100 0 0 60'/%3E%3Cpath d='M80 0q3 14 20 20M60 0q5 30 40 40M40 0q8 46 60 60M20 0q10 60 80 80'/%3E%3C/svg%3E") no-repeat top right / contain; }
.season-spider { position: fixed; inset-block-start: 0; inset-inline-end: 64px; z-index: 0; pointer-events: none; display: grid; justify-items: center; animation: season-drop 9s ease-in-out infinite; }
.season-spider::before { content: ""; inline-size: 1px; block-size: var(--thread, 90px); background: color-mix(in srgb, currentColor 35%, transparent); }
.season-spider svg { inline-size: 26px; block-size: 26px; margin-block-start: -2px; color: var(--nv-color-text-secondary, #888); }
@keyframes season-drop { 0%, 100% { transform: translateY(-40px); } 45%, 60% { transform: translateY(60px); } }
@media (max-width: 64rem) { .season-web, .season-spider { display: none; } }

/* Nietoperze z machającymi skrzydłami (rysuje je halloween.js). */
.season-bat { position: fixed; inset: 0 auto auto 0; z-index: 1; pointer-events: none; opacity: .85;
  animation: season-fly var(--d, 18s) linear var(--delay, 0s) infinite; }
.season-bat span { display: block; font-size: var(--s, 24px); line-height: 1; animation: season-flap .35s ease-in-out infinite alternate; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--nv-brand) 45%, transparent)); }
@keyframes season-flap { from { transform: scaleY(1) rotate(-4deg); } to { transform: scaleY(.7) rotate(4deg); } }
@keyframes season-fly {
  0%   { transform: translate(-12vw, var(--y, 20vh)); }
  25%  { transform: translate(25vw, calc(var(--y, 20vh) - 7vh)); }
  50%  { transform: translate(55vw, calc(var(--y, 20vh) + 5vh)); }
  75%  { transform: translate(85vw, calc(var(--y, 20vh) - 6vh)); }
  100% { transform: translate(112vw, var(--y, 20vh)); }
}

/* Mgła przy dolnej krawędzi ekranu. */
.season-fog { position: fixed; inset: auto 0 0 0; block-size: 18vh; z-index: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(40% 70% at 20% 100%, color-mix(in srgb, var(--brand-2) 22%, transparent), transparent 70%),
              radial-gradient(45% 80% at 75% 100%, color-mix(in srgb, var(--nv-brand) 14%, transparent), transparent 70%);
  animation: season-fog 22s ease-in-out infinite alternate; }
@keyframes season-fog { from { transform: translateX(-3%); } to { transform: translateX(3%); } }

.season-off .season-bat, .season-off .season-web, .season-off .season-spider, .season-off .season-fog { display: none; }
@media (prefers-reduced-motion: reduce) { .season-bat { display: none; } .season-spider, .season-fog, .nv-nav__brand::after { animation: none !important; } }

/* Przycisk ukrycia/pokazania motywu. */
.season-toggle { position: fixed; inset-block-end: 16px; inset-inline-start: 16px; z-index: 50; inline-size: 42px; block-size: 42px; border-radius: 50%;
  border: 1px solid var(--nv-color-border, rgb(127 127 127 / .3)); background: var(--nv-color-surface, #fff); box-shadow: 0 4px 18px color-mix(in srgb, var(--nv-brand) 35%, transparent);
  font-size: 20px; cursor: pointer; display: grid; place-items: center; transition: transform .15s; }
.season-toggle:hover { transform: scale(1.08) rotate(-6deg); }
.season-off .season-toggle { opacity: .55; filter: grayscale(1); box-shadow: 0 4px 16px rgb(0 0 0 / .18); }
@media print { .season-bat, .season-toggle, .season-web, .season-spider, .season-fog { display: none !important; } }
