/* A project's overview (overview.js): its cover, then M3's supporting pane
   layout. The main pane holds what the project is, its activity, its
   latest commits and its README; the supporting pane, 360px wide beside it
   from the expanded size (840px), or under the head on narrower pages,
   holds its facts, the clone command and its languages. */

.page-hero {
	height: clamp(200px, 36vh, 380px);
	margin-bottom: var(--s6);
	border-radius: var(--s4);
	transform-origin: top center;
	/* Opening, the cover's backing fades in as it grows out of the tile. */
	background: color-mix(in srgb, var(--surface) calc(var(--hero-fill, 1) * 100%), transparent);
	overflow: hidden;
}

.page-hero canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.page-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: start;
	gap: var(--s6);
}

/* The supporting pane beside the main one, across all its rows; the last
   row takes up any height the pane needs beyond them. */
@container page (min-width: 840px) {
	.page-body {
		grid-template-columns: minmax(0, 1fr) 360px;
		grid-template-rows: auto auto auto 1fr;
		column-gap: var(--s7);
	}

	.page-body > :not(.page-aside) {
		grid-column: 1;
	}

	.page-aside {
		grid-column: 2;
		grid-row: 1 / -1;
	}
}

.page-aside {
	display: flex;
	flex-direction: column;
	gap: var(--s6);
	min-width: 0;
}

.page-section {
	min-width: 0;
}

/* Section titles take M3's title-medium role. */
.page-section-title {
	margin: 0 0 var(--s3);
	font-size: 16px;
	font-weight: 700;
	line-height: 24px;
	letter-spacing: 0.01em;
}

.page-slot[aria-busy="true"] {
	min-height: 24px;
}

.page-slot-note {
	margin: 0;
	font-size: 14px;
	color: var(--ink-quiet);
}

/* Placeholders shaped like what's coming, so little moves when it does. */
.page-placeholder {
	display: flex;
	flex-direction: column;
	gap: var(--s3);
}

.page-placeholder-block {
	height: 160px;
	border-radius: var(--s2);
	background: color-mix(in srgb, var(--text) 6%, transparent);
	animation: skeletonPulse 1s ease-in-out infinite alternate;
}

.page-head {
	max-width: 64ch;
}

.page-kind {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 18px;
	margin: 0 0 var(--s2);
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

.page-kind svg {
	width: 14px;
	height: 14px;
}

.page-title {
	margin: 0 0 var(--s3);
	font-size: clamp(32px, 4vw, 45px);
	line-height: 1.2;
	letter-spacing: -0.012em;
}

/* Focused when the page opens, for keyboards and screen readers, not by
   the user. */
.project-page:focus,
.paper-page:focus,
.page-title:focus {
	outline: none;
}

.page-title.has-logo {
	line-height: 0;
}

.page-title img {
	height: clamp(44px, 5vw, 60px);
	width: auto;
}

.page-title .logo-light,
html[data-theme="light"] .page-title .logo-dark {
	display: none;
}

html[data-theme="light"] .page-title .logo-light {
	display: inline;
}

.page-summary {
	margin: 0 0 var(--s5);
	font-size: 16px;
	line-height: 24px;
	color: var(--muted);
}

.page-summary:empty {
	display: none;
}

.page-facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--s4) var(--s5);
	margin: 0;
}

.page-facts .wide {
	grid-column: 1 / -1;
}

.page-facts dt {
	margin-bottom: 4px;
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

.page-facts dd {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	margin: 0;
	font-size: 14px;
	line-height: 20px;
}

.page-facts dd time:not(:only-child) {
	font-size: 12px;
	color: var(--muted);
}

.page-facts dd a {
	color: var(--text);
}

.page-commit {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.page-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.page-status svg {
	width: 16px;
	height: 16px;
}

/* M3 buttons: the repository filled, other links outlined, 40px tall with
   fully rounded corners and a trailing icon. */
.page-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s2);
	margin: 0;
}

.page-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: var(--s2);
	height: 40px;
	padding: 0 var(--s4) 0 var(--s5);
	border: 1px solid var(--border);
	border-radius: 20px;
	background: none;
	color: var(--text);
	font-size: 14px;
	overflow: hidden;
}

.page-button.primary {
	border-color: transparent;
	background: var(--accent);
	color: var(--accent-ink);
}

.page-button::before {
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	opacity: 0;
	transition: opacity 150ms var(--ease-effects);
}

.page-button:hover,
.page-button:focus-visible {
	color: var(--text);
}

.page-button.primary:hover,
.page-button.primary:focus-visible {
	color: var(--accent-ink);
}

.page-button:hover::before {
	opacity: 0.08;
}

.page-button:active::before {
	opacity: 0.12;
}

.page-button svg {
	width: 18px;
	height: 18px;
	transition: translate 350ms cubic-bezier(0.42, 1.67, 0.21, 0.9);
}

.page-button:hover svg {
	translate: 2px -2px;
}

/* The clone command in M3's outlined text field, read-only, with the
   copy button trailing it. The command wraps rather than hiding its end,
   and a click selects all of it. */
.clone-field {
	display: flex;
	align-items: center;
	gap: var(--s1);
	min-height: 56px;
	padding: var(--s2) var(--s1) var(--s2) var(--s4);
	border: 1px solid var(--border);
	border-radius: 4px;
}

.clone-command {
	flex: 1 1 auto;
	min-width: 0;
	font: inherit;
	font-size: 13px;
	line-height: 20px;
	overflow-wrap: anywhere;
	user-select: all;
}

.page-loc-total {
	margin: 0 0 var(--s3);
	font-size: 14px;
}

.page-loc-aside {
	margin: var(--s3) 0 0;
	font-size: 12px;
	line-height: 16px;
	color: var(--ink-quiet);
}

.page-aside .loc-languages {
	font-size: 14px;
}

/* M3's text button, under the latest commits, to the whole history. */
.page-more {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: var(--s2);
	height: 40px;
	margin: var(--s2) 0 0 calc(var(--s3) * -1);
	padding: 0 var(--s3);
	border-radius: 20px;
	color: var(--ink-accent);
	font-size: 14px;
}

.page-more::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: currentColor;
	opacity: 0;
	transition: opacity 150ms var(--ease-effects);
}

.page-more:hover::before {
	opacity: 0.08;
}

.page-more:hover,
.page-more:focus-visible {
	color: var(--ink-accent);
}

.page-more svg {
	width: 18px;
	height: 18px;
	transition: translate 350ms cubic-bezier(0.42, 1.67, 0.21, 0.9);
}

.page-more:hover svg {
	translate: 3px 0;
}

.page-readme .code-readme {
	margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
	.page-button::before,
	.page-button svg,
	.page-more::before,
	.page-more svg {
		transition: none;
	}

	.page-placeholder-block {
		animation: none;
	}
}
