/* Pegasos Lab — landing page */

:root {
	--ink: #f2f6ff;
	--ink-soft: #c2cee8;
	--ink-mute: #8e9cbb;
	--accent: #a8c6ff;
	--night: #020617;
	--edge: rgba(168, 198, 255, 0.16);
	--edge-strong: rgba(168, 198, 255, 0.42);
	--card: rgba(10, 18, 40, 0.42);
	--card-hover: rgba(18, 30, 60, 0.58);
	--gutter: clamp(1.5rem, 5vw, 5.5rem);
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100svh;
	font-family: var(--font);
	color: var(--ink);
	background-color: var(--night);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* --- Background layers ------------------------------------------------ */

.backdrop,
.scrim {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
}

.backdrop {
	background-color: var(--night);
	background-image: url("../images/pegasos_background.webp");
	background-position: 72% center;
	background-size: cover;
	background-repeat: no-repeat;
}

/* Darkens the side the text sits on, so the pegasus stays readable art. */
.scrim {
	background:
		linear-gradient(
			100deg,
			rgba(2, 6, 23, 0.94) 0%,
			rgba(2, 6, 23, 0.86) 28%,
			rgba(2, 6, 23, 0.55) 52%,
			rgba(2, 6, 23, 0.12) 76%,
			rgba(2, 6, 23, 0) 100%
		),
		linear-gradient(to top, rgba(2, 6, 23, 0.75), rgba(2, 6, 23, 0) 45%);
}

/* --- Page frame ------------------------------------------------------- */

.page {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 100svh;
	padding: clamp(1.5rem, 3.5vw, 2.5rem) var(--gutter) clamp(1.5rem, 3vw, 2.25rem);
	gap: clamp(2rem, 5vh, 3.5rem);
}

.masthead,
.hero,
.footer {
	width: 100%;
	max-width: 41rem;
}

.hero {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(1rem, 4vh, 3rem) 0;
}

/* --- Brand ------------------------------------------------------------ */

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--ink-soft);
	text-decoration: none;
}

.brand-mark {
	width: 1.05rem;
	height: 1.05rem;
	color: var(--accent);
	filter: drop-shadow(0 0 8px rgba(168, 198, 255, 0.55));
}

/* --- Hero copy -------------------------------------------------------- */

.title {
	margin: 0;
	padding-bottom: 8px;
	font-size: clamp(2.75rem, 7vw, 4.5rem);
	font-weight: 700;
	line-height: 1.04;
	letter-spacing: -0.035em;
	background: linear-gradient(180deg, #ffffff 25%, #b9cdf2 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.subtitle {
	margin: 0.75rem 0 0;
	font-size: clamp(1.15rem, 2.4vw, 1.5rem);
	font-weight: 500;
	letter-spacing: -0.01em;
	color: var(--accent);
}

.lead {
	margin: 1.15rem 0 0;
	max-width: 34rem;
	font-size: clamp(0.98rem, 1.5vw, 1.06rem);
	color: var(--ink-soft);
}

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

.apps {
	margin-top: clamp(2.25rem, 5vh, 3.25rem);
}

.apps-heading {
	margin: 0 0 0.9rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--ink-mute);
}

.app-card {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	grid-template-areas:
		"icon name go"
		"icon desc go";
	align-items: center;
	column-gap: clamp(0.9rem, 2vw, 1.15rem);
	padding: 1.1rem 1.25rem;
	border: 1px solid var(--edge);
	border-radius: 1rem;
	background: var(--card);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	color: inherit;
	text-decoration: none;
	transition:
		transform 0.25s ease,
		border-color 0.25s ease,
		background-color 0.25s ease,
		box-shadow 0.25s ease;
}

.app-card + .app-card {
	margin-top: 0.75rem;
}

.app-card:hover,
.app-card:focus-visible {
	transform: translateY(-2px);
	border-color: var(--edge-strong);
	background: var(--card-hover);
	box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.9);
}

.app-card:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.app-icon {
	grid-area: icon;
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	overflow: hidden;
	border: 1px solid var(--edge);
	border-radius: 0.8rem;
	background: rgba(168, 198, 255, 0.08);
	color: var(--accent);
}

.app-icon svg {
	width: 1.4rem;
	height: 1.4rem;
}

/* App logos are opaque full-bleed squares, so let them fill the tile. */
.app-icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.app-name {
	grid-area: name;
	font-size: 1.06rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.app-desc {
	grid-area: desc;
	margin-top: 0.15rem;
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--ink-mute);
}

.app-go {
	grid-area: go;
	color: var(--ink-mute);
	transition:
		transform 0.25s ease,
		color 0.25s ease;
}

.app-go svg {
	display: block;
	width: 1.25rem;
	height: 1.25rem;
}

.app-card:hover .app-go,
.app-card:focus-visible .app-go {
	transform: translateX(3px);
	color: var(--accent);
}

/* --- Footer ----------------------------------------------------------- */

.footer {
	font-size: 0.8rem;
	color: var(--ink-mute);
}

.footer p {
	margin: 0;
}

/* --- Utilities -------------------------------------------------------- */

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* --- Entrance --------------------------------------------------------- */

.masthead,
.title,
.subtitle,
.lead,
.apps,
.footer {
	animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.title {
	animation-delay: 0.06s;
}
.subtitle {
	animation-delay: 0.12s;
}
.lead {
	animation-delay: 0.18s;
}
.apps {
	animation-delay: 0.24s;
}
.footer {
	animation-delay: 0.3s;
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

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

@media (max-width: 48rem) {
	/* Too narrow to hold the pegasus without it turning to mush behind the
     copy, so frame the starfield and milky way instead. */
	.backdrop {
		background-position: 28% center;
	}

	.scrim {
		background: linear-gradient(
			to bottom,
			rgba(2, 6, 23, 0.42) 0%,
			rgba(2, 6, 23, 0.72) 26%,
			rgba(2, 6, 23, 0.88) 55%,
			rgba(2, 6, 23, 0.95) 100%
		);
	}
}

/* Below this the side-by-side card layout gets too cramped: drop the
   description onto its own full-width row. */
@media (max-width: 34rem) {
	.app-card {
		grid-template-areas:
			"icon name go"
			"desc desc desc";
		row-gap: 0.55rem;
	}

	.app-desc {
		margin-top: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
