:root {
	--ink: #f3f6fb;
	--ink-muted: #b9c6dc;
	--court: #0b1a3a;
	--field: rgb(255 255 255 / 0.09);
	--field-edge: rgb(255 255 255 / 0.3);
	--ball: #dcef4a;
	--error: #ffb4a8;
	--ok: #c8f0b4;

	/* 280 -> 1440 px two-anchor clamps; the rem term keeps zoom working */
	--size-title: clamp(2.5rem, 1.9569rem + 3.1034vw, 4.75rem);
	--size-lead: clamp(1.125rem, 1.0345rem + 0.5172vw, 1.5rem);
	--gutter: clamp(1rem, 0.1552rem + 4.8276vw, 4.5rem);
	--stack: clamp(1.5rem, 1.319rem + 1.0345vw, 2.25rem);

	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	color-scheme: dark;
}

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

html {
	background: var(--court);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100dvh;
	background: var(--court);
	color: var(--ink);
	font: 400 1rem/1.5 "Archivo", system-ui, sans-serif;
	position: relative;
	isolation: isolate;
}

/* The photo sits under a navy wash that deepens towards the form's side,
   so labels and fields stay readable over the bright court and roof. */
.backdrop {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 55% 60%;
	z-index: -2;
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(90deg, rgb(8 20 48 / 0.9) 0%, rgb(8 20 48 / 0.78) 38%, rgb(8 20 48 / 0.45) 75%, rgb(8 20 48 / 0.35) 100%),
		linear-gradient(180deg, rgb(8 20 48 / 0.2) 0%, rgb(8 20 48 / 0.55) 100%);
}

.page {
	min-height: 100dvh;
	width: 100%;
	max-width: 90rem;
	margin-inline: auto;
	padding: calc(var(--stack) * 1.5) var(--gutter) calc(var(--stack) * 2);
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--stack);
}

.intro,
.form {
	width: 100%;
	max-width: 30rem;
}

.intro {
	display: grid;
	gap: 0.5rem;
}

.lead {
	margin: 0;
	font-size: var(--size-lead);
	font-weight: 600;
	line-height: 1.25;
	color: var(--ink-muted);
}

.title {
	margin: 0;
	font-size: var(--size-title);
	font-weight: 700;
	font-stretch: 125%;
	line-height: 1.02;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.form {
	display: grid;
	gap: 1.125rem;
}

.field {
	display: grid;
	gap: 0.375rem;
}

label {
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.optional {
	font-weight: 400;
	color: var(--ink-muted);
}

input,
textarea {
	width: 100%;
	font: inherit;
	font-size: 1rem; /* 16px: iOS does not zoom on focus */
	color: var(--ink);
	background: var(--field);
	border: 1px solid var(--field-edge);
	border-radius: 0.375rem;
	padding: 0.75rem 0.875rem;
	transition:
		border-color 150ms ease,
		background-color 150ms ease;
}

textarea {
	resize: vertical;
	min-height: 8rem;
}

input:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--ball);
	outline-offset: 1px;
	border-color: transparent;
	background: rgb(255 255 255 / 0.13);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
	border-color: var(--error);
}

.trap {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.send {
	justify-self: start;
	margin-top: 0.375rem;
	font: inherit;
	font-weight: 700;
	font-stretch: 112%;
	color: var(--court);
	background: var(--ball);
	border: 0;
	border-radius: 0.375rem;
	padding: 0.875rem 1.5rem;
	min-height: 3rem;
	cursor: pointer;
	touch-action: manipulation;
	transition:
		transform 160ms var(--ease-out),
		filter 160ms ease;
}

.send:active {
	transform: scale(0.97);
}

.send:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 3px;
}

.send[disabled] {
	cursor: progress;
	filter: saturate(0.6) brightness(0.9);
}

@media (hover: hover) and (pointer: fine) {
	.send:hover:not([disabled]) {
		filter: brightness(1.06);
	}
}

.status {
	margin: 0;
	min-height: 1.5em;
	font-weight: 500;
}

.status[data-tone="ok"] {
	color: var(--ok);
}

.status[data-tone="error"] {
	color: var(--error);
}

.credit {
	position: fixed;
	right: var(--gutter);
	bottom: 0.75rem;
	margin: 0;
	font-size: 0.75rem;
	color: var(--ink-muted);
}

.credit a {
	color: inherit;
}

/* Phones: the form fills the width, so the wash darkens top to bottom
   instead of left to right, and the credit follows the form. */
@media (max-width: 47.99rem) {
	body::before {
		background: linear-gradient(180deg, rgb(8 20 48 / 0.62) 0%, rgb(8 20 48 / 0.86) 45%, rgb(8 20 48 / 0.92) 100%);
	}

	.page {
		min-height: auto;
		justify-content: flex-start;
	}

	.credit {
		position: static;
		padding: 0 var(--gutter) 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.send {
		transition: filter 160ms ease;
	}

	.send:active {
		transform: none;
	}
}
