:root {
  /* Hues taken from the in-app album art placeholders, plus the logo colours. */
  --ink: #17121f;
  --lavender: #d8baff;
  --mint: #6fbf99;
  --violet: #8f74ea;
  --peach: #e48b5f;
  --teal: #2fa596;
  --sun: #c9a93a;
  /* Live preset colours, updated by script.js. */
  --c1: #8f74ea;
  --c2: #d8baff;
  --c3: #2fa596;

  --bg: #f6f3fa;
  --surface: #ece6f4;
  --text: #1d1726;
  --muted: #564d63;
  --line: #d6cde2;
  --accent: #5b3fb8;
  --code-bg: #1d1726;
  --code-text: #ece6f4;

  --display: "Unbounded", "Arial Black", sans-serif;
  --body: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", monospace;
  --measure: 66ch;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --mint: #b8e5ce;
    --violet: #a58cf5;
    --peach: #f0a77f;
    --teal: #5fc9b8;
    --sun: #e6cb6a;
    --bg: #15111b;
    --surface: #211b2a;
    --text: #efe9f6;
    --muted: #b3a9c2;
    --line: #342b40;
    --accent: #d8baff;
    --code-bg: #0e0b13;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.2em; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h2 {
  font: 500 clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem)/1.1 var(--display);
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}
h3 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.icon { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  padding: 0.6rem 1rem; border-radius: 8px;
  background: var(--lavender); color: var(--ink); font-weight: 700;
}
.skip-link:focus { top: 1rem; }

.wrap { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; gap: 0.55rem;
  min-height: 3rem; padding: 0.7rem 1.35rem;
  border-radius: 999px; border: 2px solid transparent;
  font: 700 1rem/1 var(--body); text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s;
}
.button.primary { background: var(--accent); color: var(--bg); }
.button.primary:hover { background: color-mix(in srgb, var(--accent) 85%, var(--text)); }
.button.quiet { border-color: var(--line); color: var(--text); }
.button.quiet:hover { border-color: var(--accent); }
.text-link { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; }

/* Hero: the only loud part of the page */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: #fff;
  background:
    radial-gradient(circle at 70% 40%, var(--c1) 0, transparent 45%),
    radial-gradient(circle at 25% 70%, var(--c3) 0, transparent 40%),
    var(--ink);
  overflow: hidden;
}
.viz {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  display: block;
}
.hero::after {
  /* Keep text legible over any preset. */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgb(23 18 31 / 0.55) 0, transparent 22%, transparent 45%, rgb(23 18 31 / 0.8) 100%);
}
.hero-bar {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
}
.brand { margin-right: auto; }
.brand img { border-radius: 10px; }
.bar-link { color: #fff; font-weight: 700; text-decoration: none; }
.bar-link:hover { text-decoration: underline; }
.hero :focus-visible { outline-color: #fff; }

.hero-copy {
  align-self: end;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 2rem;
}
.wordmark {
  font: 900 clamp(3.5rem, 19.5vw, 19rem)/0.82 var(--display);
  letter-spacing: -0.045em;
  margin-left: -0.04em;
  text-shadow: 0 0.04em 0.3em rgb(23 18 31 / 0.35);
}
.lede {
  max-width: 22em;
  margin-top: 1.75rem;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.45rem);
  line-height: 1.45;
  text-shadow: 0 1px 12px rgb(23 18 31 / 0.6);
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero .button.primary { background: #fff; color: var(--ink); }
.hero .button.primary:hover { background: var(--lavender); }
.hero .button.ghost { border-color: rgb(255 255 255 / 0.7); color: #fff; background: rgb(23 18 31 / 0.3); backdrop-filter: blur(6px); }
.hero .button.ghost:hover { border-color: #fff; background: rgb(23 18 31 / 0.5); }

.deck {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem) 1.5rem;
  font-size: 0.9375rem;
  border-top: 1px solid rgb(255 255 255 / 0.18);
}
.deck-label { margin-right: auto; color: rgb(255 255 255 / 0.8); }
.deck-label strong { color: #fff; font-family: var(--display); font-weight: 500; margin-left: 0.4rem; }
.deck-button {
  min-height: 2.5rem; padding: 0.4rem 1rem;
  border: 1px solid rgb(255 255 255 / 0.55); border-radius: 999px;
  background: rgb(23 18 31 / 0.35); color: #fff;
  font: 700 0.9375rem/1 var(--body); cursor: pointer;
}
.deck-button:hover { background: rgb(255 255 255 / 0.15); }
.deck-button[hidden] { display: none; }
.toggle-motion { min-inline-size: 6em; flex: none; }
.toggle-motion[hidden] { display: inline-block; visibility: hidden; }

/* Calm content */
main > section { padding-block: clamp(3.5rem, 7vw, 6rem); }

.screen-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem, 2.5vw, 2rem); }
.screen-row figure { margin: 0; }
.screen-row img {
  border-radius: clamp(14px, 2vw, 24px);
  border: 1px solid var(--line);
  background: var(--ink);
}
.screen-row figcaption { margin-top: 0.9rem; color: var(--muted); font-size: 0.975rem; line-height: 1.45; }
.screen-row figcaption strong { color: var(--text); }

.features { border-top: 1px solid var(--line); }
.feature-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: dense;
  gap: 2.75rem clamp(1.5rem, 4vw, 3.5rem);
}
.feature-list p { color: var(--muted); margin-top: 0.5rem; max-width: var(--measure); }
.rings { width: 2.5rem; height: 2.5rem; margin-bottom: 1rem; fill: none; stroke: var(--hue); stroke-width: 1.6; }

/* The one echo of the hero: painted with the current preset's colours. */
.milkdrop {
  grid-column: span 2;
  grid-row: span 2;
  display: flex; align-items: flex-end;
  min-height: 20rem;
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 3rem);
  color: #fff;
  background:
    repeating-radial-gradient(circle at 78% 42%, transparent 0 22px, rgb(255 255 255 / 0.22) 23px, transparent 24px) no-repeat 0 0 / 100% 100%,
    radial-gradient(ellipse at 85% 20%, var(--c2), transparent 55%),
    radial-gradient(ellipse at 60% 110%, var(--c3), transparent 60%),
    conic-gradient(from 200deg at 75% 50%, var(--c1), var(--c3), var(--c2), var(--c1));
  position: relative; isolation: isolate; overflow: hidden;
  transition: background 0.8s;
}
.milkdrop::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(20deg, rgb(23 18 31 / 0.88) 0, rgb(23 18 31 / 0.6) 50%, rgb(23 18 31 / 0.2) 100%);
}
.milkdrop h3 { font: 900 clamp(1.5rem, 1.1rem + 1.8vw, 2.5rem)/1.05 var(--display); letter-spacing: -0.02em; }
.milkdrop .milkdrop-copy { max-width: 36rem; }
.milkdrop p { color: rgb(255 255 255 / 0.9); margin-top: 0.85rem; }
.milkdrop .milkdrop-note { color: rgb(255 255 255 / 0.75); font-size: 0.9375rem; }

/* Install */
.install { border-top: 1px solid var(--line); }
.install h2 { margin-bottom: 1rem; }
.alpha {
  max-width: var(--measure);
  padding-left: 1rem;
  border-left: 4px solid var(--sun);
  color: var(--muted);
}
.alpha strong { color: var(--text); }
.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); margin-top: 3rem; }
.platform { min-width: 0; }
.platform h3 { font: 900 1.6rem/1.1 var(--display); letter-spacing: -0.02em; }
.platform h3 span { display: block; margin-top: 0.4rem; font: 400 1rem/1.3 var(--body); letter-spacing: 0; color: var(--muted); }
.platform > p { margin-top: 1rem; color: var(--muted); max-width: 46ch; }
.platform-body { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; justify-content: space-between; }
.links { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; margin-top: 1.5rem; }
.qr { margin-top: 1.5rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); }
.qr img { width: 9.5rem; }

details { margin-top: 1.75rem; border-top: 1px solid var(--line); padding-top: 1rem; }
summary {
  display: flex; align-items: center; gap: 0.5rem;
  min-height: 2.75rem; cursor: pointer; font-weight: 700; list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary .icon { transition: transform 0.2s; }
details[open] summary .icon { transform: rotate(180deg); }
details p { color: var(--muted); margin-top: 0.75rem; }

.code-block { position: relative; margin-top: 0.6rem; }
.code-block pre {
  margin: 0; padding: 1rem 3.5rem 1rem 1rem;
  white-space: pre-wrap; overflow-wrap: anywhere;
  border-radius: 10px;
  background: var(--code-bg); color: var(--code-text);
  font: 0.875rem/1.6 var(--mono);
}
.code-block code { font: inherit; }
.code-block .c { color: #b8e5ce; }
.code-block .o { color: #f0a77f; }
.code-block .s { color: #d8baff; }
.fingerprint { font-family: var(--mono); font-size: 0.875rem; overflow-wrap: anywhere; color: var(--text); }
.copy-button {
  position: absolute; top: 0.5rem; right: 0.5rem;
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem;
  border: 1px solid rgb(255 255 255 / 0.2); border-radius: 8px;
  background: rgb(255 255 255 / 0.06); color: #ece6f4; cursor: pointer;
}
.copy-button:hover { background: rgb(255 255 255 / 0.14); }
.copy-button:focus-visible { outline-color: var(--lavender); }
.copy-button .check-icon, .copy-button[data-copied] .copy-icon { display: none; }
.copy-button[data-copied] .check-icon { display: block; color: #b8e5ce; }

/* Why */
.why { display: flex; gap: clamp(1.5rem, 4vw, 3rem); align-items: flex-start; border-top: 1px solid var(--line); }
.why img { border-radius: 18px; flex: none; }
.why h2 { margin-bottom: 1rem; }
.why p { max-width: var(--measure); color: var(--muted); font-size: 1.125rem; }
.why .text-link { margin-top: 1.25rem; }

footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.9375rem;
}

/* Layout breakpoints */
@media (max-width: 960px) {
  .feature-list { grid-template-columns: 1fr 1fr; }
  .milkdrop { grid-column: auto; grid-row: span 3; }
  .platforms { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .screen-row { grid-template-columns: 1fr 1fr; row-gap: 2rem; }
  .feature-list { grid-template-columns: 1fr; gap: 2.25rem; }
  .milkdrop { grid-row: auto; min-height: 0; }
  .hero-bar { gap: 1rem; }
  .deck-label { flex-basis: 100%; }
  .why { flex-direction: column; }
  .why img { width: 56px; height: 56px; }
}

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