/* Home page only — scoped to body.home-page; does not affect other pages */

@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap");

:root {
	--home-ink: #0c1218;
	--home-surface: #121a22;
	--home-muted: rgba(232, 240, 245, 0.62);
	--home-text: #e8f0f5;
	--home-accent: #3db8a0;
	--home-accent-soft: rgba(61, 184, 160, 0.18);
	--home-line: rgba(232, 240, 245, 0.12);
	--home-glow: rgba(61, 184, 160, 0.35);
	--home-hero-a: #0a1620;
	--home-hero-b: #143028;
	--home-hero-c: #1a2a3a;
	--home-btn-bg: rgba(255, 255, 255, 0.08);
	--home-btn-hover: rgba(255, 255, 255, 0.14);
	--home-btn-border: rgba(255, 255, 255, 0.16);
	--home-card-bg: rgba(255, 255, 255, 0.05);
	--home-card-hover: rgba(255, 255, 255, 0.09);
	--home-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
	--home-font-display: "Syne", sans-serif;
	--home-font-body: "Figtree", sans-serif;
	--home-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="sakura-earthly"] {
	--home-ink: #f2f5f3;
	--home-surface: #ffffff;
	--home-muted: rgba(20, 36, 32, 0.62);
	--home-text: #142420;
	--home-accent: #0d7a68;
	--home-accent-soft: rgba(13, 122, 104, 0.12);
	--home-line: rgba(20, 36, 32, 0.12);
	--home-glow: rgba(13, 122, 104, 0.22);
	--home-hero-a: #e8f2ef;
	--home-hero-b: #d4e8e2;
	--home-hero-c: #c5dce8;
	--home-btn-bg: rgba(0, 0, 0, 0.04);
	--home-btn-hover: rgba(0, 0, 0, 0.08);
	--home-btn-border: rgba(0, 0, 0, 0.1);
	--home-card-bg: rgba(255, 255, 255, 0.72);
	--home-card-hover: rgba(255, 255, 255, 0.95);
	--home-shadow: 0 18px 50px rgba(20, 36, 32, 0.1);
}

/* Override sakura layout constraints on home only */
body.home-page {
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	font-family: var(--home-font-body);
	font-size: 1.05rem;
	line-height: 1.65;
	color: var(--home-text);
	background: var(--home-ink);
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
}

body.home-page a {
	color: var(--home-accent);
	text-decoration: none;
	transition: color 0.2s var(--home-ease);
}

body.home-page a:hover {
	color: var(--home-text);
}

body.home-page h1,
body.home-page h2,
body.home-page h3 {
	font-family: var(--home-font-display);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.05;
	margin: 0;
	color: var(--home-text);
}

/* Fixed controls */
body.home-page .huge-btn {
	width: 48px;
	height: 48px;
	position: fixed;
	border-radius: 14px;
	z-index: 9999;
	border: 1px solid var(--home-btn-border);
	background: var(--home-btn-bg);
	color: var(--home-text);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--home-shadow);
	transition: transform 0.25s var(--home-ease), background 0.25s var(--home-ease);
}

body.home-page .huge-btn:hover {
	transform: translateY(-2px);
	background: var(--home-btn-hover);
}

body.home-page .sun-dark-btn {
	right: 20px;
	top: 20px;
	font-size: 1.25rem;
}

body.home-page .topbtn {
	right: 20px;
	bottom: 20px;
	display: none;
}

/* Hero */
.home-hero {
	position: relative;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: flex-end;
	padding: clamp(5rem, 12vh, 8rem) clamp(1.25rem, 5vw, 4rem) clamp(3rem, 8vh, 5rem);
	isolation: isolate;
	overflow: hidden;
}

.home-hero__bg {
	position: absolute;
	inset: 0;
	z-index: -2;
	background:
		radial-gradient(ellipse 80% 60% at 15% 20%, var(--home-glow), transparent 55%),
		radial-gradient(ellipse 70% 50% at 85% 75%, rgba(45, 120, 160, 0.28), transparent 50%),
		linear-gradient(145deg, var(--home-hero-a) 0%, var(--home-hero-b) 48%, var(--home-hero-c) 100%);
	animation: home-bg-shift 18s ease-in-out infinite alternate;
}

html[data-theme="sakura-earthly"] .home-hero__bg {
	background:
		radial-gradient(ellipse 80% 60% at 12% 18%, rgba(13, 122, 104, 0.2), transparent 55%),
		radial-gradient(ellipse 65% 45% at 88% 80%, rgba(40, 110, 150, 0.18), transparent 50%),
		linear-gradient(145deg, var(--home-hero-a) 0%, var(--home-hero-b) 48%, var(--home-hero-c) 100%);
}

.home-hero__grid {
	position: absolute;
	inset: 0;
	z-index: -1;
	opacity: 0.22;
	background-image:
		linear-gradient(var(--home-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--home-line) 1px, transparent 1px);
	background-size: 64px 64px;
	mask-image: radial-gradient(ellipse 70% 65% at 50% 40%, #000 20%, transparent 75%);
	-webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 40%, #000 20%, transparent 75%);
	animation: home-grid-drift 28s linear infinite;
}

.home-hero__content {
	width: min(920px, 100%);
}

.home-hero__brand {
	font-family: var(--home-font-display);
	font-size: clamp(3.4rem, 11vw, 7.2rem);
	font-weight: 800;
	letter-spacing: -0.045em;
	line-height: 0.92;
	margin: 0 0 0.35rem;
	opacity: 0;
	transform: translateY(28px);
	animation: home-rise 0.9s var(--home-ease) 0.1s forwards;
}

.home-hero__zh {
	font-family: var(--home-font-display);
	font-size: clamp(1.35rem, 3.2vw, 2rem);
	font-weight: 600;
	letter-spacing: 0.28em;
	margin: 0 0 1.25rem;
	color: var(--home-muted);
	opacity: 0;
	transform: translateY(28px);
	animation: home-rise 0.9s var(--home-ease) 0.22s forwards;
}

.home-hero__lead {
	max-width: 34rem;
	font-size: clamp(1.05rem, 2.2vw, 1.25rem);
	color: var(--home-muted);
	margin: 0 0 2rem;
	opacity: 0;
	transform: translateY(28px);
	animation: home-rise 0.9s var(--home-ease) 0.34s forwards;
}

.home-hero__lead a {
	font-weight: 600;
	border-bottom: 1px solid transparent;
}

.home-hero__lead a:hover {
	border-bottom-color: currentColor;
}

.home-hero__cta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	opacity: 0;
	transform: translateY(28px);
	animation: home-rise 0.9s var(--home-ease) 0.46s forwards;
}

.home-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	padding: 0.85rem 1.35rem;
	border-radius: 999px;
	font-family: var(--home-font-body);
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none !important;
	border: 1px solid transparent;
	transition: transform 0.25s var(--home-ease), background 0.25s var(--home-ease), box-shadow 0.25s var(--home-ease);
}

.home-cta--primary {
	background: var(--home-accent);
	color: #04110e !important;
	box-shadow: 0 10px 30px var(--home-glow);
}

.home-cta--primary:hover {
	transform: translateY(-2px);
	color: #04110e !important;
	box-shadow: 0 14px 36px var(--home-glow);
}

.home-cta--ghost {
	background: var(--home-btn-bg);
	color: var(--home-text) !important;
	border-color: var(--home-btn-border);
	backdrop-filter: blur(8px);
}

.home-cta--ghost:hover {
	transform: translateY(-2px);
	background: var(--home-btn-hover);
	color: var(--home-text) !important;
}

/* Sections */
.home-main {
	width: min(920px, calc(100% - 2.5rem));
	margin: 0 auto;
	padding: 0 0 5rem;
}

.home-section {
	padding: clamp(3rem, 8vh, 5rem) 0;
	border-top: 1px solid var(--home-line);
	opacity: 0;
	transform: translateY(24px);
	animation: home-rise 0.8s var(--home-ease) forwards;
}

.home-section:nth-of-type(1) { animation-delay: 0.55s; }
.home-section:nth-of-type(2) { animation-delay: 0.65s; }
.home-section:nth-of-type(3) { animation-delay: 0.75s; }
.home-section:nth-of-type(4) { animation-delay: 0.85s; }

.home-section__title {
	font-size: clamp(1.5rem, 3vw, 2rem);
	margin-bottom: 1.25rem;
}

.home-section__rule {
	width: 3rem;
	height: 3px;
	border: 0;
	margin: 0 0 1.5rem;
	background: var(--home-accent);
	border-radius: 2px;
}

.home-about p {
	margin: 0;
	color: var(--home-muted);
	font-size: 1.05rem;
	max-width: 62ch;
}

/* Contact */
.home-contact__meta {
	display: grid;
	gap: 0.35rem;
	margin: 0 0 1.5rem;
	color: var(--home-muted);
	font-variant-numeric: tabular-nums;
}

.home-contact__meta a {
	color: inherit;
}

.home-contact__meta a:hover {
	color: var(--home-accent);
}

.home-social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}

.home-social .icon {
	width: 28px;
	height: 28px;
	cursor: pointer;
	opacity: 0.75;
	transition: opacity 0.2s var(--home-ease), transform 0.2s var(--home-ease);
}

.home-social .icon:hover {
	opacity: 1;
	transform: translateY(-2px);
}

#parent-v,
#parent-g {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}

/* Explore / nav */
.home-nav {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.home-nav__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem;
}

.home-nav__label {
	min-width: 7.5rem;
	font-weight: 700;
	font-size: 0.92rem;
	letter-spacing: 0.02em;
	color: var(--home-text);
}

.home-nav__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 1rem;
	border-radius: 10px;
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none !important;
	color: var(--home-text) !important;
	background: var(--home-btn-bg);
	border: 1px solid var(--home-btn-border);
	transition: transform 0.2s var(--home-ease), background 0.2s var(--home-ease), box-shadow 0.2s var(--home-ease);
}

.home-nav__btn:hover {
	transform: translateY(-2px);
	background: var(--home-btn-hover);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	color: var(--home-text) !important;
}

.home-nav__btn--accent {
	background: var(--home-accent-soft);
	border-color: transparent;
	color: var(--home-accent) !important;
}

.home-nav__btn--accent:hover {
	color: var(--home-text) !important;
}

/* CV downloads — interactive cards OK here */
.home-cv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
	gap: 0.85rem;
}

.home-cv-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	padding: 1rem 1.05rem;
	border-radius: 14px;
	font-weight: 600;
	font-size: 0.92rem;
	text-decoration: none !important;
	color: var(--home-text) !important;
	background: var(--home-card-bg);
	border: 1px solid var(--home-line);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: transform 0.25s var(--home-ease), background 0.25s var(--home-ease), border-color 0.25s var(--home-ease), box-shadow 0.25s var(--home-ease);
}

.home-cv-btn:hover {
	transform: translateY(-3px);
	background: var(--home-card-hover);
	border-color: var(--home-accent);
	box-shadow: var(--home-shadow);
	color: var(--home-text) !important;
}

.home-cv-btn__icon {
	display: inline-flex;
	flex-shrink: 0;
	color: var(--home-accent);
	opacity: 0.9;
}

.home-cv-btn:hover .home-cv-btn__icon {
	opacity: 1;
}

.home-cv-btn__label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.home-footer {
	width: min(920px, calc(100% - 2.5rem));
	margin: 0 auto;
	padding: 0 0 3rem;
	color: var(--home-muted);
	font-size: 0.85rem;
}

@keyframes home-rise {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes home-bg-shift {
	0% { filter: hue-rotate(0deg) saturate(1); }
	100% { filter: hue-rotate(12deg) saturate(1.08); }
}

@keyframes home-grid-drift {
	0% { background-position: 0 0; }
	100% { background-position: 64px 64px; }
}

@media (prefers-reduced-motion: reduce) {
	.home-hero__bg,
	.home-hero__grid,
	.home-hero__brand,
	.home-hero__zh,
	.home-hero__lead,
	.home-hero__cta,
	.home-section {
		animation: none !important;
		opacity: 1;
		transform: none;
		filter: none;
	}
}

@media (max-width: 600px) {
	.home-nav__label {
		min-width: 100%;
		margin-bottom: 0.15rem;
	}

	.home-cv-grid {
		grid-template-columns: 1fr;
	}

	.home-hero__zh {
		letter-spacing: 0.18em;
	}
}
