/* evvoli Halloween layer — self-contained, only active when <html> has .hw-lights or .hw-pumpkin.
   Rule (Gemma, 23 Oct): every change animates smoothly, nothing pops or jumps; reduced motion = instant.
   Look (Gemma, 23 Oct): silent film. Silver projector light, black-and-white inside it, title cards with a fine
   off-white double frame and Playfair italic. No coloured glow. */
:root{--hw-ink:#efebe3;--hw-ink-soft:rgba(239,235,227,.72);--hw-rule:rgba(239,235,227,.42);--hw-card:#0a0a0a}
@keyframes hwIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ---------- 1. Lights out ---------- */
#hw-dark{position:fixed;inset:0;z-index:38;pointer-events:none;opacity:0;transition:opacity 1.4s ease;
  --x:50vw;--y:55vh;--r:240px;
  background:
    radial-gradient(circle var(--r) at var(--x) var(--y),rgba(4,6,8,0) 0%,rgba(4,6,8,.15) 35%,rgba(4,6,8,.64) 75%,rgba(3,4,6,.76) 100%)}
.hw-lights #hw-dark{opacity:1}
/* projector light: plain silver; inside it the page turns black-and-white, like old film */
#hw-dark::before{content:'';position:absolute;inset:0;mix-blend-mode:screen;
  background:radial-gradient(circle calc(var(--r) * .8) at var(--x) var(--y),rgba(236,233,226,.13),rgba(236,233,226,.04) 55%,rgba(236,233,226,0) 80%)}
/* film lens: under the light the page itself turns black-and-white (backdrop filter, masked to the beam) */
#hw-film{position:fixed;inset:0;z-index:37;pointer-events:none;opacity:0;transition:opacity 1.4s ease;--x:50vw;--y:55vh;--r:240px;
  -webkit-backdrop-filter:grayscale(1) contrast(1.06);backdrop-filter:grayscale(1) contrast(1.06);
  -webkit-mask-image:radial-gradient(circle calc(var(--r) * .95) at var(--x) var(--y),#000 0,#000 50%,transparent 100%);
          mask-image:radial-gradient(circle calc(var(--r) * .95) at var(--x) var(--y),#000 0,#000 50%,transparent 100%)}
.hw-lights #hw-film{opacity:1}
/* phones: a little less dark outside the light, so the copy stays readable */
@media (max-width:700px){#hw-dark{background:radial-gradient(circle var(--r) at var(--x) var(--y),rgba(4,6,8,0) 0%,rgba(4,6,8,.1) 35%,rgba(4,6,8,.5) 75%,rgba(3,4,6,.62) 100%)}}

/* hidden silhouettes: only inside the beam; fade in and out with the lights */
.hw-g{position:absolute;z-index:4;pointer-events:none;display:block;visibility:hidden;opacity:0;background:no-repeat center/contain;
  transition:opacity 1.2s ease,visibility 0s linear 1.2s;
  -webkit-mask-image:radial-gradient(circle var(--gr,300px) at var(--mx,-999px) var(--my,-999px),#000 0,#000 40%,transparent 72%);
          mask-image:radial-gradient(circle var(--gr,300px) at var(--mx,-999px) var(--my,-999px),#000 0,#000 40%,transparent 72%)}
.hw-lights .hw-g{visibility:visible;opacity:.92;transition:opacity 1.2s ease}
.hw-msg{background:none;font-family:'Playfair Display',serif;font-style:italic;font-weight:400;line-height:1;color:var(--hw-ink);white-space:nowrap}
.hw-lights #next > *:not(.hw-g){position:relative;z-index:1}
/* phones can find the code too; above the newsletter content so a tap reaches it */
@media (max-width:700px){.hw-msg{font-size:88px!important;left:8%!important;top:14px!important;transform:none!important}}

#hw-intro{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:71;pointer-events:none;text-align:center;
  padding:26px 34px 24px;background:var(--hw-card);border:1px solid var(--hw-rule);box-shadow:inset 0 0 0 4px var(--hw-card),inset 0 0 0 5px rgba(239,235,227,.22);
  font-family:'Playfair Display',serif;font-style:italic;font-weight:400;font-size:clamp(24px,3vw,36px);line-height:1.2;color:var(--hw-ink);
  opacity:0;transition:opacity 1.2s ease;max-width:min(86vw,520px)}
#hw-intro small{display:block;margin-top:14px;font:400 15px/1.65 Lato,sans-serif;font-style:normal;color:var(--hw-ink)}
#hw-intro.on{opacity:1}

/* lights switch (bottom left): fades in and out */
#hw-switch{position:fixed;left:max(16px,env(safe-area-inset-left,0px));bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:72;
  display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:42px;padding:0 18px;border-radius:100px;cursor:pointer;
  background:rgba(9,9,9,.82);border:1px solid rgba(255,255,255,.28);color:rgba(255,255,255,.9);font:700 12px Lato,sans-serif;
  visibility:hidden;opacity:0;transform:translateY(8px);
  transition:opacity .6s ease,transform .6s ease,visibility 0s linear .6s,border-color .3s,box-shadow .3s}
.hw-lights #hw-switch,.hw-off-chosen #hw-switch{visibility:visible;opacity:1;transform:none;transition:opacity .6s ease,transform .6s ease,border-color .3s,box-shadow .3s}
#hw-switch:hover{border-color:var(--hw-ink)}
#hw-switch i{flex:none;width:8px;height:8px;border-radius:50%;background:var(--hw-ink);border:1px solid var(--hw-ink);transition:background .4s ease}
.hw-off-chosen:not(.hw-lights) #hw-switch i{background:transparent}

/* ---------- 2. Pumpkin card: fades in; fades out before it is removed ---------- */
.hw-card{display:none}
.hw-pumpkin .hw-card{display:grid;animation:hwIn .9s ease backwards}
.hw-card{grid-template-columns:minmax(0,120px) 1fr;gap:20px;align-items:center;margin:0 0 36px;padding:16px;border:1px solid rgba(255,255,255,.14);border-radius:4px;background:rgba(255,255,255,.025);transition:opacity .5s ease}
.hw-card img{display:block;width:100%;aspect-ratio:4/5;object-fit:cover}
.hw-card .k{font-size:12.5px;font-weight:700;color:rgba(255,255,255,.55)}
.hw-card .t{margin-top:6px;font-family:'Playfair Display',serif;font-size:24px;line-height:1.15}
.hw-card .d{margin-top:6px;font-weight:300;font-size:14.5px;line-height:1.65;color:rgba(255,255,255,.7)}
.hw-idea{display:none;transition:opacity .5s ease}
.hw-pumpkin .hw-idea{display:block;animation:hwIn .9s ease backwards}
.hw-pumpkin .hw-hide{display:none}
.hw-hide{animation:hwIn .9s ease backwards}
.hw-pumpkin-out .hw-card,.hw-pumpkin-out .hw-idea{opacity:0}
/* phones: smaller picture, title on two or three lines instead of one word per line */
@media (max-width:700px){
  .hw-card{grid-template-columns:84px 1fr;gap:14px;padding:12px;margin-bottom:28px}
  .hw-card .t{font-size:19px;line-height:1.2}
  .hw-card .d{font-size:13.5px;line-height:1.55}
}

/* ---------- Preview toggle (preview hosts only) ---------- */
#hw-test{position:fixed;top:84px;right:16px;z-index:80;display:flex;align-items:center;font:700 11.5px Lato,sans-serif;color:#fff}
#hw-test .hw-open{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:0 16px;border-radius:100px;cursor:pointer;
  background:rgba(9,9,9,.85);border:1px solid rgba(255,255,255,.35);color:#fff;font:inherit;transition:border-color .4s ease,box-shadow .4s ease}
#hw-test .hw-open:hover{border-color:var(--hw-ink)}
#hw-test .hw-open i{width:8px;height:8px;border-radius:50%;border:1px solid rgba(239,235,227,.6);background:transparent;transition:background .4s ease,border-color .4s ease}
#hw-test .hw-open[aria-pressed=true]{border-color:var(--hw-ink)}
#hw-test .hw-open[aria-pressed=true] i{background:var(--hw-ink);border-color:var(--hw-ink)}
@media (max-width:700px){#hw-test{top:80px;right:12px}#hw-test .hw-open{min-height:30px;padding:0 12px;font-size:11px;gap:6px}}

/* ---------- Menu bar during lights out: above the darkness, off-white ink, a fine double rule underneath; eases in and out ---------- */
.hw-page header{transition:background 1.4s ease,border-color 1.4s ease,box-shadow 1.4s ease}
.hw-page header .lg{transition:filter 1.4s ease}
.hw-page header nav a{transition:color .6s ease,text-shadow 1.2s ease}
.hw-page header span,.hw-page header .btn{transition:color 1.2s ease,background 1.2s ease,box-shadow 1.2s ease}
.hw-lights header{z-index:39!important;background:rgba(6,6,6,.92)!important;border-bottom-color:rgba(239,235,227,.2)!important;box-shadow:0 4px 0 -3px rgba(239,235,227,.12)}
.hw-lights header nav a{color:var(--hw-ink-soft)!important}
.hw-lights header nav a:hover{color:var(--hw-ink)!important}
.hw-lights header span{color:rgba(239,235,227,.5)!important}
.hw-lights header .btn{background:transparent;color:var(--hw-ink);box-shadow:0 0 0 1px var(--hw-rule)}

/* ---------- 3. Hidden code card: click "Boo."; fades and settles in ---------- */
.hw-lights .hw-boo{pointer-events:auto;cursor:pointer}
/* easier to find (Gemma, 26 Oct): the "Boo." shows faintly through the dark and slowly breathes, like a flickering
   title card; the beam still brings it up full. Colour breathes, not opacity, so the lights fade stays smooth. */
@keyframes hwBreath{0%,100%{color:var(--hw-ink)}50%{color:rgba(239,235,227,.45)}}
.hw-lights .hw-boo{animation:hwBreath 3.6s ease-in-out infinite}
@media (prefers-reduced-motion:reduce){.hw-lights .hw-boo{animation:none}}
#hw-code{position:fixed;inset:0;z-index:90;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(0,4,8,.55);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  visibility:hidden;opacity:0;transition:opacity .45s ease,visibility 0s linear .45s}
#hw-code.on{visibility:visible;opacity:1;transition:opacity .45s ease}
#hw-code .hw-code-box{width:min(380px,100%);padding:34px 30px 26px;border-radius:2px;text-align:center;background:var(--hw-card);border:1px solid var(--hw-rule);box-shadow:inset 0 0 0 5px var(--hw-card),inset 0 0 0 6px rgba(239,235,227,.24),0 30px 80px -20px #000;font-family:Lato,sans-serif;color:var(--hw-ink-soft);
  transform:translateY(12px) scale(.97);transition:transform .45s cubic-bezier(.2,.7,.2,1)}
#hw-code.on .hw-code-box{transform:none}
#hw-code .k{font-family:'Playfair Display',serif;font-style:italic;font-size:16px;color:var(--hw-ink-soft)}
#hw-code .t{margin-top:8px;font-family:'Playfair Display',serif;font-size:26px;line-height:1.15;color:var(--hw-ink)}
#hw-code .c{display:block;margin:20px auto 16px;padding:12px 24px 10px;border:0;border-top:1px solid var(--hw-rule);border-bottom:1px solid var(--hw-rule);background:transparent;color:var(--hw-ink);font:400 34px/1 'Playfair Display',serif;cursor:pointer;min-width:190px;transition:color .3s ease,font-size .3s ease}
#hw-code .c:hover{color:#fff}
#hw-code .c.ok{font-size:16px}
#hw-code .d{font-weight:300;font-size:14px;line-height:1.7;color:var(--hw-ink-soft)}
#hw-code .x{margin-top:18px;min-height:40px;padding:0 22px;border-radius:100px;border:1px solid var(--hw-rule);background:transparent;color:var(--hw-ink);font:700 12px Lato,sans-serif;cursor:pointer;transition:border-color .3s ease}
#hw-code .x:hover{border-color:var(--hw-ink)}

/* ---------- 4. Hint for the hidden code (warmer / colder on Home) ---------- */
/* in the middle of the screen, where the eye already is in the dark (Gemma, 26 Oct); clicks pass through to the page except on its link and close button */
#hw-hint{position:fixed;left:50%;top:50%;transform:translate(-50%,calc(-50% + 12px));z-index:73;text-align:center;
  display:flex;align-items:center;gap:14px;width:max-content;max-width:min(560px,calc(100vw - 32px));padding:16px 14px 16px 24px;border-radius:2px;
  background:var(--hw-card);border:1px solid var(--hw-rule);box-shadow:inset 0 0 0 4px var(--hw-card),inset 0 0 0 5px rgba(239,235,227,.2);
  font:italic 400 18px/1.45 'Playfair Display',serif;color:var(--hw-ink);opacity:0;pointer-events:none;
  transition:opacity .8s ease,transform .8s ease,border-color .6s ease,box-shadow .6s ease}
#hw-hint.on{opacity:1;transform:translate(-50%,-50%)}
#hw-hint a,#hw-hint button{pointer-events:auto}
/* wait for the opening title card to fade before taking the middle */
#hw-intro.on ~ #hw-hint{opacity:0;transition-delay:0s}
#hw-hint.on{transition-delay:.2s}
#hw-hint b{font-style:normal;font-weight:400;color:#fff}
#hw-hint a{color:var(--hw-ink);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
#hw-hint .hw-go{flex:none;display:inline-flex;align-items:center;min-height:32px;padding:0 14px;border-radius:100px;border:1px solid var(--hw-ink);background:var(--hw-ink);color:#0a0a0a;font:700 12px Lato,sans-serif;font-style:normal;text-decoration:none;cursor:pointer;white-space:nowrap;transition:background .3s ease,color .3s ease}
#hw-hint .hw-go:hover{background:transparent;color:var(--hw-ink)}
#hw-hint .hw-x{flex:none;width:28px;height:28px;border-radius:50%;border:1px solid var(--hw-rule);background:transparent;color:var(--hw-ink);font:400 16px/1 Lato,sans-serif;cursor:pointer;transition:border-color .3s ease}
#hw-hint .hw-x:hover{border-color:var(--hw-ink)}
/* warmer / colder: the frame's lines brighten as the light gets close, no glow */
#hw-hint[data-heat=cold]{border-color:rgba(239,235,227,.3)}
#hw-hint[data-heat=warm]{border-color:rgba(239,235,227,.6)}
#hw-hint[data-heat=hot]{border-color:rgba(239,235,227,.85);box-shadow:inset 0 0 0 4px var(--hw-card),inset 0 0 0 5px rgba(239,235,227,.5)}
#hw-hint[data-heat=found]{border-color:var(--hw-ink);box-shadow:inset 0 0 0 4px var(--hw-card),inset 0 0 0 5px rgba(239,235,227,.85)}

/* phones and tablets: round lights button bottom left; hint stays in the middle */
@media (max-width:1100px){
  #hw-switch{width:44px;min-height:44px;padding:0;gap:0}
  #hw-switch i{width:10px;height:10px}
  #hw-switch span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  #hw-hint{width:calc(100vw - 32px);max-width:480px;padding:14px 12px 14px 18px;font-size:16px;min-height:44px}
}

@media (prefers-reduced-motion:reduce){
  #hw-film,#hw-dark,#hw-intro,.hw-g,#hw-switch,#hw-hint,#hw-code,#hw-code .hw-code-box,.hw-card,.hw-idea,.hw-page header,.hw-page header *{transition:none!important}
  .hw-pumpkin .hw-card,.hw-pumpkin .hw-idea,.hw-hide{animation:none!important}
}

/* code reads unmistakably (Playfair's old-style figures make 10 look like "1o"); focus rings in ink, not the site cyan */
#hw-code .c,#hw-code .t{font-variant-numeric:lining-nums}
#hw-code :focus-visible,#hw-hint :focus-visible,#hw-switch:focus-visible,#hw-test :focus-visible,.hw-boo:focus-visible{outline:1px solid var(--hw-ink);outline-offset:4px}

/* hint that follows the light (desktop, Home): small, no buttons, eased */
#hw-hint .hw-arrow{flex:none;display:inline-block;font-style:normal;font-size:18px;line-height:1;transition:transform .25s ease}
#hw-hint[data-heat=found] .hw-arrow{opacity:0}
#hw-hint.follow{left:0;top:0;transform:translate(calc(var(--hx,50vw) - 50%),var(--hy,50vh));max-width:340px;padding:10px 16px;font-size:15px;transition:opacity .8s ease,border-color .6s ease,box-shadow .6s ease}
#hw-hint.follow .hw-go,#hw-hint.follow .hw-x{display:none}
#hw-showme{position:fixed;left:50%;margin-left:-90px;width:180px;display:flex;align-items:center;justify-content:center;text-decoration:none;box-sizing:border-box;bottom:calc(96px + env(safe-area-inset-bottom,0px));z-index:72;min-height:40px;padding:0 18px;border-radius:100px;border:1px solid var(--hw-ink);background:var(--hw-card);color:var(--hw-ink);font:700 12px Lato,sans-serif;cursor:pointer;opacity:0;visibility:hidden;transform:translateY(8px);transition:opacity .6s ease,transform .6s ease,visibility 0s linear .6s,background .3s ease,color .3s ease}
#hw-showme.on{opacity:1;visibility:visible;transform:none;transition:opacity .6s ease,transform .6s ease,background .3s ease,color .3s ease}
#hw-showme:hover{background:var(--hw-ink);color:#0a0a0a}
@media (prefers-reduced-motion:reduce){#hw-hint .hw-arrow,#hw-showme{transition:none}}
