/* ==========================================================================
   Basuru Yasaruwan · Portfolio
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
	font-family: 'Zx Gamut';
	src: url('../fonts/ZxGamut-Thin.otf') format('opentype');
	font-weight: 100;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Zx Gamut';
	src: url('../fonts/ZxGamut-ExtraLight.otf') format('opentype');
	font-weight: 200;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Zx Gamut';
	src: url('../fonts/ZxGamut-Regular.otf') format('opentype');
	font-weight: 300 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Zx Gamut';
	src: url('../fonts/ZxGamut-Medium.otf') format('opentype');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Zx Gamut';
	src: url('../fonts/ZxGamut-Bold.otf') format('opentype');
	font-weight: 600 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Zx Gamut';
	src: url('../fonts/ZxGamut-ExtraBold.otf') format('opentype');
	font-weight: 800 900;
	font-style: normal;
	font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
	--bg: #f7f8fb;
	--bg-alt: #eef1f6;
	--surface: #ffffff;
	--border: #e2e6ee;
	--text: #0f1420;
	--text-2: #4a5468;
	--text-3: #7a8396;
	--accent: #3b6cf6;
	--accent-2: #14b8a6;
	--accent-soft: rgba(59, 108, 246, 0.1);
	--shadow: 0 1px 2px rgba(15, 20, 32, 0.04), 0 8px 24px rgba(15, 20, 32, 0.06);
	--shadow-lg: 0 2px 4px rgba(15, 20, 32, 0.05), 0 20px 48px rgba(15, 20, 32, 0.12);
	--term-bg: #0f1420;

	--font: 'Zx Gamut', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--font-head: 'Zx Gamut', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

	--radius: 16px;
	--radius-sm: 10px;
	--container: 1120px;
	--nav-h: 68px;

	/* Spacing rhythm, shared by every section */
	--section-y: 64px;
	--head-gap: 32px;
	--grid-gap: 24px;
	--card-pad: 28px;

	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0b0d12;
		--bg-alt: #10131a;
		--surface: #151922;
		--border: #232937;
		--text: #eef1f7;
		--text-2: #a7b0c2;
		--text-3: #6f7a8f;
		--accent: #6b8fff;
		--accent-2: #2dd4bf;
		--accent-soft: rgba(107, 143, 255, 0.12);
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
		--shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 56px rgba(0, 0, 0, 0.45);
		--term-bg: #07090d;
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--bg: #0b0d12;
	--bg-alt: #10131a;
	--surface: #151922;
	--border: #232937;
	--text: #eef1f7;
	--text-2: #a7b0c2;
	--text-3: #6f7a8f;
	--accent: #6b8fff;
	--accent-2: #2dd4bf;
	--accent-soft: rgba(107, 143, 255, 0.12);
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
	--shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 56px rgba(0, 0, 0, 0.45);
	--term-bg: #07090d;
	color-scheme: dark;
}

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: var(--nav-h);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
	transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
	font-family: var(--font-head);
	line-height: 1.2;
	margin: 0;
	letter-spacing: -0.02em;
}

p {
	margin: 0 0 1em;
}

a {
	color: inherit;
	text-decoration: none;
}

img {
	max-width: 100%;
	display: block;
}

ul, ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

button {
	font: inherit;
	cursor: pointer;
}

svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

svg.fill {
	fill: currentColor;
	stroke: none;
}

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

::selection {
	background: var(--accent);
	color: #fff;
}

.container {
	width: 100%;
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 24px;
}

.skip-link {
	position: absolute;
	left: 16px;
	top: -48px;
	z-index: 100;
	background: var(--accent);
	color: #fff;
	padding: 8px 14px;
	border-radius: 8px;
	transition: top 0.2s;
}

.skip-link:focus {
	top: 12px;
}

/* ---------- Buttons & links ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 48px;
	padding: 0 22px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 15px;
	border: 1px solid transparent;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
	transform: translateY(-2px);
}

.btn--primary {
	background: var(--accent);
	color: #fff;
	box-shadow: 0 8px 24px -8px var(--accent);
}

.btn--primary:hover {
	box-shadow: 0 12px 28px -8px var(--accent);
}

.btn--ghost {
	background: transparent;
	color: var(--text);
	border-color: var(--border);
}

.btn--ghost:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--accent);
	font-weight: 600;
	font-size: 15px;
}

.link-arrow::after {
	content: '→';
	transition: transform 0.2s ease;
}

.link-arrow:hover::after,
.post:hover .link-arrow::after {
	transform: translateX(4px);
}

.link-arrow--up::after {
	content: '↑';
}

.link-arrow--up:hover::after {
	transform: translateY(-3px);
}

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text);
	transition: border-color 0.2s, color 0.2s;
}

.icon-btn:hover {
	border-color: var(--accent);
	color: var(--accent);
}

/* ---------- Nav ---------- */
.nav {
	position: fixed;
	inset: 0 0 auto 0;
	height: var(--nav-h);
	z-index: 50;
	transition: background-color 0.3s, border-color 0.3s, backdrop-filter 0.3s;
	border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: saturate(160%) blur(14px);
	-webkit-backdrop-filter: saturate(160%) blur(14px);
	border-bottom-color: var(--border);
}

.nav__inner {
	height: 100%;
	display: flex;
	align-items: center;
	gap: 24px;
}

.nav__brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 17px;
	margin-right: auto;
}

.nav__logo {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: var(--accent);
	color: #fff;
	font-size: 15px;
	letter-spacing: -0.04em;
}

.nav__links {
	display: flex;
	gap: 4px;
}

.nav__links a {
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 14.5px;
	font-weight: 500;
	color: var(--text-2);
	transition: color 0.2s, background-color 0.2s;
}

.nav__links a:hover,
.nav__links a.is-active {
	color: var(--text);
	background: var(--accent-soft);
}

.nav__links a.is-active {
	color: var(--accent);
}

.nav__actions {
	display: flex;
	gap: 8px;
}

.nav__menu {
	display: none;
}

.i-moon {
	display: none;
}

:root[data-theme="dark"] .i-sun {
	display: none;
}

:root[data-theme="dark"] .i-moon {
	display: block;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .i-sun {
		display: none;
	}

	:root:not([data-theme="light"]) .i-moon {
		display: block;
	}
}

/* ---------- Hero ---------- */
.hero {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--head-gap);
	padding: calc(var(--nav-h) + var(--section-y)) 0 var(--section-y);
	overflow: hidden;
}

.hero__glow {
	position: absolute;
	top: -25%;
	left: 50%;
	transform: translateX(-50%);
	width: 90vw;
	height: 60vw;
	max-width: 1100px;
	max-height: 700px;
	background:
		radial-gradient(circle at 30% 40%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 60%),
		radial-gradient(circle at 70% 70%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 55%);
	filter: blur(40px);
	pointer-events: none;
}

.hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(var(--border) 1px, transparent 1px),
		linear-gradient(90deg, var(--border) 1px, transparent 1px);
	background-size: 56px 56px;
	mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%);
	-webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%);
	opacity: 0.5;
	pointer-events: none;
}

.hero__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 6px 14px 6px 10px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	font-size: 13.5px;
	font-weight: 500;
	color: var(--text-2);
	margin-bottom: 28px;
}

.dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
	animation: pulse 2.2s infinite;
}

@keyframes pulse {
	70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero__title {
	font-size: clamp(40px, 7vw, 84px);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.05;
	margin-bottom: 24px;
}

.grad {
	background: linear-gradient(100deg, var(--accent), var(--accent-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.hero__lead {
	font-size: clamp(17px, 1.6vw, 19px);
	color: var(--text-2);
	max-width: 620px;
	margin: 0 auto 36px;
}

.hero__cta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-bottom: 28px;
}

.socials {
	display: flex;
	justify-content: center;
	gap: 10px;
}

/* Tech stack marquee */
.marquee {
	position: relative;
	display: flex;
	overflow: hidden;
	mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
	display: flex;
	flex-shrink: 0;
	animation: marquee 45s linear infinite;
}

.marquee:hover .marquee__track {
	animation-play-state: paused;
}

.marquee__group {
	display: flex;
	flex-shrink: 0;
	gap: 12px;
	padding-right: 12px;
}

.marquee__group li {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px 10px 12px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	font-size: 15px;
	font-weight: 500;
	white-space: nowrap;
	color: var(--text-2);
}

.marquee__group img {
	width: 22px;
	height: 22px;
	object-fit: contain;
}

@keyframes marquee {
	to { transform: translateX(-50%); }
}

.socials a {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text-2);
	transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.socials a:hover {
	color: var(--accent);
	border-color: var(--accent);
	transform: translateY(-2px);
}

.socials svg {
	width: 18px;
	height: 18px;
}

/* Terminal */
.terminal {
	background: var(--term-bg);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	font-family: var(--font-mono);
	font-size: 13.5px;
	color: #d6dcea;
	overflow: hidden;
}

.terminal__bar {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 12px 16px;
	background: rgba(255, 255, 255, 0.04);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal__bar span {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #ff5f57;
}

.terminal__bar span:nth-child(2) { background: #febc2e; }
.terminal__bar span:nth-child(3) { background: #28c840; }

.terminal__bar p {
	margin: 0 auto;
	padding-right: 40px;
	font-size: 12px;
	color: #7a8396;
}

.terminal__body {
	padding: 20px 22px 24px;
	overflow-wrap: anywhere;
}

.terminal__body p {
	margin: 0 0 4px;
}

.terminal__body .out {
	color: #8b95a8;
	margin-bottom: 14px;
}

.prompt {
	color: #2dd4bf;
	margin-right: 6px;
}

/* ---------- Sections ---------- */
.section {
	padding: var(--section-y) 0;
}

.section--alt {
	background: var(--bg-alt);
}

.section__head {
	margin-bottom: var(--head-gap);
}

.section__head--row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}

.section__kicker {
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--accent);
	letter-spacing: 0.02em;
	margin-bottom: 12px;
}

.section__title {
	font-size: clamp(32px, 4vw, 44px);
	font-weight: 700;
}

.subhead {
	font-size: 22px;
	margin: calc(var(--head-gap) + 8px) 0 var(--grid-gap);
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--card-pad);
	box-shadow: var(--shadow);
	transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.card h3 {
	font-size: 20px;
	margin-bottom: 6px;
}

.card h4 {
	font-size: 18px;
	margin: 6px 0;
}

.card__org {
	color: var(--text-3);
	font-size: 14.5px;
	margin-bottom: 14px;
}

.card p:last-child {
	margin-bottom: 0;
}

.card > p,
.bullets li {
	color: var(--text-2);
}

time {
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--text-3);
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 18px;
}

.chips li {
	font-family: var(--font-mono);
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
}

.tag {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 999px;
	margin-bottom: 8px;
}

.tag--live {
	background: rgba(34, 197, 94, 0.12);
	color: #16a34a;
}

/* ---------- About ---------- */
.about {
	display: grid;
	grid-template-columns: 0.85fr 1.15fr;
	gap: calc(var(--head-gap) + var(--grid-gap));
	align-items: center;
}

.about__photo {
	position: relative;
	margin: 0;
}

.about__photo::before {
	content: '';
	position: absolute;
	inset: 20px -20px -20px 20px;
	border: 2px solid var(--accent);
	border-radius: 24px;
	opacity: 0.35;
}

.about__photo img {
	position: relative;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 24px;
	box-shadow: var(--shadow-lg);
}

.about__copy > p {
	color: var(--text-2);
	font-size: 17px;
}

.facts {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin: var(--grid-gap) 0 0;
}

.facts div {
	padding: 16px 18px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
}

.facts dt {
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--text-3);
	margin-bottom: 4px;
}

.facts dd {
	margin: 0;
	font-weight: 600;
	font-size: 15px;
}

/* ---------- Timeline ---------- */
.timeline {
	position: relative;
	display: grid;
	gap: var(--grid-gap);
}

.timeline::before {
	content: '';
	position: absolute;
	left: 200px;
	top: 8px;
	bottom: 8px;
	width: 2px;
	background: var(--border);
}

.timeline__item {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 48px;
	position: relative;
}

.timeline__item::before {
	content: '';
	position: absolute;
	left: 194px;
	top: 32px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--bg-alt);
	border: 3px solid var(--accent);
}

.timeline__meta {
	padding-top: 26px;
	text-align: right;
	padding-right: 24px;
}

.timeline__meta time {
	display: block;
}

.bullets {
	display: grid;
	gap: 10px;
	margin-top: 4px;
}

.bullets li {
	position: relative;
	padding-left: 20px;
	font-size: 15.5px;
}

.bullets li::before {
	content: '';
	position: absolute;
	left: 2px;
	top: 0.7em;
	width: 6px;
	height: 6px;
	border-radius: 2px;
	background: var(--accent);
}

.bullets strong {
	color: var(--text);
	font-weight: 600;
}

.edu {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--grid-gap);
}

.edu .card > p:not(.card__org) {
	font-size: 15px;
}

/* ---------- Projects ---------- */
.filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 5px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
}

.filter {
	border: 0;
	background: transparent;
	color: var(--text-2);
	font-size: 14px;
	font-weight: 500;
	padding: 7px 16px;
	border-radius: 999px;
	transition: background-color 0.2s, color 0.2s;
}

.filter:hover {
	color: var(--text);
}

.filter.is-active {
	background: var(--accent);
	color: #fff;
}

.projects {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--grid-gap);
}

.project {
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
}

.project.is-hidden {
	display: none;
}

.project:hover {
	transform: translateY(-6px);
	box-shadow: var(--shadow-lg);
	border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.project__media {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--bg-alt);
}

.project__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.project:hover .project__media img {
	transform: scale(1.05);
}

.project__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--card-pad);
}

.project__meta {
	display: flex;
	justify-content: space-between;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--text-3);
	margin-bottom: 10px;
}

.project h3 {
	font-size: 20px;
	margin-bottom: 8px;
}

.project h3 a {
	background-image: linear-gradient(var(--accent), var(--accent));
	background-size: 0 2px;
	background-repeat: no-repeat;
	background-position: 0 100%;
	transition: background-size 0.3s;
}

.project h3 a::after {
	content: ' ↗';
	font-size: 0.8em;
	color: var(--text-3);
}

.project:hover h3 a {
	background-size: 100% 2px;
}

.project p {
	color: var(--text-2);
	font-size: 15px;
	margin-bottom: 0;
}

.project .chips {
	margin-top: auto;
	padding-top: 18px;
}

.more {
	text-align: center;
	margin: var(--head-gap) 0 0;
}

/* ---------- Skills ---------- */
.skills {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--grid-gap);
}

.skill-group h3 {
	font-size: 17px;
	margin-bottom: 18px;
}

.skill-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.skill-list li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 12px 7px 9px;
	border: 1px solid var(--border);
	border-radius: 10px;
	font-size: 14px;
	font-weight: 500;
	background: var(--bg);
	transition: border-color 0.2s, transform 0.2s;
}

.skill-list li:hover {
	border-color: var(--accent);
	transform: translateY(-2px);
}

.skill-list img,
.skill-svg {
	width: 20px;
	height: 20px;
	object-fit: contain;
}

.skill-svg {
	color: var(--accent);
}

/* Some brand logos are black or very dark; lift them in dark mode */
:root[data-theme="dark"] :is(.skill-list, .marquee__group) img:is([src*="amazonwebservices"], [src*="githubactions"], [src*="ansible"], [src*="bash"]) {
	filter: invert(1) hue-rotate(180deg);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) :is(.skill-list, .marquee__group) img:is([src*="amazonwebservices"], [src*="githubactions"], [src*="ansible"], [src*="bash"]) {
		filter: invert(1) hue-rotate(180deg);
	}
}

/* ---------- Awards ---------- */
.awards {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--grid-gap);
}

.award:hover,
.post:hover {
	transform: translateY(-4px);
	border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
	box-shadow: var(--shadow-lg);
}

.award__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
}

.award__icon {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 18px;
}

.award p:last-child {
	font-size: 15px;
}

/* ---------- Writing ---------- */
.posts {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--grid-gap);
}

.post {
	display: flex;
	flex-direction: column;
	padding: 0;
	overflow: hidden;
}

.post img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.post__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--card-pad);
}

.post h3 {
	font-size: 19px;
	margin: 8px 0 10px;
}

.post p {
	color: var(--text-2);
	font-size: 15px;
}

.post .link-arrow {
	margin-top: auto;
}

/* ---------- Contact ---------- */
.contact {
	display: grid;
	grid-template-columns: 1fr 1.05fr;
	gap: calc(var(--head-gap) + var(--grid-gap));
	align-items: center;
}

.contact__lead {
	color: var(--text-2);
	font-size: 17px;
	max-width: 460px;
	margin-bottom: 28px;
}

.status {
	display: grid;
	gap: 10px;
	margin-bottom: 32px;
	font-size: 15px;
	color: var(--text-2);
}

.status li {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.status__key {
	min-width: 82px;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--text-3);
}

#local-time {
	font-family: var(--font-mono);
	color: var(--text);
}

.contact__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* Contact terminal */
.contact-term {
	display: flex;
	flex-direction: column;
}

.contact-term__body {
	max-height: 380px;
	overflow-y: auto;
	padding-bottom: 8px;
}

.contact-term code {
	color: #2dd4bf;
	font-family: inherit;
}

.endpoints {
	margin: 6px 0 14px;
}

.endpoints a {
	display: grid;
	grid-template-columns: 92px 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 7px 10px;
	margin: 0 -10px;
	border-radius: 8px;
	transition: background-color 0.2s;
}

.endpoints a:hover,
.endpoints a:focus-visible {
	background: rgba(255, 255, 255, 0.06);
}

.ep__name {
	color: #6b8fff;
}

.ep__name::before {
	content: '→ ';
	color: #4b5466;
}

.endpoints a:hover .ep__name::before {
	color: #2dd4bf;
}

.ep__val {
	color: #a7b0c2;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ep__ok {
	font-size: 11px;
	color: #22c55e;
}

#term-log p {
	margin-bottom: 4px;
}

#term-log .out {
	margin-bottom: 12px;
}

#term-log a {
	color: #6b8fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.term-input {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 22px 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.term-input input {
	flex: 1;
	min-width: 0;
	background: transparent;
	border: 0;
	outline: none;
	color: #eef1f7;
	font: inherit;
	caret-color: #2dd4bf;
}

.term-input {
	transition: box-shadow 0.2s, background-color 0.2s;
}

.term-input:focus-within {
	background: rgba(45, 212, 191, 0.05);
	box-shadow: inset 0 0 0 2px rgba(45, 212, 191, 0.55);
	border-bottom-left-radius: var(--radius);
	border-bottom-right-radius: var(--radius);
}

.term-input input::placeholder {
	color: #4b5466;
}

/* ---------- Footer ---------- */
.footer {
	border-top: 1px solid var(--border);
	padding: 18px 0;
}

.footer__inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	font-size: 14px;
	color: var(--text-3);
}

.footer p {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
}

.footer__logo {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 8px;
	background: var(--accent);
	color: #fff;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 12px;
}

/* ---------- Toast ---------- */
.toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	transform: translate(-50%, 20px);
	padding: 12px 20px;
	border-radius: 999px;
	background: var(--text);
	color: var(--bg);
	font-size: 14px;
	font-weight: 500;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s, transform 0.25s;
	z-index: 60;
}

.toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------- Reveal on scroll ---------- */
.js .reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.nav__links a {
		padding: 8px 9px;
		font-size: 14px;
	}

	.projects,
	.posts,
	.skills {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 880px) {
	.nav__menu {
		display: inline-grid;
	}

	.nav__links {
		position: absolute;
		top: var(--nav-h);
		left: 16px;
		right: 16px;
		flex-direction: column;
		padding: 10px;
		border: 1px solid var(--border);
		border-radius: var(--radius);
		background: var(--surface);
		box-shadow: var(--shadow-lg);
		opacity: 0;
		visibility: hidden;
		transform: translateY(-8px);
		transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
	}

	.nav__links.is-open {
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.nav__links a {
		padding: 12px 14px;
		font-size: 16px;
	}

	.nav.menu-open {
		background: var(--bg);
		border-bottom-color: var(--border);
	}

	.about,
	.contact {
		grid-template-columns: 1fr;
		gap: var(--head-gap);
	}

	.about__photo {
		max-width: 380px;
	}

	.timeline::before {
		left: 6px;
	}

	.timeline__item {
		grid-template-columns: 1fr;
		gap: 12px;
		padding-left: 32px;
	}

	.timeline__item::before {
		left: 0;
		top: 4px;
	}

	.timeline__meta {
		text-align: left;
		padding: 0;
		display: flex;
		align-items: center;
		gap: 12px;
	}

	.timeline__meta .tag {
		margin: 0;
	}

	.edu,
	.awards {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	:root {
		--section-y: 48px;
		--head-gap: 24px;
		--grid-gap: 16px;
		--card-pad: 22px;
	}

	.container {
		padding: 0 16px;
	}

	.about__photo::before {
		inset: 12px -10px -12px 12px;
	}

	.about__photo {
		margin-right: 10px;
	}

	.nav__name {
		display: none;
	}

	.projects,
	.posts,
	.skills,
	.facts {
		grid-template-columns: 1fr;
	}

	.terminal {
		font-size: 12px;
	}


	.filters {
		width: 100%;
		border-radius: 14px;
	}

	.ep__val {
		display: none;
	}

	.endpoints a {
		grid-template-columns: 1fr auto;
	}

	.footer__inner {
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}

	.js .reveal {
		opacity: 1;
		transform: none;
	}
}
