/*
 * Landing page (docs/index.rst).
 *
 * Everything here is scoped to the containers the landing page declares, so these
 * rules cannot leak into ordinary content pages.
 */

/* ------------------------------------------------------------------ *
 * Hero
 *
 * The page title is a real document heading (good for accessibility, the browser
 * tab title and search results), and the hero container follows it. Both are
 * selected through :has() on the article, which avoids needing a per-page body
 * class. Where :has() is unsupported the page still reads correctly, it just
 * loses the glow and the centered title.
 *
 * The glow is painted as the article's own background rather than a positioned
 * pseudo-element, so it sits behind the title without any negative z-index that
 * could disappear behind an opaque ancestor background.
 * ------------------------------------------------------------------ */

.md-typeset:has(> .nextpyp-hero) {
	background-image: radial-gradient(
		ellipse 38rem 20rem at 50% -2rem,
		var(--nextpyp-blue-pale) 0%,
		transparent 70%
	);
	background-repeat: no-repeat;
	background-position: top center;
}

[data-md-color-scheme="slate"] .md-typeset:has(> .nextpyp-hero) {
	background-image:
		radial-gradient(
			ellipse 42rem 24rem at 50% -2rem,
			rgba(5, 124, 255, 0.32) 0%,
			rgba(5, 124, 255, 0.08) 42%,
			transparent 72%
		),
		radial-gradient(
			ellipse 28rem 14rem at 80% 8%,
			rgba(77, 163, 255, 0.12) 0%,
			transparent 70%
		);
}

.nextpyp-hero {
	margin-bottom: 3rem;
	padding-bottom: 1.25rem;
	text-align: center;
}

/* the document title doubles as the hero headline */
.md-typeset:has(> .nextpyp-hero) > h1 {
	max-width: 22em;
	margin: 1rem auto;
	font-size: 2.3rem;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.025em;
	text-align: center;
	color: var(--md-default-fg-color);
}

.nextpyp-hero-tagline {
	max-width: 46em;
	margin: 0 auto 2rem;
	font-size: 0.92rem;
	line-height: 1.7;
	color: var(--md-default-fg-color--light);
}

.nextpyp-hero-tagline p:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------ *
 * Hero call to action
 * ------------------------------------------------------------------ */

.nextpyp-hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
	margin-bottom: 3rem;
}

.nextpyp-hero-actions p {
	margin: 0;
}

.md-typeset .nextpyp-cta {
	min-width: 11rem;
	padding: 0.62em 1.6em;
	border-radius: var(--nextpyp-radius);
	font-size: 0.8rem;
	font-weight: 650;
	box-shadow: var(--nextpyp-shadow);
	transition:
		box-shadow var(--nextpyp-motion),
		transform var(--nextpyp-motion),
		outline-offset var(--nextpyp-motion);
}

.md-typeset .nextpyp-cta:hover {
	box-shadow: var(--nextpyp-shadow-hover);
	transform: translateY(-1px);
}

.md-typeset .nextpyp-cta:focus-visible {
	outline: 2px solid var(--md-accent-fg-color);
	outline-offset: 3px;
}

/* ------------------------------------------------------------------ *
 * Hero screenshot
 *
 * A :class: option on a figure directive lands on the <img>, not the <figure>,
 * so the wrapper is selected through the hero container instead.
 * ------------------------------------------------------------------ */

.nextpyp-hero figure {
	max-width: 62rem;
	margin: 0 auto;
}

.md-typeset img.nextpyp-hero-shot {
	width: 100%;
	border-radius: var(--nextpyp-radius-lg);
	border: 1px solid var(--nextpyp-border);
	box-shadow: var(--nextpyp-shadow-hover);
	background: none;
	animation: nextpyp-hero-shot-in 220ms ease both;
}

[data-md-color-scheme="slate"] .md-typeset img.nextpyp-hero-shot {
	border-color: rgba(77, 163, 255, 0.35);
	box-shadow:
		0 1px 2px rgba(0, 0, 0, 0.45),
		0 16px 36px rgba(0, 0, 0, 0.45),
		0 0 0 1px rgba(77, 163, 255, 0.08);
}

@keyframes nextpyp-hero-shot-in {
	from {
		opacity: 0;
		transform: translateY(0.4rem);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.md-typeset img.nextpyp-hero-shot {
		animation: none;
	}
}

/* ------------------------------------------------------------------ *
 * Citation and funders
 * ------------------------------------------------------------------ */

.nextpyp-citation {
	margin: 3rem 0 1.5rem;
	padding: 1.25rem 1.5rem;
	border: 1px solid var(--nextpyp-border);
	border-left: 3px solid var(--nextpyp-blue);
	border-radius: var(--nextpyp-radius);
	background-color: var(--nextpyp-surface-alt);
	font-size: 0.78rem;
	line-height: 1.7;
}

.nextpyp-citation p:first-child {
	margin-top: 0;
	font-size: 0.8rem;
}

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

.nextpyp-funders {
	margin-bottom: 2rem;
	font-size: 0.72rem;
	text-align: center;
	color: var(--md-default-fg-color--light);
}

/* ------------------------------------------------------------------ *
 * Announcement banner
 * ------------------------------------------------------------------ */

.nextpyp-announce {
	font-size: 0.7rem;
}

.nextpyp-announce a {
	color: currentcolor;
	font-weight: 650;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * Narrow screens
 * ------------------------------------------------------------------ */

@media screen and (max-width: 44.9375em) {
	.nextpyp-hero {
		padding: 2.25rem 0.5rem 1.75rem;
	}

	.nextpyp-hero-title {
		font-size: 1.7rem;
	}

	.md-typeset .nextpyp-cta {
		min-width: 100%;
	}
}
