/* Mirrors the Listen & Repeat landing page (listen-and-repeat-web/src/App.tsx). */

:root {
	--duo-green: #58cc02;
	--duo-blue: #1cb0f6;
	--font-sans: "Nunito", "M PLUS Rounded 1c", ui-rounded, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic",
		system-ui, sans-serif;

	font-family: var(--font-sans);
	color: #3c3c3c;
	background: #ffffff;
	font-synthesis: none;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

* {
	box-sizing: border-box;
}

html,
body {
	min-width: 320px;
	margin: 0;
	background: #ffffff;
}

/*
 * The halo is wider than small screens. Setting overflow on html keeps body's
 * value from being handed to the viewport, so body really clips the halo and
 * phones do not widen the page. Vertical scrolling is unaffected.
 */
html {
	overflow-x: hidden;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100svh;
	overflow-x: hidden; /* fallback for Safari < 16 */
	overflow-x: clip;
}

::selection {
	background: rgba(28, 176, 246, 0.2);
}

img,
svg {
	display: block;
}

/* ---------- Nav ---------- */

.site-nav {
	z-index: 10;
	display: flex;
	width: 100%;
	max-width: 1280px;
	margin: 0 auto;
	padding: 24px;
	align-items: center;
	justify-content: space-between;
}

.brand {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #3c3c3c;
	text-decoration: none;
}

.brand img {
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	border-radius: 12px;
	object-fit: cover;
}

.brand span {
	color: var(--duo-green);
	font-size: 1.5rem;
	font-weight: 900;
	letter-spacing: -0.025em;
	line-height: 1;
}

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

.hero {
	display: grid;
	width: 100%;
	max-width: 1280px;
	flex: 1;
	grid-template-columns: 1fr;
	align-items: center;
	gap: 48px;
	margin: 0 auto;
	padding: 32px 24px;
	text-align: center;
}

.hero-copy {
	display: flex;
	min-width: 0;
	flex-direction: column;
	align-items: center;
	gap: clamp(28px, 4vw, 40px);
}

.copy-stack {
	display: grid;
	justify-items: center;
}

.copy-stack h1 {
	max-width: 680px;
	margin: 0;
	font-size: clamp(2rem, 8.75vw, 3.75rem);
	font-weight: 900;
	letter-spacing: -0.025em;
	line-height: 1.2;
}

.copy-stack h1 .accent {
	color: var(--duo-green);
}

.hero-line {
	display: block;
}

.hero-answer {
	margin-top: 0.45em;
}

/* ---------- Store buttons ---------- */

.store-actions {
	display: flex;
	width: 100%;
	max-width: 540px;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

.store-button {
	position: relative;
	display: flex;
	width: 100%;
	height: 62px;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 16px 24px;
	border: 1px solid #d8d8d8;
	border-bottom-width: 4px;
	border-radius: 16px;
	background: #ffffff;
	color: #111111;
	font-size: 0.875rem;
	font-weight: 900;
	letter-spacing: 0.025em;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
	box-shadow: 0 8px 24px -18px rgba(0, 0, 0, 0.35);
	transition: all 150ms ease;
}

.store-button:hover {
	background: #fafafa;
}

.store-button:active {
	border-bottom-width: 2px;
	transform: translateY(2px);
}

.store-button[hidden] {
	display: none;
}

.store-button svg {
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	margin-bottom: 4px;
	fill: currentColor;
}

.store-button img {
	width: 28px;
	height: 28px;
	flex-shrink: 0;
}

/* ---------- Phone preview ---------- */

.device-stage {
	position: relative;
	display: grid;
	min-height: 560px;
	place-items: center;
	padding-block: 16px;
}

.device-halo {
	position: absolute;
	width: min(140%, 560px);
	aspect-ratio: 1;
	border-radius: 999px;
	background: rgba(28, 176, 246, 0.07);
}

.phone-frame {
	--phone-bezel: 9px;
	--phone-radius: 15.5%;

	position: relative;
	z-index: 10;
	width: min(78vw, 320px);
	padding: var(--phone-bezel);
	border: 1px solid #e5e5e5;
	border-radius: var(--phone-radius) / 7.5%;
	background: #f7f7f7;
	box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.16);
	transition: transform 500ms ease;
}

.phone-frame:hover {
	transform: scale(1.02);
}

.phone-screen {
	width: 100%;
	aspect-ratio: 1320 / 2804;
	overflow: hidden;
	border-radius: 13.5% / 6.35%;
	background: #ffffff;
}

.phone-screen img {
	width: 100%;
	height: auto;
}

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

.site-footer {
	width: 100%;
	padding: 40px 24px 48px;
	color: #707070;
	font-size: 0.75rem;
	font-weight: 900;
	letter-spacing: 0.2em;
	line-height: 1.375;
	text-align: center;
	text-transform: uppercase;
}

.footer-links {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.footer-links a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: #d8d8d8;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
	transition: color 150ms ease;
}

.footer-links a:hover {
	color: #3c3c3c;
}

/* ---------- Support / Privacy ---------- */

.page {
	width: 100%;
	max-width: 896px;
	flex: 1;
	margin: 0 auto;
	padding: 48px 24px;
}

.page-card {
	display: grid;
	gap: 32px;
	padding: 32px;
	border: 2px solid #eeeeee;
	border-radius: 2rem;
	background: #ffffff;
	text-align: center;
}

.page h1 {
	margin: 0;
	font-size: 2.25rem;
	font-weight: 900;
	letter-spacing: -0.025em;
	line-height: 1.25;
}

.page p {
	margin: 16px 0 0;
	color: #666666;
	font-size: 1rem;
	font-weight: 700;
	line-height: 2;
}

.page-button {
	display: inline-flex;
	justify-self: center;
	padding: 16px 24px;
	border-radius: 16px;
	background: var(--duo-green);
	color: #ffffff;
	font-size: 1rem;
	font-weight: 900;
	text-decoration: none;
	transition: all 150ms ease;
}

.page-button:hover {
	filter: brightness(1.03);
}

.page-button:active {
	transform: translateY(2px);
}

/* ---------- Privacy policy ---------- */

.privacy-policy {
	display: grid;
	gap: 40px;
}

.policy-header {
	display: grid;
	gap: 16px;
	padding-bottom: 32px;
	border-bottom: 2px solid #eeeeee;
}

.policy-section {
	display: grid;
	gap: 16px;
}

.privacy-policy h2,
.privacy-policy h3 {
	margin: 0;
	font-weight: 900;
	line-height: 1.25;
}

.privacy-policy h2 {
	font-size: 1.5rem;
}

.privacy-policy h3 {
	font-size: 1.125rem;
}

.privacy-policy p,
.privacy-policy ul {
	margin: 0;
	color: #666666;
	font-size: 1rem;
	font-weight: 700;
	line-height: 2;
}

.privacy-policy ul {
	display: grid;
	gap: 8px;
	padding-left: 24px;
}

.privacy-policy a {
	color: #0877a8;
	font-weight: 900;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
	overflow-wrap: anywhere;
}

.privacy-policy a:hover {
	color: #075579;
}

/* ---------- Breakpoints (Tailwind sm / md / lg) ---------- */

@media (min-width: 640px) {
	.store-actions {
		flex-direction: row;
	}

	.store-button {
		width: auto;
		min-width: 0;
		flex: 1;
	}

	.footer-links {
		flex-direction: row;
		gap: 20px;
	}
}

@media (min-width: 768px) {
	.brand {
		gap: 12px;
	}

	.brand span {
		font-size: 1.875rem;
	}

	.store-button {
		font-size: clamp(0.875rem, 1.25vw, 1rem);
	}

	.page-card {
		padding: 48px;
	}

	.page h1 {
		font-size: 3rem;
	}
}

@media (min-width: 1024px) {
	.site-nav {
		padding: 32px 64px;
	}

	.hero {
		grid-template-columns: minmax(0, 1fr) minmax(280px, 0.85fr);
		gap: 96px;
		padding: 24px 64px 64px;
		text-align: left;
	}

	.hero-copy {
		align-items: flex-start;
	}

	.copy-stack {
		justify-items: start;
	}

	.copy-stack h1 {
		font-size: clamp(2.75rem, 4.5vw, 3.75rem);
	}

	.device-stage {
		min-height: 0;
		padding-block: 0;
	}

	/* Fit the prepared screenshot and bezel below the nav, with a 240px minimum width. */
	.phone-frame {
		width: min(100%, 320px, max(240px, calc((100svh - 240px) * 1320 / 2804 + 20px)));
	}

	.device-halo {
		width: min(120%, 520px, max(400px, calc((100svh - 220px) * 1.1)));
	}

	.page {
		padding: 80px 64px;
	}
}
