/* ==========================================================================
   NEON AUDIO — HALLOWEEN EXTRAS (opt-in, on top of halloween.css)
   Load AFTER halloween.css. Pure CSS, no markup change, no JS, no image files.
   Every block below is independent — delete any one of them and the rest stand.
   All motion is disabled under prefers-reduced-motion at the bottom of the file.
   ========================================================================== */

/* ── 1. JACK-O'-LANTERN MARK ────────────────────────────────────────────────
   Carves a face out of the EXISTING sun logo with a CSS mask, so the mark keeps
   its gradient, its retro slice-mask and its 18s colour cycle — it just becomes a
   pumpkin for October. Nothing about the SVG in the markup changes.
   The face is a fill-rule='evenodd' HOLE, not black paint: an image mask is read
   as ALPHA by default, so an opaque black shape carves nothing and the first
   attempt rendered a perfectly normal sun. Holes are alpha 0 and do carve. */
.sunmark,.sun{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23fff' fill-rule='evenodd' d='M0 0 H32 V32 H0 Z M6.5 9 L14 16.5 L6.5 16.5 Z M25.5 9 L18 16.5 L25.5 16.5 Z M5.5 19.5 L10.5 25 L14 19.5 L18 25 L21.5 19.5 L26.5 25 L24 28 L8 28 Z'/%3E%3C/svg%3E");
          mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23fff' fill-rule='evenodd' d='M0 0 H32 V32 H0 Z M6.5 9 L14 16.5 L6.5 16.5 Z M25.5 9 L18 16.5 L25.5 16.5 Z M5.5 19.5 L10.5 25 L14 19.5 L18 25 L21.5 19.5 L26.5 25 L24 28 L8 28 Z'/%3E%3C/svg%3E");
  -webkit-mask-size:contain; mask-size:contain;
  -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
}

/* ── 2. OOZE UNDER THE STICKY NAV ───────────────────────────────────────────
   The header already has a bottom border; this hangs a slow drip off it in the
   signal colour. It is a mask, so it picks up whatever the season's accent is. */
header,.bar{position:relative}
header::after,.bar::after{
  content:"";position:absolute;left:0;right:0;top:100%;height:16px;
  pointer-events:none;background:var(--signal);opacity:.5;
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 16' preserveAspectRatio='none'%3E%3Cpath fill='%23fff' d='M0 0 h240 v2 H0 Z M18 2 q3 9 6 0 Z M54 2 q4 13 8 0 Z M96 2 q2 6 4 0 Z M140 2 q5 15 10 0 Z M186 2 q3 8 6 0 Z M216 2 q4 11 8 0 Z'/%3E%3C/svg%3E");
          mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 16' preserveAspectRatio='none'%3E%3Cpath fill='%23fff' d='M0 0 h240 v2 H0 Z M18 2 q3 9 6 0 Z M54 2 q4 13 8 0 Z M96 2 q2 6 4 0 Z M140 2 q5 15 10 0 Z M186 2 q3 8 6 0 Z M216 2 q4 11 8 0 Z'/%3E%3C/svg%3E");
  -webkit-mask-size:240px 16px; mask-size:240px 16px;
  animation:ooze 9s ease-in-out infinite alternate;
}
@keyframes ooze{0%{transform:translateY(-1px) scaleY(.85)}100%{transform:translateY(0) scaleY(1.15)}}

/* ── 3. COBWEBBED CORNERS ───────────────────────────────────────────────────
   One web in the top-left of each pack card and each panel. Drawn, not an image:
   five radial threads and three arcs, masked so it takes the season's cool tone. */
.card,.links{position:relative;overflow:hidden}
.card::before,.links::before{
  content:"";position:absolute;left:0;top:0;width:72px;height:72px;z-index:1;
  pointer-events:none;background:var(--cool);opacity:.18;
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.1'%3E%3Cpath d='M0 0 L64 0 M0 0 L0 64 M0 0 L64 64 M0 0 L30 64 M0 0 L64 30'/%3E%3Cpath d='M15 0 A15 15 0 0 1 0 15 M33 0 A33 33 0 0 1 0 33 M52 0 A52 52 0 0 1 0 52'/%3E%3C/g%3E%3C/svg%3E");
          mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.1'%3E%3Cpath d='M0 0 L64 0 M0 0 L0 64 M0 0 L64 64 M0 0 L30 64 M0 0 L64 30'/%3E%3Cpath d='M15 0 A15 15 0 0 1 0 15 M33 0 A33 33 0 0 1 0 33 M52 0 A52 52 0 0 1 0 52'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-size:contain; mask-size:contain;
}
.card.featured::before{opacity:.28}

/* ── 4. A BAT CROSSES THE HERO ──────────────────────────────────────────────
   Once every 34s, left to right, above the grid horizon and behind the copy.
   Deliberately ONE bat and deliberately slow: a swarm is a novelty site. */
.hero{position:relative}
.hero::after{
  content:"";position:absolute;top:18%;left:-8%;width:26px;height:16px;z-index:0;
  pointer-events:none;background:var(--ink);opacity:.5;
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 20'%3E%3Cpath fill='%23fff' d='M32 4 C27 0 22 2 20 7 C18.5 4.5 13.5 4.5 12 7 C10 2 5 0 0 4 C4 5 6 9 7.5 14 C9.5 10.5 12 10 14 12 L16 9.5 L18 12 C20 10 22.5 10.5 24.5 14 C26 9 28 5 32 4 Z'/%3E%3C/svg%3E");
          mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 20'%3E%3Cpath fill='%23fff' d='M32 4 C27 0 22 2 20 7 C18.5 4.5 13.5 4.5 12 7 C10 2 5 0 0 4 C4 5 6 9 7.5 14 C9.5 10.5 12 10 14 12 L16 9.5 L18 12 C20 10 22.5 10.5 24.5 14 C26 9 28 5 32 4 Z'/%3E%3C/svg%3E");
  -webkit-mask-size:contain; mask-size:contain; -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
  animation:batfly 34s linear infinite,batflap 0.42s steps(2,end) infinite;
}
@keyframes batfly{
  0%{transform:translate(0,0)}      25%{transform:translate(30vw,-22px)}
  50%{transform:translate(58vw,14px)} 75%{transform:translate(84vw,-16px)}
  100%{transform:translate(118vw,4px)}}
@keyframes batflap{0%{scale:1 1}100%{scale:1 .58}}

/* ── 5. THE 404 BECOMES A HEADSTONE ─────────────────────────────────────────
   Scoped with :has() to the only page that carries <p class="code"> — verified,
   it appears on 404.html and nowhere else on the site. */
body:has(p.code) main{position:relative;padding-top:78px}
body:has(p.code) main::before{
  content:"R.I.P.";position:absolute;top:0;left:50%;transform:translateX(-50%);
  width:190px;padding:46px 0 14px;text-align:center;
  font-family:var(--mono);font-size:19px;letter-spacing:.22em;color:var(--muted);
  background:var(--panel,#17100F);border:1px solid var(--line);
  border-radius:95px 95px 6px 6px;box-shadow:0 0 34px rgba(0,0,0,.6);
}
body:has(p.code) main p.code{position:relative;text-align:center}

/* ── motion opt-out, same contract as the base theme ───────────────────────── */
@media(prefers-reduced-motion:reduce){
  header::after,.bar::after{animation:none}
  .hero::after{animation:none;opacity:0}
}

/* ── 6. THE OCTOBER PROMO BAR ───────────────────────────────────────────────
   The markup for this lives in halloween-promo.html and season.py drops it in as
   the first child of <body> on the homepage only; remove takes it back out. It is
   the one extra that is not pure CSS, because a bar people CLICK has to be real
   links — and it is the one with money in it: October is horror season and there
   is a horror pack plus a horror sampler to point at.
   DELIBERATELY NOT STICKY. The header already is, both at top:0, and two sticky
   bars at the same offset stack on top of each other the moment you scroll. */
#octobar{position:static;display:flex;gap:6px 10px;flex-wrap:wrap;
  justify-content:center;align-items:center;padding:9px 14px;
  font-family:var(--mono);font-size:12.5px;line-height:1.5;letter-spacing:.03em;
  color:var(--ink);
  background:linear-gradient(90deg,rgba(255,140,46,.16),rgba(185,140,255,.16));
  border-bottom:1px solid var(--line)}
#octobar b{color:var(--signal);font-weight:600}
#octobar a{color:var(--ink);text-underline-offset:3px}
#octobar a:hover{color:var(--signal)}

/* The bar adds height at the TOP of the page, and the hero's waveform does not move
   with it: #scope spans the whole hero but the JS pins the centre line to 55% of the
   VIEWPORT (index.html:1529, `vh*CY_VIEW - pageTop`), on purpose, so the waves always
   land on the first screen. Add ~50px above the hero and the headline slides down into
   them — "fall flat" ends up with a wave drawn through it. Caught by screenshotting the
   shipped page, not by reading the CSS. So: give the hero back what the bar took.
   Scoped with :has() so it only applies while the bar is actually on the page. */
body:has(#octobar) .hero{padding-top:44px}
@media(max-width:720px){
  #octobar{font-size:11.5px;padding:8px 12px;gap:4px 8px}
  body:has(#octobar) .hero{padding-top:34px}
}
