/*
 * GeneratePress Retro — CRT / terminal aesthetic
 * Black background, phosphor-green monospace, scanlines + flicker.
 */

:root {
	--crt-bg: #000000;
	--crt-panel: #000000;
	--crt-green: #00ff41;
	--crt-green-soft: #4dff88;
	--crt-dim: #0b3d0b;
	--crt-faint: #051a05;
}

html {
	background: var(--crt-bg);
}

body {
	background: var(--crt-bg);
	color: var(--crt-green);
	font-family: 'Share Tech Mono', 'Courier New', monospace;
	font-size: 18px;
	line-height: 1.65;
	text-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
}

/* ---- CRT overlay: scanlines + vignette + flicker ---- */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 9999;
	pointer-events: none;
	background:
		repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.25) 0px, rgba(0, 0, 0, 0.25) 1px, transparent 1px, transparent 3px),
		radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.6) 100%);
	animation: crt-flicker 5s infinite;
}

@keyframes crt-flicker {
	0%, 100% { opacity: 1; }
	90% { opacity: 1; }
	91% { opacity: 0.85; }
	92% { opacity: 1; }
	96% { opacity: 0.93; }
	97% { opacity: 1; }
}

/* ---- selection & scrollbar ---- */
::selection {
	background: var(--crt-green);
	color: #000;
	text-shadow: none;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--crt-dim); border: 2px solid #000; }
::-webkit-scrollbar-thumb:hover { background: var(--crt-green); }

/* ---- typography ---- */
h1, h2, h3, h4, h5, h6,
.site-title {
	font-family: 'VT323', 'Share Tech Mono', monospace;
	font-weight: 400;
	color: var(--crt-green);
	letter-spacing: 2px;
	text-shadow: 0 0 12px rgba(0, 255, 65, 0.75);
}

a {
	color: var(--crt-green-soft);
	text-decoration: underline dotted;
	text-underline-offset: 3px;
}

a:hover, a:focus {
	background: var(--crt-green);
	color: #000;
	text-shadow: none;
	text-decoration: none;
}

/* ---- header ---- */
.site-header {
	background: transparent;
	border-bottom: 1px solid var(--crt-dim);
}

.site-title {
	font-size: 40px;
}

.site-title a {
	text-decoration: none;
	color: var(--crt-green);
}

/* ---- ASCII art logo (replaces the "kasan.us" text, printed by functions.php) ---- */
/* breathing room under the logo, before the menu bar */
body .site-branding {
	margin-bottom: 22px;
}

body .main-title a {
	display: inline-block;
	text-decoration: none;
	color: var(--crt-green);
	padding: 6px 0;
}

body .ascii-logo {
	display: inline-block;
	margin: 0;
	padding: 0;
	background: transparent !important;
	border: 0 !important;
	font-family: 'Share Tech Mono', 'Courier New', monospace;
	font-size: clamp(10px, 3.9vw, 22px);
	line-height: 1.12;
	letter-spacing: 0;
	white-space: pre;
	color: var(--crt-green) !important;
	text-shadow: 0 0 4px rgba(0, 255, 65, 0.45);
}

/* hovering the logo must not paint a green box behind the art */
body .main-title a:hover {
	background: transparent !important;
	color: var(--crt-green) !important;
}

/* blinking block cursor after the site title (hidden — ASCII logo replaces it) */
.main-title a::after {
	content: none;
}

@keyframes crt-blink {
	50% { opacity: 0; }
}

.site-description {
	color: var(--crt-dim);
	font-size: 14px;
}

/* ---- nav as shell commands ---- */
.main-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.main-nav li {
	display: inline-block;
	margin-right: 18px;
}

.main-nav li a {
	text-decoration: none;
	text-transform: lowercase;
}

.main-nav li a::before {
	content: "./";
	color: var(--crt-dim);
	margin-right: 3px;
}

.main-nav li a:hover,
.main-nav li a:hover::before {
	background: var(--crt-green);
	color: #000;
}

/* ---- content as a terminal window ---- */
.site-content {
	max-width: 1100px;
	width: 100%;
	margin: 0 auto;
	background: var(--crt-panel);
	border: 1px solid var(--crt-dim);
	box-shadow: 0 0 30px rgba(0, 255, 65, 0.10), inset 0 0 80px rgba(0, 255, 65, 0.03);
	padding: 24px 32px;
	position: relative;
}

.site-content::before {
	content: "[ kasan.us ~ ]";
	display: block;
	margin: -24px -32px 24px;
	padding: 8px 16px;
	border-bottom: 1px solid var(--crt-dim);
	color: var(--crt-dim);
	font-size: 13px;
	letter-spacing: 2px;
}

/* ---- entries ---- */
.entry-title {
	font-size: 46px;
	border-bottom: 1px dashed var(--crt-dim);
	padding-bottom: 10px;
	margin-bottom: 20px;
}

.entry-title a {
	text-decoration: none;
	color: var(--crt-green);
}

.entry-meta {
	color: var(--crt-dim);
	font-size: 14px;
}

.entry-meta a { color: var(--crt-dim); }

/* blog/archive list styled like `ls -la` output */
.blog .entry-header::before,
.archive .entry-header::before {
	content: "-rw-r--r-- 1 kasan kasan ";
	color: var(--crt-dim);
	font-size: 14px;
}

.blog .post .inside-article,
.archive .post .inside-article {
	border-bottom: 1px dashed var(--crt-faint);
}

/* ---- content elements ---- */
p { margin: 0 0 1em; }

pre, code {
	background: #000;
	border: 1px solid var(--crt-dim);
	color: var(--crt-green-soft);
	font-family: 'Share Tech Mono', monospace;
	text-shadow: none;
}

pre {
	padding: 12px 16px;
	overflow-x: auto;
}

blockquote {
	border-left: 3px solid var(--crt-green);
	margin-left: 0;
	padding-left: 16px;
	color: var(--crt-green-soft);
}

img {
	border: 1px solid var(--crt-dim);
	max-width: 100%;
}

hr {
	border: 0;
	border-top: 1px dashed var(--crt-dim);
}

/* ---- forms ---- */
input[type="text"], input[type="email"], input[type="search"],
input[type="password"], input[type="url"], textarea {
	background: #000;
	border: 1px solid var(--crt-dim);
	color: var(--crt-green);
	font-family: inherit;
	font-size: 16px;
	padding: 8px 10px;
	text-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
}

input:focus, textarea:focus {
	outline: none;
	border-color: var(--crt-green);
	box-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

button, input[type="submit"], .button {
	background: #000;
	border: 1px solid var(--crt-green);
	color: var(--crt-green);
	font-family: 'VT323', monospace;
	font-size: 20px;
	letter-spacing: 2px;
	padding: 6px 18px;
	cursor: pointer;
	text-transform: uppercase;
	text-shadow: 0 0 8px rgba(0, 255, 65, 0.6);
}

button:hover, input[type="submit"]:hover, .button:hover {
	background: var(--crt-green);
	color: #000;
	text-shadow: none;
}

/* ---- comments & pagination ---- */
.comments-area {
	border-top: 1px dashed var(--crt-dim);
}

.paging-navigation a {
	text-decoration: none;
	border: 1px solid var(--crt-dim);
	padding: 2px 10px;
}

.paging-navigation .current {
	border: 1px solid var(--crt-green);
	padding: 2px 10px;
}

/* ---- footer ---- */
.site-footer {
	background: transparent;
	border-top: 1px solid var(--crt-dim);
}

.site-info {
	color: var(--crt-dim);
	font-size: 14px;
	text-align: center;
}

.site-info::after {
	content: "  // EOF";
	color: var(--crt-faint);
}

/* ---- mobile ---- */
@media (max-width: 768px) {
	body { font-size: 15px; line-height: 1.7; text-shadow: 0 0 5px rgba(0, 255, 65, 0.4); }
	.site-content { padding: 14px 14px; }
	.site-content::before {
		font-size: 11px;
		letter-spacing: 1px;
		margin: -14px -14px 14px;
		padding: 6px 12px;
	}
	.entry-title { font-size: 26px; padding-bottom: 6px; margin-bottom: 14px; }
	.site-title { font-size: 26px; }
	.site-description { font-size: 13px; }
	.entry-meta { font-size: 12px; }
	.blog .entry-header::before,
	.archive .entry-header::before { font-size: 12px; }
	.main-nav li { margin-right: 8px; }
	body .inside-header { padding-left: 10px !important; padding-right: 10px !important; }
	input[type="text"], input[type="email"], input[type="search"],
	input[type="password"], input[type="url"], textarea { font-size: 15px; }
	button, input[type="submit"], .button { font-size: 17px; padding: 5px 14px; }
	.site-info { font-size: 12px; }
}

/* =====================================================================
 * HARD OVERRIDES — GeneratePress prints its own inline CSS *after*
 * this file (white backgrounds, dark text, blue accent). These rules
 * use a `body` prefix + !important so the whole page stays uniformly
 * black with phosphor-green text regardless of load order.
 * ===================================================================== */

html body {
	background: var(--crt-bg) !important;
	color: var(--crt-green) !important;
	font-family: 'Share Tech Mono', 'Courier New', monospace !important;
}

body .site-header,
body .top-bar,
body .main-navigation,
body .main-navigation ul ul,
body.separate-containers .inside-article,
body.separate-containers .comments-area,
body.separate-containers .page-header,
body.one-container .container,
body.separate-containers .paging-navigation,
body .inside-page-header,
body .sidebar .widget,
body .footer-widgets,
body .site-info,
body .site-footer,
body .site-content {
	background: var(--crt-bg) !important;
	background-color: var(--crt-bg) !important;
	color: var(--crt-green) !important;
	border-color: var(--crt-dim) !important;
	box-shadow: none !important;
}

body .site-content {
	box-shadow: 0 0 30px rgba(0, 255, 65, 0.10) !important;
}

body .entry-title a,
body .main-navigation .main-nav ul li a,
body .main-navigation .menu-toggle,
body .main-navigation .menu-bar-items,
body .main-navigation .main-nav ul li:not([class*="current-menu-"]):hover > a,
body .main-navigation .main-nav ul li[class*="current-menu-"] > a,
body .entry-meta,
body .entry-meta a,
body .site-description,
body .site-title a,
body .top-bar,
body .top-bar a,
body a {
	color: var(--crt-green) !important;
}

body .main-navigation .main-nav ul li a:hover,
body .main-navigation .main-nav ul li a:hover::before,
body .top-bar a:hover,
body a:hover,
body .entry-title a:hover {
	background: var(--crt-green) !important;
	color: #000 !important;
	text-shadow: none !important;
}

/* the logo is an exception: hovering it must never invert to a green block */
body .main-title a:hover,
body .main-title a:focus {
	background: transparent !important;
	color: var(--crt-green) !important;
	text-shadow: 0 0 6px rgba(0, 255, 65, 0.55) !important;
}

body h1, body h2, body h3, body h4, body h5, body h6 {
	color: var(--crt-green) !important;
	font-family: 'VT323', 'Share Tech Mono', monospace !important;
}

body input[type="text"], body input[type="email"], body input[type="url"],
body input[type="password"], body input[type="search"], body input[type="tel"],
body input[type="number"], body textarea, body select {
	background: #000 !important;
	background-color: #000 !important;
	border-color: var(--crt-dim) !important;
	color: var(--crt-green) !important;
}

body button, body html input[type="button"], body input[type="reset"],
body input[type="submit"], body a.button, body .menu-toggle {
	background: #000 !important;
	background-color: #000 !important;
	border-color: var(--crt-green) !important;
	color: var(--crt-green) !important;
}

body button:hover, body html input[type="button"]:hover, body input[type="reset"]:hover,
body input[type="submit"]:hover, body a.button:hover, body .menu-toggle:hover {
	background: var(--crt-green) !important;
	background-color: var(--crt-green) !important;
	color: #000 !important;
}

body .main-navigation .main-nav ul li:not([class*="current-menu-"]):hover > a,
body .main-navigation .menu-bar-item:hover > a {
	background: var(--crt-green) !important;
	color: #000 !important;
}

/* ---- full-width terminal menu bar ---- */
body .inside-header {
	flex-wrap: wrap;
}

body .main-navigation {
	flex-basis: 100%;
	width: 100%;
	border-top: 1px solid var(--crt-dim);
	border-bottom: 1px solid var(--crt-dim);
}

body .main-navigation .inside-navigation {
	max-width: 100%;
	width: 100%;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

body .main-navigation .main-nav {
	width: 100%;
}

body .main-navigation .main-nav > ul {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
}

body .main-nav li {
	margin: 0;
}

body .main-nav li a {
	display: inline-block;
	font-family: 'VT323', 'Share Tech Mono', monospace;
	font-size: 26px;
	letter-spacing: 2px;
	padding: 10px 14px;
}

body .site-content::before {
	white-space: nowrap;
}

/* ---- no sidebar: single full-width terminal column ---- */
body .widget-area {
	display: none !important;
}

body .site-content .content-area {
	width: 100% !important;
}

@media (max-width: 768px) {
	body .main-navigation .main-nav > ul {
		flex-wrap: wrap;
		justify-content: flex-start;
		gap: 1px 4px;
	}
	body .main-nav li a {
		font-size: 18px;
		padding: 5px 7px;
		letter-spacing: 1px;
	}
	/* collapsed mobile nav should not draw an empty bordered bar */
	body .main-navigation,
	body .main-navigation.mobile-menu-control-wrapper { border-top: 0; border-bottom: 0; }
	body #site-navigation.toggled { border-top: 1px solid var(--crt-dim); border-bottom: 1px solid var(--crt-dim); }
	body .main-navigation .menu-toggle { padding: 4px 12px; }
}

/* ---- matrix digital rain background (canvas injected by matrix.js) ---- */
#matrix-rain {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
	opacity: 0.45;
}

body .site {
	position: relative;
	z-index: 1;
}

/* content panel slightly translucent so the rain shows through */
body .site-content {
	background: rgba(0, 0, 0, 0.88) !important;
	background-color: rgba(0, 0, 0, 0.88) !important;
}

/* ---- desktop: fixed left terminal pane, vertical section menu ---- */
@media (min-width: 1024px) {
	body .site-header {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 270px;
		height: auto;
		background: rgba(0, 0, 0, 0.94);
		border-right: 1px solid var(--crt-dim);
		border-bottom: 0;
		overflow-y: auto;
		z-index: 30;
	}

	body .inside-header {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		max-width: 100%;
		padding: 18px 16px 28px !important;
	}

	body .site-branding {
		margin-bottom: 20px;
	}

	/* the art is 43 chars wide - shrink it so it fits the pane without clipping */
	body .ascii-logo {
		font-size: 9px;
		line-height: 1.15;
	}

	body .main-navigation {
		flex-basis: auto;
		width: 100%;
		border-top: 1px solid var(--crt-dim);
		border-bottom: 0;
	}

	body .main-navigation .inside-navigation {
		display: block;
		padding: 0 !important;
	}

	body .main-navigation .main-nav {
		width: 100%;
	}

	body .main-navigation .main-nav > ul {
		display: flex;
		flex-direction: column;
		align-items: stretch;
	}

	body .main-navigation .main-nav ul li {
		width: 100%;
		border-bottom: 1px dashed rgba(0, 255, 65, 0.18);
	}

	body .main-navigation .main-nav ul li a {
		display: block;
		font-size: 22px;
		padding: 9px 6px;
	}

	/* active section: the "selected file" is inverted */
	body .main-navigation .main-nav ul li.current-menu-item > a,
	body .main-navigation .main-nav ul li.current_page_item > a,
	body .main-navigation .main-nav ul li.current-menu-ancestor > a {
		background: var(--crt-green) !important;
		color: #000 !important;
		text-shadow: none !important;
	}

	body .main-navigation .main-nav ul li.current-menu-item > a::before,
	body .main-navigation .main-nav ul li.current_page_item > a::before,
	body .main-navigation .main-nav ul li.current-menu-ancestor > a::before {
		content: "> ";
		color: #000;
	}

	/* content clears the fixed pane */
	body #page {
		margin-left: 270px;
		max-width: none;
		width: auto;
		margin-right: 0;
	}

	body .site-footer {
		margin-left: 270px;
	}
}

/* ---- contextual pane index (blog section) ---- */
.gpr-section-index {
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px dashed rgba(0, 255, 65, 0.3);
}

.gpr-index-title {
	margin: 0 0 6px;
	padding: 0 6px;
	color: var(--crt-dim);
	font-family: 'Share Tech Mono', monospace;
	font-size: 14px;
	letter-spacing: 1px;
}

.gpr-section-index ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gpr-section-index li {
	margin: 0;
	border-bottom: 1px dotted rgba(0, 255, 65, 0.12);
}

.gpr-section-index a {
	display: block;
	padding: 6px 6px 6px 6px;
	font-family: 'Share Tech Mono', monospace;
	font-size: 15px;
	line-height: 1.35;
	color: var(--crt-green-soft);
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.gpr-section-index a::before {
	content: "$ ";
	color: var(--crt-dim);
}

.gpr-section-index li.current a,
.gpr-section-index a:hover {
	background: var(--crt-green) !important;
	color: #000 !important;
	text-shadow: none !important;
}

.gpr-section-index li.current a::before,
.gpr-section-index a:hover::before {
	color: #000;
}

/* mobile: hamburger hugs the left edge of its bar instead of floating in the middle */
@media (max-width: 1023px) {
	body .mobile-menu-control-wrapper .menu-toggle {
		text-align: left;
		padding-left: 6px;
	}
}
