@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
	--bg: #000;
	--text: #e8eef7;
	--muted: #9aa8bd;
	--accent: #0090ff;
	--accent-glow: rgba(0, 112, 206, 0.55);
	--glass: rgba(0, 0, 0, 0.55);
	--glass-strong: rgba(0, 0, 0, 0.72);
	--panel: rgba(0, 112, 206, 0.12);
	--border: rgba(0, 112, 206, 0.45);
	--tile-bg: rgba(20, 28, 40, 0.75);
	--radius: 0.75rem;
	--gutter: clamp(0.85rem, 2.2vw, 2rem);
	--aside: clamp(15rem, 18vw, 20rem);
	--font-display: "Orbitron", sans-serif;
	--font-sans: "IBM Plex Sans", system-ui, sans-serif;
	--font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
	color-scheme: dark;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--font-sans);
	font-size: 1.05rem;
	line-height: 1.55;
	color: var(--text);
	background-color: var(--bg);
	background-image: url("/images/site/bg.jpg");
	background-repeat: no-repeat;
	background-attachment: fixed;
	background-position: right top;
	background-size: cover;
}

a {
	color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

a:hover { color: #5cbcff; }

a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 0.5rem 1rem;
	background: var(--glass-strong);
	color: var(--text);
}

.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__inner,
.site-footer__inner,
.layout {
	width: 100%;
	max-width: none;
	margin-inline: 0;
	padding-inline: var(--gutter);
	box-sizing: border-box;
}

.site-header__inner {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.1rem 0;
}

.site-brand {
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(1.6rem, 4vw, 2.2rem);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1;
}

.site-brand a {
	color: var(--text);
	text-decoration: none;
	text-shadow: 0 0 1.2em var(--accent-glow);
}

.site-tagline {
	margin: 0;
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--muted);
	letter-spacing: 0.04em;
}

.layout {
	display: grid;
	grid-template-columns: var(--aside) minmax(0, 1fr);
	gap: clamp(1rem, 2vw, 1.75rem);
	padding-block: 1.75rem 3rem;
	align-items: start;
}

@media (max-width: 900px) {
	.layout {
		grid-template-columns: 1fr;
	}
	.layout__aside {
		display: flex;
		flex-direction: column;
		gap: 1rem;
	}
}

@media (min-width: 641px) and (max-width: 900px) {
	.layout__aside {
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-areas:
			"brand brand"
			"intro intro"
			"who contact"
			"lang lang";
		gap: 1rem;
		align-items: start;
	}
	.brand-block { grid-area: brand; }
	.aside-intro { grid-area: intro; }
	.whoami-panel { grid-area: who; }
	.contact-panel { grid-area: contact; }
	.lang-panel { grid-area: lang; }
}

.panel {
	background: var(--panel);
	border: 1px solid var(--border);
	box-shadow: 0 0 3.5em var(--accent-glow);
	border-radius: var(--radius);
	padding: 1rem 1.1rem;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.panel + .panel { margin-top: 1rem; }

@media (max-width: 900px) {
	.layout__aside .panel + .panel { margin-top: 0; }
}

.panel__title {
	margin: 0 0 0.75rem;
	font-family: var(--font-display);
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

.whoami {
	display: grid;
	grid-template-columns: 3.25rem 1fr;
	gap: 0.85rem;
	align-items: start;
}

.whoami__avatar {
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 0.35rem;
	object-fit: cover;
	box-shadow: 0 0 0.8em var(--accent-glow);
}

.whoami__text {
	margin: 0;
	font-size: 0.9rem;
	color: var(--muted);
	line-height: 1.45;
}

.boxlink {
	display: block;
	margin-top: 0.85rem;
	padding: 0.55rem 0.7rem;
	text-align: center;
	text-decoration: none;
	color: var(--text);
	background: rgba(40, 40, 40, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 0.4rem;
	font-family: var(--font-mono);
	font-size: 0.82rem;
	letter-spacing: 0.03em;
	opacity: 0.7;
	transition: opacity 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.boxlink:hover {
	opacity: 1;
	border-color: var(--border);
	box-shadow: 0 0 1.2em var(--accent-glow);
	color: var(--text);
}

.contact-links {
	text-align: center;
}

.contact-links__icons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.55rem;
	margin: 0.6rem 0 0.75rem;
}

.contact-links__icons a {
	display: inline-flex;
	opacity: 0.55;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.contact-links__icons a:hover {
	opacity: 1;
	transform: translateY(-2px);
}

.contact-links__icons img {
	width: 32px;
	height: 32px;
	display: block;
}

.contact-links__note {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.72rem;
	color: var(--muted);
	line-height: 1.35;
}

.intro {
	margin: 0 0 1.5rem;
	padding: 1rem 1.15rem;
	background: var(--glass);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: var(--muted);
	font-size: 0.98rem;
}

.section { margin-bottom: 2rem; }

.section__title {
	margin: 0 0 0.9rem;
	font-family: var(--font-display);
	font-size: 0.85rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #c9d7ea;
	text-shadow: 0 0 0.8em var(--accent-glow);
}

.tile-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
	gap: clamp(0.65rem, 1.2vw, 1rem);
	list-style: none;
	margin: 0;
	padding: 0;
}

.tile {
	margin: 0;
}

.tile__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: var(--text);
	background: var(--tile-bg);
	border: 1px solid rgba(0, 112, 206, 0.35);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: 0 0 0 rgba(0, 112, 206, 0);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.tile__link:hover,
.tile__link:focus-visible {
	transform: translateY(-4px) scale(1.02);
	border-color: rgba(0, 144, 255, 0.85);
	box-shadow: 0 0.6rem 1.8em var(--accent-glow);
	color: var(--text);
}

.tile__media {
	aspect-ratio: 16 / 10;
	background: #0a1018;
	overflow: hidden;
}

.tile__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s ease;
}

.tile__link:hover .tile__media img {
	transform: scale(1.06);
}

.tile__media--empty {
	display: grid;
	place-items: center;
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--muted);
	letter-spacing: 0.08em;
	background:
		linear-gradient(135deg, rgba(0, 112, 206, 0.25), transparent 60%),
		#0a1018;
}

.tile__body {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.65rem 0.7rem 0.75rem;
	flex: 1;
}

.tile__title {
	font-size: 0.86rem;
	font-weight: 600;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tile__date {
	font-family: var(--font-mono);
	font-size: 0.68rem;
	color: var(--muted);
	letter-spacing: 0.02em;
}

.back-link {
	display: inline-block;
	margin-bottom: 1.1rem;
	font-family: var(--font-mono);
	font-size: 0.85rem;
}

.post-shell {
	background: var(--glass-strong);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius);
	padding: 1.4rem 1.5rem 1.75rem;
	box-shadow: 0 0 2.5em rgba(0, 112, 206, 0.35);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.post-article h1 {
	margin: 0 0 0.4rem;
	font-family: var(--font-display);
	font-size: clamp(1.45rem, 3.5vw, 2rem);
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-shadow: 0.05em 0.05em 0.25em #000;
}

.post-article__banner {
	position: relative;
	margin: -1.4rem -1.5rem 1.35rem;
	padding: 1.6rem 1.5rem 1.35rem;
	min-height: 7.5rem;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	background-color: #0a1018;
	background-image: var(--post-banner);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	border-radius: var(--radius) var(--radius) 0 0;
	overflow: hidden;
}

.post-article__banner::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.45) 100%);
	pointer-events: none;
}

.post-article__banner > * {
	position: relative;
	z-index: 1;
}

.post-article__banner h1 {
	color: #fff;
	-webkit-text-stroke: 0.06em #000;
	paint-order: stroke fill;
	text-shadow:
		0 0 0.05em #000,
		0.04em 0.04em 0 #000,
		-0.04em 0.04em 0 #000,
		0.04em -0.04em 0 #000,
		-0.04em -0.04em 0 #000,
		0.06em 0 0 #000,
		-0.06em 0 0 #000,
		0 0.06em 0 #000,
		0 -0.06em 0 #000;
}

.post-article__banner .post-article__meta {
	margin-bottom: 0;
	color: #f0f4fa;
	text-shadow: 0 0 0.25em #000, 0.05em 0.05em 0 #000;
}

.post-article__meta {
	margin: 0 0 1.25rem;
	font-family: var(--font-mono);
	font-size: 0.82rem;
	color: var(--muted);
}

.post-article__body > *:first-child { margin-top: 0; }

.muted { color: var(--muted); }

.site-footer {
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	padding: 1rem 0 1.5rem;
	color: var(--muted);
	font-family: var(--font-mono);
	font-size: 0.75rem;
}

/* entrance */
.js .tile {
	opacity: 0;
	transform: translateY(10px);
	animation: tile-in 0.5s ease forwards;
}

@keyframes tile-in {
	to { opacity: 1; transform: none; }
}

.site-main--post {
	padding-block: 1.75rem 3rem;
}

.site-main--post .post-shell {
	width: 100%;
}

.post-article__body h2 {
	margin: 2rem 0 0.75rem;
	font-family: var(--font-display);
	font-size: 1rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #c9d7ea;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	padding-bottom: 0.4rem;
}

.post-article__body ul { padding-left: 1.2rem; }
.post-article__body li { margin-bottom: 0.55rem; }
.text-small { font-size: 0.88rem; color: var(--muted); }
.lead { font-size: 1.1rem; color: var(--muted); }

.post-hero {
	margin: 0 0 1.4rem;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid rgba(0, 112, 206, 0.35);
	box-shadow: 0 0 1.5em var(--accent-glow);
}
.post-hero img { display: block; width: 100%; height: auto; }

.boxlink--inline {
	display: inline-block;
	margin-top: 0.5rem;
	padding-inline: 1rem;
}

.contact-page-list {
	list-style: none;
	margin: 1.25rem 0 1.75rem;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

.contact-page-item {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.85rem 1rem;
	text-decoration: none;
	color: var(--text);
	background: rgba(0, 112, 206, 0.1);
	border: 1px solid rgba(0, 112, 206, 0.4);
	border-radius: var(--radius);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.contact-page-item:hover,
.contact-page-item:focus-visible {
	transform: translateY(-2px);
	border-color: rgba(0, 144, 255, 0.85);
	box-shadow: 0 0 1.4em var(--accent-glow);
	color: var(--text);
}

.contact-page-item img { flex-shrink: 0; width: 48px; height: 48px; }

.contact-page-item__text {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

.contact-page-item__text strong {
	font-family: var(--font-display);
	font-size: 0.85rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.contact-page-item__text span {
	font-size: 0.88rem;
	color: var(--muted);
}

.pgp-block {
	overflow-x: auto;
	padding: 1rem;
	background: rgba(0, 0, 0, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--radius);
	font-family: var(--font-mono);
	font-size: 0.72rem;
	line-height: 1.45;
	color: #c5d4e8;
}
.pgp-block code { font-family: inherit; white-space: pre; }

@media (min-width: 901px) {
	.layout__aside {
		position: sticky;
		top: var(--gutter);
		align-self: start;
	}
}

@media (min-width: 1400px) {
	.tile-grid {
		grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
	}
}

.brand-block {
	margin: 0 0 0.5rem;
	padding: 0.15rem 0 0.85rem;
}
.brand-block .site-brand {
	font-size: clamp(2.1rem, 4.5vw, 2.9rem);
	line-height: 1.05;
}
.brand-block .site-tagline {
	margin-top: 0.5rem;
	font-size: 0.95rem;
}
.layout__aside .panel + .panel {
	margin-top: 1rem;
}
.site-header--post .site-header__inner {
	justify-content: flex-start;
	gap: 1.25rem;
	align-items: baseline;
}

.post-article__body img {
	max-width: 100%;
	height: auto;
	border-radius: 0.4rem;
}

.post-article__body a {
	overflow-wrap: anywhere;
	word-break: break-word;
}

.post-article__body video {
	max-width: 100%;
	height: auto;
}

.post-article__body pre,
.post-article__body code {
	font-family: var(--font-mono);
}

.post-article__body pre {
	overflow-x: auto;
	padding: 0.85rem 1rem;
	background: rgba(0, 0, 0, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--radius);
	font-size: 0.82rem;
}

.post-article__body .rightbox {
	float: right;
	margin: 0 0 1rem 1rem;
	max-width: min(100%, 20rem);
}

@media (max-width: 640px) {
	.post-article__body .rightbox {
		float: none;
		margin: 0 0 1rem;
		max-width: 100%;
	}
}

.post-article__body::after {
	content: "";
	display: table;
	clear: both;
}

.post-article__body .alignright {
	float: right;
	margin: 0 0 1rem 1rem;
	max-width: min(100%, 20rem);
}

@media (max-width: 640px) {
	.post-article__body .alignright {
		float: none;
		margin: 0 0 1rem;
		max-width: 100%;
	}
}

.post-article__body iframe {
	max-width: 100%;
	aspect-ratio: 16 / 9;
	width: min(100%, 720px);
	height: auto;
	min-height: 200px;
	border: 0;
	border-radius: 0.4rem;
}

.layout__main--post .back-link {
	margin-bottom: 1rem;
}

.layout__main--post .post-shell {
	width: 100%;
}



/* ---- Language switch ---- */
.lang-switch {
	display: flex;
	gap: 0.55rem;
}

.lang-switch__btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	min-height: 2.75rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid rgba(0, 112, 206, 0.45);
	border-radius: var(--radius);
	background: rgba(0, 0, 0, 0.35);
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.lang-switch__btn:hover,
.lang-switch__btn:focus-visible {
	border-color: rgba(0, 144, 255, 0.85);
	background: rgba(0, 112, 206, 0.22);
	outline: none;
}

.lang-switch__btn.is-active,
.lang-switch__btn[aria-pressed="true"] {
	border-color: rgba(0, 144, 255, 0.95);
	background: rgba(0, 112, 206, 0.35);
	box-shadow: 0 0 1em var(--accent-glow);
}

.lang-switch__flag {
	display: block;
	width: 2.6rem;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 0.2rem;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* ---- Modal (generic) ---- */
body.site-modal-open {
	overflow: hidden;
}

.site-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: grid;
	place-items: center;
	padding: 1.25rem;
}

.site-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.site-modal__dialog {
	position: relative;
	z-index: 1;
	max-width: min(100%, 96vw);
	max-height: min(100%, 92vh);
	display: flex;
	flex-direction: column;
	align-items: center;
}

.site-modal__close {
	position: fixed;
	top: 0.85rem;
	right: 0.85rem;
	z-index: 2;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 0.45rem;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.site-modal__close:hover,
.site-modal__close:focus-visible {
	background: rgba(0, 112, 206, 0.45);
	border-color: rgba(0, 144, 255, 0.85);
	outline: none;
}

.site-modal__body {
	max-width: 100%;
	max-height: 92vh;
	overflow: auto;
}

.site-modal--media .site-modal__body {
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.site-modal__media {
	display: block;
	max-width: min(96vw, 1400px);
	max-height: 88vh;
	width: auto;
	height: auto;
	border-radius: 0.35rem;
	box-shadow: 0 0 2.5em rgba(0, 112, 206, 0.35);
}
