/* Halloween look - only active while halloween.js puts the "hw" class on <html> (until 1 Nov 2026). */
:root.hw.hw.hw {
  --bg: #0b0612; --surface: #160d22; --ink: #f1e9f6; --muted: #a596b8; --line: #2f2142;
  --gold: #ff8a2b; --gold-soft: #3b1d0c;
  --accent: #ff7a1a; --accent-soft: #3a1c0a; --accent-ink: #160700;
  --hw-green: #b8ff6a; --hw-blood: #c3142d;
  color-scheme: dark;
}
html.hw { background: radial-gradient(120% 80% at 70% 0%, #2a1240 0%, #12081d 45%, #07040b 100%) fixed; }
html.hw body, html.hw body.vc { background: transparent; }
html.hw .top { background: color-mix(in srgb, #0b0612 82%, transparent); border-bottom-color: #2f2142; }
html.hw .theme-btn { display: none; }               /* the night look is always dark */
html.hw ::selection { background: #ff7a1a; color: #160700; }
html.hw a { text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); }

/* headings: a spooky face and a candle glow (Sinhala and Tamil keep their own fonts) */
html.hw .display, html.hw h2 { font-family: "Creepster", var(--f-display); letter-spacing: .05em; font-weight: 400; }
html.hw:is([lang="si"], [lang="ta"]) .display, html.hw:is([lang="si"], [lang="ta"]) h2 { font-family: var(--f-display); }
html.hw .display { color: #ffe9d6; text-shadow: 0 0 18px rgba(255,122,26,.55), 0 0 42px rgba(195,20,45,.35); animation: hw-candle 4.2s ease-in-out infinite; }
html.hw h2 { text-shadow: 0 0 14px rgba(255,122,26,.35); }
@keyframes hw-candle { 0%, 100% { text-shadow: 0 0 18px rgba(255,122,26,.55), 0 0 42px rgba(195,20,45,.35); }
  47% { text-shadow: 0 0 12px rgba(255,122,26,.35), 0 0 30px rgba(195,20,45,.2); }
  50% { text-shadow: 0 0 24px rgba(255,150,60,.75), 0 0 56px rgba(195,20,45,.45); } }
html.hw .btn:not(.ghost) { box-shadow: 0 0 0 1px rgba(255,122,26,.35), 0 8px 28px -10px rgba(255,122,26,.7); }
html.hw .btn:not(.ghost):hover { box-shadow: 0 0 0 1px rgba(255,160,80,.6), 0 10px 34px -8px rgba(255,122,26,.9); }
html.hw .eyebrow { color: var(--hw-green); }

/* the pumpkin switch next to the menu / chat buttons */
.hw-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; }
.hw-btn svg { width: 26px; height: 26px; transition: transform .25s ease; }
.hw-btn:hover svg { transform: rotate(-12deg) scale(1.08); }
.hw-btn.is-off svg { filter: grayscale(1) opacity(.55); }
html.hw .hw-btn svg { filter: drop-shadow(0 0 6px rgba(255,122,26,.8)); animation: hw-glow 3s ease-in-out infinite; }
@keyframes hw-glow { 50% { filter: drop-shadow(0 0 11px rgba(255,140,40,1)); } }
.hw-btn:focus-visible { outline: 2px solid #ff7a1a; outline-offset: 2px; }

/* ---------------------------------------------------------------- the night scene (behind the page) */
.hw-sky, .hw-moon, .hw-fog, .hw-yard { position: fixed; pointer-events: none; z-index: -1; }
.hw-sky { inset: 0; }
.hw-sky::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 60% at 65% 10%, #d9c8ff, transparent 70%); opacity: 0; }
.hw-sky.hw-flash::after { animation: hw-bolt .7s ease-out; }
@keyframes hw-bolt { 0% { opacity: 0; } 8% { opacity: .55; } 18% { opacity: .08; } 30% { opacity: .38; } 100% { opacity: 0; } }
.hw-stars { position: absolute; left: 0; top: 0; width: 1px; height: 1px; border-radius: 50%; animation: hw-twinkle 6s ease-in-out infinite; }
@keyframes hw-twinkle { 50% { opacity: .55; } }
.hw-moon { top: clamp(70px, 10vh, 120px); right: clamp(16px, 9vw, 160px); width: clamp(90px, 13vw, 180px); aspect-ratio: 1; }
.hw-moon i { position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #fffbe9 0%, #f3e3b8 45%, #c9b27e 100%);
  box-shadow: 0 0 60px 18px rgba(255,236,190,.18), 0 0 140px 50px rgba(160,120,255,.12);
  animation: hw-moon 14s ease-in-out infinite; }
.hw-moon i::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 30% 60%, rgba(120,95,60,.35) 0 9%, transparent 10%), radial-gradient(circle at 62% 40%, rgba(120,95,60,.28) 0 7%, transparent 8%), radial-gradient(circle at 55% 72%, rgba(120,95,60,.25) 0 5%, transparent 6%); }
.hw-moon::after { content: ""; position: absolute; left: -70%; top: 46%; width: 240%; height: 22%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(150,130,190,.35), rgba(60,40,90,.18) 60%, transparent); filter: blur(9px); animation: hw-cloud 30s linear infinite; }
@keyframes hw-moon { 50% { transform: translateY(-8px); box-shadow: 0 0 80px 24px rgba(255,236,190,.22), 0 0 160px 60px rgba(160,120,255,.16); } }
@keyframes hw-cloud { 0% { transform: translateX(-35%); opacity: .0; } 15%, 85% { opacity: 1; } 100% { transform: translateX(35%); opacity: 0; } }

.hw-yard { left: 0; right: 0; bottom: 0; height: clamp(120px, 22vh, 230px); }
.hw-yard svg { width: 100%; height: 100%; display: block; }
.hw-eyes g { animation: hw-eyes 9s steps(1) infinite; opacity: 0; }
.hw-eyes g:nth-child(2) { animation-delay: 3.1s; } .hw-eyes g:nth-child(3) { animation-delay: 6.3s; }
@keyframes hw-eyes { 0% { opacity: 0; } 8% { opacity: 1; } 10% { opacity: 0; } 11% { opacity: 1; } 24% { opacity: 0; } }
.hw-fog { left: -20%; right: -20%; bottom: 0; height: 40vh; }
.hw-fog i { position: absolute; inset: 0; background: radial-gradient(60% 50% at 30% 90%, rgba(190,170,230,.13), transparent 70%), radial-gradient(50% 45% at 75% 95%, rgba(170,150,220,.11), transparent 70%);
  filter: blur(10px); animation: hw-fog 38s ease-in-out infinite alternate; }
.hw-fog i + i { animation-duration: 52s; animation-direction: alternate-reverse; opacity: .8; }
@keyframes hw-fog { to { transform: translateX(12%); } }

/* in front of the page, never in the way of a click */
.hw-bats, .hw-web, .hw-spider, .hw-ghost, .hw-torch { position: fixed; pointer-events: none; }
.hw-bats { inset: 0; z-index: 30; overflow: hidden; }
.hw-bat { position: absolute; left: 0; top: 0; display: block; color: #05020a; animation: hw-fly var(--dur) linear forwards; }
.hw-bat svg { display: block; width: 100%; transform: scaleX(var(--flip, 1)); }
.hw-bat .w { fill: #05020a; transform-origin: 50% 45%; animation: hw-flap var(--flap) ease-in-out infinite alternate; }
@keyframes hw-fly { 0% { transform: translate(var(--x0), var(--y0)); } 50% { transform: translate(calc((var(--x0) + var(--x1)) / 2), calc(var(--y1) - 4vh)); } 100% { transform: translate(var(--x1), var(--y1)); } }
@keyframes hw-flap { from { transform: scaleY(1); } to { transform: scaleY(.35); } }
.hw-web { top: 0; width: clamp(90px, 11vw, 160px); color: rgba(225,215,245,.28); z-index: 31; }
.hw-web-l { left: 0; } .hw-web-r { right: 0; transform: scaleX(-1); }
.hw-spider { top: 0; right: clamp(40px, 6vw, 90px); width: 30px; z-index: 32; animation: hw-drop 16s ease-in-out infinite; }
.hw-spider svg { display: block; width: 30px; }
.hw-thread { position: absolute; left: 50%; bottom: 100%; width: 1px; height: 60vh; background: rgba(230,220,250,.35); }
@keyframes hw-drop { 0%, 12% { transform: translateY(-40px); } 30%, 60% { transform: translateY(32vh); } 38% { transform: translateY(30vh) rotate(6deg); } 46% { transform: translateY(32vh) rotate(-6deg); } 80%, 100% { transform: translateY(-40px); } }
.hw-ghost { left: 0; top: 0; width: clamp(60px, 7vw, 100px); z-index: 29; opacity: 0; filter: drop-shadow(0 0 18px rgba(200,180,255,.55)); }
.hw-ghost.go { animation: hw-boo 9s ease-in-out forwards; }
.hw-ghost svg { display: block; animation: hw-wobble 1.6s ease-in-out infinite alternate; }
@keyframes hw-boo { 0% { transform: translate(-12vw, var(--gy)); opacity: 0; } 15% { opacity: .55; } 50% { transform: translate(50vw, calc(var(--gy) - 8vh)); opacity: .5; }
  85% { opacity: .5; } 100% { transform: translate(112vw, var(--gy)); opacity: 0; } }
@keyframes hw-wobble { to { transform: translateY(10px) rotate(4deg); } }
.hw-torch { inset: 0; z-index: 28;
  background: radial-gradient(circle 320px at var(--mx, 50vw) var(--my, 35vh), transparent 0%, transparent 35%, rgba(4,2,8,.34) 100%); }

/* the web chat: the colours and a quiet sky, nothing moving over the messages */
html.hw-chat .hw-moon { top: 58px; right: 18px; width: 70px; opacity: .55; }
html.hw-chat .hw-moon::after { display: none; }
html.hw-chat .hw-web { width: 80px; color: rgba(225,215,245,.18); }
html.hw-chat .hw-bats { bottom: auto; height: 32vh; }
html.hw-chat .hw-fog { opacity: .55; height: 30vh; }
html.hw-chat .vc-top { background: color-mix(in srgb, #0b0612 85%, transparent); }

/* phones: a lighter scene */
@media (max-width: 700px) {
  .hw-spider, .hw-web-l { display: none; }
  .hw-web-r { width: 70px; }
  .hw-yard { height: 110px; opacity: .75; }
}
/* visitors who asked for less motion get the still scene */
html.hw-calm .hw-stars, html.hw-calm .hw-moon i, html.hw-calm .hw-moon::after, html.hw-calm .hw-fog i, html.hw-calm .hw-eyes g,
html.hw-calm .display, html.hw-calm .hw-btn svg, html.hw-calm .hw-spider { animation: none; }
html.hw-calm .hw-eyes g { opacity: 1; }
html.hw-calm .hw-ghost, html.hw-calm .hw-bats { display: none; }
@media print { .hw-sky, .hw-moon, .hw-fog, .hw-yard, .hw-bats, .hw-web, .hw-spider, .hw-ghost, .hw-torch { display: none !important; } }
