:root {
  --ink: #000;
  --paper: #fff;
  --blue: #271ae9;
  --magenta: #f822e8;
  --gutter: 16px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 13px/1.4 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { color: var(--blue); }
a:focus-visible { outline: 1px solid var(--blue); outline-offset: 3px; }

/* ── ticker ─────────────────────────────────────────── */

.ticker {
  overflow: hidden;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .01em;
  padding: 6px 0;
}

.ticker-track {
  display: inline-block;
  animation: ticker var(--ticker-dur, 40s) linear infinite;
  will-change: transform;
}

.ticker:hover .ticker-track { animation-play-state: paused; }

@keyframes ticker {
  to { transform: translateX(-50%); }
}

/* ── banner ─────────────────────────────────────────── */

.banner {
  position: relative;
  margin: 0 var(--gutter);
  height: clamp(140px, 19vw, 300px);
  background: var(--blue);
  overflow: hidden;
}

.banner canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.banner-pixels { image-rendering: pixelated; }

/* pixel banner palettes — read by main.js. Use 6-digit hex. */
.banner[data-style="pixel"] {
  --px-bg: #271ae9;
  --px-cloud: #ffffff; /* clouds fade from --px-bg half-way toward this */
  background: var(--px-bg);
}
.banner[data-style="pixel"][data-palette="mono"] {
  --px-bg: #000000;
}
/* white sky, whitish-grey clouds */
.banner[data-style="pixel"][data-palette="sky"] {
  --px-bg: #ffffff;
  --px-cloud: #8c8c8c;
}
.banner[data-palette="sky"] .banner-word {
  left: 0;
  bottom: 0;
  padding: 3px 7px;
  background: var(--ink);
}
.banner[data-palette="mono"] .banner-word {
  left: 0;
  bottom: 0;
  padding: 3px 7px;
  background: var(--paper);
  color: var(--ink);
}

.banner-word {
  position: absolute;
  left: 12px;
  bottom: 9px;
  color: var(--paper);
  letter-spacing: .08em;
  font-size: 12px;
}
.banner-word:hover { color: var(--paper); }

/* speakers: whole speakers spaced evenly across the strip, scaled with crisp pixels */
.banner[data-style="speakers"] {
  /* swap in assets/speaker.gif for the grey vibrating one */
  --speaker: url("assets/speaker-black.gif");
  height: clamp(84px, 19vw, 300px); /* shorter on phones so ~4 speakers still fit */
  background: var(--paper) var(--speaker) center / auto 100% space no-repeat;
  image-rendering: pixelated;
}
.banner[data-style="speakers"] canvas { display: none; }
.banner[data-style="speakers"] .banner-word {
  left: 0;
  bottom: 0;
  padding: 3px 7px;
  background: var(--ink);
}

/* ── nav ────────────────────────────────────────────── */

.nav {
  display: flex;
  justify-content: space-around;
  width: min(100% - 2 * var(--gutter), 900px);
  margin: 4px auto 0;
  text-transform: uppercase;
}

.nav a { padding: 4px 8px; }
.nav a[aria-current="page"] { color: var(--blue); }

/* ── views ──────────────────────────────────────────── */

main {
  flex: 1;
  padding: 72px var(--gutter) 96px;
}

.view { display: none; }
.view.is-active { display: block; animation: fade .4s ease both; }

@keyframes fade {
  from { opacity: 0; }
}

/* store */

.store-item + .store-item { margin-top: 128px; }
/* offset each product's fade so one star dims as the other brightens */
.store-item:nth-of-type(2) .rollover-star,
.bundle-marks .rollover + .rollover .rollover-star { animation-delay: -1.5s; }

/* platform badges: text only (the Windows and Ableton logos need their owners' permission) */
.platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 8px 0 10px !important; }
.legal .platforms { justify-content: flex-start; margin: 0 0 8px !important; }
.badge {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--ink);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.3;
}
.badge-plain { border-style: dashed; }

/* the store card links to the product page (#rollover) */
.store-link { display: block; }
.store-link:hover .rollover-mark, .store-link:focus-visible .rollover-mark { opacity: .85; }
.product-line a:hover { color: var(--blue); }

/* product page: Rollover + Steps */
.product-page { max-width: 900px; margin: 0 auto; }
.product-page .back { display: block; width: fit-content; margin-bottom: 40px; text-transform: uppercase; }
.product-page .plugin-name { margin-top: 0; }
.product-video { position: relative; max-width: 800px; margin: 56px auto 0; aspect-ratio: 16 / 9; border: 1px solid var(--ink); }
.product-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px 48px; margin-top: 64px; }
.breakdown h2 { margin: 0 0 8px; font-size: 15px; font-weight: normal; letter-spacing: .06em; text-transform: uppercase; }
.breakdown p { margin: 0 0 12px; }
.features { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.features li { padding: 7px 0; border-bottom: 1px solid var(--ink); }
.features[data-todo] li { opacity: .5; }
.product-page .fx { margin-top: 64px; }
.product-buy-again { margin: 56px 0 0; text-align: center; }

/* the bundle shows both logos side by side */
.bundle-marks { display: flex; gap: 6%; justify-content: center; max-width: 560px; margin: 0 auto; }
.bundle-marks .rollover { width: 47%; margin: 0; }

/* Buy buttons are form buttons (they post to /api/checkout) styled like the .buy link */
button.buy { font: inherit; color: inherit; background: none; border-radius: 0; cursor: pointer; }
button.buy:disabled { opacity: .5; cursor: progress; }
.buy-form { margin: 0; }
.price s { opacity: .5; margin-right: 6px; }
.sale-note { font-size: 11px; text-transform: uppercase; color: var(--blue); }
.code-note { margin-top: 14px !important; font-size: 11px; }
.buy-status { min-height: 1.4em; margin-top: 10px !important; }
.store-note { max-width: 420px; margin: 96px auto 0; text-align: center; font-size: 11px; }
.store-note a { text-decoration: underline; text-underline-offset: 2px; }

/* pre-order lock-in */

.lockin {
  max-width: 480px;
  margin: 0 auto 96px;
  text-align: center;
}
/* the form shows while the store is closed; once it's open (main.js: data-store on <html>) the #lockin page says so */
html:not([data-store="closed"]) .lockin { display: none; }
.lockin-out { display: none; max-width: 480px; margin: 0 auto; text-align: center; }
html[data-store="open"] .lockin-out { display: block; }
.lockin-page { margin-bottom: 0; }
.lockin-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: normal;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.lockin-page .lockin-title { font-size: 28px; }
.lockin-desc { margin: 0 0 20px; }
.lockin-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.lockin-form input[type="email"] {
  flex: 1 1 220px;
  min-width: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 1px solid var(--ink);
  border-right: 0;
  border-radius: 0;
  padding: 9px 12px;
}
.lockin-form input[type="email"]:focus { outline: none; border-color: var(--blue); }
.lockin-form button {
  font: inherit;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 9px 22px;
  cursor: pointer;
}
.lockin-form button:hover, .lockin-form button:focus-visible { background: var(--blue); border-color: var(--blue); }
.lockin-form button:disabled { opacity: .5; cursor: default; }
.lockin-status { flex-basis: 100%; min-height: 1.4em; margin: 12px 0 0; }
.lockin-form.is-done input, .lockin-form.is-done button { display: none; }
.lockin-page .back { display: inline-block; margin-top: 48px; text-transform: uppercase; }
/* honeypot: off-screen field that only bots fill in */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.rollover {
  position: relative;
  width: min(100%, 480px);
  aspect-ratio: 966 / 617;
  margin: 0 auto;
}

.rollover img { position: absolute; display: block; }
.rollover-mark { inset: 0; width: 100%; height: 100%; }

/* numbers come from tools/make_logo.py (assets/rollover-star.json) */
.rollover-star {
  left: 68.53%;
  top: 6.483%;
  width: 17.598%;
  animation: twinkle 3s ease-in-out infinite;
}

/* a slow, soft fade out and back in */
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50%      { opacity: .12; }
}

.product {
  max-width: 420px;
  margin: 48px auto 0;
  text-align: center;
}

.product p { margin: 0 0 6px; }
.meta { text-transform: uppercase; font-size: 11px; }
.price { font-size: 15px; margin-top: 18px !important; }

.buy {
  display: inline-block;
  margin-top: 14px;
  padding: 9px 22px;
  border: 1px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: background .15s, color .15s, border-color .15s;
}
.buy:hover, .buy:focus-visible {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--paper);
}

/* free */

.list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 900px;
}

.list li {
  display: grid;
  /* fixed format/download columns so every row's text lines up */
  grid-template-columns: 1fr 2fr 9em 7em;
  gap: 24px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--ink);
}
.list li:last-child { border-bottom: 1px solid var(--ink); }

.list .name, .list a { text-transform: uppercase; }
.list .fmt { font-size: 11px; }
.list li > a:last-child { justify-self: end; } /* the Download link */

/* plugin pages */

.plugin-page {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.plugin-page .back {
  display: block;
  width: fit-content;
  margin-bottom: 40px;
  text-transform: uppercase;
}
.plugin-name {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: normal;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.plugin-desc { margin: 0 0 6px; }
.shot { margin: 36px auto 0; }
.shot img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--ink);
}
.shot figcaption {
  margin-top: 8px;
  font-size: 11px;
  text-transform: uppercase;
}
.shot-missing {
  margin: 36px auto 0;
  padding: 72px 16px;
  border: 1px dashed var(--ink);
  text-transform: uppercase;
  font-size: 11px;
}
.plugin-page .buy { margin-top: 40px; }
.req { margin: 10px auto 0; max-width: 560px; font-size: 11px; }
.credit { margin: 14px auto 0; }
.credit a { text-decoration: underline; text-underline-offset: 2px; }

/* effect notes under the screenshots: ruled rows like the free list */
.fx { margin-top: 56px; text-align: left; }
.fx-title {
  margin: 40px 0 6px;
  font-size: 15px;
  font-weight: normal;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.fx-title:first-child { margin-top: 0; }
.fx-intro { margin: 0 0 14px; max-width: 640px; }
.plugin-page > .fx-intro { margin: 28px auto 0; }
.fx-list {
  display: grid;
  grid-template-columns: 10em 1fr;
  margin: 0;
  border-bottom: 1px solid var(--ink);
}
.fx-list dt, .fx-list dd {
  margin: 0;
  padding: 7px 0;
  border-top: 1px solid var(--ink);
}
.fx-list dt { text-transform: uppercase; }

/* OsTIrus: one device per row at its real width */
.devices .shot figcaption span { display: block; margin-top: 2px; text-transform: none; }

/* screenshots with a light and a dark version follow the site's mode */
html:not(.dark) .shot .theme-dark,
html.dark .shot .theme-light { display: none; }

/* NXFX skin picker: only the chosen set of screenshots shows */
.skin-switch {
  display: inline-flex;
  margin-top: 28px;
  border: 1px solid var(--ink);
}
.skin-switch button {
  font: inherit;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: inherit;
  background: none;
  border: 0;
  padding: 7px 16px;
  cursor: pointer;
}
.skin-switch button + button { border-left: 1px solid var(--ink); }
.skin-switch button:hover, .skin-switch button:focus-visible { color: var(--blue); }
.skin-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.skin-set { display: none; }
.plugin-page[data-skin="minimal"] [data-skin-set="minimal"],
.plugin-page[data-skin="photo"] [data-skin-set="photo"],
.plugin-page[data-skin="classic"] [data-skin-set="classic"] { display: block; }
.plugin-page[data-skin] .skin-row { /* the hardware skins: tall panels side by side */
  justify-content: center;
  align-items: flex-start;
  gap: 0 20px;
}
.plugin-page[data-skin="photo"] .skin-row[data-skin-set="photo"],
.plugin-page[data-skin="classic"] .skin-row[data-skin-set="classic"] { display: flex; }
/* each panel takes row space in proportion to its real width (--w), never past it */
.skin-row .shot {
  flex: var(--w) 1 0;
  max-width: calc(var(--w) * 1px);
  min-width: 0;
  margin-left: 0;
  margin-right: 0;
}
.skin-row .shot img { width: 100%; }

.note {
  max-width: 900px;
  margin: 18px auto 0;
}

/* stats dashboard (#stats) */

.stats { max-width: 900px; margin: 0 auto; }
.stats [hidden] { display: none !important; }
.stats .plugin-name { text-align: center; }
.stats button {
  font: inherit;
  color: inherit;
  background: none;
  border: 1px solid var(--ink);
  padding: 6px 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
}
.stats button:hover, .stats button:focus-visible { color: var(--blue); border-color: var(--blue); }
.stats button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.stats input {
  font: inherit;
  color: inherit;
  background: none;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 6px 8px;
}
.stats.is-loading .kpis, .stats.is-loading .stats-chart, .stats.is-loading .stats-grid { opacity: .4; }

.stats-login { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 24px; }
.stats-login input { width: min(260px, 100%); }
.stats-msg, .stats-error { flex-basis: 100%; margin: 4px 0 0; text-align: center; }
.stats-error:empty { display: none; }

.stats-live { margin-top: 28px; padding: 12px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.live-head { margin: 0; text-transform: uppercase; }
.live-head strong { font-size: 22px; font-weight: normal; margin-right: 6px; vertical-align: -2px; }
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--blue);
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse { 50% { opacity: .25; } }
.live-list { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12px; }
.live-list li { padding: 2px 0; }

.stats-range { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; }
.range-presets { display: flex; }
.range-presets button + button { border-left: 0; }
.range-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0;
  margin: 28px 0 0;
  border-top: 1px solid var(--ink);
}
.kpis div { padding: 12px 0; border-bottom: 1px solid var(--ink); }
.kpis dt { font-size: 11px; text-transform: uppercase; }
.kpis dd { margin: 4px 0 0; font-size: 28px; letter-spacing: .02em; }

.stats-chart { margin: 32px 0 0; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.chart-head figcaption { text-transform: uppercase; }
.chart-metric { display: flex; }
.chart-metric button + button { border-left: 0; }
.chart-plot { position: relative; }
.chart-plot svg { display: block; width: 100%; overflow: visible; }
.chart-plot .grid { stroke: var(--ink); stroke-opacity: .12; }
.chart-plot .axis { stroke: var(--ink); }
.chart-plot .tick { fill: var(--ink); font-size: 10px; }
.chart-plot .area { fill: var(--blue); fill-opacity: .1; }
.chart-plot .line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-plot .cross { stroke: var(--ink); stroke-opacity: .4; }
.chart-plot .dot { fill: var(--blue); stroke: var(--paper); stroke-width: 2; }
.chart-plot .hit { fill: transparent; cursor: crosshair; }
.chart-tip {
  position: absolute;
  top: -6px;
  transform: translate(-50%, -100%);
  padding: 6px 10px;
  background: var(--paper);
  border: 1px solid var(--ink);
  white-space: nowrap;
  pointer-events: none;
  font-size: 12px;
}
.chart-tip strong { display: block; font-weight: normal; font-size: 15px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px 40px;
  margin-top: 40px;
}
.stats-grid h2 { margin: 0 0 6px; font-size: 13px; font-weight: normal; text-transform: uppercase; letter-spacing: .04em; }
.stats-grid ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.stats-grid li {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--ink);
}
/* a bar behind each row, its length the share of the top row */
.stats-grid li::before {
  content: "";
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: var(--share, 0);
  background: var(--blue);
  opacity: .12;
  border-radius: 0 4px 4px 0;
}
.stats-grid li span { position: relative; overflow-wrap: anywhere; }
.stats-grid li .n { flex: none; }
.stats-grid li.empty { color: inherit; opacity: .5; }

.stats-foot { margin: 32px 0 0; font-size: 12px; }
.stats-foot + .stats-foot { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.stats-foot code { font: inherit; border-bottom: 1px solid var(--ink); }

/* legal pages (site/legal/*.html): terms, privacy, refunds, EULA */

.legal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px var(--gutter);
  text-transform: uppercase;
}
.legal-home {
  background: var(--ink);
  color: var(--paper);
  padding: 2px 6px;
  letter-spacing: .02em;
}
.legal-home:hover, .legal-home:focus-visible { background: var(--blue); color: var(--paper); }
.legal-top nav { display: flex; gap: 20px; }
.legal-top a[aria-current="page"] { color: var(--blue); }

.legal { max-width: 680px; margin: 0 auto; font-size: 14px; line-height: 1.55; }
.legal h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: normal;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.legal .updated { margin: 0 0 28px; font-size: 11px; text-transform: uppercase; }
.legal .summary { padding: 12px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.legal h2 {
  margin: 36px 0 8px;
  font-size: 13px;
  font-weight: normal;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.legal h3 { margin: 22px 0 6px; font-size: 14px; font-weight: bold; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 4px; }
.legal a { text-decoration: underline; text-underline-offset: 2px; }
.legal table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 13px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 6px 8px 6px 0; border-top: 1px solid var(--ink); }
.legal th { font-weight: normal; text-transform: uppercase; font-size: 11px; }
.legal address { font-style: normal; margin-bottom: 12px; }

/* /download and /activate */
.download .buy, .activate .buy { margin-top: 6px; text-decoration: none; }
.download .buy[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.download-meta:empty { display: none; }
.download-meta { font-size: 11px; text-transform: uppercase; }
.download-note { font-size: 12px; }

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }

/* about */

.about {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}
.about-mark { display: block; margin: 0 auto 24px; image-rendering: pixelated; }

/* ── footer ─────────────────────────────────────────── */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 var(--gutter) 24px;
  text-transform: uppercase;
}
.footer small { font-size: 10px; }

.theme-toggle {
  font: inherit;
  font-size: 15px;
  line-height: 1;
  color: inherit;
  background: none;
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--blue); }

/* ── dark mode: invert everything ───────────────────── */
/* Each section is inverted on its own rather than the whole <html>, so the
   Lemon Squeezy checkout overlay (appended to <body>) stays un-inverted and
   still covers the viewport. hue-rotate keeps the blue accent blue. */

html.dark { color-scheme: dark; }
html.dark body { background: var(--ink); }
html.dark body > :is(.ticker, .banner, .nav, .legal-top, main, .footer) {
  filter: invert(1) hue-rotate(180deg);
}
/* ...except plugin screenshots, flipped back so they show their real colours */
html.dark .shot img { filter: invert(1) hue-rotate(180deg); }

/* ── small screens ──────────────────────────────────── */

@media (max-width: 600px) {
  main { padding-top: 48px; }
  .list li {
    grid-template-columns: 1fr auto;
    gap: 2px 16px;
  }
  .list .desc { grid-column: 1 / -1; grid-row: 2; }
  .list .fmt { grid-row: 1; grid-column: 2; }
  .list li > a:last-child { grid-column: 1 / -1; justify-self: start; }
  /* phones: hardware-skin panels stack instead of shrinking to slivers */
  .plugin-page[data-skin] .skin-row { flex-direction: column; align-items: center; }
  .skin-row .shot { flex: none; width: 100%; }
  .fx-list { grid-template-columns: 1fr; }
  .fx-list dd { border-top: 0; padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .rollover-star, .view.is-active, .live-dot { animation: none; }
}
