/* ═══════════════════════════════════════════════
   DeltaForm303 — Custom CSS
   CRT effects, glitch animations, block styles
   ═══════════════════════════════════════════════ */

/* ── CSS Custom Properties (beyond theme.json) ── */
:root {
	--df303-void: #0a0a0c;
	--df303-abyss: #0e0e12;
	--df303-panel: #141418;
	--df303-border: #1e1e24;
	--df303-muted: #666670;
	--df303-signal: #a0a0a8;
	--df303-neon: #e8e8f0;
	--df303-phosphor: #33ff33;
	--df303-phosphor-dim: #1a8c1a;
	--df303-error: #ff3344;
	--df303-transition: 300ms ease;
	--df303-transition-fast: 150ms ease;
}


/* ───────────────────────────────────────────────
   1. CRT SCANLINE OVERLAY
   Applied globally as a pseudo-element on body.
   ─────────────────────────────────────────────── */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 9999;
	pointer-events: none;
	background: repeating-linear-gradient(
		0deg,
		transparent,
		transparent 2px,
		rgba(0, 0, 0, 0.06) 2px,
		rgba(0, 0, 0, 0.06) 4px
	);
	mix-blend-mode: multiply;
}


/* ───────────────────────────────────────────────
   2. GLITCH ANIMATION — Heading style
   .is-style-df303-glitch
   ─────────────────────────────────────────────── */
@keyframes df303-glitch {
	0%, 100% {
		text-shadow:
			2px 0 var(--df303-phosphor),
			-2px 0 var(--df303-error);
		transform: translate(0);
	}
	20% {
		text-shadow:
			-3px 0 var(--df303-phosphor),
			3px 0 var(--df303-error);
		transform: translate(-1px, 1px);
	}
	40% {
		text-shadow:
			3px 0 var(--df303-phosphor),
			-3px 0 var(--df303-error);
		transform: translate(1px, -1px);
	}
	60% {
		text-shadow:
			-2px 0 var(--df303-phosphor),
			2px 0 var(--df303-error);
		transform: translate(-1px);
	}
	80% {
		text-shadow:
			2px 0 var(--df303-phosphor),
			-2px 0 var(--df303-error);
		transform: translate(1px);
	}
}

@keyframes df303-glitch-subtle {
	0%, 92%, 100% {
		text-shadow:
			1px 0 rgba(51, 255, 51, 0.3),
			-1px 0 rgba(255, 51, 68, 0.3);
	}
	93% {
		text-shadow:
			-2px 0 var(--df303-phosphor),
			2px 0 var(--df303-error);
		transform: translate(-1px, 1px);
	}
	95% {
		text-shadow:
			2px 0 var(--df303-phosphor),
			-2px 0 var(--df303-error);
		transform: translate(1px, -1px);
	}
	97% {
		text-shadow:
			-1px 0 rgba(51, 255, 51, 0.5),
			1px 0 rgba(255, 51, 68, 0.5);
		transform: translate(0);
	}
}

.is-style-df303-glitch {
	animation: df303-glitch-subtle 4s infinite;
	will-change: text-shadow, transform;
}

.is-style-df303-glitch:hover {
	animation: df303-glitch 0.3s infinite;
}


/* ───────────────────────────────────────────────
   3. PHOSPHOR HEADING
   .is-style-df303-phosphor
   ─────────────────────────────────────────────── */
.is-style-df303-phosphor {
	color: var(--df303-phosphor) !important;
	text-shadow: 0 0 20px rgba(51, 255, 51, 0.4);
}


/* ───────────────────────────────────────────────
   4. CRT PANEL — Group style
   .is-style-df303-crt-panel
   ─────────────────────────────────────────────── */
.is-style-df303-crt-panel {
	position: relative;
	overflow: hidden;
}

.is-style-df303-crt-panel::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: repeating-linear-gradient(
		0deg,
		transparent,
		transparent 2px,
		rgba(51, 255, 51, 0.02) 2px,
		rgba(51, 255, 51, 0.02) 4px
	);
	z-index: 1;
}


/* ───────────────────────────────────────────────
   5. SIGNAL CARD — Group style
   .is-style-df303-signal-card
   ─────────────────────────────────────────────── */
.is-style-df303-signal-card {
	transition: border-color var(--df303-transition),
	            box-shadow var(--df303-transition);
}

.is-style-df303-signal-card:hover {
	border-color: var(--df303-phosphor) !important;
	box-shadow: 0 0 20px rgba(51, 255, 51, 0.15);
}


/* ───────────────────────────────────────────────
   6. GLOW BORDER — Group style
   .is-style-df303-glow-border
   ─────────────────────────────────────────────── */
.is-style-df303-glow-border {
	border: 1px solid var(--df303-phosphor) !important;
	box-shadow:
		0 0 10px rgba(51, 255, 51, 0.1),
		inset 0 0 10px rgba(51, 255, 51, 0.05);
}


/* ───────────────────────────────────────────────
   7. OUTLINE BUTTON
   .is-style-df303-outline
   ─────────────────────────────────────────────── */
.is-style-df303-outline > .wp-block-button__link {
	background: transparent !important;
	color: var(--df303-phosphor) !important;
	border: 1px solid var(--df303-phosphor) !important;
	transition: all var(--df303-transition);
}

.is-style-df303-outline > .wp-block-button__link:hover {
	background: var(--df303-phosphor) !important;
	color: var(--df303-void) !important;
	box-shadow: 0 0 20px rgba(51, 255, 51, 0.3);
}


/* ───────────────────────────────────────────────
   8. PHOSPHOR LINE — Separator style
   .is-style-df303-phosphor-line
   ─────────────────────────────────────────────── */
.is-style-df303-phosphor-line {
	border-color: var(--df303-phosphor) !important;
	opacity: 0.4;
}

.is-style-df303-phosphor-line:not(.is-style-wide):not(.is-style-dots) {
	width: 80px;
}


/* ───────────────────────────────────────────────
   9. SCANLINE IMAGE — Image style
   .is-style-df303-scanline
   ─────────────────────────────────────────────── */
.is-style-df303-scanline {
	position: relative;
	overflow: hidden;
}

.is-style-df303-scanline::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: repeating-linear-gradient(
		0deg,
		transparent,
		transparent 3px,
		rgba(0, 0, 0, 0.12) 3px,
		rgba(0, 0, 0, 0.12) 6px
	);
	z-index: 2;
}


/* ───────────────────────────────────────────────
   10. SIGNAL DOT PULSE ANIMATION
   ─────────────────────────────────────────────── */
@keyframes df303-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.3; }
}

.df303-signal-dot {
	animation: df303-pulse 2s ease-in-out infinite;
	display: inline-block;
}


/* ───────────────────────────────────────────────
   11. HEADER — sticky + backdrop blur
   ─────────────────────────────────────────────── */
.df303-header {
	backdrop-filter: blur(12px) saturate(120%);
	-webkit-backdrop-filter: blur(12px) saturate(120%);
	z-index: 100;
	background: rgba(10, 10, 12, 0.92) !important;
}


/* ───────────────────────────────────────────────
   12. POST CARD HOVER EFFECTS
   ─────────────────────────────────────────────── */
.df303-post-card,
.df303-release-card {
	transition:
		border-color var(--df303-transition),
		box-shadow var(--df303-transition),
		transform var(--df303-transition);
}

.df303-post-card:hover,
.df303-release-card:hover {
	border-color: var(--df303-phosphor) !important;
	box-shadow: 0 0 24px rgba(51, 255, 51, 0.12);
	transform: translateY(-2px);
}

.df303-post-card .wp-block-post-featured-image img,
.df303-release-card .wp-block-post-featured-image img {
	transition: transform 0.5s ease, filter 0.5s ease;
}

.df303-post-card:hover .wp-block-post-featured-image img,
.df303-release-card:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
	filter: brightness(1.1);
}

.df303-post-card .wp-block-post-featured-image,
.df303-release-card .wp-block-post-featured-image {
	overflow: hidden;
}


/* ───────────────────────────────────────────────
   13. HERO COVER ENHANCEMENTS
   ─────────────────────────────────────────────── */
.df303-hero-cover {
	position: relative;
}

.df303-hero-cover::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(
		ellipse at center,
		transparent 40%,
		rgba(10, 10, 12, 0.6) 100%
	);
	z-index: 1;
}

.df303-hero-cover > .wp-block-cover__inner-container {
	position: relative;
	z-index: 2;
}

.df303-hero-signal {
	animation: df303-pulse 3s ease-in-out infinite;
}


/* ───────────────────────────────────────────────
   14. SCROLL-TRIGGERED FADE-IN
   Applied via JS: IntersectionObserver adds
   .df303-visible when elements scroll into view.
   ─────────────────────────────────────────────── */
.df303-fade-in {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.df303-fade-in.df303-visible {
	opacity: 1;
	transform: translateY(0);
}


/* ───────────────────────────────────────────────
   15. CRT FLICKER (subtle background flicker)
   ─────────────────────────────────────────────── */
@keyframes df303-flicker {
	0%, 100% { opacity: 1; }
	92% { opacity: 1; }
	93% { opacity: 0.85; }
	94% { opacity: 1; }
	96% { opacity: 0.9; }
	97% { opacity: 1; }
}

.df303-hero-cover {
	animation: df303-flicker 8s infinite;
}


/* ───────────────────────────────────────────────
   16. NAVIGATION — Overlay menu styling
   ─────────────────────────────────────────────── */
.wp-block-navigation__responsive-container.is-menu-open {
	background: rgba(10, 10, 12, 0.97) !important;
	backdrop-filter: blur(20px);
}

.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item__content {
	font-size: 1.5rem !important;
	letter-spacing: 0.12em;
}


/* ───────────────────────────────────────────────
   17. FORM ELEMENTS (search, comments)
   ─────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
	background: var(--df303-abyss);
	border: 1px solid var(--df303-border);
	color: var(--df303-neon);
	font-family: 'IBM Plex Mono', monospace;
	padding: 0.6em 1em;
	border-radius: 2px;
	transition: border-color var(--df303-transition);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus {
	border-color: var(--df303-phosphor);
	outline: none;
	box-shadow: 0 0 8px rgba(51, 255, 51, 0.15);
}

input[type="submit"] {
	background: var(--df303-phosphor);
	color: var(--df303-void);
	border: none;
	font-family: 'IBM Plex Mono', monospace;
	font-weight: 700;
	font-size: 0.8rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 0.8em 1.5em;
	border-radius: 2px;
	cursor: pointer;
	transition: all var(--df303-transition);
}

input[type="submit"]:hover {
	background: var(--df303-neon);
	box-shadow: 0 0 15px rgba(51, 255, 51, 0.2);
}


/* ───────────────────────────────────────────────
   18. SCROLLBAR
   ─────────────────────────────────────────────── */
::-webkit-scrollbar {
	width: 6px;
}

::-webkit-scrollbar-track {
	background: var(--df303-void);
}

::-webkit-scrollbar-thumb {
	background: var(--df303-border);
	border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--df303-phosphor-dim);
}


/* ───────────────────────────────────────────────
   19. SELECTION COLOR
   ─────────────────────────────────────────────── */
::selection {
	background: var(--df303-phosphor);
	color: var(--df303-void);
}

::-moz-selection {
	background: var(--df303-phosphor);
	color: var(--df303-void);
}


/* ───────────────────────────────────────────────
   20. REDUCED MOTION — respect accessibility
   ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.df303-fade-in {
		opacity: 1;
		transform: none;
	}

	body::after {
		display: none;
	}
}


/* ───────────────────────────────────────────────
   21. RESPONSIVE ADJUSTMENTS
   ─────────────────────────────────────────────── */
@media (max-width: 782px) {
	.df303-post-card:hover,
	.df303-release-card:hover {
		transform: none;
	}

	body::after {
		background: repeating-linear-gradient(
			0deg,
			transparent,
			transparent 3px,
			rgba(0, 0, 0, 0.04) 3px,
			rgba(0, 0, 0, 0.04) 6px
		);
	}
}
