/*
 * Inbox & Chill — inboxandchill.app
 *
 * Tokens come from docs/brand/STYLE-GUIDE.md in the Mac app repo:
 * plum ground, cream text, one warm amber note. Change the brand there first,
 * then bring it here.
 *
 * Amber discipline: --warm / dark-mode --accent is the only saturated colour in
 * the system. If two things are amber in one viewport, one of them is wrong —
 * which is why the page has exactly one filled button, the hero's download CTA.
 *
 * The style guide says the OS picks the scheme and there is no toggle, so both
 * palettes are declared under color-scheme and dark reads prefers-color-scheme.
 */

:root {
	color-scheme: light dark;

	--ground: #f7f5f0;
	--raised: #ffffff;
	--text: #200220;
	--text-dim: #6e5f6e;
	--border: #e2dcd4;
	--accent: #2a0b2a;
	--on-accent: #f7f5f0;
	--warm: #e8a33d;
	--link: #1565c0;

	/* Geometry: pill controls, 1.25rem panels, 0.625rem chips. */
	--r-pill: 100vmax;
	--r-panel: 1.25rem;
	--r-sm: 0.625rem;

	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--wrap: 70rem;
	--gap-section: clamp(3.5rem, 8vw, 6rem);
}

@media (prefers-color-scheme: dark) {
	:root {
		--ground: #190118;
		--raised: #2a0b2a;
		--text: #f5f4f0;
		--text-dim: #b3a6b3;
		--border: #3a203a;
		--accent: #e8a33d;
		--on-accent: #190118;
		--warm: #e8a33d;
		--link: #8e93ae;
	}
}

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

body {
	margin: 0;
	background: var(--ground);
	color: var(--text);
	font-family: "SN Pro", system-ui, -apple-system, sans-serif;
	font-size: clamp(1rem, 0.96rem + 0.22vi, 1.125rem);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
	font-weight: 500;
	letter-spacing: -0.025em;
	line-height: 1.15;
	text-wrap: balance;
	margin: 0;
}

h1 {
	font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.5rem);
	max-width: 22ch;
}

h2 {
	font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
	max-width: 24ch;
}

/* "Supports 10 sources (+ more to come)" is longer than the 24ch other
   headings stay under — give it room to sit on one line instead of wrapping. */
.h2-nowrap {
	max-width: none;
}

h3 {
	font-size: 1rem;
	letter-spacing: 0;
}

p {
	margin: 0;
	max-width: 62ch;
}

a {
	color: var(--link);
	text-underline-offset: 0.2em;
}

a:hover {
	text-decoration-thickness: 2px;
}

code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.875em;
	background: color-mix(in oklab, var(--text) 7%, transparent);
	border-radius: 0.3em;
	padding: 0.1em 0.35em;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 2px;
}

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

.skip:focus {
	left: 1rem;
	top: 1rem;
	z-index: 10;
	background: var(--raised);
	padding: 0.6rem 1rem;
	border-radius: var(--r-sm);
}

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

/* ---------- Header ---------- */

.site-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-block: 1.5rem;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--text);
	text-decoration: none;
	font-weight: 500;
}

.brand img {
	border-radius: 0.45rem;
}

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

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* Pill controls, and a target comfortably over the 24pt minimum. */
	border-radius: var(--r-pill);
	background: var(--accent);
	color: var(--on-accent);
	border: 1px solid var(--accent);
	padding: 0.8rem 1.6rem;
	font: inherit;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.btn:hover {
	background: color-mix(in oklab, var(--accent) 88%, var(--ground));
	border-color: color-mix(in oklab, var(--accent) 88%, var(--ground));
}

.btn:active {
	transform: translateY(1px);
}

/* ---------- Layout rhythm ---------- */

main {
	display: flex;
	flex-direction: column;
	gap: var(--gap-section);
	padding-block: clamp(2rem, 5vw, 3.5rem) var(--gap-section);
}

main > section {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.prose {
	gap: 1rem;
}

.dim {
	color: var(--text-dim);
}

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

/*
 * Two columns once there's room. The screenshot is the menu bar panel, which is
 * portrait (956x1237) — full-bleed it would tower over the copy, so it gets a
 * fixed-ish column beside the hero rather than a row of its own.
 */
.hero-grid {
	display: flex;
	flex-direction: column;
	gap: var(--gap-section);
}

@media (min-width: 60rem) {
	.hero-grid {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 21rem);
		align-items: start;
		gap: 3.5rem;
	}

	.hero-grid .hero {
		padding-top: 0.5rem;
	}
}

.hero {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.lede {
	font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.375rem);
	color: var(--text-dim);
	max-width: 54ch;
}

.cta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.75rem;
	padding-top: 0.25rem;
}

.meta {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.8125rem;
	color: var(--text-dim);
	letter-spacing: -0.01em;
}

.fine {
	font-size: 0.8125rem;
	color: var(--text-dim);
}

/* ---------- Signup sheet ---------- */

/*
 * The email ask is a dialog rather than a field in the hero, so the page keeps
 * exactly one call to action. Two ways in: showModal() when there's JS, and
 * :target when there isn't — a plain #hash link opens it either way, so the
 * download is never behind a script.
 */
.sheet {
	border: 0;
	padding: 0;
	background: none;
	color: inherit;
	max-width: min(32rem, 92vw);
}

.sheet::backdrop {
	background: color-mix(in oklab, #190118 72%, transparent);
}

/* No-JS: :target has to build its own backdrop and centring, since nothing
   here is a real modal without showModal(). */
.sheet:target {
	display: flex;
	align-items: center;
	justify-content: center;
	position: fixed;
	inset: 0;
	z-index: 20;
	max-width: none;
	width: 100%;
	height: 100%;
	background: color-mix(in oklab, #190118 72%, transparent);
}

.sheet-panel {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.9rem;
	width: min(32rem, 92vw);
	background: var(--raised);
	border: 1px solid var(--border);
	border-radius: var(--r-panel);
	padding: clamp(1.5rem, 4vw, 2rem);
}

.sheet-panel p {
	color: var(--text-dim);
}

/* Field over button, both full width. Side by side never fits inside a panel
   this narrow without squeezing the field down to a slot nobody can read an
   address in. */
.sheet-row {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	width: 100%;
}

/* flex: none matters — .field's `flex: 1 1 16rem` basis would be read as a
   height in this column, giving a 256px-tall email box. */
.sheet-row .field,
.sheet-row .btn {
	flex: none;
	width: 100%;
	max-width: none;
}

.sheet-foot {
	color: var(--text-dim);
	font-size: 0.9375rem;
}

.field {
	font: inherit;
	font-size: 1rem;
	color: var(--text);
	background: var(--raised);
	border: 1px solid var(--border);
	border-radius: var(--r-pill);
	padding: 0.8rem 1.2rem;
	min-width: 16rem;
	flex: 1 1 16rem;
	max-width: 22rem;
}

.field::placeholder {
	color: var(--text-dim);
}

.field:user-invalid {
	border-color: color-mix(in oklab, var(--warm) 70%, var(--border));
}

/* Netlify's honeypot: a real field, hidden from people and from the a11y tree,
   left empty by everyone except bots. */
.hp {
	position: absolute;
	left: -9999px;
}

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

/* ---------- Screenshot ---------- */

.shot {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.shot img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--border);
	border-radius: var(--r-panel);
}

/* ---------- Band (raised panel) ---------- */

.band {
	background: var(--raised);
	border: 1px solid var(--border);
	border-radius: var(--r-panel);
	padding: clamp(1.75rem, 4vw, 2.75rem);
	gap: 1rem;
}

.band p {
	color: var(--text-dim);
}

.band h2 + p {
	margin-top: 0.25rem;
}

/* ---------- Sources ---------- */

.sources {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 0;
	border-top: 1px solid var(--border);
}

.sources li {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 1rem 1.25rem 1.1rem 0;
	border-bottom: 1px solid var(--border);
}

.sources p {
	font-size: 0.9375rem;
	color: var(--text-dim);
}

/* ---------- Keyboard ---------- */

.keys {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem 1.75rem;
	font-size: 0.9375rem;
	color: var(--text-dim);
}

.keys li {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
}

.key-combo {
	display: inline-flex;
	gap: 0.25rem;
}

/* Keyboard shortcuts are a core feature of the app, so the page renders them
   as real keys rather than plain text. */
kbd {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.8125em;
	line-height: 1.4;
	min-width: 1.85em;
	padding: 0.15em 0.4em;
	color: var(--text);
	background: var(--raised);
	border: 1px solid var(--border);
	border-radius: 0.4rem;
	box-shadow: 0 1px 0 var(--border);
}

/* ---------- Facts ---------- */

.facts {
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
	gap: 1.75rem 2.5rem;
}

.facts > div {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.facts dt {
	font-weight: 500;
}

.facts dd {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--text-dim);
}

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

.site-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	padding-block: 1.75rem 3rem;
	border-top: 1px solid var(--border);
	font-size: 0.875rem;
	color: var(--text-dim);
}

.site-foot nav {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
}

/*
 * The style guide allows hover and active transitions only: no entrance
 * animation, no scroll animation, no parallax.
 */
@media (prefers-reduced-motion: no-preference) {
	a,
	.btn {
		transition:
			background-color 150ms var(--ease),
			border-color 150ms var(--ease),
			color 150ms var(--ease),
			transform 150ms var(--ease);
	}
}

/* ---------- Legal pages (/terms, /privacy) ---------- */

.legal {
	max-width: 44rem;
	display: block;
	padding-block: clamp(1.5rem, 4vw, 2.5rem) var(--gap-section);
}

.legal h1 {
	max-width: none;
	font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
}

.legal h2 {
	max-width: none;
	font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
	margin-top: 2.5rem;
}

.legal h2 + p,
.legal h2 + ul {
	margin-top: 0.75rem;
}

.legal p,
.legal li {
	max-width: none;
}

.legal p + p,
.legal ul + p,
.legal p + ul {
	margin-top: 0.9rem;
}

.legal ul {
	margin: 0;
	padding-left: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.legal-meta {
	margin-top: 0.75rem;
	color: var(--text-dim);
	font-size: 0.9375rem;
}

/* The plain-English summary each document opens with. */
.legal-summary {
	margin-top: 2rem;
	background: var(--raised);
	border: 1px solid var(--border);
	border-radius: var(--r-panel);
	padding: clamp(1.25rem, 3vw, 1.75rem);
}

.legal-summary p {
	color: var(--text-dim);
}

.legal-summary > :first-child {
	margin-top: 0;
}
