/* The Sync Haven home page, in the noahlampert.com look: a deep plum night, cream type,
   Fraunces headings, mono labels and one accent colour per product.
   The product pages keep their own look in style.css. */
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-latin-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url("fonts/martian-mono-var.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
	--bg: #12060d;
	--card: #1f0d18;
	--card-2: #2a1321;
	--line: rgba(251, 241, 208, .13);
	--line-2: rgba(251, 241, 208, .26);
	--text: #fbf1d0;
	--soft: #d2bfb4;   /* 10:1 on --bg */
	--dim: #a8919a;    /* 6:1 on --bg, small labels only */
	--butter: #fff393;
	--coral: #ff6b6f;
	--blue: #6ab4e6;
	--green: #a9d655;
	--orange: #fbb040;
	--violet: #dc8fca;
	--acc: var(--butter);
	--display: "Fraunces", Georgia, "Times New Roman", serif;
	--sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
	--max: 1200px;
	--gutter: clamp(16px, 4vw, 44px);
	--radius: 1.375rem;
	--ease: cubic-bezier(.2, .7, .2, 1);
}
[data-acc="orange"] { --acc: var(--orange); }
[data-acc="violet"] { --acc: var(--violet); }
[data-acc="green"] { --acc: var(--green); }
[data-acc="coral"] { --acc: var(--coral); }

*, *::before, *::after { box-sizing: border-box; }
html {
	scroll-behavior: smooth; -webkit-text-size-adjust: 100%; color-scheme: dark;
	scrollbar-color: #5b2c42 var(--bg);
	background:
		radial-gradient(1100px 700px at 85% -100px, rgba(197, 109, 176, .22), transparent 60%),
		radial-gradient(900px 600px at -10% 300px, rgba(255, 90, 95, .1), transparent 60%),
		var(--bg);
}
body {
	margin: 0; color: var(--text);
	font: 400 1.0625rem/1.6 var(--sans);
	-webkit-font-smoothing: antialiased; overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; font-variation-settings: "opsz" 144; letter-spacing: -.025em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
::selection { background: var(--butter); color: var(--bg); }
:focus-visible { outline: 2px solid var(--butter); outline-offset: 3px; border-radius: 6px; }
main, .nav > div, footer > div { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
section[id] { scroll-margin-top: 80px; }

/* nav */
.nav {
	position: sticky; top: 0; z-index: 10;
	background: rgba(18, 6, 13, .72);
	-webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
	border-bottom: 1px solid var(--line);
}
.nav > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 3.75rem; }
.mark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-family: var(--display); font-weight: 600; font-size: 1.1875rem; letter-spacing: -.01em; white-space: nowrap; }
.mark svg { width: 26px; height: 26px; border-radius: 7px; }
.nav nav { display: flex; gap: 2px; }
.nav nav a {
	display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 999px;
	font: 400 .6875rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--soft);
	transition: color .2s ease, background .2s ease;
}
.nav nav a:hover { color: var(--text); background: rgba(251, 241, 208, .08); }

/* hero */
.studio-hero { padding-block: clamp(48px, 9vw, 112px) clamp(48px, 8vw, 96px); }
.studio-hero h1 {
	font-size: clamp(3.25rem, 12vw, 7.5rem); font-weight: 700; line-height: .9; letter-spacing: -.045em;
	max-width: 9ch; margin-left: -.04em;
}
.studio-hero h1 span {
	background: linear-gradient(100deg, var(--coral), var(--orange) 45%, var(--butter));
	-webkit-background-clip: text; background-clip: text; color: transparent;
	padding-bottom: .12em; /* room for the descenders under the clip */
}
.lede { font-size: clamp(1.125rem, 1.7vw, 1.3125rem); line-height: 1.55; color: var(--soft); max-width: 30em; margin-top: clamp(18px, 2.4vw, 28px); }

/* products */
.catalog { padding-bottom: clamp(64px, 9vw, 120px); }
.catalog h2, .signup h2 { font-size: clamp(2.5rem, 6.4vw, 4.5rem); line-height: .98; }
.catalog h2 { margin-bottom: clamp(22px, 3.4vw, 36px); }
.products { display: grid; gap: 14px; }
.product {
	position: relative; isolation: isolate; overflow: hidden; min-width: 0;
	display: flex; flex-direction: column;
	background: linear-gradient(180deg, var(--card-2), var(--card));
	border: 1px solid var(--line); border-radius: var(--radius);
	transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.product:hover { border-color: color-mix(in srgb, var(--acc) 60%, transparent); transform: translateY(-3px); box-shadow: 0 24px 50px -30px var(--acc); }
.product:focus-visible { border-radius: var(--radius); }
/* The screenshots each come on their own dark grey. Blended (lighten) onto the card and faded at
   the edges, the grey drops away and the device sits in the card's own light. */
.shot {
	aspect-ratio: 16 / 9; overflow: hidden;
	background: radial-gradient(70% 90% at 50% 55%, color-mix(in srgb, var(--acc) 20%, var(--card-2)), var(--card-2) 75%);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(transparent, #000 8%, #000 86%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(transparent, #000 8%, #000 86%, transparent);
	-webkit-mask-composite: source-in; mask-composite: intersect;
}
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: lighten; transition: transform .6s var(--ease); }
.product:hover .shot img { transform: scale(1.04); }
/* the Chopsmith device is a wide strip, so a small tile zooms into its waveform */
.feature .shot img, .feature:hover .shot img { transform: scale(1.75); }
.body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: clamp(18px, 2.4vw, 26px); padding-top: 6px; }
.tag { font: 500 .6875rem/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc); }
.product h3 { font-size: 1.75rem; line-height: 1.1; letter-spacing: -.02em; }
.product p { color: var(--soft); font-size: 1rem; line-height: 1.5; }
.price { padding-top: 6px; font: 400 .75rem/1.5 var(--mono); letter-spacing: .03em; color: var(--text); }
.cta { margin-top: auto; padding-top: 14px; font: 500 .6875rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--acc); }
.cta b { display: inline-block; font-weight: inherit; transition: transform .2s ease; }
.product:hover .cta b { transform: translateX(4px); }

@media (min-width: 640px) { .products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) {
	.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	/* wide enough for the whole Chopsmith strip: it gets the full row, uncropped */
	.feature { grid-column: 1 / -1; }
	.feature .shot { aspect-ratio: 2000 / 420; margin: 18px 18px 0; }
	.feature .shot img { transform: none; }
	.feature:hover .shot img { transform: scale(1.015); }
	.feature .body { display: grid; grid-template-columns: 1fr auto; gap: 6px 48px; padding-top: 18px; }
	.feature .body > * { grid-column: 1; }
	.feature h3 { font-size: 2.5rem; }
	.feature p { max-width: 52ch; }
	.feature .price { grid-area: 2 / 2; align-self: end; text-align: right; padding: 0; }
	.feature .cta { grid-area: 3 / 2; text-align: right; margin: 0; padding-top: 8px; }
}

/* buttons and the signup */
.btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px;
	border: 1px solid var(--acc); border-radius: 999px; background: var(--acc); color: var(--bg);
	font: 500 .75rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; cursor: pointer; white-space: nowrap;
	transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -10px var(--acc); }
.btn:active { transform: none; }
.btn:disabled { opacity: .6; transform: none; box-shadow: none; cursor: default; }
.btn[aria-busy="true"] { cursor: progress; }
.signup {
	position: relative; isolation: isolate; overflow: hidden;
	margin-bottom: clamp(64px, 9vw, 120px); padding: clamp(28px, 5vw, 56px);
	background: linear-gradient(180deg, var(--card-2), var(--card));
	border: 1px solid var(--line); border-radius: var(--radius);
}
.signup::after { content: ""; position: absolute; z-index: -1; width: 60%; aspect-ratio: 1; right: -18%; top: -45%; background: radial-gradient(closest-side, rgba(255, 243, 147, .14), transparent); }
.signup > p { color: var(--soft); max-width: 46ch; margin-top: 14px; }
.signup form { display: flex; gap: 10px; flex-wrap: wrap; max-width: 520px; margin-top: 24px; }
.signup input {
	flex: 1 1 240px; min-width: 0; min-height: 46px; padding: 0 18px;
	font: inherit; color: var(--text);
	background: rgba(18, 6, 13, .55); border: 1px solid var(--line-2); border-radius: 999px;
	transition: border-color .2s ease;
}
.signup input::placeholder { color: var(--dim); }
.signup input:hover, .signup input:focus-visible { border-color: var(--butter); outline-offset: 0; }
.signup > .fine { font: 400 .6875rem/1.6 var(--mono); letter-spacing: .03em; color: var(--dim); }
.fine a { color: var(--soft); text-decoration: underline; text-underline-offset: 3px; }
.fine a:hover { color: var(--butter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* footer */
footer { border-top: 1px solid var(--line); padding-block: 22px 40px; font: 400 .6875rem/1.6 var(--mono); letter-spacing: .03em; color: var(--dim); }
footer > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }
footer .links { display: flex; flex-wrap: wrap; gap: 0 20px; }
footer .links a { display: inline-flex; align-items: center; min-height: 32px; color: var(--soft); transition: color .2s ease; }
footer .links a:hover { color: var(--butter); }
footer p:last-child { display: flex; align-items: center; min-height: 32px; }

/* first paint: the hero rises in, then the cards one after another */
.studio-hero > *, .catalog h2, .product { animation: rise .9s var(--ease) backwards; }
.lede { animation-delay: .1s; }
.catalog h2 { animation-delay: .2s; }
.product { animation-delay: .28s; }
.product:nth-child(2) { animation-delay: .36s; }
.product:nth-child(3) { animation-delay: .44s; }
.product:nth-child(4) { animation-delay: .52s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
