/*
 * PyGitWeb landing: extends ../pygitweb/static/main.css (--pgw-* tokens, links, .text-muted).
 * Scroll-driven reveals use animation-timeline: view(); static fallbacks apply when unsupported.
 */

.landing-root {
	scroll-behavior: smooth;
}

body.landing {
	--landing-stone: #d1caa1;
	--landing-slate: #66717e;
	--landing-mist: #d4d6b9;
	--landing-ink: #0f1218;
	--landing-ink-soft: #1a1f2e;

	margin: 0;
	padding: 0;
	border: none;
	min-height: 100vh;
	font-family: "Figtree", system-ui, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.65;
	background-color: var(--pgw-bg);
	color: var(--pgw-text);
}

.landing h1,
.landing h2,
.landing h3 {
	font-family: "Fraunces", Georgia, serif;
	font-weight: 600;
	font-variation-settings: "SOFT" 50, "WONK" 1;
	color: var(--pgw-text);
}

.skip-link {
	position: absolute;
	left: -9999px;
	z-index: 9999;
	padding: 0.5rem 1rem;
	background: var(--pgw-link);
	color: var(--pgw-bg-raised);
	font-weight: 600;
}

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

/* Hero */
.hero {
	position: relative;
	min-height: min(92vh, 52rem);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: clamp(2rem, 6vw, 5rem) 1.5rem 4rem;
	overflow: clip;
	background:
		radial-gradient(ellipse 120% 80% at 50% -20%, color-mix(in srgb, var(--landing-stone) 35%, transparent), transparent 55%),
		radial-gradient(ellipse 80% 50% at 100% 60%, color-mix(in srgb, var(--landing-slate) 22%, transparent), transparent 50%),
		radial-gradient(ellipse 70% 45% at 0% 70%, color-mix(in srgb, var(--landing-mist) 18%, transparent), transparent 45%),
		var(--pgw-bg);
}

.hero__mesh {
	position: absolute;
	inset: -40% -20% -20%;
	background:
		repeating-linear-gradient(
			-18deg,
			transparent,
			transparent 3px,
			color-mix(in srgb, var(--pgw-text) 4%, transparent) 3px,
			color-mix(in srgb, var(--pgw-text) 4%, transparent) 4px
		);
	opacity: 0.35;
	animation: mesh-drift 28s linear infinite;
	pointer-events: none;
	mask-image: radial-gradient(ellipse 65% 55% at 50% 40%, black 20%, transparent 75%);
}

@keyframes mesh-drift {
	0% {
		transform: translate(0, 0) rotate(0deg);
	}
	100% {
		transform: translate(-2%, 1.5%) rotate(0.5deg);
	}
}

.hero__inner {
	position: relative;
	z-index: 1;
	max-width: 38rem;
	text-align: center;
}

.hero__mark {
	margin-bottom: 1.25rem;
	filter: drop-shadow(0 12px 28px color-mix(in srgb, var(--landing-slate) 45%, transparent));
}

.hero__logo {
	display: block;
	margin: 0 auto;
	width: clamp(5rem, 18vw, 7.5rem);
	height: auto;
}

@keyframes logo-float {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-6px);
	}
}

.hero__eyebrow {
	margin: 0 0 0.35rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--pgw-text-muted);
}

.hero__title {
	margin: 0 0 0.5rem;
	font-size: clamp(2.75rem, 8vw, 4.25rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.03em;
	background: linear-gradient(
		135deg,
		var(--pgw-text) 0%,
		color-mix(in srgb, var(--landing-slate) 75%, var(--pgw-text)) 100%
	);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

@media (prefers-reduced-motion: reduce) {
	.hero__mesh,
	.hero__logo {
		animation: none;
	}
}

.hero__tagline {
	margin: 0 0 1.25rem;
	font-size: clamp(1.15rem, 2.8vw, 1.45rem);
	font-weight: 500;
	color: var(--pgw-text-muted);
}

.hero__lede {
	margin: 0;
	color: var(--pgw-text);
	text-wrap: pretty;
}

.hero__scroll-hint {
	position: absolute;
	bottom: 1.25rem;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	opacity: 0.5;
}

.hero__scroll-line {
	width: 1px;
	height: 2.5rem;
	background: linear-gradient(to bottom, var(--pgw-text-muted), transparent);
	animation: scroll-pulse 2.2s ease-in-out infinite;
}

@keyframes scroll-pulse {
	0%,
	100% {
		opacity: 0.35;
		transform: scaleY(0.85);
		transform-origin: top;
	}
	50% {
		opacity: 1;
		transform: scaleY(1);
		transform-origin: top;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hero__scroll-line {
		animation: none;
	}
}

/* Main sections */
.main {
	position: relative;
}

.section {
	padding: clamp(3.5rem, 10vw, 6rem) 1.5rem;
}

.section__container {
	max-width: 52rem;
	margin: 0 auto;
}

.section__heading {
	margin: 0 0 1.5rem;
	font-size: clamp(1.75rem, 4vw, 2.25rem);
	letter-spacing: -0.02em;
}

.section__prose p {
	margin: 0 0 1rem;
	text-wrap: pretty;
}

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

.section--split {
	background: var(--pgw-bg-muted);
	border-top: 1px solid var(--pgw-border);
	border-bottom: 1px solid var(--pgw-border);
}

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

.section--philosophy {
	background: linear-gradient(
		180deg,
		var(--pgw-bg-raised) 0%,
		color-mix(in srgb, var(--landing-mist) 12%, var(--pgw-bg-muted)) 100%
	);
	border-top: 1px solid var(--pgw-border);
}

.section--note {
	background: var(--pgw-bg-muted);
	border-top: 1px solid var(--pgw-border);
}

.section__cta {
	font-weight: 600;
	color: var(--pgw-text);
}

/* Dependency grid */
.dep-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
	.dep-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 56rem) {
	.dep-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.dep-card {
	margin: 0;
	padding: 1.25rem 1.35rem;
	background: var(--pgw-bg-raised);
	border: 1px solid var(--pgw-border);
	border-radius: 2px;
	box-shadow: 0 1px 0 color-mix(in srgb, var(--pgw-text) 6%, transparent);
	transition:
		border-color 0.25s ease,
		box-shadow 0.25s ease,
		transform 0.25s ease;
}

.dep-card:hover {
	border-color: color-mix(in srgb, var(--landing-slate) 45%, var(--pgw-border));
	box-shadow: 0 8px 24px color-mix(in srgb, var(--landing-slate) 12%, transparent);
	transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
	.dep-card {
		transition: border-color 0.2s ease;
	}

	.dep-card:hover {
		transform: none;
	}
}

.dep-card__name {
	margin: 0 0 0.4rem;
	font-size: 1.125rem;
	font-weight: 600;
}

.dep-card__desc {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--pgw-text-muted);
	line-height: 1.55;
}

/* Pull quote */
.pullquote {
	margin: 0 0 1.75rem;
	padding: 1.5rem 1.25rem 1.5rem 1.75rem;
	border-left: 4px solid var(--landing-slate);
	background: color-mix(in srgb, var(--pgw-bg-raised) 92%, var(--landing-stone));
	border-radius: 0 4px 4px 0;
}

.pullquote p {
	margin: 0;
	font-family: "Fraunces", Georgia, serif;
	font-size: clamp(1.2rem, 2.5vw, 1.45rem);
	font-style: italic;
	font-weight: 400;
	line-height: 1.45;
	color: var(--pgw-text);
}

/* Footer */
.site-footer {
	padding: 2rem 1.5rem 2.5rem;
	border-top: 1px solid var(--pgw-border);
	background: var(--pgw-bg-raised);
}

.site-footer__inner {
	max-width: 52rem;
	margin: 0 auto;
	text-align: center;
}

.site-footer__text {
	margin: 0 0 0.35rem;
	font-family: "Fraunces", Georgia, serif;
	font-weight: 600;
	font-size: 1.125rem;
}

.site-footer__meta {
	margin: 0;
	font-size: 0.875rem;
}

.footer-code {
	font-size: 0.85em;
	padding: 0.1em 0.35em;
	background: var(--pgw-code-bg);
	border: 1px solid var(--pgw-code-border);
	border-radius: 3px;
	color: var(--pgw-text);
}

/* Scroll-driven reveal (progressive enhancement) */
.reveal {
	opacity: 0.97;
	transform: translateY(1.25rem);
	animation: reveal-fallback 0.9s ease-out forwards;
	animation-delay: var(--reveal-delay, 0ms);
}

@keyframes reveal-fallback {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes reveal-in {
	from {
		opacity: 0;
		transform: translateY(2rem);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@supports (animation-timeline: view()) {
	.reveal {
		opacity: 0;
		transform: translateY(2rem);
		animation: reveal-in linear both;
		animation-timeline: view();
		animation-range: entry 0% cover 42%;
		animation-delay: var(--reveal-delay, 0ms);
	}

	.hero .reveal {
		animation-range: entry -5% cover 55%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.reveal {
		opacity: 1;
		transform: none;
		animation: none;
	}
}
