/*
 * Links page: the phone-first link hub at /links/.
 *
 * Renders without the site header or footer, so this file owns the whole page
 * surface rather than slotting into the usual layout. It still reads from the
 * tokens in main.css, which loads first, so the brand stays in one place.
 *
 * Shape follows the theme rule: interactive things are full pill, surfaces are
 * 24px. Nothing here invents a third radius.
 */

.links-page {
	background:
		radial-gradient(120% 60% at 50% 0%, var(--tint) 0%, transparent 62%),
		var(--sand);

	/* Bottom padding clears the iOS home indicator on a short page. */
	padding: clamp(2rem, 7vh, 3.5rem) 1.25rem calc(2.5rem + env(safe-area-inset-bottom));
	min-height: 100dvh;
}

.links {
	display: grid;
	gap: 1.5rem;
	width: 100%;

	/* Roughly a phone's width. On a desktop it stays a card rather than
	   stretching into a layout the content cannot fill. */
	max-width: 27rem;
	margin-inline: auto;
}

.links__head {
	display: grid;
	justify-items: center;
	gap: 0.85rem;
	text-align: center;
}

.links__logo {
	display: block;
	width: min(15rem, 70%);
}

.links__logo img {
	width: 100%;
	height: auto;
}

.links__intro {
	margin: 0;
	max-width: 30ch;
	color: var(--muted);
	font-size: 0.98rem;
	line-height: 1.55;
}

/* The one surface on the page, so the form reads as the primary action. */
.links__card {
	padding: 1.5rem 1.35rem 1.25rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg);
	box-shadow: 0 10px 30px rgb(11 58 92 / 8%);
}

.links__title {
	margin: 0 0 1.1rem;
	color: var(--ink);
	font-size: 1.35rem;
	line-height: 1.25;
	text-align: center;
}

.links-form {
	display: grid;
	gap: 0.9rem;
}

.links-form__submit {
	width: 100%;

	/* Comfortably past the 44px minimum tap target, thumb-first. */
	min-height: 3rem;
	justify-content: center;
}

/* Submitting swaps the label for a pulse, so the button keeps its width and
   the layout does not jump while the request is in flight. */
.links-form__submit[aria-busy="true"] .links-form__label {
	opacity: 0.55;
}

.links-form__status {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.5;
	text-align: center;
}

/* Empty status text must not reserve a line, or the card grows on load. */
.links-form__status:empty {
	display: none;
}

.links-form__status[data-state="ok"] {
	color: #1a7f4b;
}

.links-form__status[data-state="error"] {
	color: #a3262c;
}

.links__legal {
	display: block;
	margin-top: 1rem;
	color: var(--muted);

	/* Attribution Google requires when the badge is hidden. Small, but it
	   still has to clear AA against the card, hence --muted not a lighter grey. */
	font-size: 0.72rem;
	line-height: 1.5;
	text-align: center;
}

.links__legal a {
	color: inherit;
}

.links__channels {
	display: grid;
	gap: 0.65rem;
}

.links__row {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	min-height: 3.25rem;
	padding: 0.75rem 1.25rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--bg);
	color: var(--ink);
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none;
	box-shadow: 0 2px 10px rgb(11 58 92 / 6%);
	transition: box-shadow 0.25s ease, transform 0.15s ease;
}

.links__row:hover {
	box-shadow: 0 6px 18px rgb(11 58 92 / 12%);
}

/* Presses down rather than lighting up: on a phone there is no hover state to
   inherit, so the press itself has to be the feedback. */
.links__row:active {
	transform: translateY(1px);
}

.links__icon {
	width: 24px;
	height: 24px;
	flex: none;
}

.links__row--whatsapp .links__icon {
	color: #25d366;
}

.links__row--facebook .links__icon {
	color: #1877f2;
}

.links__more {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem 1.25rem;
	padding-top: 0.25rem;
}

.links__more a {
	padding: 0.35rem 0;
	color: var(--muted);
	font-size: 0.9rem;
	text-decoration: none;
}

.links__more a:hover,
.links__more a:focus-visible {
	color: var(--accent);
	text-decoration: underline;
}

/*
 * Entry motion. Sequenced top to bottom so the eye is walked from the logo to
 * the form rather than everything arriving at once. Short, and only on load.
 */
@media (prefers-reduced-motion: no-preference) {
	.links > * {
		animation: links-rise 0.5s var(--ease-out) backwards;
	}

	.links > *:nth-child(2) {
		animation-delay: 0.06s;
	}

	.links > *:nth-child(3) {
		animation-delay: 0.12s;
	}

	.links > *:nth-child(4) {
		animation-delay: 0.18s;
	}

	@keyframes links-rise {
		from {
			opacity: 0;
			transform: translateY(10px);
		}
	}
}
