/* The front page. Everything here is scoped to body.home, and builds on style.css. */

.home {
	--mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
	--line: color-mix(in srgb, var(--muted) 45%, transparent);
	--panel: color-mix(in srgb, var(--bg) 85%, transparent);
	--wash: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* The 2-cell stays with the hero and scrolls away with it. */
.home .plane { position: absolute; inset: 0 auto auto 0; height: 100vh; }

.home main { flex: 1; }
.home a { text-underline-offset: 0.18em; }

/* Hero */
.home .hero {
	min-height: calc(100vh - 6rem);
	min-height: calc(100dvh - 6rem);
	padding: 2rem 0 4.5rem;
	position: relative;
}

.home .hero .tagline { margin-bottom: 0.9rem; }

.sub {
	margin: 0 0 2.25rem;
	font-size: clamp(1.05rem, 2vw, 1.25rem);
	text-wrap: balance;
}

.pill {
	display: inline-flex;
	align-items: baseline;
	gap: 0.6rem;
	max-width: 100%;
	margin: 0 0 2.25rem;
	padding: 0.4rem 1rem 0.4rem 0.45rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--panel);
	backdrop-filter: blur(6px);
	color: var(--fg);
	text-decoration: none;
	font-size: 1rem;
	text-align: left;
	transition: border-color 150ms ease;
}

.pill b {
	flex: none;
	padding: 0.1rem 0.6rem;
	border-radius: 999px;
	background: var(--accent);
	color: var(--bg);
	font-weight: 400;
	font-size: 0.9rem;
}

.pill i, .more i, .course .meta i, .feed i { font-style: normal; transition: transform 150ms ease; display: inline-block; }
.pill:hover, .pill:focus-visible { border-color: var(--accent); }

/* Announcements above the headline: one rounded panel, one row per link.
   Subgrid lines up the badges, the titles and the arrows across rows. */
.pills {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	max-width: 100%;
	margin: 0 0 2.25rem;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: var(--panel);
	backdrop-filter: blur(6px);
	overflow: hidden;
}
.pills .pill {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: subgrid;
	align-items: baseline;
	column-gap: 0.6rem;
	margin: 0;
	padding: 0.55rem 1rem 0.55rem 0.6rem;
	border: 0;
	border-radius: 0;
	background: none;
	backdrop-filter: none;
	transition: background-color 150ms ease;
}
.pills .pill + .pill { border-top: 1px solid var(--line); }
.pills .pill b { justify-self: stretch; text-align: center; }
.pills .pill:hover, .pills .pill:focus-visible { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.pill:hover i, .more:hover i, .course:hover .meta i, .feed a:hover i { transform: translateX(4px); }

.ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem; }
.ctas.left { justify-content: flex-start; }

.cta.solid { background: var(--fg); color: var(--bg); }
.cta.solid:hover, .cta.solid:focus-visible { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.scroll {
	position: absolute;
	bottom: 1rem;
	left: 50%;
	translate: -50% 0;
	color: var(--muted);
	text-decoration: none;
	font-size: 1.4rem;
	padding: 0.25rem 0.75rem;
}

.scroll span { display: block; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* Sections */
.band { padding: 4.5rem 0; border-top: 1px solid var(--rule); scroll-margin-top: 1rem; }

.eyebrow { margin: 0 0 0.6rem; color: var(--accent); font-style: italic; font-size: 1.1rem; }

.band > h2, .closing h2 {
	margin: 0 0 1rem;
	max-width: 26ch;
	font-weight: 400;
	font-size: clamp(1.75rem, 4.2vw, 2.75rem);
	line-height: 1.12;
	text-wrap: balance;
}

#faithful > h2 { max-width: 30ch; }

.band .lede { max-width: 44rem; margin-bottom: 2.25rem; }
.band .lede strong, .copy strong { color: var(--fg); }
.band a:not(.cta):not(.course):not(.video) { color: var(--accent); }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2.5rem; align-items: center; }
.split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.note { margin: 1.75rem 0 0; max-width: 44rem; color: var(--muted); }

/* The three steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }

.steps li {
	display: flex;
	gap: 1rem;
	padding: 0.9rem 1rem;
	border-left: 2px solid var(--rule);
	transition: border-color 300ms ease, background-color 300ms ease;
}

.steps li.on { border-left-color: var(--role); background: color-mix(in srgb, var(--role) 9%, transparent); }
.steps [data-role="you"] { --role: var(--fg); }
.steps [data-role="ai"] { --role: var(--accent); }
.steps [data-role="lean"] { --role: var(--gold); }
.steps h3, .principles h3 { margin: 0 0 0.25rem; font-size: 1.2rem; font-weight: 700; }
.steps p, .principles p { margin: 0; color: var(--muted); }
.steps .n { font-size: 1.2rem; }

/* The demo */
.demo { margin: 0; padding: 0; overflow: hidden; }

.demo-bar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.6rem 1rem;
	border-bottom: 1px solid var(--line);
	font-size: 0.95rem;
	color: var(--muted);
}

.dots { display: inline-flex; gap: 0.35rem; }
.dots i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--line); }
.demo .file { font-family: var(--mono); font-size: 0.82rem; }
.demo .status { margin-left: auto; font-style: italic; text-align: right; }

.code {
	margin: 0;
	padding: 1rem 1.1rem;
	min-height: calc(7 * 1.6em + 2rem);
	overflow-x: auto;
	font-family: var(--mono);
	font-size: clamp(0.72rem, 1.55vw, 0.9rem);
	line-height: 1.6;
	tab-size: 2;
}

.code .k, .mapping .k { color: var(--accent); fill: var(--accent); }
.code .ai { color: var(--accent); }
.code .caret { display: inline-block; width: 0.55em; height: 1.1em; margin-bottom: -0.2em; background: currentColor; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.verdict {
	margin: 0;
	padding: 0.7rem 1.1rem;
	min-height: 3.1rem;
	border-top: 1px solid var(--line);
	font-size: 1rem;
	transition: background-color 300ms ease;
}

.verdict code, .certs code { font-family: var(--mono); font-size: 0.85em; }
.verdict.ok { background: var(--wash); }
.verdict.weak { background: color-mix(in srgb, var(--gold) 20%, transparent); }
.verdict.wait { color: var(--muted); font-style: italic; }

.demo figcaption {
	display: flex;
	align-items: center;
	gap: 1.1rem;
	padding: 0.55rem 1.1rem;
	border-top: 1px solid var(--line);
	font-size: 0.9rem;
	color: var(--muted);
}

.legend { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend i { width: 0.65rem; height: 0.65rem; border-radius: 2px; background: var(--fg); }
.legend i.ai { background: var(--accent); }
.legend i.lean { background: var(--gold); }

.demo button {
	margin-left: auto;
	font: inherit;
	color: var(--accent);
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

.demo button:hover { text-decoration: underline; }

/* Academy numbers */
.stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin: 0 0 2.25rem;
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
}

.stats div { display: flex; flex-direction: column-reverse; padding: 1.1rem 1rem 1rem 0; }
.stats div + div { padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.stats dd { margin: 0; font-size: clamp(2rem, 5.5vw, 3.25rem); line-height: 1; font-variant-numeric: tabular-nums; }
.stats dt { margin-top: 0.35rem; color: var(--muted); font-style: italic; }

/* Courses */
.courses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }

.course {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 1.25rem 1.4rem;
	border: 1.5px solid var(--line);
	border-radius: 18px;
	background: var(--panel);
	color: var(--fg);
	text-decoration: none;
	overflow: hidden;
	transition: border-color 150ms ease, transform 150ms ease;
}

.course:hover, .course:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.course .level { color: var(--accent); font-style: italic; }
.course h3 { margin: 0.2rem 0 0.4rem; font-size: 1.4rem; font-weight: 400; line-height: 1.2; }
.course p { margin: 0 0 1.25rem; color: var(--muted); }
.course .meta { margin-top: auto; font-size: 0.95rem; }

.course.feature { grid-column: span 2; }
.course.feature h3 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); }
.course.feature p { max-width: 34rem; }

/* The featured course: the zeta function down the left, the words beside it. */
.course.feature { padding-left: calc(38% + 1.4rem); }

.course .art {
	position: absolute;
	inset: 0 62% 0 0;
	background: #1e4ba8 url("/riemann/zeta-landscape.png") 42% center / cover;
	border-right: 1.5px solid var(--line);
}

/* Faithfulness Review */
.copy p { margin: 0 0 1rem; font-size: 1.15rem; }

.copy .coined { font-size: 1rem; font-style: italic; color: var(--muted); }

.certs { list-style: none; margin: 1.25rem 0 1.75rem; padding: 0; display: grid; gap: 0.75rem; }
.certs li { padding-left: 1rem; border-left: 2px solid var(--accent); color: var(--muted); }
.certs b { display: block; color: var(--fg); }

.mapping { margin: 0; padding: 1.25rem; }
.mapping svg { display: block; width: 100%; height: auto; overflow: visible; }
.mapping .pane rect { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.mapping .pane line { stroke: var(--line); stroke-width: 1; }
.mapping .tab { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.mapping .tex { font-family: var(--serif); font-size: 16px; fill: var(--fg); }
.mapping .lean { font-family: var(--mono); font-size: 12.5px; fill: var(--fg); }
.mapping .bar { fill: var(--line); }
.mapping .hl { fill: var(--wash); }
.mapping .link { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-dasharray: 1; }
.mapping .tick circle { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.mapping .tick path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mapping .tick { transform-box: fill-box; transform-origin: center; }
.mapping .count { font-family: var(--serif); font-style: italic; font-size: 14px; fill: var(--muted); }

/* The mappings draw themselves once the section is on screen. */
.js .mapping .hl, .js .mapping .tick, .js .mapping .count { opacity: 0; }
.js .mapping .link { stroke-dashoffset: 1; }
.js .in .mapping .hl { animation: fade 400ms ease forwards; }
.js .in .mapping .link { animation: drawline 600ms ease forwards; }
.js .in .mapping .tick { animation: pop 350ms ease forwards; }
.js .in .mapping .count { animation: fade 400ms ease 3.5s forwards; }
.js .in .mapping .h1 { animation-delay: 0.5s; }
.js .in .mapping .l1 { animation-delay: 0.8s; }
.js .in .mapping .t1 { animation-delay: 1.3s; }
.js .in .mapping .h2 { animation-delay: 1.5s; }
.js .in .mapping .l2 { animation-delay: 1.8s; }
.js .in .mapping .t2 { animation-delay: 2.3s; }
.js .in .mapping .h3 { animation-delay: 2.5s; }
.js .in .mapping .l3 { animation-delay: 2.8s; }
.js .in .mapping .t3 { animation-delay: 3.3s; }
@keyframes fade { to { opacity: 1; } }
@keyframes drawline { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }

/* The talk */
.talk {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: 2.5rem;
	align-items: center;
	margin-top: 3.5rem;
	padding-top: 3.5rem;
	border-top: 1px solid var(--rule);
}

.talk h3 { margin: 0 0 0.75rem; font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 400; line-height: 1.15; }
.talk .eyebrow { font-size: 1rem; }
.more { text-decoration: none; }
.more:hover { text-decoration: underline; }

.video {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	border: 1.5px solid var(--line);
	border-radius: 18px;
	overflow: hidden;
	background: #0b1020;
}

.video img, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video img { transition: transform 400ms ease, opacity 200ms ease; opacity: 0.92; }
.video:hover img { transform: scale(1.02); opacity: 1; }

.play {
	position: absolute;
	inset: 50% auto auto 50%;
	translate: -50% -50%;
	display: grid;
	place-items: center;
	width: 4.5rem;
	height: 4.5rem;
	border-radius: 50%;
	background: #f6f4ee;
	box-shadow: 0 4px 24px rgb(0 0 0 / 0.35);
	transition: scale 150ms ease;
}

.play svg { width: 2rem; height: 2rem; fill: #0b1020; }
.video:hover .play, .video:focus-visible .play { scale: 1.08; }

/* Principles */
.principles { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }

.principles a {
	display: block;
	height: 100%;
	padding: 1.25rem 1.4rem;
	border-top: 2px solid var(--fg);
	color: var(--fg) !important;
	text-decoration: none;
	transition: border-color 150ms ease, background-color 150ms ease;
}

.principles a:hover, .principles a:focus-visible { border-top-color: var(--accent); background: var(--wash); }
.principles .n { display: block; margin-bottom: 0.75rem; font-size: 2rem; line-height: 1; }

.goal { margin: 3.5rem 0 0; text-align: center; }
.goal p { margin: 0 0 0.75rem; font-size: clamp(1.7rem, 5vw, 3.1rem); font-style: italic; line-height: 1.15; text-wrap: balance; }
.goal footer { display: block; font-size: 1.1rem; }

/* Latest */
.feed { list-style: none; margin: 1.5rem 0 0; padding: 0; border-top: 1px solid var(--rule); }

.feed a {
	display: grid;
	grid-template-columns: 7.5rem 6rem minmax(0, 1fr) auto;
	gap: 1rem;
	align-items: baseline;
	padding: 1rem 0.5rem;
	border-bottom: 1px solid var(--rule);
	color: var(--fg) !important;
	text-decoration: none;
	font-size: 1.15rem;
	transition: background-color 150ms ease;
}

.feed a:hover, .feed a:focus-visible { background: var(--wash); }
.feed time { color: var(--muted); font-size: 1rem; font-variant-numeric: tabular-nums; }
.feed .tag { color: var(--accent); font-style: italic; font-size: 1rem; }
.feed i { color: var(--accent); }

/* Closing call */
.closing { padding: 5rem 0 5.5rem; border-top: 1px solid var(--rule); text-align: center; }
.closing h2 { margin-inline: auto; }
.closing p { margin: 0 0 2rem; color: var(--muted); font-size: 1.25rem; }

/* Footer links */
.sitemap {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: 1.5rem;
	padding: 2.5rem 0 1.5rem;
	border-top: 1px solid var(--rule);
}

.sitemap h2 { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 400; font-style: italic; color: var(--muted); }
.sitemap a { display: block; padding: 0.15rem 0; color: var(--fg); text-decoration: none; }
.sitemap a:hover { color: var(--accent); }

/* Sections arrive as you reach them. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 600ms ease, transform 600ms ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
	.split, .split.even, .talk { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
	.courses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.principles { grid-template-columns: minmax(0, 1fr); }
	.feed a { grid-template-columns: 7rem minmax(0, 1fr) auto; }
	.feed .tag { display: none; }
}

@media (max-width: 560px) {
	.band { padding: 3.25rem 0; }
	.courses { grid-template-columns: minmax(0, 1fr); }
	.course.feature { grid-column: auto; padding-left: 1.4rem; padding-top: calc(7.5rem + 1.1rem); }
	.course .art { inset: 0 0 auto 0; height: 7.5rem; border-right: 0; border-bottom: 1.5px solid var(--line); }
	.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stats div:nth-child(3) { padding-left: 0; border-left: 0; }
	.stats div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
	.pill { font-size: 0.92rem; border-radius: 18px; }
	.feed a { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.1rem; }
	.feed time { grid-column: 1 / -1; }
	.home .nav { gap: 0.75rem; font-size: 0.95rem; }
	.home .nav functorial-account { margin-left: 0; }
	.home .brand span { display: none; }
	.mapping { padding: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
	.js .reveal { opacity: 1; transform: none; transition: none; }
	.scroll span, .code .caret { animation: none; }
	.js .mapping .hl, .js .mapping .tick, .js .mapping .count { opacity: 1; animation: none !important; }
	.js .mapping .link { stroke-dashoffset: 0; animation: none !important; }
	.course, .pill i, .more i, .video img, .play { transition: none; }
}
