/* Palette mirrors fono8-player/src/ui/theme.rs */
:root {
  --bg: #07101e;
  --surface: #0e1a2c;
  --panel: #0c1829;
  --elevated: #15243a;
  --border: #24334b;
  --border-strong: #263d5e;
  --text: #e8f0ff;
  --muted: #9baecb;
  --accent: #3de8f7;
  --accent-pressed: #20c9db;
  --purple: #9b6dff;
  --hover: #17273d;
  --selected: #243347;
  --code-bg: #0a1526;
  --grad: linear-gradient(90deg, var(--accent), var(--purple));

  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: "Inter", "Ubuntu", "Noto Sans", "Cantarell", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Ubuntu Mono", "Cascadia Code", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(900px 520px at 85% -120px, rgba(155, 109, 255, .16), transparent 70%),
    radial-gradient(800px 500px at 0% 120px, rgba(61, 232, 247, .09), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
svg { flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #8ff3fb; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
strong { font-weight: 600; color: #fff; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }

code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .08em .4em;
  overflow-wrap: anywhere;
}

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: calc(780px + 2 * var(--gutter)); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 16, 30, .82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(36, 51, 75, .7);
}
.topbar__inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand__bars { width: 22px; height: 23px; }
.brand__word { width: 86px; height: 22px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 14.5px;
  padding: 6px 12px; border-radius: 8px;
}
.nav a:hover { color: var(--text); background: var(--hover); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.lang { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.lang__opt {
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em;
  color: var(--muted); text-decoration: none;
  padding: 4px 10px; border-radius: 999px;
}
.lang__opt:hover { color: var(--text); }
.lang__opt[aria-current="page"] { background: var(--selected); color: var(--accent); }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; color: var(--text); border: 1px solid var(--border); background: var(--surface);
}
.icon-btn:hover { color: var(--accent); background: var(--hover); }
.icon-btn svg { width: 20px; height: 20px; }

@media (max-width: 820px) {
  .nav { display: none; }
}

/* ---------- Buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px; border-radius: 999px;
  font: 600 15px/1.2 var(--font); text-decoration: none;
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:hover { background: #7ff0fa; color: var(--bg); }
.btn--primary:active { background: var(--accent-pressed); }
.btn--ghost { color: var(--text); border-color: var(--border-strong); background: rgba(14, 26, 44, .6); }
.btn--ghost:hover { color: var(--text); background: var(--hover); border-color: #3a5378; }

.chips { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text); background: rgba(14, 26, 44, .7);
}
.chip--accent { border-color: rgba(61, 232, 247, .45); color: var(--accent); }
.chip--muted { color: var(--muted); }
.chip--link a { color: inherit; text-decoration: none; }
.chip--link:hover { border-color: var(--accent); }

.tag {
  display: inline-block; vertical-align: middle;
  font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; margin-left: 6px;
  color: var(--bg); background: var(--accent);
}
.tag--muted { color: var(--muted); background: var(--elevated); border: 1px solid var(--border); }

.ui {
  display: inline-block; white-space: nowrap;
  font-size: .9em; font-weight: 500; line-height: 1.35;
  padding: 0 .45em; border-radius: 6px;
  background: var(--selected); color: var(--text); border: 1px solid #33496a;
}

.eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 9vw, 104px) 0 0; }
.hero__title { font-size: clamp(40px, 7.4vw, 76px); font-weight: 700; letter-spacing: -.03em; max-width: 16ch; }
.hero__lead { margin-top: 22px; max-width: 640px; font-size: clamp(17px, 2vw, 19px); color: var(--muted); }
.hero__lead strong { color: var(--text); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__shot-wrap { margin-top: clamp(44px, 7vw, 72px); position: relative; }
.hero__shot-wrap::before {
  content: ""; position: absolute; inset: 10% 6% -4%; z-index: -1;
  background: radial-gradient(closest-side, rgba(61, 232, 247, .22), rgba(155, 109, 255, .14) 55%, transparent);
  filter: blur(40px);
}

.window {
  display: block; margin: 0;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .02) inset;
}
.hero__shot { border-radius: 16px; }

/* ---------- Sources strip ---------- */
.sources { padding: 40px 0 0; }
.sources__inner {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 36px;
  color: var(--muted); font-size: 15px;
}
.sources__item { display: inline-flex; align-items: center; gap: 9px; }
.sources__item svg { width: 22px; height: 22px; color: var(--text); }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 120px) 0 0; }
.section--last { padding-bottom: clamp(72px, 10vw, 120px); }
.section__title { font-size: clamp(28px, 4.2vw, 42px); font-weight: 650; max-width: 22ch; }
.section__lead { margin-top: 16px; max-width: 700px; color: var(--muted); font-size: 17px; }
.section__lead strong { color: var(--text); }

.card {
  background: linear-gradient(180deg, rgba(21, 36, 58, .55), rgba(14, 26, 44, .75));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- Non-commercial manifest ---------- */
.manifest {
  position: relative;
  border-radius: 20px;
  padding: clamp(24px, 5vw, 52px);
  background:
    linear-gradient(135deg, rgba(16, 37, 62, .9), rgba(7, 20, 40, .9) 55%, rgba(34, 25, 54, .9));
  border: 1px solid #2a3e59;
  overflow: hidden;
}
.manifest::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad);
}
.manifest__grid {
  list-style: none; padding: 0; margin: 40px 0 0;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.point {
  padding: 22px; border-radius: var(--radius);
  background: rgba(7, 16, 30, .55); border: 1px solid var(--border);
}
.point__icon { width: 28px; height: 28px; color: var(--accent); margin-bottom: 14px; }
.point h3 { font-size: 17px; margin-bottom: 8px; }
.point p { color: var(--muted); font-size: 15px; }
.manifest__foot { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.manifest__foot .btn { font-weight: 500; }

/* ---------- Features ---------- */
.features {
  list-style: none; padding: 0; margin: 44px 0 0;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.feature { padding: 26px; }
.feature__icon {
  width: 44px; height: 44px; padding: 10px; border-radius: 12px; margin-bottom: 18px;
  color: var(--accent); background: var(--selected);
}
.feature:nth-child(3n+2) .feature__icon { color: var(--purple); background: #252a48; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 15px; }

.gallery {
  margin-top: 56px;
  display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.gallery__item { margin: 0; }
.gallery__item .window { transition: transform .2s, border-color .2s; }
.gallery__item .window:hover { transform: translateY(-3px); border-color: #3a5378; }
.gallery__item figcaption { margin-top: 12px; color: var(--muted); font-size: 14px; text-align: center; }

/* Full-size screenshot dialog. */
html:has(.lightbox[open]) { overflow: hidden; }
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 72px 76px 24px; border: 0; background: transparent; color: var(--text);
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(4, 9, 18, .9); backdrop-filter: blur(6px); }
.lightbox__figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.lightbox__img {
  display: block; width: auto; height: auto;
  max-width: min(1600px, 100%); max-height: calc(100dvh - 140px);
  border-radius: var(--radius); border: 1px solid var(--border-strong);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
}
.lightbox__caption { color: var(--muted); font-size: 14px; text-align: center; }
.lightbox__btn {
  position: absolute; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: rgba(14, 26, 44, .85); color: var(--text);
}
.lightbox__btn:hover, .lightbox__btn:focus-visible { color: var(--accent); border-color: var(--accent); }
.lightbox__btn svg { width: 20px; height: 20px; }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev, .lightbox__next { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }
@media (max-width: 640px) {
  .lightbox { padding: 72px 16px 84px; }
  .lightbox__img { max-height: calc(100dvh - 200px); }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 20px; transform: none; }
  .lightbox__prev { left: calc(50% - 56px); }
  .lightbox__next { right: calc(50% - 56px); }
}

/* ---------- Install tabs ---------- */
.tabs { margin-top: 40px; }
.tabs__list {
  display: flex; gap: 6px; padding: 5px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs__list::-webkit-scrollbar { display: none; }
.tabs__tab {
  flex: 1 0 auto; white-space: nowrap; cursor: pointer;
  font: 500 14.5px/1 var(--font); color: var(--muted);
  padding: 11px 16px; border-radius: 8px; border: 0; background: transparent;
}
.tabs__tab:hover { color: var(--text); background: var(--hover); }
.tabs__tab[aria-selected="true"] { color: var(--accent); background: var(--selected); }
html:not(.js) .tabs__list { display: none; }
html:not(.js) .tabs__panel[hidden] { display: block; }
html:not(.js) .tabs__panel + .tabs__panel { margin-top: 16px; }

.tabs__panel, .cli { padding: clamp(20px, 4vw, 34px); }
.panel__title { font-size: 20px; margin-bottom: 18px; }
.tabs__panel > p { color: var(--muted); }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps > li {
  position: relative; counter-increment: step;
  padding: 0 0 18px 46px; min-height: 32px;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: var(--bg); background: var(--grad);
}
.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 14.5px; top: 32px; bottom: 4px;
  width: 1px; background: var(--border);
}
.steps[start="5"] { counter-reset: step 4; }
.steps[start="6"] { counter-reset: step 5; }
.steps ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.steps ul li { margin-top: 6px; }
.steps__title {
  font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 28px 0 16px;
}

.code {
  margin: 12px 0 6px; padding: 14px 16px;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  font: 13.5px/1.65 var(--mono); color: #cfe0ff;
  overflow-x: auto; white-space: pre;
}
.code code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }
.code .c { color: #6f84a6; }

.note {
  margin-top: 8px; padding: 18px 20px; border-radius: 12px;
  background: rgba(7, 16, 30, .55); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}
.note h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.note ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.note li + li { margin-top: 6px; }
.note--info { border-left-color: var(--purple); margin-top: 24px; }
.note--warn { border-left-color: #f7c948; }

.hint { margin-top: 22px; color: var(--muted); font-size: 15px; }

.cli { margin-top: 16px; }
.cli .code { margin: 0; }
.install__cta { margin-top: 28px; display: flex; justify-content: center; }

/* ---------- Accounts ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 32px 0 24px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px; text-decoration: none;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
  font-size: 14.5px; font-weight: 500;
}
.pill svg { width: 18px; height: 18px; }
.pill:hover { color: var(--accent); background: var(--hover); }

.service { margin-top: 20px; overflow: hidden; }
.service__head {
  display: flex; gap: 18px; align-items: center;
  padding: clamp(20px, 4vw, 30px) clamp(20px, 4vw, 34px);
  border-bottom: 1px solid var(--border);
  background: rgba(21, 36, 58, .45);
}
.service__icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; flex: none;
  background: var(--selected); color: var(--accent);
}
#spotify .service__icon { color: #5ef08f; }
#tidal .service__icon { color: var(--purple); background: #252a48; }
.service__icon svg { width: 28px; height: 28px; }
.service__head h3 { font-size: 22px; }
.service__sub { color: var(--muted); margin-top: 4px; font-size: 15px; }
.service__body { padding: clamp(20px, 4vw, 34px); }
.service__body > .note:first-child { margin: 0 0 28px; }

.copy {
  display: flex; align-items: center; gap: 4px; max-width: 100%;
  margin-top: 10px; padding: 4px 4px 4px 14px;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  width: fit-content;
}
.copy code { background: none; border: 0; padding: 0; font-size: 14px; color: var(--accent); }
.copy__btn {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 0; border-radius: 8px; cursor: pointer;
  color: var(--muted); background: transparent;
}
.copy__btn:hover { color: var(--text); background: var(--hover); }
.copy__btn svg { width: 18px; height: 18px; }
.copy__btn.is-done { color: var(--accent); }
html:not(.js) .copy__btn { display: none; }

/* ---------- FAQ ---------- */
.faq { margin-top: 32px; display: grid; gap: 10px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.faq summary {
  cursor: pointer; list-style: none; position: relative;
  padding: 18px 52px 18px 22px; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 22px; top: 50%;
  width: 9px; height: 9px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details > div { padding: 0 22px 20px; color: var(--muted); }
.faq details[open] { border-color: var(--border-strong); }

/* ---------- Contribute ---------- */
.contribute {
  text-align: center; padding: clamp(36px, 6vw, 64px) var(--gutter);
  border-radius: 20px; border: 1px solid var(--border);
  background: radial-gradient(600px 260px at 50% 0, rgba(155, 109, 255, .16), transparent), var(--panel);
}
.contribute__logo { width: 48px; height: 50px; margin: 0 auto 22px; }
.contribute .section__title, .contribute .section__lead { margin-left: auto; margin-right: auto; }
.contribute .hero__cta { justify-content: center; }
.contribute__author { margin: 28px auto 0; max-width: 620px; color: var(--muted); font-size: 15px; }

/* ---------- Footer ---------- */
.prose .section__title { max-width: none; }
.prose__updated { margin-top: 10px; color: var(--muted); font-size: 14px; }
.prose h2 { margin: 40px 0 12px; font-size: 21px; }
.prose p, .prose ul { color: var(--muted); }
.prose p + p { margin-top: 12px; }
.prose ul { margin: 0; padding-left: 20px; }
.prose li + li { margin-top: 8px; }
.prose strong { color: var(--text); }

.footer { border-top: 1px solid var(--border); background: rgba(7, 14, 26, .9); padding: 44px 0 36px; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; align-items: flex-start; }
.footer__brand p { color: var(--muted); margin-top: 10px; font-size: 14px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer__links a { color: var(--muted); text-decoration: none; font-size: 14.5px; }
.footer__links a:hover { color: var(--accent); }
.footer__legal { margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(36, 51, 75, .6); }
.footer__legal p { color: #7385a3; font-size: 13px; max-width: 900px; }
.footer__legal p + p { margin-top: 8px; }

@media (max-width: 560px) {
  .topbar__inner { gap: 12px; }
  .brand__word { width: 74px; }
  .btn { padding: 11px 18px; }
  .hero__cta .btn { flex: 1 1 auto; justify-content: center; }
  .service__head { align-items: flex-start; }
  .service__icon { width: 44px; height: 44px; }
  .steps > li { padding-left: 40px; }
  .copy code { font-size: 12.5px; }
}
