/* Encore – product site. One family (Bricolage Grotesque, self-hosted, OFL); the device mockup is the hero. */
@font-face {
	font-family: "Bricolage";
	src: url("fonts/bricolage-latin.woff2") format("woff2");
	font-weight: 200 800;
	font-stretch: 75% 100%;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Bricolage";
	src: url("fonts/bricolage-latin-ext.woff2") format("woff2");
	font-weight: 200 800;
	font-stretch: 75% 100%;
	font-display: swap;
	unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	--paper: #e9ecef;     /* cool light grey, like a studio desk */
	--paper-deep: #dde1e6;
	--ink: #14161b;
	--mist: #5a616d;      /* secondary text, 5.6:1 on paper */
	--graphite: #26292f;  /* device body */
	--cobalt: #2442d6;    /* links and the one call to action */
	--font: "Bricolage", "Segoe UI", system-ui, sans-serif;
	/* Key size and the bezel gap the plugin compensates for (40 px per 144 px key) */
	--k: 92px;
	--g: calc(var(--k) * 40 / 144);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body {
	margin: 0;
	font: 400 1.125rem/1.55 var(--font);
	font-optical-sizing: auto;
	-webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--cobalt); text-underline-offset: 0.18em; }
a:focus-visible, .cta:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }

/* --- type scale (1.333) -------------------------------------------------------------------- */
h1, h2, h3 { margin: 0; font-weight: 760; letter-spacing: -0.01em; }
h1 {
	font-size: clamp(3rem, 7.2vw, 6.4rem);
	line-height: 0.92;
	font-stretch: 75%;
	letter-spacing: -0.025em;
}
h2 { font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1; font-stretch: 80%; }
h3 { font-size: 1.333rem; line-height: 1.2; font-weight: 680; }
p { margin: 0; max-width: 62ch; }
.lede { font-size: 1.333rem; line-height: 1.45; color: var(--ink); max-width: 34ch; }
.quiet { color: var(--mist); }

/* --- header -------------------------------------------------------------------------------- */
.top { padding-block: 28px; display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.brand { font-weight: 780; font-size: 1.5rem; font-stretch: 75%; text-decoration: none; color: var(--ink); }
.top nav { display: flex; gap: 22px; font-size: 1rem; }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { color: var(--cobalt); }

/* --- hero ---------------------------------------------------------------------------------- */
.hero {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	align-items: center;
	gap: 56px;
	padding-block: 48px 96px;
}
.hero-copy { display: grid; gap: 28px; }
.cta {
	display: inline-block;
	justify-self: start;
	background: var(--cobalt);
	color: #fff;
	text-decoration: none;
	font-weight: 640;
	padding: 16px 26px;
	border-radius: 999px;
}
.cta:hover { background: #1a33b0; }
.fineprint { font-size: 1rem; color: var(--mist); }

/* --- the device ---------------------------------------------------------------------------- */
.deck {
	--cols: 5;
	justify-self: center;
	padding: calc(var(--k) * 0.42);
	background: linear-gradient(160deg, #34383f, var(--graphite) 45%, #1b1d21);
	border-radius: calc(var(--k) * 0.34);
	box-shadow:
		inset 0 1px 0 rgb(255 255 255 / 0.12),
		0 2px 0 #121316,
		0 30px 60px -20px rgb(20 22 27 / 0.55);
}
.keys { display: grid; grid-template-columns: repeat(var(--cols), var(--k)); gap: var(--g); }
.key {
	position: relative;
	width: var(--k);
	height: var(--k);
	border-radius: calc(var(--k) * 0.14);
	overflow: hidden;
	background: #000;
	box-shadow: 0 0 0 2px #15161a, 0 3px 0 2px #0e0f11;
}
.key img { width: 100%; height: 100%; }
.deck--hero { --k: clamp(52px, 7.4vw, 104px); }
.deck--small { --k: clamp(34px, 3.85vw, 52px); } /* three in a row on a 1180 px column */

/* Bottom row of the grid: title → artist → album, like the plugin (3.5 s each) */
.cycle img { position: absolute; inset: 0; opacity: 0; animation: cycle 10.5s infinite; }
.cycle img:nth-child(1) { animation-delay: 0s; }
.cycle img:nth-child(2) { animation-delay: 3.5s; }
.cycle img:nth-child(3) { animation-delay: 7s; }
@keyframes cycle {
	0%, 31% { opacity: 1; }
	33.3%, 100% { opacity: 0; }
}

/* The one page-load moment: the cover settles onto the keys tile by tile */
.deck--hero .key.art { animation: settle 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i) * 70ms + 150ms); }
@keyframes settle { from { opacity: 0; transform: scale(0.86); } }

@media (prefers-reduced-motion: reduce) {
	.deck--hero .key.art { animation: none; }
	.cycle img { animation: none; opacity: 0; }
	.cycle img:first-child { opacity: 1; }
}

/* --- sections ------------------------------------------------------------------------------ */
.band { padding-block: 96px; }
.band--deep { background: var(--paper-deep); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.stack { display: grid; gap: 22px; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 40px; margin-top: 56px; }
.feature { display: grid; gap: 14px; align-content: start; }
.feature .tiles { display: flex; gap: 10px; margin-bottom: 8px; }
.feature .tiles img { width: 92px; height: 92px; border-radius: 13px; box-shadow: 0 0 0 2px #15161a; }
.feature .tiles--strip { gap: 0; }
.feature .tiles--strip img { border-radius: 0; box-shadow: none; }
.feature .tiles--strip img:first-child { border-radius: 13px 0 0 13px; }
.feature .tiles--strip img:last-child { border-radius: 0 13px 13px 0; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 18px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.2rem 1fr; gap: 12px; }
.steps li::before {
	content: counter(step);
	font-weight: 760;
	font-stretch: 75%;
	font-size: 1.6rem;
	line-height: 1.1;
	color: var(--cobalt);
}

.themes { display: flex; flex-wrap: wrap; gap: 36px; margin-top: 48px; align-items: end; }
.themes figure { margin: 0; display: grid; gap: 12px; }
.themes figcaption { font-size: 1rem; color: var(--mist); }

.languages { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 14px; margin-top: 48px; }
.languages figure { margin: 0; display: grid; gap: 10px; justify-items: start; }
.languages img { width: 100%; max-width: 92px; aspect-ratio: 1; border-radius: 12px; box-shadow: 0 0 0 2px #15161a; }
.languages figcaption { font-size: 1rem; font-weight: 600; }

.facts { margin: 40px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 48px; }
.facts li { border-top: 2px solid var(--ink); padding-top: 14px; }
.facts strong { display: block; font-weight: 680; margin-bottom: 4px; }

/* --- footer -------------------------------------------------------------------------------- */
.foot { padding-block: 72px 56px; display: grid; gap: 28px; }
.foot .row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.legal { font-size: 0.875rem; color: var(--mist); max-width: 90ch; }

/* --- privacy page -------------------------------------------------------------------------- */
.doc { padding-block: 32px 96px; display: grid; gap: 20px; max-width: 70ch; }
.doc h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
.doc h2 { font-size: 1.6rem; margin-top: 20px; font-stretch: 85%; }
.doc table { border-collapse: collapse; width: 100%; font-size: 1rem; }
.doc th, .doc td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid #c4c9d0; vertical-align: top; }

/* --- small screens ------------------------------------------------------------------------- */
@media (max-width: 960px) {
	.hero, .split { grid-template-columns: 1fr; gap: 40px; }
	.features { grid-template-columns: 1fr; }
	.languages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.facts { grid-template-columns: 1fr; }
	/* a 5-key-wide device is ~6.95 keys wide including bezels and padding */
	.deck--hero { --k: min(96px, (100vw - 76px) / 7.1); }
	.deck--small { --k: min(52px, (100vw - 76px) / 7.1); }
	.band { padding-block: 64px; }
}
@media (max-width: 560px) {
	.top nav { display: none; }
}

/* --- tip jar after Download (donate.js) --------------------------------------------------- */
.thanks {
	width: min(480px, calc(100vw - 24px));
	max-width: none;
	max-height: calc(100dvh - 24px);
	padding: 0;
	border: 0;
	border-radius: 28px;
	overflow: auto;
	background: var(--paper);
	color: var(--ink);
	font: inherit;
	box-shadow: 0 40px 90px -20px rgb(10 12 16 / 0.6);
}
.thanks::backdrop { background: rgb(20 22 27 / 0.6); backdrop-filter: blur(4px); }
.thanks[open] { animation: thanks-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes thanks-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } }

.thanks-x {
	position: absolute; top: 14px; right: 14px;
	width: 36px; height: 36px; border: 0; border-radius: 50%;
	background: rgb(255 255 255 / 0.12); color: #fff;
	font: 400 1.5rem/1 var(--font); cursor: pointer;
}
.thanks-x:hover { background: rgb(255 255 255 / 0.22); }

/* a slice of the device: the cover settling onto three keys, and the plugin's progress bar */
.thanks-deck {
	--k: min(92px, (100vw - 120px) / 3.6);
	--g: calc(var(--k) * 40 / 144);
	display: grid; justify-items: center; gap: 12px;
	padding: 36px 28px 26px;
	background: linear-gradient(160deg, #34383f, var(--graphite) 45%, #1b1d21);
	box-shadow: inset 0 -1px 0 rgb(255 255 255 / 0.06);
}
.thanks-deck .keys { --cols: 3; margin-bottom: 8px; }
.thanks[open] .thanks-deck .key { animation: settle 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i) * 90ms + 150ms); }
.thanks-file { font-size: 0.8rem; color: #aab0ba; letter-spacing: 0.01em; }
.thanks-bar { width: calc(var(--k) * 3 + var(--g) * 2); height: 4px; border-radius: 2px; background: rgb(255 255 255 / 0.14); overflow: hidden; }
.thanks-bar span { display: block; height: 100%; width: 100%; background: #fff; border-radius: inherit; transform-origin: left; }
.thanks[open] .thanks-bar span { animation: thanks-load 1.8s 0.3s cubic-bezier(0.3, 0.6, 0.2, 1) both; }
@keyframes thanks-load { from { transform: scaleX(0); } }

.thanks-body { display: grid; gap: 14px; padding: 28px 32px 26px; }
.thanks h2 { font-size: clamp(1.8rem, 6vw, 2.3rem); }
.thanks p { font-size: 1.02rem; }
.thanks-ask { color: var(--mist); margin-top: 4px; }

/* tips are keys you press */
.tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 6px; }
.tip {
	aspect-ratio: 1;
	display: grid; place-content: center; justify-items: center; gap: 2px;
	border-radius: 20px;
	background: linear-gradient(160deg, #3a3e46, #1b1d21);
	color: #fff; text-decoration: none;
	box-shadow: 0 0 0 2px #15161a, 0 5px 0 2px #0e0f11;
	transition: transform 0.12s, box-shadow 0.12s;
}
.tip b { font-size: clamp(1.7rem, 7vw, 2.3rem); font-weight: 780; font-stretch: 75%; line-height: 1; }
.tip span { font-size: 0.85rem; color: #b8bec8; }
.tip:nth-child(2) { background: linear-gradient(160deg, #3a58f0, #1a2b9e); }
.tip:nth-child(2) span { color: #d6ddff; }
.tip:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px #15161a, 0 8px 0 2px #0e0f11; }
.tip:active { transform: translateY(4px); box-shadow: 0 0 0 2px #15161a, 0 1px 0 2px #0e0f11; }
.tip:focus-visible, .thanks-x:focus-visible, .thanks-close:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }

.thanks-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 20px; margin-top: 6px; font-size: 1rem; }
.thanks-close { font: inherit; color: var(--mist); background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
.thanks-close:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
	.thanks[open], .thanks[open] .thanks-deck .key, .thanks[open] .thanks-bar span { animation: none; }
	.tip { transition: none; }
}
