/* =========================================================
   PORTFOLIO DESIGN SYSTEM
   Minimal / editorial / Miles-inspired palette
========================================================= */
:root {
	--font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--font-mono: "DM Mono", monospace;

	--bg: #f4f4f1;
	--bg-elevated: #ffffff;
	--bg-soft: #ecece8;
	--text-primary: #111214;
	--text-secondary: #64666b;
	--text-tertiary: #8e9095;
	--border: #dedfdc;
	--accent: #d71920;
	--accent-hover: #b91218;
	--accent-soft: #f8e5e5;
	--black: #090a0b;
	--white: #ffffff;
	--shadow: 0 10px 30px rgba(14, 15, 16, 0.07);
	--shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.14);
	--overlay: rgba(5, 6, 7, 0.76);
	--radius: 20px;
}

[data-theme="dark"] {
	--bg: #090a0b;
	--bg-elevated: #111315;
	--bg-soft: #17191b;
	--text-primary: #f5f5f3;
	--text-secondary: #a4a6aa;
	--text-tertiary: #6e7176;
	--border: #292c2f;
	--accent: #ef3037;
	--accent-hover: #ff484e;
	--accent-soft: #2a1517;
	--shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
	--shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.5);
	--overlay: rgba(0, 0, 0, 0.82);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
html {
	scroll-behavior: smooth;
	scroll-padding-top: 84px;
}
body {
	font-family: var(--font-sans);
	color: var(--text-primary);
	background: var(--bg);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
body.modal-open {
	overflow: hidden;
}
button,
input,
textarea,
select {
	font: inherit;
}
button {
	color: inherit;
}
a {
	color: inherit;
}
img {
	max-width: 100%;
	display: block;
}

.container {
	width: min(1120px, calc(100% - 48px));
	margin-inline: auto;
}

h1,
h2,
h3 {
	line-height: 1.05;
	letter-spacing: -0.045em;
}
h1,
h2 {
	font-weight: 800;
}
h1 {
	font-size: clamp(3.2rem, 7vw, 6.4rem);
}
h2 {
	font-size: clamp(2rem, 4vw, 3.4rem);
}
h3 {
	font-size: clamp(1.35rem, 2vw, 1.8rem);
}

/* =========================================================
   HEADER
========================================================= */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 86%, transparent);
	border-bottom: 1px solid var(--border);
	backdrop-filter: blur(18px);
}
.header-inner {
	min-height: 72px;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 16px;
}
.logo {
	justify-self: start;
	text-decoration: none;
	font-size: 0.94rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	color: var(--text-primary);
}
.nav-desktop {
	justify-self: center;
	display: flex;
	align-items: center;
	gap: 28px;
}
.nav-desktop a {
	text-decoration: none;
	color: var(--text-secondary);
	font-size: 0.83rem;
	font-weight: 600;
	padding: 26px 0;
}
.nav-desktop a:hover {
	color: var(--text-primary);
}
.header-actions {
	justify-self: end;
	display: flex;
	align-items: center;
	gap: 8px;
}
.theme-toggle,
.nav-toggle {
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--border);
	background: var(--bg-elevated);
	border-radius: 50%;
	cursor: pointer;
	color: var(--text-primary);
}
.theme-toggle svg,
.nav-toggle svg {
	width: 17px;
	height: 17px;
}
/* Desktop: hide hamburger */
.nav-toggle {
	display: none;
}
.nav-mobile {
	display: none;
}
/* =========================================================
   SHARED SECTION UI
========================================================= */
.eyebrow {
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--text-tertiary);
	font-family: var(--font-mono);
	font-size: 0.66rem;
	letter-spacing: 0.13em;
	text-transform: uppercase;
}
.eyebrow span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
	display: inline-block;
}
.section {
	padding: 112px 0;
	border-top: 1px solid var(--border);
}
.section-heading {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 40px;
	margin-bottom: 48px;
}
.section-heading .eyebrow {
	margin-bottom: 16px;
}
.section-heading p {
	max-width: 360px;
	color: var(--text-secondary);
	font-size: 0.92rem;
}

/* =========================================================
   HERO
========================================================= */
.hero-section {
	position: relative;
	min-height: calc(100vh - 72px);
	display: flex;
	align-items: center;
	padding: 92px 0 120px;
	overflow: hidden;
}
.hero-section::before {
	content: "";
	position: absolute;
	width: 520px;
	height: 520px;
	border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--accent) 15%, transparent), transparent 68%);
	top: -240px;
	right: -160px;
	pointer-events: none;
}
.hero-layout {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) 360px;
	gap: 96px;
	align-items: center;
}
.hero-copy .eyebrow {
	margin-bottom: 22px;
}
.hero-copy h1 {
	max-width: 820px;
}
.tagline {
	margin-top: 20px;
	color: var(--accent);
	font-size: clamp(1rem, 1.8vw, 1.2rem);
	font-weight: 700;
}
.bio {
	max-width: 650px;
	margin-top: 18px;
	color: var(--text-secondary);
	font-size: 1rem;
}
.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 30px;
}

.hero-portrait-wrap {
	justify-self: end;
	width: min(100%, 340px);
}
.portrait-frame {
	position: relative;
	aspect-ratio: 4 / 5;
	border-radius: 28px;
	overflow: hidden;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	box-shadow: var(--shadow-lg);
}
.portrait-frame::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(145deg, transparent 55%, color-mix(in srgb, var(--accent) 20%, transparent));
	mix-blend-mode: multiply;
}
[data-theme="dark"] .portrait-frame::after {
	mix-blend-mode: screen;
	opacity: 0.3;
}
.avatar-shell {
	width: 100%;
	height: 100%;
	position: relative;
	background: linear-gradient(145deg, var(--bg-soft), var(--bg-elevated));
}
.avatar {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.avatar-fallback {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	color: var(--text-primary);
	font-size: clamp(3rem, 8vw, 5rem);
	font-weight: 800;
	letter-spacing: -0.06em;
}
.portrait-accent {
	position: absolute;
	z-index: 2;
	width: 72px;
	height: 72px;
	right: -20px;
	bottom: -20px;
	border: 1px solid var(--accent);
	transform: rotate(45deg);
	opacity: 0.8;
}

/* =========================================================
   BUTTONS
========================================================= */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-height: 44px;
	padding: 0 18px;
	border-radius: 12px;
	text-decoration: none;
	font-size: 0.82rem;
	font-weight: 700;
	border: 1px solid transparent;
	cursor: pointer;
}
.btn svg {
	width: 15px;
	height: 15px;
}
.btn-primary {
	background: var(--accent);
	color: var(--white);
}
.btn-primary:hover {
	background: var(--accent-hover);
}
.btn-secondary {
	background: var(--bg-elevated);
	color: var(--text-primary);
	border-color: var(--border);
}

/* =========================================================
   SKILLS
========================================================= */
.section-skills {
	background: var(--bg-elevated);
}
.section-education {
	background: var(--bg-elevated);
}
.skills-list {
	display: grid;
	gap: 14px;
}
.skill-category-block {
	border: 1px solid var(--border);
	border-radius: 16px;
	overflow: hidden;
	background: var(--bg);
}
.skill-category-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 18px;
	border-bottom: 1px solid var(--border);
}
.skill-category-heading > div {
	display: flex;
	align-items: baseline;
	gap: 10px;
}
.skill-category-kicker {
	color: var(--text-tertiary);
	font-family: var(--font-mono);
	font-size: 0.55rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}
.skill-category-heading strong {
	font-size: 0.82rem;
}
.skill-category-count {
	color: var(--text-tertiary);
	font-family: var(--font-mono);
	font-size: 0.6rem;
}
.skill-items {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
}
.skill-item {
	min-height: 78px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 13px 16px;
	border-right: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
}
.skill-item:nth-child(3n) {
	border-right: 0;
}
.skill-item:nth-last-child(-n + 3) {
	border-bottom: 0;
}
.skill-item-main {
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 11px;
}
.skill-icon {
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	display: grid;
	place-items: center;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--bg-elevated);
	overflow: hidden;
}
.skill-icon img {
	width: 23px;
	height: 23px;
	object-fit: contain;
	display: block;
}
.skill-icon-fallback,
.skill-preview-no-icon {
	color: var(--text-tertiary);
	font-family: var(--font-mono);
	font-size: 0.85rem;
}
.skill-name-wrap {
	min-width: 0;
}
.skill-name {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.77rem;
	font-weight: 800;
}
.skill-level-label {
	display: block;
	color: var(--text-tertiary);
	font-family: var(--font-mono);
	font-size: 0.53rem;
	margin-top: 3px;
}
.skill-level {
	display: flex;
	gap: 3px;
	flex: 0 0 auto;
}
.skill-level-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--border);
	transition: background 0.2s ease;
}
.skill-level-dot.is-filled {
	background: var(--skill-color);
}
.empty-state {
	color: var(--text-secondary);
	padding: 30px 0;
}

/* Home skills use the same compact library treatment as the admin dashboard. */
.home-skill-library {
	border: 1px solid var(--border);
	border-radius: 16px;
	overflow: hidden;
	background: var(--bg-elevated);
}
.home-skill-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 20px 26px 28px;
	border-bottom: 1px solid var(--border);
	background: var(--bg-soft);
}
.home-skill-categories span {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 0 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--bg-elevated);
	color: var(--text-secondary);
	font-size: 0.68rem;
	font-weight: 700;
}
.home-skill-list {
	display: grid;
}
.home-skill-row {
	min-height: 96px;
	display: grid;
	grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr);
	align-items: center;
	gap: 30px;
	padding: 18px 26px;
	border-bottom: 1px solid var(--border);
	background: var(--bg-elevated);
}
.home-skill-row:last-child {
	border-bottom: 0;
}
.home-skill-identity {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}
.home-skill-icon {
	width: 50px;
	height: 50px;
	flex: 0 0 50px;
	display: grid;
	place-items: center;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: #fff;
	overflow: hidden;
	/* Soft-skill Lucide icons must stay dark on the white tile in both themes */
	color: #111214;
}
.home-skill-icon img {
	width: 31px;
	height: 31px;
	object-fit: contain;
	display: block;
}
.home-skill-icon svg {
	width: 22px;
	height: 22px;
	stroke: #111214;
	color: #111214;
}
.home-skill-identity strong {
	display: block;
	font-size: 0.82rem;
	font-weight: 800;
}
.home-skill-identity div > span {
	display: block;
	margin-top: 3px;
	color: var(--text-tertiary);
	font-family: var(--font-mono);
	font-size: 0.58rem;
}
.home-skill-proficiency {
	max-width: 230px;
}
.home-skill-proficiency > span:first-child {
	display: block;
	margin-bottom: 8px;
	color: var(--text-tertiary);
	font-family: var(--font-mono);
	font-size: 0.58rem;
}
.home-proficiency-bars {
	display: flex;
	gap: 4px;
	width: 100%;
}
.home-proficiency-segment {
	display: block;
	flex: 1 1 0;
	height: 7px;
	border-radius: 2px;
	background: var(--border);
}
.home-proficiency-segment.is-filled {
	background: var(--skill-color, var(--accent));
}
.home-skill-row.proficiency-1 {
	--skill-color: #ef4444;
}
.home-skill-row.proficiency-2 {
	--skill-color: #f97316;
}
.home-skill-row.proficiency-3 {
	--skill-color: #eab308;
}
.home-skill-row.proficiency-4 {
	--skill-color: #84cc16;
}
.home-skill-row.proficiency-5 {
	--skill-color: #22c55e;
}

@media (max-width: 620px) {
	.home-skill-categories {
		padding: 16px 18px 20px;
	}
	.home-skill-row {
		grid-template-columns: 1fr;
		gap: 12px;
		padding: 16px 18px;
	}
	.home-skill-proficiency {
		max-width: none;
		padding-left: 64px;
	}
}

/* =========================================================
   PROJECT CAROUSEL
========================================================= */
.section-projects {
	background: var(--bg);
	overflow: hidden;
}
#projects-carousel[hidden] {
	display: none !important;
}
.section-projects:has(#projects-empty:not([hidden])) .carousel-controls,
.section-projects:has(#projects-empty:not([hidden])) .project-pagination {
	display: none !important;
}
.carousel-controls {
	display: flex;
	gap: 8px;
}
.carousel-controls button {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: var(--bg-elevated);
	display: grid;
	place-items: center;
	cursor: pointer;
}
.carousel-controls button svg {
	width: 17px;
	height: 17px;
}
.projects-carousel {
	width: calc(100% + 160px);
	margin-left: -80px;
	padding: 18px 0 52px;
	overflow: visible;
}
.projects-carousel .swiper-wrapper {
	align-items: stretch;
}
.project-slide {
	width: min(720px, 68vw);
	height: auto;
	cursor: pointer;
}
.project-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: 26px;
	overflow: hidden;
	box-shadow: var(--shadow);
	transition:
		transform 0.45s ease,
		opacity 0.45s ease,
		filter 0.45s ease,
		box-shadow 0.45s ease;
}
.project-card-media {
	position: relative;
	overflow: hidden;
	background: var(--bg-soft);
	aspect-ratio: 16 / 9;
	width: 100%;
	flex-shrink: 0;
}
.project-card-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.12));
	pointer-events: none;
}
.project-card-media img,
.project-card-media .project-image-fallback {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.project-image-fallback {
	width: 100%;
	height: 100%;
	background: radial-gradient(circle at 70% 25%, rgba(215, 25, 32, 0.2), transparent 24%), linear-gradient(135deg, var(--bg-soft), var(--bg-elevated));
}

.project-card-body {
	padding: 26px 28px 28px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 18px;
}
.project-card-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	color: var(--text-tertiary);
	font-family: var(--font-mono);
	font-size: 0.64rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}
.project-card-title {
	font-size: clamp(1.35rem, 2.4vw, 2rem);
}
.project-card-description {
	color: var(--text-secondary);
	font-size: 0.9rem;
	max-width: 600px;
	margin-top: 9px;
}
.project-card-tech {
	display: flex;
	gap: 7px;
	flex-wrap: wrap;
}
.project-tech-pill {
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 5px 9px;
	font-size: 0.68rem;
	color: var(--text-secondary);
}
.projects-carousel .swiper-slide {
	opacity: 0.36;
	filter: blur(2.5px);
	transform: scale(0.9);
	transition:
		opacity 0.45s ease,
		filter 0.45s ease,
		transform 0.45s ease;
}
.projects-carousel .swiper-slide-active {
	opacity: 1;
	filter: none;
	transform: scale(1);
	z-index: 2;
}
.projects-carousel .swiper-slide-active .project-card {
	box-shadow: var(--shadow-lg);
}
.project-pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	min-height: 8px;
}
.project-pagination .bullet {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--border);
}
.project-pagination .bullet.active {
	width: 22px;
	border-radius: 99px;
	background: var(--accent);
}
.empty-state {
	color: var(--text-secondary);
	padding: 30px 0;
}

/* =========================================================
   CONTACT
========================================================= */
.section-contact {
	padding-top: 96px;
}
.contact-card {
	background: var(--bg-elevated);
	color: var(--text-primary);
	border: 1px solid var(--border);
	border-radius: 28px;
	padding: 56px;
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 56px;
	position: relative;
	overflow: hidden;
}
.contact-card::before {
	content: "";
	position: absolute;
	width: 340px;
	height: 340px;
	border-radius: 50%;
	right: -130px;
	top: -160px;
	background: radial-gradient(circle, rgba(215, 25, 32, 0.34), transparent 68%);
}
.contact-copy {
	position: relative;
	z-index: 1;
}
.contact-copy .eyebrow {
	color: var(--text-tertiary);
}
.contact-copy h2 {
	max-width: 560px;
	margin-top: 14px;
}
.contact-copy p {
	max-width: 520px;
	color: var(--text-secondary);
	margin-top: 18px;
	font-size: 0.92rem;
	overflow-wrap: break-word;
	word-break: normal;
	white-space: normal;
}
.contact-links {
	position: relative;
	z-index: 1;
	display: grid;
	align-content: center;
	gap: 10px;
	min-width: 0; /* critical: let grid shrink */
}

.contact-link {
	min-width: 0; /* critical: stop row from growing past the card */
	min-height: 64px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 12px 18px;
	border: 1px solid var(--border);
	border-radius: 14px;
	color: var(--text-primary);
	text-decoration: none;
	background: var(--bg);
	overflow: hidden; /* keep children inside the pill */
}

.contact-link-main {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	flex: 1;
	overflow: hidden;
}

.contact-link-icon {
	width: 20px;
	flex-shrink: 0;
	display: grid;
	place-items: center;
	color: var(--accent);
}

.contact-link-icon svg {
	width: 18px;
	height: 18px;
}

.contact-link-text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	min-width: 0;
	flex: 1;
	overflow: hidden;
}

.contact-link-label {
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--text-tertiary);
	line-height: 1.2;
}

.contact-link-value {
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text-primary);
	line-height: 1.35;
	white-space: nowrap; /* one line only */
	overflow-x: auto; /* scroll the overflow */
	overflow-y: hidden;
	max-width: 100%;
	cursor: grab;
	touch-action: pan-x; /* allow horizontal swipe on mobile */
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.contact-link-value::-webkit-scrollbar {
	display: none;
}

.contact-link-value.is-dragging {
	cursor: grabbing;
	user-select: none;
}

.contact-link-arrow {
	flex-shrink: 0;
	color: var(--text-tertiary);
	align-self: center;
}

/* =========================================================
   SKELETONS
========================================================= */
.skeleton {
	position: relative;
	overflow: hidden;
	background: var(--bg-soft);
	border-radius: 14px;
}
.skeleton::after {
	content: "";
	position: absolute;
	inset: 0;
	transform: translateX(-100%);
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
	animation: shimmer 1.35s infinite;
}
[data-theme="dark"] .skeleton::after {
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
}
@keyframes shimmer {
	100% {
		transform: translateX(100%);
	}
}

/* =========================================================
   MODAL
========================================================= */
.modal {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 22px;
	background: var(--overlay);
	backdrop-filter: blur(14px);
}
.modal.hidden {
	display: none;
}
.modal-content {
	width: min(820px, 100%);
	max-height: 92vh;
	overflow: auto;
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: 24px;
	padding: 34px;
	box-shadow: var(--shadow-lg);
	position: relative;
}
.modal-close {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: var(--bg);
	cursor: pointer;
}
.modal-close svg {
	width: 17px;
	height: 17px;
}
.modal-content > .eyebrow {
	margin-bottom: 13px;
}
#project-swiper {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	margin: 26px 0;
	border-radius: 16px;
	overflow: hidden;
	background: var(--bg-soft);
}
#project-swiper .swiper-wrapper {
	height: 100% !important;
}
#project-swiper .swiper-slide {
	height: 100% !important;
}
#project-swiper .swiper-slide img,
#project-swiper .swiper-slide .project-image-fallback {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
#project-swiper .swiper-button-prev,
#project-swiper .swiper-button-next {
	z-index: 12;
	width: 42px;
	height: 42px;
	margin-top: 0;
	top: 50%;
	transform: translateY(-50%);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.56);
	color: #fff;
	pointer-events: auto;
}
#project-swiper .swiper-button-prev::after,
#project-swiper .swiper-button-next::after {
	font-size: 14px;
}
.modal-description {
	color: var(--text-secondary);
	font-size: 0.92rem;
}
.tech-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-top: 18px;
}
.tech-tag {
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid var(--border);
	color: var(--text-secondary);
	font-size: 0.72rem;
}
.modal-links {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin-top: 24px;
}

/* =========================================================
   FOOTER
========================================================= */
.site-footer {
	border-top: 1px solid var(--border);
	padding: 28px 0;
	color: var(--text-tertiary);
	font-family: var(--font-mono);
	font-size: 0.66rem;
}
.footer-inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 16px;
}
.footer-inner > :first-child {
	justify-self: start;
}
.footer-location {
	justify-self: center;
	text-align: center;
	max-width: 42ch;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.footer-meta {
	justify-self: end;
	text-align: right;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 900px) {
	.hero-layout {
		grid-template-columns: 1fr 280px;
		gap: 48px;
	}
	.project-slide {
		width: min(680px, 78vw);
	}
	.projects-carousel {
		width: calc(100% + 80px);
		margin-left: -40px;
	}
	.contact-card {
		grid-template-columns: 1fr;
		gap: 32px;
		padding: 40px;
	}
}

@media (max-width: 720px) {
	.container {
		width: min(100% - 32px, 600px);
	}
	.header-inner {
		grid-template-columns: 38px 1fr 38px;
		gap: 12px;
	}
	.nav-toggle {
		display: inline-flex;
		justify-self: start;
	}
	.logo {
		display: block;
		justify-self: center;
		text-align: center;
	}
	.nav-desktop {
		display: none;
	}
	.header-actions {
		justify-self: end;
	}

	.nav-mobile {
		display: none;
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		z-index: 60;
		flex-direction: column;
		padding: 8px 16px 16px;
		border-bottom: 1px solid var(--border);
		background: color-mix(in srgb, var(--bg-elevated) 96%, transparent);
		backdrop-filter: blur(18px);
		box-shadow: var(--shadow);
	}
	.nav-mobile.open {
		display: flex;
	}
	.nav-mobile a {
		display: block;
		padding: 12px 8px;
		color: var(--text-secondary);
		font-size: 0.9rem;
		font-weight: 600;
		text-decoration: none;
		border-radius: 10px;
	}
	.nav-mobile a:hover,
	.nav-mobile a:focus {
		color: var(--text-primary);
		background: var(--bg-soft);
	}

	body {
		padding-bottom: 0;
	}
	body.nav-open {
		overflow: hidden;
	}

	.hero-section {
		min-height: auto;
		padding: 48px 0 64px;
	}
	.hero-section::before {
		width: 280px;
		height: 280px;
		top: -120px;
		right: -100px;
	}
	.hero-layout {
		grid-template-columns: 1fr;
		gap: 28px;
		align-items: start;
	}
	.hero-portrait-wrap {
		order: -1;
		justify-self: center;
		width: min(200px, 55vw);
	}
	.portrait-frame {
		border-radius: 22px;
	}
	.portrait-accent {
		width: 48px;
		height: 48px;
		right: -12px;
		bottom: -12px;
	}
	.hero-copy {
		text-align: left;
	}
	.hero-copy .eyebrow {
		margin-bottom: 14px;
	}
	.hero-copy h1 {
		font-size: clamp(2.4rem, 11vw, 3.4rem);
		line-height: 1.08;
		letter-spacing: -0.04em;
	}
	.tagline {
		margin-top: 12px;
		font-size: 0.95rem;
	}
	.bio {
		margin-top: 12px;
		font-size: 0.92rem;
		line-height: 1.55;
	}
	.hero-actions {
		width: 100%;
		margin-top: 22px;
		display: flex;
		flex-direction: column;
		gap: 10px;
	}
	.hero-actions .btn {
		width: 100%;
		min-height: 48px;
		flex: none;
	}

	.section {
		padding: 78px 0;
	}
	.section-heading {
		align-items: flex-start;
		flex-direction: column;
		gap: 20px;
		margin-bottom: 34px;
	}
	.projects-heading {
		flex-direction: row;
		align-items: flex-end;
	}
	.projects-heading .carousel-controls {
		flex-shrink: 0;
	}
	.skill-items {
		grid-template-columns: repeat(2, 1fr);
	}
	.skill-item:nth-child(3n) {
		border-right: 1px solid var(--border);
	}
	.skill-item:nth-child(2n) {
		border-right: 0;
	}

	.projects-carousel {
		width: 100%;
		margin-left: 0;
		padding: 0 0 26px;
	}
	.project-slide {
		width: 100%;
	}
	.project-card {
		border-radius: 18px;
	}
	.project-card-body {
		padding: 18px;
		gap: 12px;
	}
	.project-slide {
		width: 82vw;
	}
	.project-card {
		border-radius: 20px;
	}
	.project-card-body {
		padding: 22px;
	}

	.contact-card {
		padding: 28px 20px;
		border-radius: 20px;
		background: var(--bg-elevated);
		color: var(--text-primary);
		border: 1px solid var(--border);
	}
	.contact-card::before {
		opacity: 0.12;
	}
	.contact-copy .eyebrow {
		color: var(--text-tertiary);
	}
	.contact-copy p {
		color: var(--text-secondary);
	}
	.contact-link {
		min-height: 56px;
		padding: 10px 14px;
		color: var(--text-primary);
		border-color: var(--border);
		background: var(--bg);
	}
	.contact-link-label {
		color: var(--text-tertiary);
	}
	.contact-link-value {
		color: var(--text-primary);
	}
	.contact-link-arrow {
		color: var(--text-tertiary);
	}
	/* #project-swiper uses aspect-ratio: 16/9 — no fixed height override needed */
	.modal-content {
		padding: 26px 20px;
		border-radius: 20px;
	}
}

@media (max-width: 440px) {
	.header-inner {
		min-height: 64px;
	}
	.hero-section {
		padding: 36px 0 56px;
	}
	.hero-portrait-wrap {
		width: min(170px, 50vw);
	}
	.hero-copy h1 {
		font-size: clamp(2.1rem, 10vw, 2.8rem);
	}
	.hero-actions {
		flex-direction: column;
		gap: 8px;
	}
	.hero-actions .btn {
		width: 100%;
		min-height: 46px;
	}
	.skill-items {
		grid-template-columns: 1fr;
	}
	.skill-item,
	.skill-item:nth-child(2n),
	.skill-item:nth-child(3n) {
		border-right: 0;
	}
	.projects-heading {
		align-items: center;
	}
	.carousel-controls button {
		width: 40px;
		height: 40px;
	}
	.project-slide {
		width: 88vw;
	}
	/* .project-card height is driven by 16:9 media + body — no min-height needed */
	.modal-links {
		flex-direction: column;
	}
	.modal-links .btn {
		width: 100%;
	}
	.footer-inner {
		grid-template-columns: 1fr;
		justify-items: center;
		text-align: center;
		gap: 8px;
	}
	.footer-inner > :first-child,
	.footer-location,
	.footer-meta {
		justify-self: center;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	.skeleton::after {
		animation: none;
	}
	.projects-carousel .swiper-slide,
	.project-card {
		transition: none;
	}
}

@media (max-width: 1000px) {
	.skill-items {
		grid-template-columns: repeat(2, 1fr);
	}
	.skill-item:nth-child(3n) {
		border-right: 1px solid var(--border);
	}
	.skill-item:nth-child(2n) {
		border-right: 0;
	}
	.skill-item:nth-last-child(-n + 3) {
		border-bottom: 1px solid var(--border);
	}
	.skill-item:last-child,
	.skill-item:nth-last-child(2):nth-child(2n) {
		border-bottom: 0;
	}
}
@media (max-width: 620px) {
	.skill-items {
		grid-template-columns: 1fr;
	}
	.skill-item,
	.skill-item:nth-child(2n),
	.skill-item:nth-child(3n) {
		border-right: 0;
		border-bottom: 1px solid var(--border);
	}
	.skill-item:last-child {
		border-bottom: 0;
	}
}

.data-error-banner {
	position: fixed;
	left: 50%;
	bottom: 20px;
	transform: translateX(-50%);
	z-index: 9999;
	width: min(720px, calc(100% - 32px));
	padding: 12px 16px;
	border: 1px solid #f59e0b;
	border-radius: 12px;
	background: rgba(255, 251, 235, 0.97);
	color: #78350f;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
	font-size: 0.85rem;
}
[data-theme="dark"] .data-error-banner {
	background: rgba(69, 26, 3, 0.97);
	color: #fed7aa;
	border-color: #f59e0b;
}

/* =========================================================
   EDUCATION
========================================================= */
.education-list {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}
.education-item {
	display: flex;
	flex-direction: column;
}
.education-item-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	margin-bottom: 0.5rem;
}
@media (max-width: 640px) {
	.education-item-header {
		flex-direction: column;
		gap: 0.25rem;
	}
}
.education-item-institution {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--text-primary);
}
.education-item-date {
	font-family: var(--font-mono);
	font-size: 0.85rem;
	color: var(--text-tertiary);
}
.education-item-degree {
	font-size: 1rem;
	color: var(--text-secondary);
	margin-bottom: 0.25rem;
}
.education-item-location {
	font-size: 0.9rem;
	color: var(--text-tertiary);
}
.no-underline,
.no-underline:hover,
.no-underline:focus {
	text-decoration: none;
}
#featured-icon,
#resume-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1em;
	height: 1em;
}
/* Override Bootstrap's pointer-events: none on disabled buttons
   so cursor: not-allowed can actually show. Native [disabled]
   still prevents clicks and form submit. */
.dashboard-page button:disabled,
.dashboard-page .btn:disabled,
.dashboard-page .btn.disabled,
.dashboard-page .btn.is-loading,
.dashboard-page select:disabled,
.dashboard-page input:disabled,
.dashboard-page textarea:disabled {
	pointer-events: auto !important;
	cursor: not-allowed !important;
	opacity: 0.55 !important;
}

/* Children must not steal the cursor */
.dashboard-page button:disabled *,
.dashboard-page .btn:disabled *,
.dashboard-page .btn.is-loading * {
	cursor: not-allowed !important;
	pointer-events: none !important;
}
/* Login Google button loading / disabled */
#google-login-btn:disabled,
#google-login-btn.is-loading,
.btn-google:disabled,
.btn-google.is-loading {
	pointer-events: auto !important;
	cursor: not-allowed !important;
	opacity: 0.55 !important;
}

#google-login-btn:disabled *,
#google-login-btn.is-loading *,
.btn-google:disabled *,
.btn-google.is-loading * {
	cursor: not-allowed !important;
	pointer-events: none !important;
}
