/* ============ THE CONSUL — Halloween ============
   Everything here is built by assets/js/halloween.js, and only in season. */

.hw-defs{position:absolute;width:0;height:0;overflow:hidden}

/* the pen: webs spun in fine antique-gold silk; gold on the dark grounds */
.hw-ink{fill:none;stroke:var(--ink);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;visibility:hidden}
.hw-web .hw-ink{stroke:rgba(150,110,58,.58);stroke-width:.9}
.chapter--dark .hw-ink,.hw-web--band .hw-ink{stroke:rgba(233,181,121,.6)}
/* dew on the silk, catching the light once the web is spun (halloween.js) */
.hw-dew{fill:url(#hwDew);opacity:0;transition:opacity 1.2s ease}
.is-spun .hw-dew{opacity:1;animation:hwDew 4.2s var(--tw,0s) ease-in-out infinite}
@keyframes hwDew{0%,100%{opacity:.45}50%{opacity:1}}

/* ---------------- the sketch at night ----------------
   laid exactly over the sketch, under the photograph; the hero gains the
   scroll for its extra stage */
#wickedImg{z-index:1;opacity:0}
.is-halloween .hero-track{height:540vh}

/* the wordmark by night: layers over the letters (halloween.js), shown with the night.
   A glow needs its filter on a parent: a masked element's own filter is cut away by its mask. */
.is-halloween .hero-title__word{position:relative}
.hw-word{position:absolute;inset:0;pointer-events:none;opacity:0}
.hw-word > span,.hw-word .wordmark{position:absolute;left:0;top:0;width:100%;height:100%}
.hw-word__moon{filter:blur(.32em);opacity:.5}
.hw-word__moon .wordmark{background:#b9a4ff}
.hw-word__halo{filter:blur(.1em);animation:hwFlame 3.4s ease-in-out infinite}
.hw-word__halo .wordmark{background:#ffae4f}
/* candlelight passing through the letters, left to right, then a rest */
.hw-word__lit{background:linear-gradient(100deg,#f6dfb8 0%,#f6dfb8 40%,#ffcf73 45%,#fffaf0 50%,#d8c4ff 55%,#f6dfb8 61%,#f6dfb8 100%) 100% 0/300% 100% no-repeat;
  animation:hwSheen 5.6s cubic-bezier(.45,0,.3,1) infinite}
.hw-word__spark{position:absolute;inset:-.55em -.3em;width:calc(100% + .6em);height:calc(100% + 1.1em)}
@keyframes hwSheen{0%{background-position:100% 0}68%,100%{background-position:0 0}}
@keyframes hwFlame{0%,100%{opacity:.75}18%{opacity:.95}31%{opacity:.68}47%{opacity:.9}63%{opacity:.62}82%{opacity:.88}}

/* ---------------- cobwebs ---------------- */
.hw-web{position:absolute;top:0;z-index:7;pointer-events:none}
.hw-web svg{display:block;width:100%;height:100%;overflow:visible}
.hw-web--left{left:0}
.hw-web--right{right:0;transform:scaleX(-1)}
/* an act's web is placed by its arch (left/top set by the script) */
.hw-web--arch{right:auto;z-index:3}
.hw-web--arch .hw-ink{stroke:rgba(150,110,58,.5)}
/* the membership band's web, in the corner of its dark ground */
.hw-web--band{z-index:2}

/* ---------------- the spider on its silk ---------------- */
.hw-hang{position:absolute;z-index:7;width:40px;margin-left:-20px;overflow:hidden;pointer-events:none}
.chapter .hw-hang{z-index:3}
.hw-drop{position:absolute;left:0;right:0;top:0}
.hw-bob{position:relative;animation:hwBob 3.4s ease-in-out infinite}
.hw-silk{position:absolute;left:50%;bottom:calc(100% - 10px);width:1px;height:3000px;margin-left:-.5px;
  background:rgba(150,110,58,.5)}
/* a sleek black spider with a fine gold mark */
.hw-spider{display:block;width:24px;height:24px;margin:0 auto;fill:#120a05;overflow:visible}
.hw-spider .hw-legs{fill:none;stroke:#120a05;stroke-width:.85;stroke-linecap:round;stroke-linejoin:round}
.hw-spider__mark{fill:var(--gold)}
.hw-spider__sheen{fill:rgba(255,236,200,.32)}
.hw-hang--band{z-index:2}
.hw-hang--band .hw-silk{background:rgba(233,181,121,.45)}
.hw-hang--band .hw-spider{filter:drop-shadow(0 0 1.5px rgba(233,181,121,.75))}
@keyframes hwBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}

/* Act III's spider on its way down the page (halloween.js): a layer over the page, under the nav */
.hw-journey{position:fixed;inset:0;z-index:61;pointer-events:none;visibility:hidden;overflow:hidden}
.hw-journey--silk{z-index:50}
html.mnav-open .hw-journey{display:none}   /* never over the open phone menu */
.hw-journey__silk{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.hw-journey__silk line{stroke:rgba(150,110,58,.62);stroke-width:1;transition:stroke .5s}
.hw-journey--silk.is-dark .hw-journey__silk line{stroke:rgba(233,181,121,.6)}
.hw-journey__spider{position:absolute;left:0;top:0;width:24px;height:24px;margin:-12px 0 0 -12px;will-change:transform}
.hw-journey .hw-spider{transition:filter .5s}
.hw-journey.is-dark .hw-spider{filter:drop-shadow(0 0 .6px rgba(246,214,160,1)) drop-shadow(0 0 3px rgba(233,181,121,.55))}
.hw-journey.is-dark .hw-spider__sheen{fill:rgba(255,236,200,.5)}
/* its catchers: real bats, close up and all black, no gold */
.hw-cbat{position:absolute;left:0;top:0;width:200px;height:100px;margin:-50px 0 0 -100px;opacity:0;will-change:transform,opacity}
.hw-cbat svg{display:block;width:100%;height:100%;overflow:visible}
.hw-cbat__wing{transform-box:fill-box;transform-origin:0 46%;
  animation:hwBeat var(--flap,.32s) var(--delay,0s) ease-in-out infinite alternate}
.hw-cbat__skin{fill:url(#hwBatSkin)}
.hw-cbat__bone{fill:none;stroke:#2e2621;stroke-width:.9;stroke-linecap:round}
.hw-cbat__fur{fill:url(#hwBatFur)}
.hw-cbat__tuft{fill:none;stroke:#302823;stroke-width:.6;stroke-linecap:round}
.hw-cbat__claw{fill:none;stroke:#1c1512;stroke-width:1;stroke-linecap:round;stroke-linejoin:round}
.hw-cbat__ear{fill:#3a2622}
.hw-cbat__muzzle{fill:#16100d}
.hw-cbat__eye{fill:#040202}
.hw-cbat__glint{fill:#f6efe4;opacity:.9}
.hw-cbat__nose{fill:#2b1d19}
.hw-cbat__mouth{fill:#4a1714}
.hw-cbat__fang{fill:#f1e9dc}
@keyframes hwBeat{from{transform:rotate(-30deg) scaleY(.55)}to{transform:rotate(22deg) scaleY(1)}}

/* ---------------- bats ---------------- */
.hw-bats{position:absolute;inset:0;z-index:7;pointer-events:none;overflow:hidden}
.hw-bat{position:absolute;left:0;top:0;width:90px;height:40px;margin:-20px 0 0 -45px;opacity:0;
  will-change:transform,opacity}
.hw-bat svg,.hw-mbat svg{display:block;width:100%;height:100%;fill:#140b06;overflow:visible}
/* the fingers through the wing, a breath of gold */
.hw-bat__bones{fill:none;stroke:rgba(233,181,121,.3);stroke-width:.6;stroke-linecap:round}
.hw-mbat .hw-bat__bones{stroke:rgba(65,38,18,.35)}
/* a breath of candlelight on the edge, so they still read against the sketch at night */
.hw-bat svg{stroke:rgba(246,196,120,.55);stroke-width:.8;paint-order:stroke;stroke-linejoin:round}
.hw-bat__wing{transform-box:fill-box;transform-origin:0 59%;
  animation:hwFlap var(--flap,.26s) var(--delay,0s) ease-in-out infinite alternate}
.hw-bat__eye{fill:var(--gold)}
@keyframes hwFlap{from{transform:rotate(-38deg) scaleY(.5)}to{transform:rotate(24deg) scaleY(1)}}

/* the marquee's bats, in its gold, beating slowly */
.marquee__row .hw-mbat{width:30px;height:13px;opacity:1}
.hw-mbat svg{fill:var(--gold)}
.hw-mbat .hw-bat__wing{--flap:.55s}
.hw-mbat .hw-bat__eye{fill:var(--brown)}

/* bats behind an arch: they leave from under it as the visitor scrolls (halloween.js) */
.hw-flock{position:absolute;inset:0;z-index:1;pointer-events:none}
.is-halloween .chapter__media{z-index:2}
.is-halloween .member{isolation:isolate}
.member .hw-flock{z-index:-1}
/* on the dark grounds a bat is a silhouette edged in gold */
.chapter--dark .hw-bat svg,.member .hw-bat svg{stroke:rgba(233,181,121,.85);stroke-width:1.2}
.chapter--dark .hw-bat__bones,.member .hw-bat__bones{stroke:rgba(233,181,121,.5)}

/* Halloween week: the lantern's place on the line of "On stage this week" (halloween.js
   widens it as the lantern flies in), and the lantern in flight */
.hw-tlan{position:relative;display:inline-block;width:0;height:.8em;vertical-align:baseline}
.hw-tlan .hw-lantern{position:absolute;left:0;bottom:-.1em;width:.98em;visibility:hidden}
.hw-tlan.is-here .hw-lantern{visibility:visible}
.hw-flylan.hw-lantern{position:absolute;left:0;top:0;visibility:hidden;will-change:transform}
.hw-tlan .hw-pk,.hw-flylan .hw-pk{filter:drop-shadow(0 0 1px rgba(233,181,121,.35)) drop-shadow(0 6px 8px rgba(0,0,0,.5))}
.hw-tlan .hw-flame,.hw-flylan .hw-flame{filter:none}

/* ---------------- jack-o'-lanterns at the foot of the arches ----------------
   left/top (set by the script) are the arch outline's bottom corner; the
   lantern (two pictures, unlit and lit, one on the other) stands on that
   line, centred on it */
.is-halloween .chapter__inner{position:relative}
.hw-patch{--hw:1.1;position:absolute;z-index:3;pointer-events:none;transform:translate(calc(-52px * var(--hw)),-92%)}
.hw-lantern{position:relative;width:calc(104px * var(--hw))}
.hw-pk{display:block;width:100%;height:auto}
.hw-lantern > .hw-pk{filter:drop-shadow(0 9px 9px rgba(20,12,6,.38))}
.chapter--dark .hw-lantern > .hw-pk{filter:drop-shadow(0 0 1px rgba(233,181,121,.35)) drop-shadow(0 9px 10px rgba(0,0,0,.5))}

/* the candle: GSAP lights it, the flame flickers by itself */
.hw-lit,.hw-halo{opacity:0}
.hw-lit{position:absolute;inset:0}
.is-lit .hw-lit,.is-lit .hw-halo{opacity:1}
.hw-flame{animation:hwFlicker 2.6s steps(1,end) infinite}
.hw-halo{position:absolute;left:50%;top:56%;width:260%;aspect-ratio:1;transform:translate(-50%,-50%);pointer-events:none}
.hw-halo i{position:absolute;inset:0;border-radius:50%;
  background:radial-gradient(closest-side,rgba(255,186,98,.36),rgba(255,150,60,.1) 45%,rgba(255,150,60,0));
  animation:hwGlowBreath 2.6s ease-in-out infinite}
.chapter--dark .hw-halo i{background:radial-gradient(closest-side,rgba(255,180,90,.46),rgba(255,140,50,.14) 45%,rgba(255,140,50,0))}
@keyframes hwFlicker{
  0%{opacity:1}12%{opacity:.84}19%{opacity:.97}33%{opacity:.9}41%{opacity:1}
  58%{opacity:.8}63%{opacity:.95}79%{opacity:.88}88%{opacity:1}
}
@keyframes hwGlowBreath{0%,100%{opacity:1;transform:scale(1)}47%{opacity:.78;transform:scale(.95)}71%{opacity:.92;transform:scale(1.02)}}

@media (max-width:880px){
  .is-halloween .hero-track{height:390vh}
  .hw-patch{--hw:.72}
  /* the title keeps one line with its lantern */
  .is-halloween .live__title{font-size:min(36px,8.3vw);white-space:nowrap}
}

@media (prefers-reduced-motion:reduce){
  .hw-bob,.hw-bat__wing,.hw-cbat__wing,.hw-flame,.hw-halo i,.hw-word__halo,.hw-word__lit,.is-spun .hw-dew{animation:none}
}
