/* Nawaf13 Halloween — everything is scoped to html.n13-hw, which the script adds only during the season. */

html.n13-hw {
	--n13-night: #0c0812;
	--n13-night-2: #160e1f;
	--n13-bone: #f1e7d6;
	--n13-pumpkin: #ff8a00;
	--n13-ember: #ffa500;
	--n13-witch: #8b3fd9;
	--n13-slime: #9be564;
}

/* ---------- Night palette ---------- */
html.n13-hw body {
	background: radial-gradient(ellipse at 20% -10%, #2a1640 0%, transparent 55%), radial-gradient(ellipse at 110% 30%, #2b1206 0%, transparent 45%), var(--n13-night);
	background-attachment: fixed;
	color: var(--n13-bone);
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Cpath d='M13 5c1-3 3-4 4-4' stroke='%233c6b1f' stroke-width='2' fill='none'/%3E%3Cellipse cx='8.5' cy='15' rx='6' ry='8' fill='%23ff8a00'/%3E%3Cellipse cx='17.5' cy='15' rx='6' ry='8' fill='%23ff8a00'/%3E%3Cellipse cx='13' cy='15' rx='5.5' ry='8.5' fill='%23ffa21f'/%3E%3Cpath d='M8 12l2.5 2.5L8 15zM18 12l-2.5 2.5L18 15zM8.5 18.5q4.5 3 9 0l-1.5 1.5-1.5-1-1.5 1-1.5-1-1.5 1z' fill='%23421400'/%3E%3C/svg%3E") 4 4, auto;
}
html.n13-hw a,
html.n13-hw button,
html.n13-hw .n13-title,
html.n13-hw .n13-pumpkin {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Cpath d='M13 5c1-3 3-4 4-4' stroke='%233c6b1f' stroke-width='2' fill='none'/%3E%3Cellipse cx='8.5' cy='15' rx='6' ry='8' fill='%23ff8a00'/%3E%3Cellipse cx='17.5' cy='15' rx='6' ry='8' fill='%23ff8a00'/%3E%3Cellipse cx='13' cy='15' rx='5.5' ry='8.5' fill='%23ffd23f'/%3E%3Cpath d='M8 12l2.5 2.5L8 15zM18 12l-2.5 2.5L18 15zM8.5 18.5q4.5 3 9 0l-1.5 1.5-1.5-1-1.5 1-1.5-1-1.5 1z' fill='%23421400'/%3E%3C/svg%3E") 4 4, pointer;
}

html.n13-hw :where(h1, h2, h3, h4, p, li, figcaption, label, .wp-block-site-title a) {
	color: inherit;
}
html.n13-hw :where(.wp-block-post-content, main) a:not(.wp-element-button) {
	color: var(--n13-ember);
}
html.n13-hw .wp-element-caption {
	color: #b9a9c9 !important;
	font-style: italic;
}
html.n13-hw .is-style-outline .wp-block-button__link {
	color: var(--n13-bone);
	border-color: var(--n13-bone);
}
html.n13-hw .has-theme-1-background-color {
	background-color: var(--n13-night-2) !important;
}
html.n13-hw input,
html.n13-hw textarea {
	background: #1b1324 !important;
	color: var(--n13-bone) !important;
	border-color: #4a3560 !important;
}
html.n13-hw .wp-block-image img,
html.n13-hw .wp-block-gallery img {
	box-shadow: 0 0 0 1px #2d1f3a, 0 18px 40px -18px #000;
	transition: box-shadow .4s ease, filter .4s ease;
}
html.n13-hw .wp-block-image:hover img {
	box-shadow: 0 0 0 1px var(--n13-pumpkin), 0 0 34px -6px rgba(255, 138, 0, .55);
}

/* Logo is black ink on white — flip it to glowing bone-white on the night background */
html.n13-hw img.wp-image-12 {
	filter: invert(1) hue-rotate(180deg) drop-shadow(0 0 10px rgba(255, 140, 0, .35));
	mix-blend-mode: screen;
	box-shadow: none !important;
}

/* Spooky section titles */
html.n13-hw :where(.wp-block-post-content, main) h2.wp-block-heading {
	font-family: "Creepster", "Public Sans", sans-serif;
	font-weight: 400;
	letter-spacing: .04em;
	color: var(--n13-pumpkin);
	text-shadow: 0 0 18px rgba(255, 120, 0, .35);
	font-size: clamp(2.4rem, 5vw, 3.6rem);
}

/* The "13" in NAWAF13 glows like a lantern */
html.n13-hw h1 .has-inline-color,
html.n13-hw h1 [style*="ffa500"] {
	animation: n13-flicker 3.2s infinite steps(1, end);
	text-shadow: 0 0 22px rgba(255, 140, 0, .75), 0 0 60px rgba(255, 90, 0, .45);
}
@keyframes n13-flicker {
	0%, 100% { opacity: 1; }
	41% { opacity: .78; }
	43% { opacity: 1; }
	71% { opacity: .9; }
	72% { opacity: .55; }
	74% { opacity: 1; }
}

/* ---------- Clickable titles ---------- */
html.n13-hw .n13-title {
	position: relative;
	transition: transform .25s ease;
}
html.n13-hw .n13-title:hover {
	animation: n13-wobble .7s ease-in-out;
}
@keyframes n13-wobble {
	0%, 100% { transform: rotate(0); }
	25% { transform: rotate(-1.2deg) translateY(-1px); }
	60% { transform: rotate(1deg); }
}
.n13-ch {
	display: inline-block;
	white-space: pre;
	will-change: transform, opacity, filter;
}
.n13-title.n13-busy {
	pointer-events: none;
}

/* ---------- Bats ---------- */
.n13-layer {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 99990;
	overflow: hidden;
}
.n13-bat {
	position: absolute;
	left: 0;
	top: 0;
	width: 28px;
	height: 16px;
	margin: -8px 0 0 -14px;
	will-change: transform, opacity;
	filter: drop-shadow(0 0 2px rgba(255, 150, 40, .95)) drop-shadow(0 0 7px rgba(139, 63, 217, .8));
}
.n13-bat svg {
	width: 100%;
	height: 100%;
	overflow: visible;
}
.n13-bat .n13-wing-l,
.n13-bat .n13-wing-r {
	transform-box: fill-box;
	animation: n13-flap .16s ease-in-out infinite alternate;
}
.n13-bat .n13-wing-l { transform-origin: 100% 40%; }
.n13-bat .n13-wing-r { transform-origin: 0% 40%; animation-name: n13-flap-r; }
@keyframes n13-flap { from { transform: rotate(18deg) scaleY(1); } to { transform: rotate(-26deg) scaleY(.55); } }
@keyframes n13-flap-r { from { transform: rotate(-18deg) scaleY(1); } to { transform: rotate(26deg) scaleY(.55); } }

/* ---------- Lightning ---------- */
.n13-flash {
	position: fixed;
	inset: 0;
	z-index: 99970;
	pointer-events: none;
	opacity: 0;
	background:
		radial-gradient(ellipse 60% 70% at var(--x, 50%) 0%, rgba(235, 228, 255, .95), rgba(170, 150, 255, .45) 45%, transparent 80%),
		rgba(120, 100, 200, .18);
	mix-blend-mode: screen;
}
.n13-bolt {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	overflow: visible;
}
.n13-bolt path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.n13-bolt .n13-bolt-glow { stroke: rgba(170, 130, 255, .55); stroke-width: 10; filter: blur(6px); }
.n13-bolt .n13-bolt-core { stroke: #fbf8ff; stroke-width: 2.6; }
.n13-bolt .n13-thin.n13-bolt-glow { stroke-width: 6; }
.n13-bolt .n13-thin.n13-bolt-core { stroke-width: 1.4; }

/* ---------- Pumpkins ---------- */
.n13-pumpkin {
	position: fixed;
	z-index: 99980;
	width: var(--s, 30px);
	height: var(--s, 30px);
	pointer-events: auto;
	animation: n13-bob var(--d, 4s) ease-in-out infinite;
	animation-delay: var(--delay, 0s);
	filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5));
	transition: opacity .4s ease;
	border: 0;
	padding: 0;
	background: none;
}
.n13-pumpkin svg { width: 100%; height: 100%; display: block; overflow: visible; }
.n13-pumpkin .n13-face { animation: n13-glow 2.4s ease-in-out infinite alternate; }
.n13-pumpkin:hover { transform: scale(1.25) rotate(-8deg); animation-play-state: paused; }
.n13-pumpkin.n13-gone { opacity: 0; pointer-events: none; }
@keyframes n13-bob {
	0%, 100% { translate: 0 0; rotate: -4deg; }
	50% { translate: 0 -10px; rotate: 5deg; }
}
@keyframes n13-glow {
	from { fill: #ffd23f; filter: drop-shadow(0 0 1px #ffb000); }
	to { fill: #ff9a00; filter: drop-shadow(0 0 4px #ff6a00); }
}

/* ---------- Spider ---------- */
.n13-spider {
	position: fixed;
	top: 0;
	right: 7vw;
	z-index: 99985;
	width: 34px;
	pointer-events: auto;
	transform-origin: 50% 0;
	animation: n13-dangle 6s ease-in-out infinite;
	transition: translate 1.1s cubic-bezier(.6, -0.4, .3, 1.4);
}
.n13-spider::before {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 26px;
	width: 1px;
	height: 100vh;
	background: linear-gradient(transparent, rgba(241, 231, 214, .55));
}
.n13-spider svg { display: block; width: 34px; height: 34px; }
.n13-spider .n13-legs { animation: n13-legs .5s ease-in-out infinite alternate; transform-origin: 50% 50%; transform-box: fill-box; }
.n13-spider.n13-up { translate: 0 -70vh; }
@keyframes n13-dangle {
	0%, 100% { rotate: 3deg; translate: 0 calc(var(--drop, 140px) - 0px); }
	50% { rotate: -3deg; translate: 0 calc(var(--drop, 140px) + 26px); }
}
@keyframes n13-legs { from { transform: scaleX(1); } to { transform: scaleX(.86); } }

/* ---------- Fog on the hero ---------- */
.n13-fog {
	position: absolute;
	left: -20%;
	right: -20%;
	bottom: 0;
	height: 38%;
	pointer-events: none;
	z-index: 1;
	opacity: .55;
	background:
		radial-gradient(ellipse 30% 60% at 20% 80%, rgba(200, 190, 220, .35), transparent 70%),
		radial-gradient(ellipse 35% 55% at 55% 90%, rgba(170, 150, 200, .3), transparent 70%),
		radial-gradient(ellipse 30% 50% at 85% 85%, rgba(210, 200, 230, .3), transparent 70%);
	animation: n13-fog 18s ease-in-out infinite alternate;
	mix-blend-mode: screen;
}
@keyframes n13-fog { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
.wp-block-cover .wp-block-cover__inner-container { z-index: 2; }

/* ---------- Hint toast ---------- */
.n13-toast {
	position: fixed;
	left: 50%;
	bottom: 22px;
	z-index: 99995;
	translate: -50% 20px;
	opacity: 0;
	padding: 10px 18px;
	border-radius: 999px;
	background: rgba(12, 8, 18, .92);
	border: 1px solid #4a3560;
	color: #f1e7d6;
	font: 600 14px/1.2 "Public Sans", system-ui, sans-serif;
	letter-spacing: .02em;
	box-shadow: 0 10px 30px -10px #000, 0 0 24px -8px rgba(139, 63, 217, .7);
	transition: opacity .5s ease, translate .5s ease;
	pointer-events: none;
	white-space: nowrap;
}
.n13-toast.n13-show { opacity: 1; translate: -50% 0; }

@media (max-width: 700px) {
	.n13-spider { right: 4vw; }
	.n13-toast { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
	.n13-pumpkin, .n13-spider, .n13-fog, .n13-pumpkin .n13-face,
	html.n13-hw h1 .has-inline-color, html.n13-hw .n13-title:hover { animation: none !important; }
}
