/* The Cadence site on top of zap's theme: zap's tokens are set to a black
   stage with a violet → pink → orange gradient, and the page layout is here. */
.zap[data-theme="dark"] {
  --zap-font: Figtree, "Avenir Next", system-ui, sans-serif;
  --zap-bg: #070a0b;
  --zap-surface: #0e1415;
  --zap-elevated: #162022;
  --zap-text: #eef6f5;
  --zap-muted: #92a5a7;
  --zap-border: #233134;
  --zap-primary: #2dd4bf;
  --zap-primary-contrast: #04161a;
  --zap-primary-soft: rgba(45, 212, 191, .14);
  --zap-radius: 14px;
  --zap-radius-sm: 9px;
  --zap-chart-1: #2dd4bf; --zap-chart-2: #3b82f6; --zap-chart-3: #a3e635; --zap-chart-4: #38bdf8;
  --grad: linear-gradient(100deg, #34d399 0%, #22d3ee 50%, #3b82f6 100%);
  --line-soft: #172224;
  --well: #040607;
  --shadow: 0 30px 90px -30px rgba(0, 0, 0, .9);
  min-height: 100vh;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #070a0b; overflow-x: hidden; }
.zap { font-size: 17px; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.muted { color: var(--zap-muted); font-size: 13.5px; }
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.noscript { width: min(760px, 100% - 40px); margin: 80px auto; }
/* the page as plain HTML, there until app.js draws it (and for readers without JavaScript) */
.readable { padding: 60px 0 80px; }
.readable img { margin: 0 0 24px; border-radius: 12px; border: 1px solid var(--zap-border); }
.readable ul, .readable ol { color: var(--zap-muted); font-size: 15px; }
.readable a { color: var(--zap-primary); }
.noscript a { color: #2dd4bf; }

/* the gradient: primary buttons marked .grad, the headline, the flags */
.zap .grad.zap-btn--primary, .zap a.grad.zap-btn--primary { background: var(--grad); border-color: transparent; color: #04161a; box-shadow: 0 8px 30px -10px rgba(34, 211, 238, .5); }
.zap .grad.zap-btn--primary:hover { filter: brightness(1.08); }
.flag.zap-badge { background: var(--grad); color: #04161a; border: 0; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: 11.5px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, #070a0b 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.top__row { display: flex; align-items: center; gap: 22px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 15px/1 "Bricolage Grotesque", sans-serif; letter-spacing: .14em; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.brand__ver { font-size: 12px; color: #2dd4bf; letter-spacing: 0; font-weight: 500; }
.top__nav { display: flex; gap: 20px; margin-left: auto; font-size: 14.5px; font-weight: 600; }
.top__nav a { text-decoration: none; color: var(--zap-muted); }
.top__nav a:hover { color: var(--zap-text); }
@media (max-width: 900px) { .top__nav { display: none; } .top__row > :last-child { margin-left: auto; } }
@media (max-width: 480px) { .brand__ver { display: none; } }

/* hero */
.hero { padding: 72px 0 40px; position: relative; }
.hero::before { content: ""; position: absolute; inset: -140px -20vw auto; height: 760px; z-index: -1; pointer-events: none;
  background: radial-gradient(42% 55% at 22% 30%, #34d39926, transparent 70%), radial-gradient(38% 50% at 72% 22%, #22d3ee22, transparent 70%), radial-gradient(34% 44% at 88% 62%, #3b82f61f, transparent 70%); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 48px; align-items: center; }
h1 { font: 800 clamp(48px, 5vw, 70px)/.95 "Bricolage Grotesque", sans-serif; letter-spacing: -.03em; margin: 0 0 22px; }
h1 em { display: block; font-size: .44em; line-height: 1.15; letter-spacing: -.01em; margin-top: 10px; font-style: normal;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 19px; color: var(--zap-muted); max-width: 34em; margin: 0 0 28px; }
.lede b { color: var(--zap-text); font-weight: 600; }
.lede a { color: inherit; text-underline-offset: 3px; }
.built-on { font-size: 14px; line-height: 1.55; color: var(--zap-muted); max-width: 40em; margin: -12px 0 26px;
  padding-left: 14px; border-left: 2px solid color-mix(in srgb, var(--zap-primary) 70%, transparent); }
.built-on__mark { display: block; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--zap-text); margin-bottom: 2px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.note { font-size: 13px; color: var(--zap-muted); margin: 16px 0 0; }
@media (max-width: 980px) { .hero { padding-top: 44px; } .hero__grid { grid-template-columns: 1fr; gap: 34px; } }

/* step sequencer */
.seq { background: var(--zap-surface); border: 1px solid var(--zap-border); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.seq__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.seq__title { font: 700 12px/1 Figtree, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--zap-muted); margin-right: auto; }
.seq__play[aria-pressed="true"] { background: var(--grad); color: #04161a; border-color: transparent; }
.seq__rows { display: grid; gap: 5px; }
.seq__row { display: grid; grid-template-columns: 50px repeat(16, minmax(0, 1fr)); gap: 4px; align-items: center; }
.seq__name { font-size: 12.5px; font-weight: 700; color: var(--zap-muted); }
.cell { aspect-ratio: 1 / 1.15; min-height: 20px; border-radius: 4px; border: 0; padding: 0; background: var(--zap-elevated); cursor: pointer; transition: transform .06s; }
.cell:nth-child(4n+2) { margin-left: 3px; }
.cell.is-on { background: var(--c); }
.cell.is-now { box-shadow: inset 0 0 0 2px var(--zap-text); }
.cell.is-now.is-on { transform: scale(1.12); }
.cell:focus-visible { outline: 2px solid #2dd4bf; outline-offset: 2px; }
.seq__swing { display: grid; grid-template-columns: 50px 1fr; gap: 10px; align-items: center; margin: 14px 0 0; font-size: 13px; color: var(--zap-muted); }
.seq__foot { margin: 10px 2px 0; font-size: 13px; color: var(--zap-muted); }
.seq-wrap { max-width: 640px; margin: 34px 0 0; }
/* the synth sketch in the hero */
.orf__waves { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.orf__scope { display: block; width: 100%; height: 118px; border-radius: 9px; background: #0a0d10; border: 1px solid var(--zap-border); }
.orf__ctls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; margin: 14px 2px 0; }
.orf__ctl { display: grid; grid-template-columns: 78px 1fr; gap: 10px; align-items: center; font-size: 13px; color: var(--zap-muted); }
.orf__keys { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; height: 74px; margin: 16px 0 0; touch-action: manipulation; }
.key { border: 0; padding: 0; border-radius: 0 0 4px 4px; background: #e9edf0; cursor: pointer; }
.key.is-on { background: #ffa53a; }
.key--black { position: absolute; top: 0; height: 60%; width: calc(100% / var(--n) * .62); left: calc(100% / var(--n) * var(--at) - 100% / var(--n) * .31); background: #14181c; border-radius: 0 0 3px 3px; box-shadow: 0 1px 0 #000; }
.key--black.is-on { background: #ff7a1a; }
.key:focus-visible { outline: 2px solid #2dd4bf; outline-offset: 1px; }
@media (max-width: 520px) { .orf__ctls { grid-template-columns: 1fr; } }

/* screenshots */
.shot { margin: 46px 0 0; }
.frame { border-radius: 12px; overflow: hidden; border: 1px solid var(--zap-border); box-shadow: var(--shadow); background: var(--well); }
.frame img { width: 100%; }
.shot .frame { box-shadow: var(--shadow), 0 0 0 1px #22d3ee33, 0 40px 140px -40px #34d39944; }
figure { margin: 0; }
figcaption { font-size: 13.5px; color: var(--zap-muted); margin-top: 12px; }
.figure { margin: 0 0 34px; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 22px; margin: 38px 0 0; align-items: start; }
.gallery__wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } }

/* sections */
section { padding: 84px 0 0; }
h2 { font: 700 clamp(28px, 3.6vw, 44px)/1.08 "Bricolage Grotesque", sans-serif; letter-spacing: -.02em; margin: 16px 0 14px; max-width: 20em; }
.intro { color: var(--zap-muted); max-width: 44em; margin: 0 0 30px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 16px; } section { padding-top: 60px; } }
dl.feat { margin: 0; display: grid; gap: 16px; }
dl.feat dt { font-weight: 700; }
dl.feat dd { margin: 2px 0 0; color: var(--zap-muted); font-size: 15.5px; }
pre { background: var(--well); border: 1px solid var(--line-soft); border-radius: 9px; padding: 13px 15px; font-size: 13px; overflow-x: auto; margin: 14px 0 0; }

/* devices */
.dev-tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dev-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.dev-search { width: min(260px, 100%); }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); background: var(--zap-surface); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; min-height: 120px; }
.cat { padding: 18px 18px 20px; box-shadow: 1px 1px 0 var(--line-soft); }
.cat h3 { font: 700 12px/1 Figtree, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #2dd4bf; margin: 0 0 10px; display: flex; justify-content: space-between; }
.cat h3 span { color: var(--zap-muted); letter-spacing: 0; font-weight: 400; }
.cat ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.cat li { padding: 3px 0; }
.cat li small { color: var(--zap-muted); font-size: 13px; }
.empty { color: var(--zap-muted); padding: 18px; margin: 0; }
.tiles { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 14px; margin: 22px 0 34px; }
.tiles img { height: 150px; width: auto; max-width: none; border-radius: 8px; border: 1px solid var(--zap-border); }

/* AI */
.chat .zap-card__body, .chat { display: grid; gap: 12px; font-size: 15px; }
.chat .me { justify-self: end; background: var(--zap-elevated); border-radius: 12px 12px 3px 12px; padding: 10px 14px; max-width: 85%; }
.chat .tool { font-size: 12.5px; color: var(--zap-muted); border-left: 2px solid #2dd4bf; padding-left: 10px; }

/* beta */
.beta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; background: var(--zap-surface); border: 1px solid var(--zap-border); border-radius: 16px; padding: 30px; }
@media (max-width: 900px) { .beta { grid-template-columns: 1fr; padding: 20px; } }
.spec { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 22px; }
.spec th { text-align: left; font-weight: 400; color: var(--zap-muted); padding: 9px 14px 9px 0; white-space: nowrap; }
.spec td { padding: 9px 0; font-weight: 600; }
.spec tr + tr { border-top: 1px solid var(--line-soft); }
.hash { font-size: 11.5px; color: var(--zap-muted); word-break: break-all; margin-top: 14px; }
.beta ol, .beta ul { margin: 0; padding-left: 20px; color: var(--zap-muted); font-size: 15px; display: grid; gap: 6px; }
.numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 28px 0 16px; }
@media (max-width: 700px) { .numbers { grid-template-columns: 1fr; } }
.chart-card { margin-bottom: 16px; }
.signup__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 14px; }
@media (max-width: 700px) { .signup__grid { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; align-content: start; }
.field__label { font-size: 13.5px; font-weight: 600; }
.signup__send { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 14px; }

.foot { margin-top: 90px; border-top: 1px solid var(--line-soft); padding: 26px 0 40px; color: var(--zap-muted); font-size: 13.5px; }
.foot__row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .cell { transition: none; } }

/* download form, tester offer, bug report */
.dl-form { display: grid; gap: 14px; }
.dl-form__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 560px) { .dl-form__row { grid-template-columns: 1fr; } }
.dl-form__beta { background: var(--zap-primary-soft); border: 1px solid rgba(45, 212, 191, .38); border-radius: 10px; padding: 12px 14px; }
.dl-form__error { color: var(--zap-danger); margin: 0; font-size: 14px; }
.req { color: var(--zap-danger); }
/* beta tester programme */
.tp__grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tp { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
.tp__reward { position: relative; border-radius: 16px; padding: 30px; background: linear-gradient(160deg, rgba(52, 211, 153, .13), rgba(59, 130, 246, .07) 55%, transparent), var(--zap-surface); border: 1px solid rgba(45, 212, 191, .38); box-shadow: 0 40px 120px -60px #22d3ee66; display: flex; flex-direction: column; }
.tp__label { font: 600 12px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--zap-primary); }
.tp__prize { font: 700 clamp(24px, 2.6vw, 32px)/1.12 "Bricolage Grotesque", sans-serif; letter-spacing: -.02em; margin: 14px 0 6px; }
.tp__sub { margin: 0 0 20px; color: var(--zap-muted); font-size: 15.5px; }
.tp__list { list-style: none; margin: 0 0 26px; padding: 18px 0 0; border-top: 1px solid var(--line-soft); display: grid; gap: 12px; font-size: 15px; color: var(--zap-muted); }
.tp__list li { position: relative; padding-left: 24px; }
.tp__list li::before { content: ""; position: absolute; left: 2px; top: .52em; width: 9px; height: 9px; border-radius: 50%; background: var(--grad); }
.tp__list b { color: var(--zap-text); font-weight: 600; }
.tp__cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: auto; }
.tp__steps { list-style: none; margin: 0; padding: 8px 0; display: grid; gap: 0; background: var(--zap-surface); border: 1px solid var(--zap-border); border-radius: 16px; }
.tp__steps li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 16px; padding: 20px 26px; position: relative; }
.tp__steps li + li { border-top: 1px solid var(--line-soft); }
.tp__num { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--zap-primary); background: var(--zap-primary-soft); border: 1px solid rgba(45, 212, 191, .38); }
.tp__steps b { font: 700 18px/1.3 "Bricolage Grotesque", sans-serif; }
.tp__steps p { margin: 4px 0 0; color: var(--zap-muted); font-size: 15px; }
.tp__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; margin-top: 34px; }
.tp__facts h3 { font: 700 17px/1.3 "Bricolage Grotesque", sans-serif; margin: 0 0 6px; }
.tp__facts p { margin: 0; color: var(--zap-muted); font-size: 15px; }
.tp__facts b { color: var(--zap-text); font-weight: 600; }
@media (max-width: 900px) { .tp { grid-template-columns: 1fr; } .tp__facts { grid-template-columns: 1fr; gap: 20px; } .tp__reward { padding: 22px; } .tp__steps li { padding: 18px 18px; } }
.bug-card .zap-input, .bug-card .zap-field { margin-bottom: 12px; }
.dl-done { display: grid; gap: 14px; }
.dl-done__lead { font-size: 18px; font-weight: 700; margin: 0; }
.dl-done__licence { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; background: var(--zap-primary-soft); border: 1px solid rgba(45, 212, 191, .38); border-radius: 10px; padding: 14px; }
.dl-done__licence > div { display: grid; gap: 2px; }
.dl-done__label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #2dd4bf; }
.dl-done__id { font-size: 16px; }
.dl-done__steps { margin: 0; padding-left: 20px; color: var(--zap-muted); display: grid; gap: 6px; font-size: 15px; }
.dl-done__steps b { color: var(--zap-text); font-weight: 600; }
.dl-foot { display: flex; gap: 10px; justify-content: flex-end; }
.dl-foot[hidden] { display: none; }

/* platforms */
.os-logo { width: 18px; height: 18px; flex: none; }
.os-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.os-btn .os-logo { width: 19px; height: 19px; }
.note-link { font-size: 14px; color: var(--zap-muted); margin: 6px 0 0; }
.note-link a { color: #2dd4bf; }
.packages { display: grid; gap: 14px; }
.package { border: 1px solid var(--zap-border); border-radius: 12px; padding: 14px 16px; background: var(--zap-elevated); }
.package__head { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.package__head .muted { margin-left: auto; }
.package__req { margin: 4px 0 12px; color: var(--zap-muted); font-size: 14px; }
.package .hash { margin: 10px 0 0; }
.os-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.os-pick__item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--zap-border); background: var(--zap-surface); color: var(--zap-text); font: inherit; cursor: pointer; }
.os-pick__item .os-logo { width: 22px; height: 22px; }
.os-pick__item span { display: grid; }
.os-pick__item small { color: var(--zap-muted); font-size: 12px; }
.os-pick__item.is-on { border-color: #2dd4bf; background: var(--zap-primary-soft); box-shadow: 0 0 0 1px #2dd4bf inset; }
.os-pick__item:focus-visible { outline: 2px solid #2dd4bf; outline-offset: 2px; }
@media (max-width: 520px) { .os-pick { grid-template-columns: 1fr; } }

/* admin */
.admin { padding: 28px 0 60px; display: grid; gap: 20px; }
.admin-loaded { margin-left: auto; font-size: 13px; }
.admin-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.admin-charts { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .admin-charts { grid-template-columns: 1fr; } }
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.admin-login > * { width: min(420px, 100%); }
.admin-login__send { margin-top: 14px; display: flex; justify-content: flex-end; }
.admin-wait { padding: 40px; text-align: center; }
.admin-detail { display: grid; gap: 10px; }
.admin-detail h4 { margin: 10px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--zap-muted); }
.admin-detail__field { display: grid; grid-template-columns: 90px 1fr; gap: 10px; font-size: 14.5px; }
.admin-detail__field > span { color: var(--zap-muted); }
.admin-pre { white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; background: var(--well); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin: 4px 0 0; }
.admin-file { color: #2dd4bf; font-weight: 600; text-decoration: none; }
.admin-file:hover { text-decoration: underline; }
.lost-link { color: #2dd4bf; }
.lost-sent p { margin: 0 0 8px; }
.dl-done__mailed { flex-basis: 100%; font-size: 13px; }

/* what's new: one accordion card per release; the newest open */
.releases { max-width: 880px; }
.release__version { font-size: 15px; font-weight: 600; color: var(--zap-text); margin-right: 10px; }
.release__date { color: var(--zap-muted); font-size: 13.5px; font-weight: 500; }
.release__list { margin: 0; padding-left: 20px; color: var(--zap-muted); }
.release__list li { margin: 0 0 7px; line-height: 1.55; }
