/* === Resets === */

*, *::before, *::after {
	box-sizing: border-box;
}

* {
	margin: 0;
	padding: 0;
}

/* Do not remove: needed for antispam. */
#mid {
	display: none;
}

/* === Theme: Light (default) === */
:root {
	--bg: #ffffff;
	--bg-alt: #f6f7f9;
	--text: #1c1e26;
	--text-muted: #5e6370;
	--acc: #2563eb;
	--acc-hover: #1d4ed8;
	--acc-soft: rgba(37, 99, 235, 0.07);
	--border: #e1e4e8;
	--code-bg: #f0f2f5;
	--shadow: 0 1px 3px rgba(0,0,0,0.06);
	--radius: 5px;
	--max-w: 48rem;
	--max-w-wide: 66rem;
	--syn-str: #1a7f37;
	--syn-kw: #8250df;
	--syn-num: #cf222e;
	--syn-fn: #2563eb;
	--syn-cmt: #6e7781;
	--syn-regex: #9a6700;
	--adm-note-border: #2563eb;
	--adm-note-bg: rgba(37, 99, 235, 0.07);
	--adm-note-text: #1d4ed8;
	--adm-tip-border: #059669;
	--adm-tip-bg: rgba(5, 150, 105, 0.07);
	--adm-tip-text: #047857;
	--adm-warning-border: #d97706;
	--adm-warning-bg: rgba(217, 119, 6, 0.07);
	--adm-warning-text: #b45309;
	--adm-danger-border: #dc2626;
	--adm-danger-bg: rgba(220, 38, 38, 0.07);
	--adm-danger-text: #b91c1c;
}

/* === Theme: Dark (prefers) === */
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0e1015;
		--bg-alt: #161921;
		--text: #d1d5db;
		--text-muted: #848b99;
		--acc: #60a5fa;
		--acc-hover: #93c5fd;
		--acc-soft: rgba(96, 165, 250, 0.1);
		--border: #252a34;
		--code-bg: #171c26;
		--shadow: 0 1px 3px rgba(0,0,0,0.3);
		--syn-str: #7ee787;
		--syn-kw: #d2a8ff;
		--syn-num: #ff7b72;
		--syn-fn: #60a5fa;
		--syn-cmt: #6e7681;
		--syn-regex: #e3b341;
		--adm-note-border: #60a5fa;
		--adm-note-bg: rgba(96, 165, 250, 0.1);
		--adm-note-text: #93c5fd;
		--adm-tip-border: #34d399;
		--adm-tip-bg: rgba(52, 211, 153, 0.1);
		--adm-tip-text: #6ee7b7;
		--adm-warning-border: #fbbf24;
		--adm-warning-bg: rgba(251, 191, 36, 0.1);
		--adm-warning-text: #fcd34d;
		--adm-danger-border: #f87171;
		--adm-danger-bg: rgba(248, 113, 113, 0.1);
		--adm-danger-text: #fca5a5;
	}
}

/* === Theme: Manual overrides === */
[data-theme="light"] {
	--bg: #ffffff;
	--bg-alt: #f6f7f9;
	--text: #1c1e26;
	--text-muted: #5e6370;
	--acc: #2563eb;
	--acc-hover: #1d4ed8;
	--acc-soft: rgba(37,99,235,0.07);
	--border: #e1e4e8;
	--code-bg: #f0f2f5;
	--shadow: 0 1px 3px rgba(0,0,0,0.06);
	--syn-str: #1a7f37;
	--syn-kw: #8250df;
	--syn-num: #cf222e;
	--syn-fn: #2563eb;
	--syn-cmt: #6e7781;
	--syn-regex: #9a6700;
	--adm-note-border: #2563eb;
	--adm-note-bg: rgba(37, 99, 235, 0.07);
	--adm-note-text: #1d4ed8;
	--adm-tip-border: #059669;
	--adm-tip-bg: rgba(5, 150, 105, 0.07);
	--adm-tip-text: #047857;
	--adm-warning-border: #d97706;
	--adm-warning-bg: rgba(217, 119, 6, 0.07);
	--adm-warning-text: #b45309;
	--adm-danger-border: #dc2626;
	--adm-danger-bg: rgba(220, 38, 38, 0.07);
	--adm-danger-text: #b91c1c;
}
[data-theme="dark"] {
	--bg: #0e1015;
	--bg-alt: #161921;
	--text: #d1d5db;
	--text-muted: #848b99;
	--acc: #60a5fa;
	--acc-hover: #93c5fd;
	--acc-soft: rgba(96,165,250,0.1);
	--border: #252a34;
	--code-bg: #171c26;
	--shadow: 0 1px 3px rgba(0,0,0,0.3);
	--syn-str: #7ee787;
	--syn-kw: #d2a8ff;
	--syn-num: #ff7b72;
	--syn-fn: #60a5fa;
	--syn-cmt: #6e7681;
	--syn-regex: #e3b341;
	--adm-note-border: #60a5fa;
	--adm-note-bg: rgba(96, 165, 250, 0.1);
	--adm-note-text: #93c5fd;
	--adm-tip-border: #34d399;
	--adm-tip-bg: rgba(52, 211, 153, 0.1);
	--adm-tip-text: #6ee7b7;
	--adm-warning-border: #fbbf24;
	--adm-warning-bg: rgba(251, 191, 36, 0.1);
	--adm-warning-text: #fcd34d;
	--adm-danger-border: #f87171;
	--adm-danger-bg: rgba(248, 113, 113, 0.1);
	--adm-danger-text: #fca5a5;
}

body {
	font-family: "B612", sans-serif;
	background: var(--bg);
}

main {
	padding: 2em 0;
	color: var(--text);
}

/* === Typography === */
h1, h2, h3, h4 {
	margin-top: 1em;
	margin-bottom: 0.4em;
}

h1 {
	font-size: 2.2rem;
}

h2 {
	font-size: 1.5rem;
}

h3 {
	font-size: 1.1rem;
}

h4 {
	font-size: 1.05rem;
}

p {
	margin-bottom: 1em;
	line-height: 1.5em;
}

a {
	color: var(--acc);
	text-decoration: none;
	transition: color 0.15s;
}

a:hover {
	color: var(--acc-hover);
	text-decoration: underline;
}

strong {
	font-weight: 700;
}

small, .muted {
	font-size: 0.85rem;
	color: var(--text-muted);
}

hr {
	border: none;
	border-top: 1px solid var(--border);
	margin: 2rem 0;
}
img {
	max-width: 100%;
	height: auto;
}
:target {
	scroll-margin-top: 5rem;
}
/* === Layout helpers === */
.wrap {
	max-width: var(--max-w);
	margin: 0 auto;
	padding: 0 1.5rem;
}
.wrap-wide {
	max-width: var(--max-w-wide);
	margin: 0 auto;
	padding: 0 1.5rem;
}

/* === Header / Nav === */

header {
	border-bottom: 1px solid var(--border);
	background: var(--bg);
	position: sticky;
	top: 0;
	z-index: 50;
	line-height: 3.2rem;
}

header > div {
	display: flex;
	justify-content: space-between;
}

header > div > a {
	font-weight: 700;
}

header a {
	color: var(--text);
}
header nav {
	display: flex;
	gap: 1.25rem;
	align-items: center;
}
header nav a {
	color: var(--text-muted);
	font-size: 0.875rem;
	text-decoration: none;
}
header nav a:hover {
	text-decoration: none;
}
/* Theme toggle */
.theme-toggle {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s;
}
.theme-toggle:hover {
	color: var(--acc);
	border-color: var(--acc);
}
/* === Sections === */
section {
	padding: 3.5rem 0;
}
section + section {
	border-top: 1px solid var(--border);
}
.section-label {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--acc);
	margin-bottom: 0.5rem;
	display: block;
}
/* === Home / Hero === */
#home {
padding-top: 5rem;
}
#home h1 {
font-size: 2.6rem;
font-weight: 700;
margin-bottom: 0.4em;
}
#home p {
font-size: 1.1rem;
color: var(--text-muted);
max-width: 38rem;
}
.services {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	gap: 1rem;
	margin-top: 2rem;
}
.services article {
	padding: 1.25rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg-alt);
	transition: border-color 0.2s;
}
.services article:hover {
	border-color: var(--acc);
}
.services article h3 {
	margin-top: 0;
	font-size: 0.95rem;
	margin-bottom: 0.35em;
}

#home .services article p {
font-size: 0.85rem;
color: var(--text-muted);
margin-bottom: 0;
line-height: 1.6;
}

/* === Blog list === */
.post-list {
	list-style: none;
}
.post-list li {
	padding: 1.1rem 0;
	border-bottom: 1px solid var(--border);
}
.post-list li:last-child {
	border-bottom: none;
}
.post-list a {
	font-weight: 700;
	font-size: 1.05rem;
}
.post-list a:hover {
	color: var(--acc);
	text-decoration: none;
}
.post-list time {
	display: block;
	font-size: 0.8rem;
	color: var(--text-muted);
	margin-top: 0.15rem;
}
.post-list .excerpt {
	font-size: 0.875rem;
	color: var(--text-muted);
	margin-top: 0.2rem;
	margin-bottom: 0;
}

.post-meta {
	font-size: 0.85rem;
	color: var(--text-muted);
}

main ul, main ol {
	margin: 1em 0;
	padding-left: 1.5em;
}
main li {
	margin-bottom: 0.4em;
}
#post img {
	border-radius: var(--radius);
	margin: 1.5em 0;
}
#post blockquote {
	border-left: 3px solid var(--acc);
	padding: 0.5em 1em;
	margin: 1.5em 0;
	color: var(--text-muted);
	background: var(--acc-soft);
	border-radius: 0 var(--radius) var(--radius) 0;
}
#post figure {
	margin: 1.5em 0;
}
#post figcaption {
	font-size: 0.8rem;
	color: var(--text-muted);
	text-align: center;
	margin-top: 0.5em;
}

#post p {
	text-align: justify;
}
/* === Code === */
code {
	font-family: "B612 Mono", monospace;
	font-size: 0.85em;
	background: var(--code-bg);
	padding: 0.15em 0.4em;
	border-radius: 3px;
}
pre {
	background: var(--code-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.15rem;
	overflow-x: auto;
	margin: 1.5em 0;
	line-height: 1.6;
	font-size: 0.85rem;
}
pre code {
	background: none;
	padding: 0;
	border-radius: 0;
	font-size: inherit;
}
/* === Projects === */
.project-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
	gap: 1.25rem;
	margin-top: 1.5rem;
}
.project-grid article {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--bg-alt);
	transition: border-color 0.2s;
}
.project-grid article:hover {
	border-color: var(--acc);
}
.project-grid article img {
	width: 100%;
	height: 11rem;
	object-fit: cover;
}
.project-grid article .card-body {
	padding: 1.1rem;
}
.project-grid article h3 {
	font-size: 0.95rem;
	margin-bottom: 0.2em;
}
.project-grid article p {
	font-size: 0.825rem;
	color: var(--text-muted);
	margin-bottom: 0;
}
.project-grid article {
	display: flex;
	flex-direction: column;
}
.project-grid article a {
	display: flex;
	flex-direction: column;
	flex: 1;
	color: inherit;
	text-decoration: none;
}
.project-grid article a:hover {
	color: inherit;
	text-decoration: none;
}

.project-grid article img {
	flex-shrink: 0;
}

/* Tags */
.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	margin-top: 0.5rem;
}
.tag {
	font-size: 0.7rem;
	font-weight: 500;
	padding: 0.12em 0.55em;
	border-radius: 9999px;
	background: var(--acc-soft);
	color: var(--acc);
}
/* === Shop === */
.item-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 1.25rem;
	margin-top: 1.5rem;
}
.item-grid article {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.25rem;
	background: var(--bg-alt);
	transition: border-color 0.2s;
}
.item-grid article:hover {
	border-color: var(--acc);
}
.item-grid article img {
	width: 100%;
	height: 9.5rem;
	object-fit: cover;
	border-radius: calc(var(--radius) - 2px);
	margin-bottom: 0.85rem;
}
.item-grid article h3 {
	font-size: 0.95rem;
	margin-bottom: 0.15em;
}
.item-grid article .price {
	font-weight: 700;
	color: var(--acc);
	font-size: 0.95rem;
}
.item-grid article p {
	font-size: 0.825rem;
	color: var(--text-muted);
	margin-top: 0.25rem;
	margin-bottom: 0;
}
/* === Item Detail === */
.item-detail {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2.5rem;
	align-items: start;
	margin-top: 1.5rem;
}
.item-detail img {
	width: 100%;
	border-radius: var(--radius);
	border: 1px solid var(--border);
}
.item-detail .price {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--acc);
	display: block;
	margin: 0.4em 0 0.75em;
}
.item-detail dl {
	margin: 1em 0;
}
.item-detail dt {
	font-size: 0.8rem;
	color: var(--text-muted);
	font-weight: 500;
}
.item-detail dd {
	margin-bottom: 0.6em;
	font-size: 0.9rem;
}
.item-detail dd p {
	margin-bottom: 0;
}
/* === Buttons === */
button, .btn {
	display: inline-block;
	padding: 0.5em 1.1em;
	font-size: 0.875rem;
	font-weight: 550;
	font-family: inherit;
	border: 1px solid var(--acc);
	border-radius: var(--radius);
	background: var(--acc);
	color: #fff;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: background 0.15s, border-color 0.15s;
	vertical-align: middle;
}
button:disabled, button[disabled] {
	background-color: var(--text-muted);
	cursor: default;
}
button:hover, .btn:hover {
	background: var(--acc-hover);
	border-color: var(--acc-hover);
	color: #fff;
	text-decoration: none;
}
.btn-outline {
	background: transparent;
	color: var(--acc);
}
.btn-outline:hover {
	background: var(--acc-soft);
	color: var(--acc);
}
.btn-sm {
	padding: 0.3em 0.75em;
	font-size: 0.8rem;
}
/* === Downloads === */
.download-list {
	list-style: none;
	margin-top: 1.5rem;
}
.download-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.15rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	margin-bottom: 0.6rem;
	background: var(--bg-alt);
	gap: 1rem;
}
.download-list li div {
	flex: 1;
	min-width: 0;
}
.download-list li h4 {
	font-size: 0.9rem;
	margin-bottom: 0.1em;
}
.download-list li p {
	font-size: 0.775rem;
	color: var(--text-muted);
	margin-bottom: 0;
}
.download-list li small {
	font-size: 0.7rem;
	white-space: nowrap;
}
/* === Contact === */
.contact-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2.5rem;
	margin-top: 1.5rem;
}
form {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}
label {
	display: block;
	font-size: 0.85rem;
	font-weight: 550;
	margin-bottom: 0.25em;
}
input, textarea {
	width: 100%;
	padding: 0.55em 0.75em;
	font-size: 0.9rem;
	font-family: inherit;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
	color: var(--text);
	transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus {
	outline: none;
	border-color: var(--acc);
	box-shadow: 0 0 0 2px var(--acc-soft);
}
textarea {
	resize: vertical;
	min-height: 7rem;
}
address {
	font-style: normal;
	font-size: 0.9rem;
	line-height: 1.9;
}
/* Hide success/error messages by default */
#form-success, #form-error {
display: none;
color: green;
margin-top: 10px;
}
#form-error {
color: red;
}
/* === Footer === */
footer {
	border-top: 1px solid var(--border);
	padding: 2rem 0;
	font-size: 0.78rem;
	color: var(--text-muted);
	background: var(--bg-alt);
}
footer .wrap-wide {
	display: flex;
	justify-content: space-between;
	align-items: start;
	flex-wrap: wrap;
	gap: 1rem;
}
footer ul {
	display: flex;
	gap: 1.25rem;
	list-style: none;
}
footer a {
	color: var(--text-muted);
}
footer a:hover {
	color: var(--acc);
}
/* === Layout & Backgrounds === */
td.linenos .normal {
	color: inherit;
	background-color: transparent;
	padding-left: 5px;
	padding-right: 5px;
}
span.linenos {
	color: inherit;
	background-color: transparent;
	padding-left: 5px;
	padding-right: 5px;
}
td.linenos .special {
	color: #000000;
	background-color: #ffffc0;
	padding-left: 5px;
	padding-right: 5px;
}
span.linenos.special {
	color: #000000;
	background-color: #ffffc0;
	padding-left: 5px;
	padding-right: 5px;
}
/* Generic.Subheading */
/* === Responsive === */
@media (max-width: 640px) {
	#home h1 {
	font-size: 1.9rem;
	}
	h2 {
		font-size: 1.35rem;
	}
	.item-detail, .contact-grid {
		grid-template-columns: 1fr;
	}
	.nav-links {
		gap: 0.85rem;
	}
	.nav-links a {
		font-size: 0.8rem;
	}
	section {
		padding: 2.5rem 0;
	}
	#home {
	padding: 3rem 0 2rem;
	}
}
/* === Print === */
@media print {
	header, footer, .theme-toggle {
		display: none;
	}
	body {
		color: #000;
		background: #fff;
	}
	a {
		color: #000;
		text-decoration: underline;
	}
}
.cc-license img {
	height: 1em;
	margin-left: .2em;
}
/* === Tables === */
.kv-table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5em 0;
	font-size: 0.9rem;
}
.kv-table td, .kv-table th {
	padding: 0.65em 0.75em;
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
}
.kv-table tr:first-child td, .kv-table > tr:first-child th {
	border-top: 1px solid var(--border);
}
.kv-table td:first-child, .kv-table th {
	font-weight: 550;
	color: var(--text-muted);
	white-space: nowrap;
	padding-right: 1.5em;
}
/* === Remote Support === */
input#rs-otp, input#rs-otp + button {
	display: inline-block;
	vertical-align: middle;
	height: 2.3rem;
	line-height: 2.3rem;
	box-sizing: border-box;
	padding-top: 0;
	padding-bottom: 0;
	margin-bottom: 0.75rem;
}
input#rs-otp {
	width: 20em;
	max-width: calc(100% - 6rem);
	padding-left: 0.75em;
	padding-right: 0.75em;
	margin-right: 0.5rem;
}
input#rs-otp + button {
	padding-left: 1.1em;
	padding-right: 1.1em;
}
.kv-copy-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}
/* Reset pre styling inside the table so it looks like normal text but retains copy formatting */
.kv-copy-row pre {
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	font-size: 0.85rem;
	line-height: 1.5;
	font-family: "B612 Mono", monospace;
	flex: 1;
	white-space: pre-wrap;
	word-break: break-all;
}
.copy-btn {
	background: transparent;
	color: var(--acc);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0.2em 0.6em;
	font-size: 0.75rem;
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
	flex-shrink: 0;
}
.copy-btn:hover {
	border-color: var(--acc);
	background: var(--acc-soft);
}
.hidden-rs {
	filter: blur(3px);
	user-select: none;
	transition: filter 0.3s ease;
}
/* Base Button Styles (Shared by Theme Toggle and Lang Buttons) */
.theme-toggle, .lang-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 30px;
	/* Fixed height ensures identical sizing */
	padding: 0 8px;
	/* Minimal horizontal padding, no vertical padding */
	background-color: var(--bg, #f8f9fa);
	border: 1px solid var(--border, #dee2e6);
	border-radius: var(--radius, 6px);
	color: var(--text-muted, #6c757d);
	cursor: pointer;
	line-height: 1;
	transition: all 0.2s ease-in-out;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	text-decoration: none;
	/* For the lang-btn link */
}
.theme-toggle:hover, .lang-btn:hover {
	background-color: var(--bg-hover, #e9ecef);
	color: var(--text, #343a40);
	border-color: var(--border-hover, #adb5bd);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.theme-toggle:active, .lang-btn:active {
	transform: translateY(1px);
	box-shadow: none;
	background-color: var(--bg-active, #dee2e6);
}
/* Flag Dimensions - Height matches, width auto-scales to maintain aspect ratio */
.lang-btn svg {
	height: 14px;
	width: auto;
	display: block;
	border-radius: 2px;
}
/* Theme Toggle SVG Dimensions */
.theme-toggle svg {
	width: 18px;
	height: 18px;
}
/* Theme Toggle SVG Visibility Logic */
/* Default (Light Mode): Show Moon, Hide Sun */
.theme-toggle .icon-sun {
	display: none;
}
.theme-toggle .icon-moon {
	display: block;
}
/* Dark Mode: Show Sun, Hide Moon */
html[data-theme="dark"] .theme-toggle .icon-sun {
	display: block;
}
html[data-theme="dark"] .theme-toggle .icon-moon {
	display: none;
}

/* Accessibility: visible focus rings */
.theme-toggle:focus-visible, .lang-btn:focus-visible {
	outline: 2px solid var(--acc, #0d6efd);
	outline-offset: 2px;
}

/* === Admonitions === */
.admonition {
	margin: 1.5em 0;
	padding: 1em 1.25em;
	border-left: 4px solid var(--border);
	background: var(--bg-alt);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.admonition-title {
	font-weight: 700;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	/* Matches your .section-label */
	margin-bottom: 0.5em;
	color: var(--text-muted);
}
.admonition p:last-child {
	margin-bottom: 0;
}
/* Note */
.admonition.note {
	border-left-color: var(--adm-note-border);
	background: var(--adm-note-bg);
}
.admonition.note .admonition-title {
	color: var(--adm-note-text);
}


/* Tip */
.admonition.tip {
	border-left-color: var(--adm-tip-border);
	background: var(--adm-tip-bg);
}
.admonition.tip .admonition-title {
	color: var(--adm-tip-text);
}
/* Warning */
.admonition.warning {
	border-left-color: var(--adm-warning-border);
	background: var(--adm-warning-bg);
}
.admonition.warning .admonition-title {
	color: var(--adm-warning-text);
}
/* Danger */
.admonition.danger {
	border-left-color: var(--adm-danger-border);
	background: var(--adm-danger-bg);
}
.admonition.danger .admonition-title {
	color: var(--adm-danger-text);
}
