/* AR-K AUDIO website: the plugins' studio look.
   Flat mid-grey panels split by dark lines, white titles with a small square in the
   plugin's colour, big grey knobs inside a thick coloured ring. Colours: ark-artwork
   brand/colours/palette.md. Each page sets its plugin with <body data-plugin="..."> */

:root {
  /* house greys */
  --page: #1f1d1b;          /* the dark lines between panels */
  --base: #2e2b28;          /* panel grey (Step Filter's warm grey = the brand's) */
  --raised: #3a3633;        /* buttons, wells */
  --sunken: #191817;        /* knob track, inputs */
  --text: #eeeeee;
  --label: #bdbdbd;
  --value: #8e8e8e;

  /* the brand: the logo creature's orange and its antenna ball */
  --accent: #f0a43a;
  --second: #ff5c6a;
  --on-accent: #241a0c;

  /* the creature (redefined per plugin) */
  --cr-light: #f8c472;
  --cr-dark: #d4842a;
  --cr-limb: #e8b468;
  --cr-line: #5a3812;

  --radius: 6px;
  --gap: 4px;               /* the dark line between panels */
  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

body[data-plugin="orbital"] {
  --accent: #4cc3d9; --second: #ff8a3d; --base: #2c2e31; --raised: #383b3f; --page: #1c1d1f;
  --on-accent: #0b2a30;
  --cr-light: #9ee6f2; --cr-dark: #2a9bb0; --cr-limb: #74d3e4; --cr-line: #0f4650;
}
body[data-plugin="resampler"] {
  --accent: #ff5f8f; --second: #4cc3d9; --base: #2d2a2f; --raised: #3a363c; --page: #1d1b1e;
  --on-accent: #33101c;
  --cr-light: #ffadc4; --cr-dark: #d63d6c; --cr-limb: #ff8aaa; --cr-line: #5c1630;
}
body[data-plugin="recall"] {
  --accent: #b8e64a; --second: #ff8a3d; --base: #2b2d2b; --raised: #383a38; --page: #1b1c1b;
  --on-accent: #1f2a08;
  --cr-light: #d8f58a; --cr-dark: #86b02a; --cr-limb: #c6ec6a; --cr-line: #34470c;
}
/* plugin colours, for cards that show another plugin than the page's own */
.c-recall      { --accent: #b8e64a; --second: #ff8a3d; --base: #2b2d2b; --on-accent: #1f2a08; }
.c-step-filter { --accent: #f0a43a; --second: #ff5c6a; --base: #2e2b28; --on-accent: #241a0c; }
.c-orbital     { --accent: #4cc3d9; --second: #ff8a3d; --base: #2c2e31; --on-accent: #0b2a30; }
.c-resampler   { --accent: #ff5f8f; --second: #4cc3d9; --base: #2d2a2f; --on-accent: #33101c; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.55 var(--font);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--label); max-width: 40em; }
.muted { color: var(--value); }
.small { font-size: .875rem; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---- header: like a plugin's top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--base);
  border-bottom: var(--gap) solid var(--page);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .04em; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand span { font-size: .95rem; }
.nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.topbar .nav-toggle { display: none; }

/* ---- buttons: the plugins' flat buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 34px; padding: 6px 14px;
  background: var(--raised); color: var(--text);
  border: 0; border-radius: 4px;
  font: 700 .85rem/1 var(--font);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #48433f; color: var(--text); }
.btn.on, .btn[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.btn.big { min-height: 44px; padding: 10px 20px; font-size: .95rem; }
.btn[disabled] { opacity: .45; cursor: default; }
.nav .btn.c-step-filter[aria-current="page"],
.nav .btn.c-orbital[aria-current="page"],
.nav .btn.c-resampler[aria-current="page"] { background: var(--accent); }

/* ---- panels: flat grey sections with a square-and-title header ---- */
.section { padding: 56px 0; }
section[id] { scroll-margin-top: 64px; }  /* under the sticky top bar */
.section.tight { padding: 32px 0; }
.panel {
  background: var(--base);
  border-radius: var(--radius);
  padding: 22px 24px 24px;
}
.panel > :last-child { margin-bottom: 0; }
.ptitle {
  display: flex; align-items: center; gap: 9px;
  font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  margin: 0 0 14px;
}
.ptitle::before {
  content: ""; width: 11px; height: 11px; border-radius: 2px; background: var(--accent); flex: none;
}
.ptitle.center { justify-content: center; }
.grid { display: grid; gap: var(--gap); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.board { background: var(--page); border-radius: var(--radius); }

.chip {
  display: inline-block; padding: 3px 9px; border-radius: 3px;
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: var(--raised); color: var(--label);
}
.chip.accent { background: var(--accent); color: var(--on-accent); }

/* ---- knobs: grey cap in a thick ring, the arc in the plugin's colour ---- */
.knob {
  --v: .6; --size: 96px; --ring: calc(var(--size) * .14);
  position: relative; width: var(--size); height: var(--size); flex: none;
  touch-action: none; user-select: none;
}
.knob::before {        /* the ring: track, then the coloured arc from -135 degrees */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 225deg, var(--accent) calc(var(--v) * 270deg), var(--sunken) 0 270deg, transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring)), #000 calc(100% - var(--ring) + 1px));
          mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring)), #000 calc(100% - var(--ring) + 1px));
}
.knob .cap {
  position: absolute; inset: calc(var(--ring) + var(--size) * .04); border-radius: 50%;
  background: #5d5955;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
  transform: rotate(calc(-135deg + var(--v) * 270deg));
}
body[data-plugin="orbital"] .knob .cap, .c-orbital .knob .cap { background: #585b60; }
.knob .cap::after {    /* the white pointer line */
  content: ""; position: absolute; left: 50%; top: 9%; width: 3px; height: 32%;
  margin-left: -1.5px; border-radius: 2px; background: var(--text);
}
.knob.live { cursor: ns-resize; }
.knob-label { text-align: center; }
.knob-label .name { display: block; font-size: .8rem; color: var(--label); margin-bottom: 6px; }
.knob-label .val { display: block; font-size: .9rem; color: var(--value); margin-top: 6px; font-variant-numeric: tabular-nums; }
.knobrow { display: flex; gap: 22px; flex-wrap: wrap; }

/* ---- home: hero ---- */
.hero { padding: 40px 0 0; }
.hero-panel {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: start;
  padding: clamp(24px, 5vw, 56px);
}
.hero-logo { width: min(460px, 100%); margin-bottom: 8px; }
.hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); margin-top: 18px; }
.hero-knobs {
  display: grid; grid-template-columns: repeat(4, auto); justify-content: center; gap: 22px 22px;
  padding: 26px 18px; background: var(--page); border-radius: var(--radius);
}
.hero-knobs .knob { --size: 92px; }
/* the arp: the four knobs above a play button and eight step lights, like a little device */
.arp-box { background: var(--page); border-radius: var(--radius); }
.arp-box .hero-knobs { background: none; padding-bottom: 14px; }
.arp-bar { display: flex; align-items: center; gap: 14px; padding: 0 18px 18px; }
.arp-bar .btn { min-width: 108px; }
.arp-steps { flex: 1; display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.arp-steps i { height: 14px; border-radius: 3px; background: var(--raised); transition: background .06s; }
.arp-steps i.lit { background: var(--accent); }
/* the drum machine under the arp: one bar, 16 steps, a row per drum in the plugins' colours */
.drums { padding: 0 18px 18px; }
.drum-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.drum-title { font-size: .85rem; font-weight: 700; color: var(--label); }
.drum-title span { font-weight: 400; color: var(--value); }
.drum-kits { display: flex; gap: 5px; }
.btn.small { min-height: 28px; padding: 4px 10px; font-size: .75rem; }
.drum-row { display: grid; grid-template-columns: 52px repeat(16, minmax(0, 1fr)); gap: 3px; align-items: center; margin-bottom: 3px; }
.drum-row > span { font-size: .72rem; color: var(--value); white-space: nowrap; overflow: hidden; }
.drum-row button { height: 22px; padding: 0; border: 0; border-radius: 3px; background: var(--raised); cursor: pointer; }
.drum-row button.beat { background: #45403c; }
.drum-row button.on { background: var(--c); }
.drum-row button.now { box-shadow: inset 0 0 0 2px var(--text); }
.drum-row button:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.arp-bar .btn.drop { min-width: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.btn.drop.held { background: var(--second); color: #2a0d10; }
/* play along: nine keys, the scale, so every note fits */
.play-along { padding: 0 18px 18px; }
.play-along .drum-title { display: block; margin-bottom: 8px; }
.play-keys { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
.play-keys button {
  height: 46px; padding: 0 0 6px; border: 0; border-radius: 4px; cursor: pointer;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--raised); color: var(--value); font: 700 .75rem/1 var(--font);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.play-keys button.down { background: var(--k); color: #1d1c1b; }
@media (max-width: 520px) {
  .play-along { padding: 0 10px 14px; }
  .arp-bar { flex-wrap: wrap; }
  .arp-bar .arp-steps { order: 3; flex-basis: 100%; }
  .drums { padding: 0 10px 14px; }
  .drum-row { grid-template-columns: 38px repeat(16, minmax(0, 1fr)); gap: 2px; }
  .drum-row button { height: 20px; border-radius: 2px; }
}
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }

/* ---- plugin cards ---- */
.card { display: flex; flex-direction: column; gap: 14px; }
.card h3 { font-size: 1.5rem; margin: 0; }
.card .shot { display: block; border-radius: 4px; background: var(--page); aspect-ratio: 16 / 10; overflow: hidden; }
.card .shot.placeholder { display: grid; }
.card .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.card .grow { flex: 1; }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---- placeholders for pictures still to make ---- */
.placeholder {
  display: grid; place-content: center; text-align: center; gap: 6px;
  min-height: 220px; padding: 24px;
  border: 2px dashed #5a5550; border-radius: var(--radius);
  color: var(--value); font-size: .9rem;
  background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255,255,255,.025) 14px 28px);
}
.placeholder strong { color: var(--label); }

/* ---- ARK Link diagram ---- */
.link-board { padding: 28px clamp(16px, 4vw, 36px) 32px; }
.link-plugins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lp {
  background: var(--base); border-radius: var(--radius); padding: 14px 16px; text-align: center;
  border-top: 4px solid var(--accent);
}
.lp b { display: block; font-size: 1.05rem; }
.lp span { font-size: .8rem; color: var(--value); }
.taps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; height: 34px; }
.taps i { justify-self: center; width: 4px; background: var(--accent); border-radius: 2px; }
.bus {
  position: relative; border-radius: var(--radius); background: var(--raised);
  padding: 14px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.bus .chan { font-weight: 800; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-right: 8px; }
.bus .ev {
  font-size: .8rem; font-weight: 700; padding: 4px 9px; border-radius: 3px;
  background: var(--sunken); color: var(--label);
}
.bus .ev em { font-style: normal; color: var(--text); }
.pulse { animation: pulse 2.4s ease-in-out infinite; }
.pulse:nth-child(3) { animation-delay: .6s; } .pulse:nth-child(4) { animation-delay: 1.2s; } .pulse:nth-child(5) { animation-delay: 1.8s; }
@keyframes pulse { 0%, 70%, 100% { background: var(--sunken); } 20% { background: #4a4541; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ---- ark-core: the plugins standing on one shared core ---- */
.core-board { padding: clamp(14px, 3vw, 28px); }
.core-plugins { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.core-plugins a.lp { color: var(--text); text-decoration: none; }
.core-plugins a.lp:hover { background: var(--raised); }
.lp-next { border-top-style: dashed; border-top-color: #6b6560; }
.core-bar {
  margin-top: 10px; background: var(--base); border-radius: var(--radius);
  border-top: 4px solid var(--text);
  padding: 16px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center;
}
.core-name { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.core-name img { border-radius: 8px; }
.core-mods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.mod { background: var(--raised); border-radius: 4px; padding: 10px 12px; }
.mod b { display: block; font-size: .9rem; }
.mod span { font-size: .78rem; color: var(--value); line-height: 1.35; display: block; margin-top: 3px; }

/* ---- shop ---- */
.price { font-size: 2rem; font-weight: 800; line-height: 1; }
.price small { font-size: .85rem; font-weight: 600; color: var(--value); }
.tbd { color: var(--value); }
.shop-card { display: flex; flex-direction: column; gap: 12px; border-top: 4px solid var(--accent); }
.shop-card .grow { flex: 1; }
.shop-card ul { margin: 0; padding-left: 1.1em; color: var(--label); font-size: .92rem; }
.shop-card li::marker { color: var(--accent); }
.bundle { border-top-color: var(--text); }
.bundle .swatches { display: flex; gap: 6px; }
.bundle .swatches i { width: 14px; height: 14px; border-radius: 3px; background: var(--accent); }
.faq details { background: var(--base); border-radius: 4px; padding: 14px 18px; }
.faq details + details { margin-top: var(--gap); }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 10px 0 0; color: var(--label); }

.steps-list { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.steps-list li::before {
  content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 4px;
  background: var(--raised); font-weight: 800; font-size: .85rem;
}

/* ---- the creature's own section ---- */
.moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--gap); margin-top: 18px; }
.move { background: var(--raised); border-radius: 4px; padding: 12px 14px; }
.move b { display: block; }
.move span { font-size: .85rem; color: var(--value); }
.creature-stage {
  display: grid; place-items: end center; min-height: 260px;
  background: var(--page); border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden;
}
.creature-stage .floor { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: var(--raised); }
.creature-stage .knob { --size: 120px; position: absolute; bottom: 40px; right: 18%; }
.creature-stage svg.cr-big { position: relative; z-index: 1; width: 120px; margin-bottom: 30px; margin-right: 34%; }

/* ---- plugin pages ---- */
.plugin-head { padding: 40px 0 0; }
.plugin-head .panel { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: clamp(22px, 4vw, 40px); }
.plugin-head h1 { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.plugin-head h1::before { content: ""; width: .5em; height: .5em; border-radius: 4px; background: var(--accent); flex: none; }
.shot-frame { padding: 10px; background: var(--base); border-radius: var(--radius); }
.shot-frame img { border-radius: 3px; width: 100%; }
.shot-frame figcaption { font-size: .85rem; color: var(--value); padding: 10px 4px 2px; }
.feature ul { margin: 0; padding-left: 1.1em; color: var(--label); }
.feature li { margin-bottom: .35em; }
.feature li::marker { color: var(--accent); }
.feature p { color: var(--label); }
.get { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.note { border-left: 4px solid var(--accent); padding: 4px 0 4px 14px; color: var(--label); }

/* ---- footer ---- */
.footer { background: var(--base); border-top: var(--gap) solid var(--page); padding: 28px 0 90px; margin-top: 40px; }
.footer .wrap { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.footer img { width: 170px; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: .9rem; }
.footer nav a { color: var(--label); text-decoration: none; }
.footer nav a:hover { color: var(--accent); }

/* ---- the creature that lives on the page ---- */
#creature {
  position: fixed; left: 0; bottom: 0; z-index: 30;
  width: 64px; height: 72px;
  pointer-events: none;
  will-change: transform;
}
#creature svg { width: 100%; height: 100%; overflow: visible; pointer-events: auto; cursor: pointer; }
/* Orbit dancing his way from the logo to the sequencer (home page, while the arp plays) */
.hero-panel { position: relative; }
.dancer { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; display: none; }
.dancer.out { display: block; }
.dancer svg { width: 100%; height: 100%; overflow: visible; }
.dancer.walking svg { rotate: -6deg; }
.dancer.partying svg, #creature.partying:not(.moonwalk) svg { animation: cr-groove .5s ease-in-out infinite alternate; }
.dancer.partying .cr-armL, #creature.partying:not(.moonwalk) .cr-armL { animation: cr-armsL .5s ease-in-out infinite alternate; }
.dancer.partying .cr-armR, #creature.partying:not(.moonwalk) .cr-armR { animation: cr-armsR .5s ease-in-out infinite alternate; }
.dancer.partying .cr-legL, #creature.partying:not(.moonwalk) .cr-legL { animation: legs .25s ease-in-out infinite alternate; }
.dancer.partying .cr-legR, #creature.partying:not(.moonwalk) .cr-legR { animation: legs .25s ease-in-out infinite alternate-reverse; }
@keyframes cr-groove { from { translate: 0 0; rotate: -8deg; } to { translate: 0 -10%; rotate: 8deg; } }
@keyframes cr-armsL { from { transform: rotate(35deg); } to { transform: rotate(125deg); } }
@keyframes cr-armsR { from { transform: rotate(-125deg); } to { transform: rotate(-35deg); } }
#logo-orbit.o-out .o-all, #logo-orbit.o-out .o-bubble, #logo-orbit.o-out .o-notes { opacity: 0 !important; transition: none; }

/* notes floating up out of the step lights */
.arp-box { position: relative; }
.note-pop {
  position: absolute; z-index: 4; pointer-events: none;
  font: 800 18px/1 var(--font); margin-left: -.3em;
  animation: note-up 1.15s ease-out forwards;
}
@keyframes note-up {
  from { opacity: 1; transform: translate(0, 0) scale(.8); }
  to   { opacity: 0; transform: translate(var(--dx), -90px) scale(1.25); }
}
/* tricks: a spin (secret word "orbit") and a jump for a note, also while partying */
#creature svg.spin, .dancer svg.spin, .dancer.partying svg.spin { animation: cr-spin .8s ease-in-out; }
.dancer.partying svg.hop { animation: hop .45s cubic-bezier(.3,.7,.4,1); }
@keyframes cr-spin { 0% { rotate: 0deg; translate: 0 0; } 50% { translate: 0 -35%; } 100% { rotate: 360deg; translate: 0 0; } }
#logo-orbit.o-spin .o-all { animation: o-spin .8s ease-in-out; }
@keyframes o-spin {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(180deg); }
  100% { transform: translateY(0) rotate(360deg); }
}
/* the moonwalk: he glides backwards; one heel lifts while the other foot slides, then they swap */
.moonwalk .cr-legL { animation: mw-leg .6s linear infinite; }
.moonwalk .cr-legR { animation: mw-leg .6s linear infinite; animation-delay: -.3s; }
.moonwalk .cr-armL { animation: mw-arm .6s ease-in-out infinite alternate; }
.moonwalk .cr-armR { animation: mw-arm .6s ease-in-out infinite alternate-reverse; }
/* ...seen from the side (drawn facing right; the svg is mirrored when he faces left): a narrower body,
   the eye and smile on the front edge, legs one behind the other with both feet pointing forward,
   arms at his sides, antenna leaning back. translate / scale / rotate, so the walk animations
   (which use transform) still work on top */
.cr-torso, .cr-eye, .cr-mouth, .cr-antenna { transform-box: fill-box; transform-origin: center; }
.cr-antenna { transform-origin: 100% 100%; }
.cr-torso, .cr-eye, .cr-mouth, .cr-antenna, .cr-arm, .cr-leg { transition: translate .25s, scale .25s, rotate .25s; }
.moonwalk .cr-torso   { scale: .84 1; }
.moonwalk .cr-eye     { translate: 8px 0; scale: .62 1; }
.moonwalk .cr-mouth   { translate: 12px 0; scale: .55 1; }
.moonwalk .cr-antenna { rotate: -12deg; translate: -3px 0; }
.moonwalk .cr-armL    { translate: 16px 0; }
.moonwalk .cr-armR    { translate: -16px 0; }
.moonwalk .cr-legL    { translate: 8px 0; scale: -1 1; }
.moonwalk .cr-legR    { translate: -8px 0; }
.dancer.moonwalk svg, #creature.moonwalk svg { rotate: -5deg; }
@keyframes mw-leg {
  0%, 40%  { transform: rotate(0deg) translateY(0); }
  50%, 90% { transform: rotate(16deg) translateY(-6%); }
  100%     { transform: rotate(0deg) translateY(0); }
}
@keyframes mw-arm { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
#logo-orbit.o-moon .o-all { animation: o-moon 2.4s ease-in-out; }
@keyframes o-moon {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-18px); }
  75% { transform: translateX(16px); }
}
@media (prefers-reduced-motion: reduce) {
  .moonwalk .cr-legL, .moonwalk .cr-legR, .moonwalk .cr-armL, .moonwalk .cr-armR, #logo-orbit.o-moon .o-all { animation: none; }
}
.footer .psst { width: 100%; margin: 0; font-size: .8rem; color: var(--value); }
.footer .psst b { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  #creature svg.spin, .dancer svg.spin, .dancer.partying svg.spin, .dancer.partying svg.hop, #logo-orbit.o-spin .o-all { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dancer.partying svg, .dancer.partying .cr-armL, .dancer.partying .cr-armR,
  .dancer.partying .cr-legL, .dancer.partying .cr-legR,
  #creature.partying svg, #creature.partying .cr-arm, #creature.partying .cr-leg { animation: none; }
}
#creature .bubble, .dancer .bubble {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #1b1a19; font: 800 .8rem/1 var(--font);
  padding: 6px 9px; border-radius: 8px; white-space: nowrap;
  opacity: 0; transition: opacity .2s;
}
#creature .bubble.show, .dancer .bubble.show { opacity: 1; }
#creature .bubble::after, .dancer .bubble::after {
  content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px;
  border: 5px solid transparent; border-top-color: var(--text);
}
#creature .zzz { position: absolute; left: 70%; bottom: 80%; font: 800 .9rem var(--font); color: var(--label); opacity: 0; }
#creature.sleep .zzz { animation: zzz 2.6s ease-out infinite; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 0) scale(.7); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -26px) scale(1.2); } }
#creature.hidden { display: none; }

.cr-leg { transform-box: fill-box; transform-origin: 50% 0; }
.cr-arm { transform-box: fill-box; }
.cr-armL { transform-origin: 100% 0; }
.cr-armR { transform-origin: 0 0; }
.walking .cr-legL { animation: legs .5s ease-in-out infinite alternate; }
.walking .cr-legR { animation: legs .5s ease-in-out infinite alternate-reverse; }
.walking .cr-body { animation: bob .25s ease-in-out infinite alternate; }
@keyframes legs { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-1.5px); } }
.happy .cr-armL { transform: rotate(118deg); }
.happy .cr-armR { transform: rotate(-118deg); }
.wave .cr-armR { animation: wave .35s ease-in-out 4 alternate; }
@keyframes wave { from { transform: rotate(-90deg); } to { transform: rotate(-150deg); } }
.hop { animation: hop .45s cubic-bezier(.3,.7,.4,1); }
/* translate / scale, not transform: the walking direction flips the svg with transform */
@keyframes hop { 0%, 100% { translate: 0 0; scale: 1 1; } 15% { translate: 0 0; scale: 1.08 .9; } 50% { translate: 0 -22px; scale: .95 1.06; } }
.cr-lid { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); transition: transform .08s; }
.blink .cr-lid, .sleep .cr-lid { transform: scaleY(1); }
.cr-pupil { transition: transform .15s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .walking .cr-legL, .walking .cr-legR, .walking .cr-body, .wave .cr-armR, .hop, #creature.sleep .zzz { animation: none; }
}

/* ---- Orbit in the home page logo: looks around, waves, dances, taps his foot ----
   Pivots are in the logo's own coordinates (transform-box: view-box). */
#logo-orbit { display: block; height: auto; overflow: visible; }
#logo-orbit * { transform-box: view-box; }
#logo-orbit .o-all { transform-origin: 274px 157px; }
/* when Orbit climbs out of the logo, the K slides over to close the gap, and back when he comes home */
#logo-orbit .o-k { transition: transform 2.2s cubic-bezier(.45, 0, .25, 1); }
#logo-orbit.o-kin .o-k { transform: translateX(-82px); }
#logo-orbit .o-armL { transform-origin: 249.45px 116px; }
#logo-orbit .o-armR { transform-origin: 298.55px 116px; }
#logo-orbit .o-foot { transform-origin: 285.05px 156.5px; }
#logo-orbit .o-pupil { transition: transform .3s ease-out; }
#logo-orbit .o-lid { transform-origin: 277.68px 96.37px; transform: scaleY(0); transition: transform .07s; }
#logo-orbit.o-blink .o-lid { transform: scaleY(1); }
#logo-orbit .o-bubble, #logo-orbit .o-notes { opacity: 0; transition: opacity .25s; }
#logo-orbit.o-hi .o-bubble { opacity: 1; }
#logo-orbit.o-hi .o-armR { animation: o-wave .32s ease-in-out infinite alternate; }
#logo-orbit.o-tap .o-foot,
#logo-orbit.o-dance .o-foot { animation: o-tap .5s ease-in-out infinite; }      /* 120 bpm */
#logo-orbit.o-dance .o-all { animation: o-sway 1s ease-in-out infinite; }
#logo-orbit.o-dance .o-armL { animation: o-armL 1s ease-in-out infinite; }
#logo-orbit.o-dance .o-armR { animation: o-armR 1s ease-in-out infinite; }
#logo-orbit.o-dance .o-notes { opacity: 1; animation: o-notes 1s ease-in-out infinite; }
@keyframes o-wave { from { transform: rotate(-8deg); } to { transform: rotate(26deg); } }
@keyframes o-tap { 0%, 60%, 100% { transform: rotate(0); } 25% { transform: rotate(-32deg); } }
@keyframes o-sway {
  0%, 100% { transform: rotate(-5deg) translateY(0); }
  25% { transform: rotate(0) translateY(-5px); }
  50% { transform: rotate(5deg) translateY(0); }
  75% { transform: rotate(0) translateY(-5px); }
}
@keyframes o-armL { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-28deg); } }
@keyframes o-armR { 0%, 100% { transform: rotate(28deg); } 50% { transform: rotate(0); } }
@keyframes o-notes { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
/* he jumps out of the logo when you scroll down, and back in at the top */
#logo-orbit .o-all { transition: opacity .3s, transform .35s ease-in; }
#logo-orbit.o-gone .o-all { opacity: 0; transform: translateY(-70px); animation: none; }
#logo-orbit.o-gone .o-bubble, #logo-orbit.o-gone .o-notes { opacity: 0; }
#creature.away { visibility: hidden; }
#creature svg.drop { animation: cr-drop .7s cubic-bezier(.5, 0, .7, 1); }
#creature svg.leave { animation: cr-leave .45s ease-in forwards; }
@keyframes cr-drop {
  0% { translate: 0 -100vh; scale: 1 1; }
  72% { translate: 0 0; scale: 1 1; }
  84% { translate: 0 0; scale: 1.18 .82; }
  100% { translate: 0 0; scale: 1 1; }
}
@keyframes cr-leave {
  0% { translate: 0 0; scale: 1 1; }
  25% { translate: 0 4px; scale: 1.12 .88; }
  100% { translate: 0 -100vh; scale: .9 1.1; }
}
@media (prefers-reduced-motion: reduce) {
  #logo-orbit .o-all { transition: none; }
  #creature svg.drop, #creature svg.leave { animation: none; }
  #logo-orbit .o-armR, #logo-orbit .o-armL, #logo-orbit .o-foot, #logo-orbit .o-all, #logo-orbit .o-notes { animation: none !important; }
}

/* ---- phones and small tablets ---- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .core-bar { grid-template-columns: 1fr; }
  .core-mods { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 900px) {
  .hero-panel, .plugin-head .panel, .get { grid-template-columns: 1fr; }
  .core-plugins { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .g2, .g4 { grid-template-columns: 1fr; }
  .section { padding: 36px 0; }
  .topbar .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--base); border-bottom: var(--gap) solid var(--page);
    padding: 10px 16px 14px; flex-direction: column; align-items: stretch;
  }
  .nav.open { display: flex; }
  .nav .btn { justify-content: flex-start; min-height: 42px; }
  .hero-knobs .knob { --size: 88px; }
  .hero-knobs { gap: 16px 16px; grid-template-columns: repeat(2, auto); }
  .link-plugins, .taps { gap: 8px; }
  .lp { padding: 10px 8px; }
  .lp b { font-size: .9rem; }
  .lp span { display: none; }
  .creature-stage .knob { --size: 90px; right: 10%; }
  .creature-stage svg.cr-big { width: 96px; margin-right: 30%; }
  #creature { width: 48px; height: 54px; }
}

/* hidden always wins over a display set by a class (the Stop button is a .btn) */
[hidden] { display: none !important; }
.arp-box { transition: margin-top .35s ease; }
/* disco: while the music plays, the logo's letters switch colour on every beat (120 bpm = .5 s),
   each letter a beat apart, in the four plugins' colours */
@keyframes o-disco {
  0%   { stroke: #f0a43a; }
  25%  { stroke: #4cc3d9; }
  50%  { stroke: #b8e64a; }
  75%  { stroke: #ff5f8f; }
}
#logo-orbit.o-disco .o-a, #logo-orbit.o-disco .o-r, #logo-orbit.o-disco .o-k, #logo-orbit.o-disco .o-audio {
  animation: o-disco 2s steps(1, end) infinite;
}
#logo-orbit.o-disco .o-r { animation-delay: -.5s; }
#logo-orbit.o-disco .o-k { animation-delay: -1s; }
#logo-orbit.o-disco .o-audio { animation-delay: -1.5s; }
@media (prefers-reduced-motion: reduce) {
  #logo-orbit.o-disco .o-a, #logo-orbit.o-disco .o-r, #logo-orbit.o-disco .o-k, #logo-orbit.o-disco .o-audio { animation: none; }
}
/* petting Orbit: pink cheeks, and dizzy eyes after too many clicks */
.cr-blush { opacity: 0; transition: opacity .3s; }
.blush .cr-blush { opacity: .75; }
.dancer svg { pointer-events: auto; cursor: pointer; }
#logo-orbit { cursor: pointer; }
@keyframes cr-dizzy { 0% { translate: 3px 0; } 25% { translate: 0 3px; } 50% { translate: -3px 0; } 75% { translate: 0 -3px; } 100% { translate: 3px 0; } }
.dizzy .cr-pupil, #logo-orbit.dizzy .o-pupil { animation: cr-dizzy .35s linear infinite; }
/* the antenna light flashes on every kick */
body.kick .cr-antenna circle, body.kick #logo-orbit .o-ball { fill: #ffd9dc; }
/* Orbit's spaceship (the secret code ↑ ↑ ↓ ↓) */
.ufo { position: fixed; top: 16vh; left: 0; width: 170px; z-index: 30; pointer-events: none; animation: ufo-fly 5.5s linear forwards; }
.ufo svg { width: 100%; height: auto; animation: ufo-bob .7s ease-in-out infinite alternate; }
.ufo .ufo-light { animation: ufo-blink .4s steps(1, end) infinite; }
.ufo .ufo-light:nth-child(2n) { animation-delay: -.2s; }
@keyframes ufo-fly { from { transform: translateX(-200px); } to { transform: translateX(calc(100vw + 40px)); } }
@keyframes ufo-bob { from { translate: 0 -6px; rotate: -3deg; } to { translate: 0 6px; rotate: 3deg; } }
@keyframes ufo-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .dizzy .cr-pupil, #logo-orbit.dizzy .o-pupil, .ufo svg { animation: none; } }
/* try-it demos on the plugin pages */
.demo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.demo-head h2 { margin: 12px 0 6px; }
.demo-head p { max-width: 40em; margin: 0; }
.demo-ctl { display: flex; gap: 8px; align-items: center; }
.demo-knobs { margin-top: 16px; }
.draw-steps, .dv-lane {
  display: grid; gap: 4px; height: 190px; padding: 8px;
  background: var(--sunken); border-radius: var(--radius);
}
.draw-steps { grid-template-columns: repeat(16, minmax(0, 1fr)); touch-action: none; cursor: crosshair; }
.draw-steps i { align-self: end; height: calc(var(--h, .5) * 100%); background: var(--accent); border-radius: 3px 3px 0 0; opacity: .75; pointer-events: none; }
.draw-steps i.now { opacity: 1; box-shadow: inset 0 0 0 2px var(--text); }
.dv-lane { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.dv-lane i { position: relative; border-radius: 4px; }
.dv-lane i.now { background: var(--raised); }
.dv-lane b { position: absolute; left: 50%; bottom: calc(var(--p, .5) * (100% - 22px)); width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: var(--accent); transition: bottom .18s; }
.dv-lane i.new b { background: var(--second); }
.chord-keys { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.chord-keys button {
  height: 84px; border: 0; border-radius: var(--radius); cursor: pointer; touch-action: manipulation;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--raised); color: var(--text); font: 700 1.05rem/1 var(--font);
}
.chord-keys button span { font-size: .72rem; font-weight: 600; color: var(--value); }
.chord-keys button.down { background: var(--accent); color: var(--on-accent); }
.chord-keys button.down span { color: var(--on-accent); }
@media (max-width: 520px) {
  .draw-steps, .dv-lane { height: 150px; gap: 2px; padding: 6px; }
  .chord-keys { gap: 3px; }
  .chord-keys button { height: 64px; font-size: .9rem; }
}
/* the plugins' own corners of the home play area: playing along with the drums and the arp */
.play-modes { padding: 0 18px 18px; }
.mode-tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.mode-tabs .btn:not(.on) { background: var(--raised); color: var(--text); }
.mode-note { margin: 8px 0 0; font-size: .8rem; color: var(--value); }
.draw-steps.mini, .dv-lane.mini { height: 110px; }
.dv-lane.mini { cursor: pointer; }
.dv-lane.mini b { width: 16px; height: 16px; margin-left: -8px; bottom: calc(var(--p, .5) * (100% - 16px)); }
.chord-keys.mini button { height: 56px; font-size: .95rem; }
.chord-keys button.on { box-shadow: inset 0 0 0 2px var(--accent); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 520px) {
  .play-modes { padding: 0 10px 14px; }
  .draw-steps.mini, .dv-lane.mini { height: 96px; }
  .chord-keys.mini button { height: 48px; font-size: .8rem; }
}
