/*
 * Home page.
 *
 * The page is one vertical stack of full-bleed bands. Every band draws its own
 * ground and inherits the ink tokens declared on .home, so a band can be moved
 * or reordered without carrying layout assumptions with it. The blue is the
 * same brand blue as the header band (see MainHeader), so the hero reads as a
 * continuation of the bar rather than a second, competing header.
 */
.home {
	--home-brand: #1b4196;
	--home-brand-deep: #14306f;

	/* Ink on the pale bands */
	--home-ink: #22262b;
	--home-ink-strong: #101317;
	--home-ink-muted: #6b7280;

	/* Ink on the blue band */
	--home-ink-invert: rgba(255, 255, 255, 0.82);
	--home-ink-invert-strong: #fff;
	--home-ink-invert-muted: rgba(255, 255, 255, 0.6);

	--home-rule: rgba(0, 0, 0, 0.11);
	--home-surface: #fff;
	--home-ground: #f6f7f9;

	/* The status sign's amber — the one saturated hue on the pale bands */
	--home-warn: #f6a02c;
	--home-warn-edge: #d97706;
	--home-warn-ink: #b45309;

	--home-measure: 68rem;
	--home-radius: 10px;

	color: var(--home-ink);
	line-height: 1.6;
}

/* Every band shares one inner measure, so section edges line up down the page */
.home__inner {
	max-width: var(--home-measure);
	margin-inline: auto;
	padding-inline: 1.25rem;
}

.home__band {
	padding-block: clamp(2.75rem, 2rem + 3vw, 4.5rem);
}

/* Set by position in Home.jsx: the grounds alternate, starting on white */
.home__band--odd { background-color: var(--home-surface); }
.home__band--even { background-color: var(--home-ground); }

/*
 * Section headings.
 *
 * An eyebrow carries the section's name in small caps and the h2 carries the
 * claim, so the claim never has to double as a label.
 */
.home__eyebrow {
	margin: 0 0 0.5rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--home-brand);
}

.home__title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
	font-weight: 600;
	letter-spacing: -0.015em;
	color: var(--home-ink-strong);
	text-wrap: balance;
}

.home__lead {
	margin: 0 0 2rem;
	color: var(--home-ink-muted);
}

/* ---------------------------------------------------------------- hero band */

.home__hero {
	background: linear-gradient(180deg, var(--home-brand) 0%, var(--home-brand-deep) 100%);
	color: var(--home-ink-invert);
	padding-block: clamp(2.5rem, 2.5rem + 4vw, 3rem);
}

.home__hero-title {
	margin: 0 0 1rem;
	/* max-width: 20ch; */
	font-size: clamp(2.25rem, 1.6rem + 3.2vw, 2.25rem);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.03em;
	color: var(--home-ink-invert-strong);
	text-wrap: balance;
}

.home__hero-lead {
	margin: 0 0 2rem;
	max-width: 44rem;
	font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
}

.home__hero-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-block-end: 1.25rem;
}

.home__hero-note {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--home-ink-invert-muted);
}

/* ---------------------------------------------------------- logo hero band */

/*
 * Alternate hero (HomeHeroLogo). The gradient is sampled from nbs_logo1.png:
 * its deepest navy at the foot, cobalt through the middle, and a soft steel
 * glow behind the mark so the pale pixels and black outline both read.
 */
/*
 * Each banner names its ground in `background`, which maps to a
 * `.home__hero-logo--<background>` modifier below. A modifier sets only the
 * ground and the rule under the band; `cobalt` is the default.
 */
.home__hero-logo,
.home__hero-logo--cobalt {
	--logo-navy: #003060;
	--logo-navy-deep: #001a36;
	--logo-cobalt: #186090;
	--logo-cobalt-bright: #006090;
	--logo-steel: #7890a8;
	--logo-silver: #c0d8d8;

	--hero-logo-ground:
		radial-gradient(ellipse 38rem 22rem at 22% 50%, rgba(120, 144, 168, 0.45) 0%, rgba(120, 144, 168, 0) 70%),
		linear-gradient(135deg, var(--logo-cobalt-bright) 0%, var(--logo-cobalt) 35%, var(--logo-navy) 72%, var(--logo-navy-deep) 100%);
	--hero-logo-rule: var(--logo-silver);
	--hero-logo-shadow: rgba(0, 26, 54, 0.55);
}

/*
 * Kingdom Come: aged parchment of a ledger, lit in the middle and browned at
 * the edges. The ground is light, so the band's ink flips to dark browns.
 */
.home__hero-logo--forge {
	--parchment-light: #efe4cc;
	--parchment: #dccaa5;
	--parchment-edge: #b99f78;
	--parchment-rule: #8a6a48;

	--hero-logo-ground:
		radial-gradient(ellipse 40rem 24rem at 22% 50%, rgba(250, 243, 226, 0.75) 0%, rgba(250, 243, 226, 0) 70%),
		radial-gradient(ellipse at 50% 50%, var(--parchment-light) 0%, var(--parchment) 60%, var(--parchment-edge) 100%);
	--hero-logo-rule: var(--parchment-rule);
	--hero-logo-shadow: rgba(60, 40, 20, 0.35);

	--home-ink-invert: #3a2c1f;
	--home-ink-invert-strong: #24190f;
	--home-ink-invert-muted: #5a4733;
}
.home__hero-logo {
	width: 100%;
	/* A floor, so a short banner doesn't shrink the band; content stays centred in it */
	min-height: 320px;
	display: grid;
	align-content: center;
	color: var(--home-ink-invert);
	padding-block: clamp(1rem, 0.5rem + 1.5vw, 1.5rem);
	background: var(--hero-logo-ground);
	border-block-end: 3px solid var(--hero-logo-rule);
}

.home__hero-logo-inner {
	/* A grid item with auto margins shrinks to its content; keep the full measure */
	box-sizing: border-box;
	width: 100%;
	display: grid;
	grid-template-columns: minmax(0, auto) minmax(0, 1fr);
	align-items: center;
	gap: clamp(1rem, 0.5rem + 2vw, 2.5rem);
}

.home__hero-logo-mark {
	display: block;
	width: clamp(12rem, 10rem + 12vw, 25rem);
	height: auto;
	image-rendering: pixelated;
	filter: drop-shadow(0 6px 18px var(--hero-logo-shadow));
}

/* Tight stack: the title sits close on the lead, and the lead closes the band */
.home__hero-logo-copy .home__hero-title { margin-block-end: 0.5rem; }
.home__hero-logo-copy .home__hero-lead { margin-block-end: 0; }
.home__hero-logo-copy > :first-child { margin-block-start: 0; }

@media (max-width: 52rem) {
	.home__hero-logo-inner {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
		text-align: center;
		gap: 1rem;
	}

	.home__hero-logo-copy .home__hero-lead { margin-inline: auto; }
}

/* ------------------------------------------------------------------ buttons */

.home__button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.65rem 1.35rem;
	border-radius: 999px;
	border: 1px solid transparent;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.home__button--primary {
	background-color: #fff;
	color: var(--home-brand-deep);
}

.home__button--primary:hover,
.home__button--primary:focus-visible {
	background-color: rgba(255, 255, 255, 0.88);
	color: var(--home-brand-deep);
}

.home__button--ghost {
	border-color: rgba(255, 255, 255, 0.4);
	color: var(--home-ink-invert-strong);
}

.home__button--ghost:hover,
.home__button--ghost:focus-visible {
	background-color: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.7);
	color: var(--home-ink-invert-strong);
}

/* ---------------------------------------------------------------- shortcuts */

/*
 * Two whole-card links on the pale ground, side by side and wrapping on their
 * own. The card lifts and its arrow slides on hover, so the strip reads as
 * "go somewhere" without needing a heading.
 */
.home__band.home__shortcuts {
	padding-block: clamp(1.5rem, 1rem + 2vw, 2.25rem);
	border-block-end: 1px solid var(--home-rule);
}

.home__shortcuts-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
	gap: 1rem;
	margin-block: 0;
	list-style: none;
}

.home__shortcut {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 1rem;
	block-size: 100%;
	padding: 1rem 1.25rem;
	background-color: var(--home-surface);
	border: 1px solid var(--home-rule);
	border-radius: var(--home-radius);
	color: inherit;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.home__shortcut:hover,
.home__shortcut:focus-visible {
	border-color: color-mix(in srgb, var(--home-brand) 45%, transparent);
	box-shadow: 0 6px 18px -8px rgba(20, 48, 111, 0.35);
	transform: translateY(-2px);
	color: inherit;
}

.home__shortcut-mark {
	display: grid;
	place-items: center;
	inline-size: 3rem;
	block-size: 3rem;
	border-radius: var(--home-radius);
	background-color: color-mix(in srgb, var(--home-brand) 10%, transparent);
	color: var(--home-brand);
	transition: background-color 0.15s ease, color 0.15s ease;
}

.home__shortcut:hover .home__shortcut-mark,
.home__shortcut:focus-visible .home__shortcut-mark {
	background-color: var(--home-brand);
	color: #fff;
}

.home__shortcut-icon {
	inline-size: 1.5rem;
	block-size: 1.5rem;
}

.home__shortcut-copy {
	display: flex;
	flex-direction: column;
	min-inline-size: 0;
}

.home__shortcut-title {
	font-size: 1.0625rem;
	font-weight: 600;
	color: var(--home-ink-strong);
}

.home__shortcut-text {
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--home-ink-muted);
}

/* The caret points down in the set; turned, it becomes the "go" arrow */
.home__shortcut-arrow {
	inline-size: 1.25rem;
	block-size: 1.25rem;
	color: var(--home-brand);
	transform: rotate(-90deg);
	transition: transform 0.15s ease;
}

.home__shortcut:hover .home__shortcut-arrow,
.home__shortcut:focus-visible .home__shortcut-arrow {
	transform: rotate(-90deg) translateY(4px);
}

@media (prefers-reduced-motion: reduce) {
	.home__shortcut,
	.home__shortcut-arrow { transition: none; }
	.home__shortcut:hover,
	.home__shortcut:focus-visible { transform: none; }
}

/* -------------------------------------------------------------------- cards */

/*
 * One grid rule for every card row on the page: columns are as wide as they
 * need to be and wrap on their own, so no band carries a breakpoint of its own.
 */
.home__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 1.25rem;
}

.home__card {
	display: flex;
	flex-direction: column;
	padding: 1.5rem;
	background-color: var(--home-surface);
	border: 1px solid var(--home-rule);
	border-radius: var(--home-radius);
}

.home__band--odd .home__card {
	background-color: var(--home-ground);
}

.home__card-title {
	margin: 0 0 0.5rem;
	font-size: 1.0625rem;
	font-weight: 600;
	color: var(--home-ink-strong);
}

.home__card p {
	margin: 0 0 1rem;
	font-size: 0.9375rem;
	color: var(--home-ink-muted);
}

/* The link sits at the card's foot whatever the copy length above it */
.home__card-link {
	margin-block-start: auto;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--home-brand);
	text-decoration: none;
}

.home__card-link:hover,
.home__card-link:focus-visible {
	text-decoration: underline;
}

/* A dated card: the date sits above the title, quieter than the copy below it */
.home__card p.home__card-meta {
	margin: 0 0 0.375rem;
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
}

/* --------------------------------------------------------------- dev blog */

/* A short band: an announcement between two long ones, not a section of its own */
.home__band.home__blog {
	padding-block: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
}

.home__blog-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem 1.5rem;
	margin-block-end: 1rem;
}

.home__blog-head .home__title {
	margin: 0;
	font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
}

.home__blog .home__grid {
	gap: 1rem;
}

.home__blog .home__card {
	padding: 1rem 1.25rem;
}

.home__blog .home__card p {
	margin-block-end: 0.75rem;
}

/* The feed's byline in small: a round face, the name in ink, then date and language */
.home__blog .home__card p.home__blog-byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35em;
	margin-block-end: 0.5rem;
}

.home__blog-avatar {
	inline-size: 1.75rem;
	block-size: 1.75rem;
	border-radius: 50%;
	object-fit: cover;
}

.home__blog-author {
	font-weight: 600;
	color: var(--home-ink-strong);
}

/* ----------------------------------------------------------- feature matrix */

.home__features {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
	gap: 0.5rem 2.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * Each row is icon column + text column, so the description hangs under the
 * title rather than under the mark and the rules across the grid stay even.
 */
.home__feature {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: start;
	gap: 0.9rem;
	padding-block: 1.1rem;
	border-block-start: 1px solid var(--home-rule);
	font-size: 0.9375rem;
}

/* Brand-tinted tile: the icon is the only colour in the band, so it leads */
.home__feature-mark {
	display: grid;
	place-items: center;
	flex: none;
	inline-size: 2.75rem;
	block-size: 2.75rem;
	border-radius: var(--home-radius);
	background-color: color-mix(in srgb, var(--home-brand) 10%, transparent);
	color: var(--home-brand);
}

.home__feature-icon {
	inline-size: 1.625rem;
	block-size: 1.625rem;
	color: inherit;
}

.home__feature-body {
	min-width: 0;
}

.home__feature b {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-block-end: 0.15rem;
	font-weight: 600;
	color: var(--home-ink-strong);
}

.home__feature-badge {
	flex: none;
	padding: 0.05rem 0.4rem;
	border: 1px solid color-mix(in srgb, var(--home-brand) 30%, transparent);
	border-radius: 999px;
	font-size: 0.6875rem;
	font-style: normal;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--home-brand);
}

.home__feature-body > span {
	display: block;
	color: var(--home-ink-muted);
}

/* ----------------------------------------------------------------- timeline */

/*
 * Generation strip. The rule runs behind the whole row and each stop paints its
 * own marker on top of it, so the line never has to be positioned per item.
 */
.home__timeline {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	gap: 1.5rem 1rem;
	margin: 0 0 1.5rem;
	padding: 0;
	list-style: none;
}

.home__stop {
	padding-block-start: 1.25rem;
	border-block-start: 2px solid var(--home-rule);
	position: relative;
}

.home__stop::before {
	content: '';
	position: absolute;
	inset-block-start: -5px;
	inset-inline-start: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--home-brand);
}

.home__stop--live::before {
	background-color: #198754;
}

.home__stop b {
	display: block;
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--home-ink-strong);
}

.home__stop span {
	font-size: 0.875rem;
	color: var(--home-ink-muted);
}

/* ------------------------------------------------------------ notice strip */

/*
 * One line under the hero: an amber pill label and a sentence of plain ink.
 * The band keeps its alternating ground but takes the tight padding of the
 * shortcuts strip, so it reads as a note on the banner rather than a section.
 */
.home__band.home__notice {
	padding-block: 0.85rem;
	border-block-end: 1px solid var(--home-rule);
}

.home__notice-line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 0.75rem;
	margin-block: 0;
	font-size: 0.9375rem;
}

.home__notice-label {
	flex: none;
	padding: 0.1rem 0.55rem;
	border-radius: 999px;
	background-color: color-mix(in srgb, var(--home-warn) 18%, transparent);
	color: var(--home-warn-ink);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.home__notice-text {
	color: var(--home-ink-muted);
}

/* ----------------------------------------------------------- status callout */

/*
 * The honest-status block.
 *
 * Structure stays loud and the prose stays plain ink, but the block carries one
 * saturated thing: a large filled warning triangle in its own column, lit from
 * behind by an amber halo and standing on an amber-washed panel. Everything
 * else — eyebrow, title, gloss, prose — shares one left edge next to it, so the
 * sign reads first and the text reads as a single column, not as a caption.
 */
.home__callout {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: start;
	gap: clamp(1.25rem, 0.5rem + 2.5vw, 2.5rem);
	position: relative;
	overflow: hidden;
	padding: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
	background-color: var(--home-surface);
	background-image: linear-gradient(135deg, color-mix(in srgb, var(--home-warn) 11%, transparent) 0%, transparent 55%);
	border: 1px solid var(--home-rule);
	border-inline-start: 4px solid var(--home-warn-edge);
	border-radius: var(--home-radius);
}

/* ---------------------------------------------------------- the warning mark */

.home__callout-mark {
	position: relative;
	display: grid;
	place-items: center;
	inline-size: clamp(4rem, 2.5rem + 6vw, 7.5rem);
	aspect-ratio: 1;
}

/*
 * The halo. A radial wash behind the triangle does the "look at this" work that
 * a badge ring would otherwise do, without drawing a hard edge around the sign.
 */
.home__callout-mark::before {
	content: '';
	position: absolute;
	inset: -18%;
	border-radius: 50%;
	background: radial-gradient(circle,
		color-mix(in srgb, var(--home-warn) 34%, transparent) 0%,
		color-mix(in srgb, var(--home-warn) 12%, transparent) 45%,
		transparent 72%);
	animation: home-warn-pulse 3.6s ease-in-out infinite;
}

.home__callout-mark svg {
	position: relative;
	inline-size: 100%;
	height: auto;
	filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--home-warn-edge) 30%, transparent));
}

@keyframes home-warn-pulse {
	0%, 100% { transform: scale(1); opacity: 0.85; }
	50% { transform: scale(1.08); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.home__callout-mark::before { animation: none; }
}

/* ----------------------------------------------------------- the text column */

/*
 * Eyebrow, title and lead are the page's shared section headings — the callout
 * only moves the eyebrow onto the warning amber and closes the lead with a rule,
 * so the announcement is fenced off from the explanation under it. The margins
 * are restated because `.home__callout p` below outweighs a lone class.
 */
.home__callout .home__callout-eyebrow {
	margin: 0 0 0.5rem;
	color: var(--home-warn-ink);
}

.home__callout .home__callout-lead {
	margin: 0 0 1.15rem;
	padding-block-end: 1.15rem;
	border-block-end: 1px solid var(--home-rule);
}

.home__callout p {
	margin: 0 0 0.85rem;
	max-width: 52rem;
}

.home__callout p:last-child {
	margin-block-end: 0;
}

/* ---------------------------------------------------------------- code slab */

.home__code {
	margin: 0 0 1.25rem;
	padding: 1rem 1.25rem;
	overflow-x: auto;
	background-color: #101317;
	color: rgba(255, 255, 255, 0.9);
	border-radius: var(--home-radius);
	font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
	font-size: 0.875rem;
	line-height: 1.7;
}

.home__code .home__prompt {
	color: rgba(255, 255, 255, 0.45);
	user-select: none;
}

.home__code .home__hint {
	color: rgba(255, 255, 255, 0.5);
	font-style: italic;
}
