/*
 * The marketing site (JOR-537). The app's own colours: Nightsky by default, Daylight when the
 * device asks for light. The system font stack only: nothing loads from anyone else.
 */

:root {
	--bg: #0b1026;
	--surface: #12172e;
	--surface-2: #1c2340;
	--text: #e7eaf6;
	--muted: #a7afcb;
	--line: #2c3358;
	--line-strong: #4a5178;
	--primary: #6ec6ff;
	--on-primary: #00293b;
	--accent: #ffb84d;
	--danger: #ffb4ab;
	--inbox: #6c63ff;
	--today: #2e9e6b;
	--week: #d98e2b;
	--backlog: #8a8f98;
	--amber: #d9a62b;
	--shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 40px rgba(0, 0, 0, 0.35);

	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--unit: 8px;
	--radius: 14px;
	--max: 1120px;
	--read: 68ch;
	color-scheme: dark;
}

@media (prefers-color-scheme: light) {
	:root {
		--bg: #f5f7fc;
		--surface: #ffffff;
		--surface-2: #e4e8f3;
		--text: #1a1d2b;
		--muted: #4a5069;
		--line: #cdd2e0;
		--line-strong: #7a8099;
		--primary: #1f6fb2;
		--on-primary: #ffffff;
		--accent: #b35f12;
		--danger: #ba1a1a;
		--shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 12px 32px rgba(26, 29, 43, 0.12);
		color-scheme: light;
	}
}

* {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 17px/1.6 var(--font);
}

img,
svg {
	display: block;
	max-width: 100%;
}

a {
	color: var(--primary);
	text-underline-offset: 3px;
}

h1,
h2,
h3 {
	line-height: 1.2;
	margin: 0 0 calc(var(--unit) * 2);
	letter-spacing: -0.01em;
}

h1 {
	font-size: clamp(2.1rem, 5vw, 3.4rem);
}

h2 {
	font-size: clamp(1.5rem, 3vw, 2.1rem);
}

h3 {
	font-size: 1.15rem;
}

p {
	margin: 0 0 calc(var(--unit) * 2);
}

.wrap {
	max-width: var(--max);
	margin: 0 auto;
	padding: 0 calc(var(--unit) * 2.5);
}

.muted {
	color: var(--muted);
}

.lead {
	font-size: 1.2rem;
	color: var(--muted);
	max-width: var(--read);
}

.eyebrow {
	color: var(--accent);
	font-weight: 700;
	font-size: 0.9rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-bottom: var(--unit);
}

.skip {
	position: absolute;
	left: -999px;
}

.skip:focus {
	left: 16px;
	top: 16px;
	z-index: 10;
	background: var(--surface);
	padding: 8px 12px;
	border-radius: 8px;
}

/* ---- Header and menu ------------------------------------------------------------------ */

.site-header {
	position: sticky;
	top: 0;
	z-index: 5;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
}

.site-header .wrap {
	display: flex;
	align-items: center;
	gap: calc(var(--unit) * 2);
	min-height: 64px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
	text-decoration: none;
	font-weight: 800;
	font-size: 1.15rem;
	margin-right: auto;
}

.brand-mark {
	width: 30px;
	height: 30px;
	flex: none;
	border-radius: 7px;
	box-shadow: 0 0 0 1px var(--line);
}

.btn {
	white-space: nowrap;
}

/* On a phone the menu holds the waitlist link; the header keeps its room for the name. */
@media (max-width: 520px) {
	.site-header .header-join {
		display: none;
	}
}

.menu {
	position: relative;
}

.menu summary {
	list-style: none;
	cursor: pointer;
	padding: 8px 12px;
	border-radius: 999px;
	border: 1px solid var(--line-strong);
	font-weight: 600;
}

.menu summary::-webkit-details-marker {
	display: none;
}

.menu nav {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	display: flex;
	flex-direction: column;
	min-width: 220px;
	padding: 8px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.menu nav a {
	color: var(--text);
	text-decoration: none;
	padding: 10px 12px;
	border-radius: 8px;
}

.menu nav a:hover,
.menu nav a[aria-current="page"] {
	background: var(--surface-2);
}

.menu nav a[aria-current="page"] {
	font-weight: 700;
}

.nav-wide {
	display: none;
}

/* Wide screens: the pages in the header itself; the Menu button only on narrow ones. */
@media (min-width: 1060px) {
	.menu {
		display: none;
	}

	.nav-wide {
		display: flex;
		gap: 2px;
	}

	.nav-wide a {
		white-space: nowrap;
		padding: 8px 10px;
		border-radius: 8px;
		font-size: 0.95rem;
		color: var(--muted);
		text-decoration: none;
	}

	.nav-wide a:hover {
		color: var(--text);
	}

	.nav-wide a[aria-current="page"] {
		color: var(--text);
		font-weight: 700;
	}
}

/* ---- Buttons ---------------------------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 22px;
	border-radius: 999px;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	border: 0;
	cursor: pointer;
}

.btn-primary {
	background: var(--primary);
	color: var(--on-primary);
}

.btn-text {
	background: none;
	color: var(--primary);
	padding: 0 8px;
}

.btn-small {
	min-height: 40px;
	padding: 0 16px;
	font-size: 0.95rem;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: calc(var(--unit) * 1.5);
	margin-top: calc(var(--unit) * 3);
}

/* ---- Sections --------------------------------------------------------------------------- */

section {
	padding: calc(var(--unit) * 9) 0;
	/* Clear of the sticky header when a link jumps to a section. */
	scroll-margin-top: 64px;
}

section + section {
	border-top: 1px solid var(--line);
}

.hero {
	padding-top: calc(var(--unit) * 8);
}

.hero-grid,
.split {
	display: grid;
	gap: calc(var(--unit) * 6);
	align-items: center;
}

@media (min-width: 900px) {
	.hero-grid {
		grid-template-columns: 1.1fr 0.9fr;
	}

	.split {
		grid-template-columns: 1fr 1fr;
	}

	.split.flip > :first-child {
		order: 2;
	}
}

.slogan {
	color: var(--accent);
	font-weight: 800;
	font-size: clamp(1.2rem, 2.4vw, 1.5rem);
	margin-bottom: calc(var(--unit) * 1.5);
}

.grid {
	display: grid;
	gap: calc(var(--unit) * 2.5);
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	margin-top: calc(var(--unit) * 4);
}

.tile {
	display: block;
	padding: calc(var(--unit) * 3);
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--line);
	color: var(--text);
	text-decoration: none;
}

a.tile:hover {
	border-color: var(--line-strong);
}

.tile h3 {
	margin-bottom: var(--unit);
}

.tile p {
	color: var(--muted);
	margin: 0;
}

.tile .more {
	display: inline-block;
	margin-top: calc(var(--unit) * 1.5);
	color: var(--primary);
	font-weight: 600;
}

.tile .icon {
	width: 32px;
	height: 32px;
	margin-bottom: calc(var(--unit) * 1.5);
	color: var(--accent);
}

/* The four steps, each in its list's colour. */
.steps {
	list-style: none;
	margin: calc(var(--unit) * 4) 0 0;
	padding: 0;
	display: grid;
	gap: calc(var(--unit) * 2);
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	counter-reset: step;
}

.steps li {
	counter-increment: step;
	padding: calc(var(--unit) * 2.5);
	border-radius: var(--radius);
	background: var(--surface);
	border-left: 4px solid var(--c, var(--primary));
}

.steps li strong {
	display: block;
	margin-bottom: 6px;
}

.steps li strong::before {
	content: counter(step) ". ";
	color: var(--c, var(--primary));
}

.steps li span {
	color: var(--muted);
}

/* A feature with its example: text on one side, the mock-up on the other. */
.feature h2 {
	margin-bottom: calc(var(--unit) * 1.5);
}

.feature ul,
.checks {
	padding-left: 0;
	list-style: none;
	margin: 0 0 calc(var(--unit) * 2);
}

.feature li,
.checks li {
	position: relative;
	padding-left: 28px;
	margin-bottom: 10px;
}

.feature li::before,
.checks li::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 0.55em;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--primary);
}

.example {
	margin: calc(var(--unit) * 2) 0 0;
	padding: calc(var(--unit) * 2) calc(var(--unit) * 2.5);
	border-radius: var(--radius);
	background: var(--surface-2);
	font-size: 0.97rem;
}

.example strong {
	color: var(--accent);
}

.toc {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: calc(var(--unit) * 3);
	padding: 0;
	list-style: none;
}

.toc a {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	border: 1px solid var(--line-strong);
	color: var(--text);
	text-decoration: none;
	font-size: 0.95rem;
}

.note {
	font-size: 0.92rem;
	color: var(--muted);
}

.badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 700;
	background: var(--surface-2);
	color: var(--accent);
	vertical-align: middle;
	margin-left: 6px;
}

.cta {
	text-align: center;
}

.cta .lead {
	margin-left: auto;
	margin-right: auto;
}

.cta .actions {
	justify-content: center;
}

.faq details {
	border-bottom: 1px solid var(--line);
	padding: calc(var(--unit) * 2) 0;
	max-width: 80ch;
}

.faq summary {
	cursor: pointer;
	font-weight: 700;
	font-size: 1.08rem;
}

.faq details p {
	margin: calc(var(--unit) * 1.5) 0 0;
	color: var(--muted);
}

.prose {
	max-width: var(--read);
}

.prose h2 {
	margin-top: calc(var(--unit) * 5);
}

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

.site-footer {
	border-top: 1px solid var(--line);
	padding: calc(var(--unit) * 5) 0;
	color: var(--muted);
	font-size: 0.95rem;
}

.site-footer .wrap {
	display: grid;
	gap: calc(var(--unit) * 3);
}

@media (min-width: 800px) {
	.site-footer .wrap {
		grid-template-columns: 1.2fr 2fr;
	}
}

.footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
}

.footer-links a {
	color: var(--muted);
}

/* ---- Screenshots: the real app in demo mode, a made-up household (shots.mjs) ------------- */

.shot {
	margin: 0 auto;
}

.shot img {
	display: block;
	width: 100%;
	height: auto;
	background: #0b1026;
}

/* A phone: the screen with rounded corners in a thin dark bezel. */
.shot-phone {
	width: min(330px, 100%);
	padding: 10px;
	border-radius: 44px;
	background: #05070f;
	border: 1px solid #262c4a;
	box-shadow: var(--shadow);
}

.shot-phone img {
	border-radius: 34px;
}

/* A laptop screen and the kitchen wall: a wide screen with a dark frame. */
.shot-laptop,
.shot-wall {
	width: 100%;
	padding: 8px;
	border-radius: 16px;
	background: #05070f;
	border: 1px solid #262c4a;
	box-shadow: var(--shadow);
}

.shot-laptop img,
.shot-wall img {
	border-radius: 9px;
}

.shot-wall {
	border-width: 6px;
	border-color: #11152a;
}

/* ---- The waitlist form (the design framework's form) ------------------------------------- */

.form {
	max-width: 640px;
}

.field {
	margin-bottom: calc(var(--unit) * 3);
}

.field label,
.field legend {
	display: block;
	font-weight: 700;
	margin-bottom: 6px;
}

.field .help {
	display: block;
	color: var(--muted);
	font-size: 0.92rem;
	margin-bottom: 8px;
}

.field input[type="email"],
.field input[type="text"],
.field textarea {
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	font: inherit;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--line-strong);
	border-radius: 10px;
}

.field textarea {
	min-height: 110px;
	resize: vertical;
}

.field input:focus,
.field textarea:focus {
	outline: 2px solid var(--primary);
	outline-offset: 1px;
}

.field fieldset {
	border: 0;
	padding: 0;
	margin: 0;
}

.options {
	display: grid;
	gap: 8px;
}

.options label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 500;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--surface);
	border: 1px solid var(--line);
	cursor: pointer;
	margin: 0;
}

.options input {
	width: 18px;
	height: 18px;
	accent-color: var(--primary);
}

/* Error lines keep their space, so nothing shifts when they come or go. */
.error {
	display: block;
	min-height: 1.5em;
	margin-top: 6px;
	color: var(--danger);
	font-size: 0.92rem;
}

.field.invalid input,
.field.invalid textarea {
	border-color: var(--danger);
}

.form-status {
	min-height: 1.6em;
	margin-top: calc(var(--unit) * 2);
}

.notice {
	padding: calc(var(--unit) * 2) calc(var(--unit) * 2.5);
	border-radius: var(--radius);
	background: var(--surface-2);
	border-left: 4px solid var(--accent);
	margin-bottom: calc(var(--unit) * 3);
}

.hp {
	position: absolute;
	left: -5000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
