/* The website in the app's own look: Catppuccin Mocha and Latte with the
   brand teal, and one colour per stem. Every colour is a variable from
   palette.css, which scripts/site_palette.py generates from
   src/ui/styles.py; never write a colour here (tests/test_site.py fails on
   one). The app is set in Segoe UI, so the site is too. */

:root {
  --max: 1040px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
    Roboto, "Helvetica Neue", sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui,
    -apple-system, Roboto, sans-serif;
  --line: color-mix(in srgb, var(--text) 14%, transparent);
  --radius: 12px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--mantle);
  color: var(--text);
  font: 400 17px/1.6 var(--font);
}

a { color: var(--accent); }
a:hover { color: var(--stem-vocals); }

img { max-width: 100%; height: auto; display: block; }

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* six stem lanes across the top, one colour each, as in the waveform */
.lanes {
  display: grid;
  grid-template-rows: repeat(6, 3px);
  gap: 2px;
  padding-bottom: 2px;
}

.lanes span:nth-child(1) { background: var(--stem-vocals); }
.lanes span:nth-child(2) { background: var(--stem-drums); }
.lanes span:nth-child(3) { background: var(--stem-bass); }
.lanes span:nth-child(4) { background: var(--stem-other); }
.lanes span:nth-child(5) { background: var(--stem-guitar); }
.lanes span:nth-child(6) { background: var(--stem-piano); }

nav.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 0;
}

.mark img { width: 180px; height: auto; }

.links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.95rem;
}

.links a { color: var(--subtext); text-decoration: none; }
.links a:hover { color: var(--text); }

button.theme {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--surface1);
  border-radius: 8px;
  background: var(--base);
  color: var(--text);
  cursor: pointer;
}

button.theme:hover { border-color: var(--accent); }

/* like the app's corner button: a sun in dark (it switches to light), a
   moon in light */
button.theme .i-moon { display: none; }
:root[data-theme="light"] button.theme .i-sun { display: none; }
:root[data-theme="light"] button.theme .i-moon { display: block; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) button.theme .i-sun { display: none; }
  :root:not([data-theme="dark"]) button.theme .i-moon { display: block; }
}

header.top {
  padding: 40px 0 8px;
  text-align: center;
}

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.1;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin: 72px 0 16px;
}

h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 10px;
}

.pitch {
  max-width: 38em;
  margin: 18px auto 0;
  font-size: 1.12rem;
  color: var(--subtext);
  text-wrap: pretty;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid var(--surface2);
  color: var(--text);
  background: var(--base);
  font-weight: 600;
  text-decoration: none;
}

.button:hover { color: var(--text); border-color: var(--accent); }

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.button.primary:hover {
  color: var(--on-accent);
  filter: brightness(1.08);
}

.note {
  color: var(--subtext);
  font-size: 0.92rem;
  margin-top: 14px;
}

.note.small { font-size: 0.85rem; margin: 0; }

header .note { text-align: center; }

ul.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0;
  margin: 18px 0 0;
}

ul.chips li {
  padding: 4px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text);
}


.lede {
  max-width: 44em;
  color: var(--subtext);
  margin: 0 0 18px;
}

/* the mixer demo, laid out like the app's practice cockpit */
.cockpit {
  background: var(--base);
  border: 1px solid var(--surface0);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 18px 50px color-mix(in srgb, var(--mantle) 70%, transparent);
}

.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--surface0);
  font-size: 0.85rem;
  color: var(--text);
}

.badge b { color: var(--text); font-weight: 600; }

.lanes-wrap canvas {
  display: block;
  width: 100%;
  height: 240px;
  border-radius: 8px;
  background: var(--mantle);
  cursor: crosshair;
  /* a vertical swipe scrolls the page; a sideways drag sets a loop */
  touch-action: pan-y;
}

.lanes-wrap canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hint {
  flex: 1 1 18em;
  margin: 0;
  font-size: 0.82rem;
  color: var(--subtext);
}

.rack {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.card {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}

.card.wide { padding: 18px 22px; background: var(--base); }
.card p:first-child { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.stems {
  display: grid;
  grid-template-columns: max-content auto auto minmax(60px, 1fr);
  align-items: center;
  gap: 6px 8px;
}

.stems .name { font-weight: 600; font-size: 0.9rem; }

.stems input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.chip, .stems button {
  font: inherit;
  font-size: 0.82rem;
  padding: 3px 9px;
  min-height: 28px;
  border-radius: 6px;
  border: 1px solid var(--surface2);
  background: var(--surface0);
  color: var(--text);
  cursor: pointer;
}

.chip:hover, .stems button:hover { border-color: var(--accent); }

.chip[aria-pressed="true"], .stems button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.88rem;
}

.row.check { gap: 6px; flex-wrap: nowrap; align-items: baseline; color: var(--subtext); }
.row input[type="checkbox"] { accent-color: var(--accent); }

.row select {
  font: inherit;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--surface2);
  background: var(--surface0);
  color: var(--text);
}

.loop-times { color: var(--subtext); font-size: 0.85rem; }

.transport {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 10px;
}

button.play {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}

button.play .i-pause { display: none; }
button.play[aria-pressed="true"] .i-play { display: none; }
button.play[aria-pressed="true"] .i-pause { display: block; }

.time { font-variant-numeric: tabular-nums; font-weight: 600; }

ol.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0;
  margin: 0;
}

ol.steps li {
  counter-increment: step;
  background: var(--base);
  border: 1px solid var(--surface0);
  border-radius: var(--radius);
  padding: 16px 18px;
}

ol.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

/* the features as cards in two columns, each with a small animated
   drawing of what it does */
ul.features {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  margin: 0;
}

ul.features li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  background: var(--base);
  border: 1px solid var(--surface0);
  border-radius: var(--radius);
  padding: 20px 22px;
}

ul.features h3 { font-size: 1.1rem; margin: 0 0 6px; }
ul.features p { margin: 0; color: var(--subtext); font-size: 0.97rem; }

.art {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--mantle);
  padding: 10px 0;
}

.ficon { display: block; width: 120px; height: auto; }

.ficon path, .ficon .ring { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ficon .thick { stroke-width: 3.5; }
.ficon .bars { stroke-width: 2.6; }
.ficon .lane { stroke-width: 1.8; }
.ficon .track { stroke-width: 3; }
.ficon text { font: 600 9px/1 var(--font); }
.ficon .chord { font-size: 19px; }
.ficon .tag, .ficon .fmt, .ficon .fon, .ficon .keycap { font-size: 8px; }

.ficon .sv { stroke: var(--stem-vocals); }
.ficon .sd { stroke: var(--stem-drums); }
.ficon .sb { stroke: var(--stem-bass); }
.ficon .so { stroke: var(--stem-other); }
.ficon .sg { stroke: var(--stem-guitar); }
.ficon .sp { stroke: var(--stem-piano); }
.ficon .sa { stroke: var(--accent); }
.ficon .st { stroke: var(--text); }
.ficon .sm { stroke: var(--surface2); }
.ficon .sr { stroke: var(--recording); }
.ficon .fv { fill: var(--stem-vocals); }
.ficon .fd { fill: var(--stem-drums); }
.ficon .fb { fill: var(--stem-bass); }
.ficon .fo { fill: var(--stem-other); }
.ficon .fg { fill: var(--stem-guitar); }
.ficon .fa { fill: var(--accent); }
.ficon .ft { fill: var(--text); }
.ficon .fm { fill: var(--surface2); }
.ficon .fr { fill: var(--recording); }
.ficon .fs { fill: var(--surface0); }
.ficon .fon { fill: var(--on-accent); }
.ficon .fbg { fill: var(--mantle); }
.ficon .shade { opacity: 0.2; }
.ficon .faint { opacity: 0.55; }

/* the motion: each loop is a bar or a few beats long */
.ficon .pulse { transform-box: fill-box; transform-origin: center; animation: fi-pulse 1.2s ease-in-out infinite; }
.ficon .flow { animation: fi-flow 1.1s linear infinite; }
.ficon .slide { animation: fi-slide 3.2s ease-in-out infinite; }
.ficon .stretch { transform-origin: 6px 36px; animation: fi-stretch 2.4s ease-in-out infinite alternate; }
.ficon .semis { animation: fi-semis 4.8s ease-in-out infinite; }
.ficon .orbit { transform-origin: 40px 30px; animation: fi-spin 2.4s linear infinite; }
.ficon .sweep { animation: fi-sweep-loop 2.4s linear infinite; }
.ficon .lap, .ficon .fmt { animation: fi-third 7.2s step-end infinite; }
.ficon .l2, .ficon .f2 { animation-delay: -4.8s; }
.ficon .l3, .ficon .f3 { animation-delay: -2.4s; }
.ficon .chord { animation: fi-quarter 4.8s step-end infinite; }
.ficon .c2 { animation-delay: -3.6s; }
.ficon .c3 { animation-delay: -2.4s; }
.ficon .c4 { animation-delay: -1.2s; }
.ficon .beat { opacity: 0.25; animation: fi-beat 1.2s ease-out infinite; }
.ficon .b2 { animation-delay: -0.9s; }
.ficon .b3 { animation-delay: -0.6s; }
.ficon .b4 { animation-delay: -0.3s; }
.ficon .swing { transform-origin: 60px 56px; animation: fi-swing 0.6s ease-in-out infinite alternate; }
.ficon .m1, .ficon .m2, .ficon .m3, .ficon .m4 { animation-duration: 2.4s; animation-name: fi-tick; }
.ficon .m2 { animation-delay: -1.8s; }
.ficon .m3 { animation-delay: -1.2s; }
.ficon .m4 { animation-delay: -0.6s; }
.ficon .reveal { animation: fi-reveal 3s linear infinite; }
.ficon .rsweep { animation: fi-rsweep 3s linear infinite; }
.ficon .blink { animation: fi-blink 1s ease-in-out infinite alternate; }
.ficon .lsweep { animation: fi-lsweep 2s linear infinite; }
.ficon .dash { stroke-dasharray: 3 3; animation: fi-dash 0.6s linear infinite; }
.ficon .pick { animation: fi-pick 6s step-end infinite; }
.ficon .resume { transform-origin: 80px 14px; animation: fi-resume 1.5s ease-out infinite; }
.ficon .key { transform-box: fill-box; animation: fi-key 3s ease-out infinite; }
.ficon .k2 { animation-delay: -2.4s; }
.ficon .k3 { animation-delay: -1.8s; }
.ficon .k4 { animation-delay: -1.2s; }
.ficon .k5 { animation-delay: -0.6s; }

@keyframes fi-pulse { 50% { transform: scaleY(0.45); } }
@keyframes fi-flow { to { transform: translateX(-13px); } }
@keyframes fi-slide { 30% { transform: translateY(-10px); } 70% { transform: translateY(6px); } }
@keyframes fi-stretch { to { transform: scaleX(1.4); } }
@keyframes fi-semis {
  0%, 15%, 50%, 65%, 100% { transform: translateY(0); }
  25%, 40% { transform: translateY(-14px); }
  75%, 90% { transform: translateY(14px); }
}
@keyframes fi-spin { to { transform: rotate(360deg); } }
@keyframes fi-sweep-loop { to { transform: translateX(24px); } }
@keyframes fi-third { 0% { opacity: 1; } 33.33% { opacity: 0; } }
@keyframes fi-quarter { 0% { opacity: 1; } 25% { opacity: 0; } }
@keyframes fi-beat { 0% { opacity: 1; } 25%, 100% { opacity: 0.25; } }
@keyframes fi-tick { 0% { opacity: 1; } 12%, 100% { opacity: 0.25; } }
@keyframes fi-swing { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }
@keyframes fi-reveal { to { transform: translateX(84px); } }
@keyframes fi-rsweep { to { transform: translateX(84px); } }
@keyframes fi-blink { to { opacity: 0.35; } }
@keyframes fi-lsweep { to { transform: translateX(30px); } }
@keyframes fi-dash { to { stroke-dashoffset: -6; } }
@keyframes fi-pick {
  0% { transform: translateY(0); } 25% { transform: translateY(15px); }
  50% { transform: translateY(30px); } 75% { transform: translateY(45px); }
}
@keyframes fi-resume { 0% { transform: scaleX(0); } 70%, 100% { transform: scaleX(1); } }
@keyframes fi-key { 0% { transform: translateY(2px); opacity: 1; } 15%, 100% { transform: none; opacity: 0.6; } }

/* only the cards on screen move (site.js marks them) */
.js ul.features li:not(.live) .ficon * { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .ficon * { animation: none !important; }
  .ficon .l2, .ficon .l3, .ficon .f2, .ficon .f3,
  .ficon .c2, .ficon .c3, .ficon .c4 { display: none; }
  .ficon .beat { opacity: 0.25; }
  .ficon .b1, .ficon .m1 { opacity: 1; }
  .ficon .reveal, .ficon .rsweep { display: none; }
}

ul.news {
  padding-left: 1.2em;
  margin: 0;
}

ul.news li { margin: 8px 0; }
ul.news li::marker { color: var(--accent); }

/* the screenshots one per row, as wide as the page allows, so the app's
   own text is readable without opening them */
.shots {
  display: grid;
  gap: 22px;
  width: min(1280px, 100vw - 32px);
  margin-left: 50%;
  transform: translateX(-50%);
}

.shots figure {
  margin: 0;
  background: var(--base);
  border: 1px solid var(--surface0);
  border-radius: var(--radius);
  overflow: hidden;
}

.shots figcaption {
  padding: 10px 16px;
  font-size: 0.95rem;
  color: var(--subtext);
}

footer {
  margin: 72px 0 0;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--subtext);
  font-size: 0.9rem;
  text-align: center;
}

footer a { color: var(--subtext); }

@media (max-width: 860px) {
  .rack { grid-template-columns: 1fr; }
  ol.steps { grid-template-columns: 1fr; }
  ul.features { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .links { gap: 14px; }
  .links a.wide-only { display: none; }
  .mark img { width: 150px; }
  .lanes-wrap canvas { height: 200px; }
  .stems { grid-template-columns: max-content auto auto minmax(40px, 1fr); }
  ul.features li { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .art { justify-self: start; padding: 8px 14px; }
}

/* the song picker above the cockpit */
.songs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

button.song {
  display: grid;
  text-align: left;
  font: inherit;
  padding: 7px 14px;
  min-width: 0;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--mantle);
  color: var(--text);
  cursor: pointer;
}

button.song:hover { border-color: var(--accent); }

button.song .genre {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtext);
}

button.song .title { font-weight: 600; font-size: 0.92rem; }

button.song[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--mantle));
  box-shadow: inset 0 0 0 1px var(--accent);
}

button.song[aria-pressed="true"] .genre { color: var(--text); }

.credit {
  margin: 8px 0 12px;
  font-size: 0.82rem;
  color: var(--subtext);
  min-height: 1.3em;
}

/* every demo song's credit, under the cockpit */
.demo-credits {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--subtext);
}

.demo-credits p { margin: 0; font-weight: 600; }

.demo-credits ul {
  margin: 2px 0 0;
  padding-left: 1.2em;
}

/* touch screens: controls big enough for a finger */
@media (pointer: coarse) {
  .chip, .stems button, .row select, button.song { min-height: 40px; }
  .chip, .stems button { padding: 6px 12px; }
  .stems input[type="range"] { min-height: 40px; }
  .row input[type="checkbox"] { width: 22px; height: 22px; }
  .row.check { align-items: center; }
}

/* the questions, as disclosures */
.faq {
  display: grid;
  gap: 8px;
}

.faq details {
  background: var(--base);
  border: 1px solid var(--surface0);
  border-radius: 10px;
  padding: 0 16px;
}

.faq details[open] { border-color: var(--surface1); }

.faq summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
}

.faq summary::marker { color: var(--accent); }

.faq details p {
  margin: 0 0 14px;
  color: var(--subtext);
}

.faq code {
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface0);
  color: var(--text);
}
