:root {
	--font-heading: "Inter Tight", sans-serif;
	--font-body: "Inter", sans-serif;
	--color-bg: #f6f8fb;
	--color-surface: #ffffff;
	--color-surface-alt: #f0f4fa;
	--color-border: #dce4ef;
	--color-border-strong: #bdc9da;
	--color-text: #111827;
	--color-text-soft: #59667a;
	--color-accent: #2f75ef;
	--color-accent-soft: #eaf2ff;
	--shadow-soft: 0 10px 28px rgba(18, 35, 62, 0.045);
	--radius-lg: 1.35rem;
	--radius-md: 1rem;
	--radius-sm: 0.75rem;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html { scroll-behavior: smooth; }

body {
	min-height: 100vh;
	font-family: var(--font-body);
	background: var(--color-bg);
	color: var(--color-text);
	padding: 0.8rem 0 1.6rem;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, a, input, textarea, select { font: inherit; }

h1, h2, h3, h4 {
	font-family: var(--font-heading);
	color: var(--color-text);
}

p, span, legend, li {
	color: var(--color-text-soft);
	line-height: 1.5;
}

.container {
	width: min(1040px, calc(100% - 1.5rem));
	margin-inline: auto;
}

.site-header {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 1rem;
	min-height: 48px;
	margin-bottom: 0.75rem;
}

.brand {
	font-family: var(--font-heading);
	font-size: 0.95rem;
	font-weight: 800;
	letter-spacing: 0.05em;
}

.site-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.3rem;
}

.site-nav a {
	font-size: 0.82rem;
	font-weight: 650;
	color: var(--color-text-soft);
}

.site-nav a.is-active { color: var(--color-accent); }
.site-header > .button { justify-self: end; }

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.45rem;
	padding: 0.62rem 1rem;
	border-radius: 0.72rem;
	background: var(--color-accent);
	color: #fff;
	font-size: 0.86rem;
	font-weight: 750;
	border: 1px solid transparent;
}

.button-secondary {
	background: transparent;
	color: var(--color-text);
	border-color: var(--color-border-strong);
}

.eyebrow {
	font-size: 0.68rem;
	letter-spacing: 0.22em;
	font-weight: 750;
	color: #7a879a;
}

.hero-copy {
	font-size: 0.98rem;
	max-width: 650px;
}

.tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.42rem;
}

.tag-list span,
.stack-chip-grid span,
.skill-list p {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.35rem 0.62rem;
	border-radius: 999px;
	background: var(--color-surface-alt);
	border: 1px solid var(--color-border);
	font-size: 0.72rem;
	font-weight: 650;
	color: var(--color-text-soft);
}

.tag-list.compact span {
	padding: 0.32rem 0.55rem;
	font-size: 0.68rem;
}

.section-heading {
	display: flex;
	flex-direction: column;
	gap: 0.22rem;
	margin-bottom: 0.75rem;
}

.section-heading h2 {
	font-size: clamp(1.35rem, 2.6vw, 1.8rem);
	line-height: 1.08;
}

.section-heading-inline {
	flex-direction: row;
	justify-content: space-between;
	align-items: end;
	gap: 1rem;
}

.section-heading-inline > a {
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--color-accent);
}

.home-footer,
.software-footer,
.projects,
.skills-wrapper,
.software-stack-section,
.software-projects,
.other-projects-section,
.page-intro,
.gd-info {
	margin-top: 1.25rem;
}

.social-links {
	display: flex;
	align-items: center;
	gap: 0.55rem;
}

.flat-social-links a {
	width: 2.2rem;
	height: 2.2rem;
	border-radius: 999px;
	border: 1px solid var(--color-border);
	background-color: var(--color-surface);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 0.9rem;
}

.flat-social-links a:nth-child(1) { background-image: url(./e07e66fd04ed1b4718df.svg); }
.flat-social-links a:nth-child(2) { background-image: url(./c4b4d65bff72f5d63e23.svg); }
.flat-social-links a:nth-child(3) { background-image: url(./01a4d15c9d9744fa8963.svg); }

.link {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	position: relative;
	padding-bottom: 0.05rem;
	border-bottom: 1px solid var(--color-border-strong);
	width: fit-content;
}

.link img { width: 0.5rem; height: 0.5rem; }
.link a { position: absolute; inset: 0; }
.flex-row-05 { display: flex; gap: 0.5rem; }
.wrap-links { flex-wrap: wrap; }

.skills-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.65rem;
	padding: 1.1rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-soft);
	text-align: center;
}

.skill-list {
	display: flex;
	justify-content: center;
	gap: 0.45rem;
	flex-wrap: wrap;
}

.project-card {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 1rem;
	padding: 0.9rem;
	border-radius: var(--radius-lg);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	box-shadow: var(--shadow-soft);
}

.project-card + .project-card { margin-top: 0.65rem; }
.exp-info { display: flex; flex-direction: column; gap: 0.48rem; }
.exp-info h2 { font-size: 1.2rem; }
.exp-info h3, .exp-info h4 { color: #67758a; font-size: 0.8rem; }
.exp-info p { font-size: 0.82rem; line-height: 1.45; }

.project-img {
	min-height: 180px;
	border-radius: calc(var(--radius-lg) - 0.3rem);
	overflow: hidden;
	background: var(--color-surface-alt);
}

.project-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.projects { display: flex; flex-direction: column; gap: 0.6rem; }
.projects > h2 { font-size: 1.45rem; }

.page-game .page-intro h1,
.page-home h1,
.page-software h1 {
	font-size: clamp(2rem, 4.7vw, 3.45rem);
	line-height: 1.01;
	letter-spacing: -0.035em;
}

.page-home h1 span { color: var(--color-accent); }

.page-game .page-intro {
	padding: 1.25rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-soft);
}

.gd-info {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 0.85rem 1.2rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-soft);
}

.gd-info-block {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.1rem;
	min-width: 6.5rem;
}

.gd-info-block h1 { font-size: 1.45rem; }
.gd-info-block h4 { font-size: 0.66rem; color: var(--color-text-soft); }
.vertical-divider { width: 1px; height: 2.7rem; background: var(--color-border); }

hr, .return-to-main, .contact-email, .pin, .profile-img, .profile-img-border, hero { display: none; }

@media (max-width: 820px) {
	.site-header { grid-template-columns: 1fr auto; }
	.site-nav { grid-column: 1 / -1; grid-row: 2; gap: 0.85rem; flex-wrap: wrap; }
	.project-card { grid-template-columns: 1fr; }
	.project-img { min-height: 210px; }
}

@media (max-width: 560px) {
	body { padding-top: 0.5rem; }
	.container { width: min(100% - 1rem, 1040px); }
	.site-header > .button { display: none; }
	.site-header { grid-template-columns: 1fr; justify-items: center; }
	.brand { justify-self: center; }
	.page-home h1, .page-software h1, .page-game .page-intro h1 { font-size: 2rem; }
	.section-heading-inline { align-items: start; flex-direction: column; gap: 0.45rem; }
	.project-card, .skills-wrapper, .page-game .page-intro, .gd-info { padding: 0.85rem; }
}

/* Theme controls */
.header-actions {
	display: flex;
	align-items: center;
	justify-self: end;
	gap: 0.45rem;
}

.theme-toggle {
	width: 2.45rem;
	height: 2.45rem;
	display: inline-grid;
	place-items: center;
	border: 1px solid var(--color-border-strong);
	border-radius: 0.72rem;
	background: transparent;
	color: var(--color-text);
	cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.theme-toggle:hover {
	background: var(--color-surface-alt);
}

.theme-icon {
	width: 1rem;
	height: 1rem;
}

.theme-icon-moon {
	fill: currentColor;
	stroke: none;
}

.theme-icon-sun {
	display: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
}

html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }

/* Dark mode */
html[data-theme="dark"] {
	color-scheme: dark;
	--color-bg: #0d1219;
	--color-surface: #141b24;
	--color-surface-alt: #1a2430;
	--color-border: #273445;
	--color-border-strong: #3a4a60;
	--color-text: #eef4fc;
	--color-text-soft: #a7b3c4;
	--color-accent: #67a0ff;
	--color-accent-soft: #172844;
	--shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] body {
	background: var(--color-bg);
}

html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .card-label {
	color: #7f91aa;
}

html[data-theme="dark"] .path-card-game,
html[data-theme="dark"] .path-card-software {
	background: var(--color-surface);
}

html[data-theme="dark"] .project-preview,
html[data-theme="dark"] .path-card-preview,
html[data-theme="dark"] .project-img {
	background: var(--color-surface-alt);
}

html[data-theme="dark"] .flat-social-links a {
	background-color: var(--color-surface-alt);
}

html[data-theme="dark"] .button-secondary {
	color: var(--color-text);
}

/* Game Developer uses the same design system with a purple accent. */
.page-game {
	--color-accent: #7457e8;
	--color-accent-soft: #eeeafd;
}

html[data-theme="dark"] .page-game {
	--color-accent: #a98cff;
	--color-accent-soft: #2b2344;
}

@media (max-width: 560px) {
	.header-actions {
		justify-self: center;
	}

	.header-actions .button {
		display: none;
	}
}

/* Language switch */
.language-toggle {
	display: inline-flex;
	align-items: center;
	padding: 0.16rem;
	border: 1px solid var(--color-border-strong);
	border-radius: 0.68rem;
	background: var(--color-surface);
}

.language-toggle button {
	min-width: 2rem;
	height: 2rem;
	padding: 0 0.45rem;
	border: 0;
	border-radius: 0.5rem;
	background: transparent;
	color: var(--color-text-soft);
	font-size: 0.68rem;
	font-weight: 800;
	cursor: pointer;
}

.language-toggle button.is-active {
	background: var(--color-accent-soft);
	color: var(--color-accent);
}

html[data-theme="dark"] .language-toggle {
	background: var(--color-surface);
}

/* Keep card content aligned throughout the portfolio. */
.featured-grid,
.other-projects-grid,
.published-games-grid {
	align-items: stretch;
	grid-auto-rows: 1fr;
}

.featured-card,
.other-project-card,
.published-game-card {
	height: 100%;
}

.featured-copy {
	flex: 1;
	height: 100%;
}

.featured-copy h3 {
	min-height: 2.1em;
}

.featured-copy > p:not(.card-label) {
	flex: 1;
}

.featured-copy .tag-list {
	margin-top: auto;
}

.page-home h1 .home-title-prefix {
	color: var(--color-text);
}

@media (max-width: 620px) {
	.featured-copy h3,
	.path-card-content h2 {
		min-height: 0;
	}
}

.page-home .home-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 1.25rem 0 0.9rem;
	gap: 0.55rem;
}

.page-home .home-hero h1 { max-width: 760px; }
.page-home .hero-copy { max-width: 660px; }

.portfolio-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.9rem;
	margin-top: 0.5rem;
}

.path-card {
	position: relative;
	display: grid;
	grid-template-rows: auto 145px;
	gap: 0.85rem;
	min-height: 0;
	padding: 1.15rem;
	border-radius: 1.4rem;
	border: 1px solid var(--color-border);
	background: var(--color-surface);
	box-shadow: var(--shadow-soft);
	overflow: hidden;
}

.path-card-game { background: #faf8ff; }
.path-card-software { background: #f6f9ff; }

.path-card-content {
	display: flex;
	flex-direction: column;
	gap: 0.48rem;
	z-index: 1;
}

.path-card-content h2 {
	font-size: clamp(1.35rem, 2.6vw, 1.82rem);
	line-height: 1.03;
	max-width: 92%;
}

.path-card-content p {
	font-size: 0.82rem;
	max-width: 92%;
}

.path-icon { font-size: 1.25rem; line-height: 1; }

.path-card-preview {
	border-radius: 0.95rem;
	overflow: hidden;
	border: 1px solid rgba(121, 139, 170, 0.2);
	background: #fff;
	min-height: 0;
}

.image-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.software-home-preview img { object-position: center; }

.card-arrow {
	position: absolute;
	top: 1.05rem;
	right: 1.05rem;
	font-size: 1.25rem;
	color: var(--color-accent);
}

.home-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: 0.9rem 0 0;
	border-top: 1px solid var(--color-border);
}

.home-footer-items {
	display: flex;
	gap: 1.2rem;
	flex-wrap: wrap;
}

.home-footer-items > div {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.home-footer-items strong { font-size: 0.75rem; color: var(--color-text); }
.home-footer-items span { font-size: 0.67rem; }

.footer-contact {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.05rem;
}

.footer-contact p { font-size: 0.7rem; }
.footer-contact a { font-size: 0.78rem; font-weight: 700; color: var(--color-accent); }

@media (max-width: 820px) {
	.portfolio-grid { grid-template-columns: 1fr; }
	.path-card { grid-template-columns: 1.05fr 0.95fr; grid-template-rows: 1fr; min-height: 250px; }
	.path-card-preview { min-height: 190px; }
}

@media (max-width: 620px) {
	.path-card { grid-template-columns: 1fr; grid-template-rows: auto 145px; }
	.home-footer { flex-direction: column; align-items: flex-start; }
	.footer-contact { align-items: flex-start; }
}

/* Equal vertical rhythm inside the two home cards. */
.path-card-content {
	height: 100%;
}

.path-card-content h2 {
	min-height: 2.05em;
}

.path-card-content > p {
	flex: 1;
}

.path-card-content .tag-list {
	margin-top: auto;
}


.page-game .game-hero {
	display: grid;
	grid-template-columns: 1.25fr 0.75fr;
	gap: 1rem;
	align-items: center;
	padding: 1rem 0 0.4rem;
}

.page-game .game-hero > div:first-child {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.55rem;
}

.page-game .game-hero h1 {
	font-size: clamp(2rem, 4.7vw, 3.45rem);
	line-height: 1.01;
	letter-spacing: -0.035em;
	max-width: 620px;
}

.game-experience-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-feature-card .project-preview {
	height: 165px;
}

.game-feature-card .image-project-preview img {
	object-position: center;
	transition: transform 180ms ease;
}

.game-feature-card a.image-project-preview:hover img {
	transform: scale(1.015);
}

.published-games-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.65rem;
}

.published-game-card {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	gap: 0.75rem;
	align-items: center;
	padding: 0.65rem;
	border-radius: 0.95rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	box-shadow: var(--shadow-soft);
}

.published-game-card > img {
	width: 96px;
	height: 78px;
	object-fit: cover;
	border-radius: 0.7rem;
}

.published-game-card > div {
	display: flex;
	flex-direction: column;
	gap: 0.12rem;
	min-width: 0;
}

.published-game-card strong {
	font-family: var(--font-heading);
	font-size: 0.82rem;
	line-height: 1.15;
	color: var(--color-text);
}

.published-game-card span {
	font-size: 0.67rem;
}

.mini-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-top: 0.18rem;
}

.mini-links a {
	font-size: 0.64rem;
	font-weight: 750;
	color: var(--color-accent);
}

.game-footer {
	margin-top: 1.25rem;
}

@media (max-width: 920px) {
	.game-experience-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.published-games-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 680px) {
	.game-experience-grid,
	.published-games-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 760px) {
	.page-game .game-hero {
		grid-template-columns: 1fr;
	}
}

/* Keep every game/experience card aligned even when copy lengths differ. */
.game-experience-grid,
.published-games-grid {
	grid-auto-rows: 1fr;
	align-items: stretch;
}

.game-feature-card {
	height: 100%;
}

.game-feature-card .project-preview {
	margin-top: auto;
}

.published-game-card {
	height: 100%;
}

.awards-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 680px) {
	.awards-grid {
		grid-template-columns: 1fr;
	}
}

/* Footer styles are defined in page-specific stylesheets. */

.page-software .software-hero {
	display: grid;
	grid-template-columns: 1.25fr 0.75fr;
	gap: 1rem;
	align-items: center;
	padding: 1rem 0 0.4rem;
}

.page-software .software-hero > div:first-child {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.55rem;
}

.page-software .software-hero h1 {
	max-width: 700px;
}

.feature-points {
	display: grid;
	gap: 0.5rem;
}

.feature-pill {
	padding: 0.72rem 0.85rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 0.95rem;
	box-shadow: var(--shadow-soft);
}

.feature-pill strong {
	display: block;
	font-size: 0.88rem;
	font-family: var(--font-heading);
	color: var(--color-text);
	margin-bottom: 0.05rem;
}

.feature-pill span { font-size: 0.72rem; }

.software-stack-section { padding-top: 0.25rem; }
.stack-chip-grid { display: flex; gap: 0.42rem; flex-wrap: wrap; }

.featured-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.75rem;
}

.featured-card {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 0.9rem;
	border-radius: 1.05rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	box-shadow: var(--shadow-soft);
}

.featured-copy {
	display: flex;
	flex-direction: column;
	gap: 0.38rem;
}

.card-label {
	font-size: 0.6rem;
	letter-spacing: 0.16em;
	font-weight: 800;
	color: #7b889c;
}

.featured-copy h3 {
	font-size: 1.18rem;
	line-height: 1.05;
}

.featured-copy > p:not(.card-label) {
	font-size: 0.75rem;
	line-height: 1.42;
}

.project-preview {
	background: #f8fbff;
	border: 1px solid var(--color-border);
	border-radius: 0.85rem;
	height: 150px;
	overflow: hidden;
}

.image-project-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.other-projects-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.6rem;
}

.other-project-card {
	display: flex;
	flex-direction: column;
	gap: 0.12rem;
	padding: 0.78rem 0.85rem;
	border-radius: 0.85rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
}

.other-project-card strong { font-size: 0.78rem; color: var(--color-text); }
.other-project-card span { font-size: 0.68rem; }

.software-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.1rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 1rem;
	box-shadow: var(--shadow-soft);
}

.software-footer h2 { font-size: 1.2rem; margin-top: 0.12rem; }
.software-footer > div > p:not(.eyebrow) { font-size: 0.72rem; margin-top: 0.12rem; }
.footer-actions { display: flex; align-items: center; gap: 0.65rem; }

@media (max-width: 920px) {
	.featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.other-projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
	.page-software .software-hero { grid-template-columns: 1fr; }
	.feature-points { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
	.featured-grid, .other-projects-grid, .feature-points { grid-template-columns: 1fr; }
	.software-footer, .footer-actions { flex-direction: column; align-items: flex-start; }
	.project-preview { height: 170px; }
}

/* Title/description stay at the top; tags and image stay aligned at the bottom. */
.featured-card {
	height: 100%;
}

.featured-copy {
	display: flex;
	flex-direction: column;
}

.featured-copy > p:not(.card-label) {
	margin-bottom: 0.15rem;
}

.project-preview {
	flex: 0 0 150px;
	margin-top: auto;
}

.other-projects-grid {
	grid-auto-rows: 1fr;
}

