/* Random Machines: one design system for the RMXY-1 site.
   A black stage where the app is the only colour. Space Grotesk (the app's own face), very large tight
   headlines, 1 px graphite hairlines, 28 px media corners, pill buttons, no shadows.
   One accent, the logo orange, used only as punctuation. The app's lime appears only inside real captures. */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000;
  --band: #0b0b0c;
  --card: #141415;
  --surface: #141415;
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #6e6e73;
  --line: #232326;
  --line-2: #3a3a3e;
  --accent: #ff6a00;
  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);

  --t-s: 0.8125rem;   /* 13 */
  --t-m: 0.9375rem;   /* 15 */
  --t-l: 1.0625rem;   /* 17 */
  --t-xl: clamp(1.1875rem, 1.7vw, 1.3125rem);          /* 19 → 21 */
  --t-h3: clamp(1.375rem, 2.2vw, 1.75rem);             /* 22 → 28 */
  --t-h2: clamp(2.5rem, 6.4vw, 5.5rem);                /* 40 → 88 */
  --t-h1: clamp(3rem, 8.6vw, 8rem);                    /* 48 → 128 */
  --max: 1280px;
  --gutter: clamp(16px, 5vw, 48px);
  --sec: clamp(96px, 13vw, 176px);
  --nav-h: 56px;
  --r: 12px;
  --r-media: clamp(18px, 2.2vw, 28px);
  --r-shot: var(--r-media);
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 24px); }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-l) / 1.5 var(--font);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #000; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: fixed; z-index: 100; top: -80px; left: 16px;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 500;
}
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

/* ---------- Type ---------- */

h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
.h1 { font-size: var(--t-h1); line-height: 0.98; letter-spacing: -0.045em; }
h2, .h2 { font-size: var(--t-h2); line-height: 1; letter-spacing: -0.04em; }
h3, .h3 { font-size: var(--t-h3); line-height: 1.15; letter-spacing: -0.02em; }
.lede { margin: 0; font-size: var(--t-xl); line-height: 1.45; letter-spacing: -0.01em; color: var(--ink-2); text-wrap: pretty; }
.small { font-size: var(--t-m); color: var(--ink-2); }
.label { margin: 0; font-size: 0.75rem; font-weight: 500; line-height: 1; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.label--live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 10px; border-radius: 50%; background: var(--accent); vertical-align: 0.1em; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;
  border: 1px solid var(--line-2); border-radius: 999px; background: none;
  font-size: var(--t-m); font-weight: 500; text-decoration: none; cursor: pointer;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.btn:hover { border-color: var(--ink-2); }
.btn--primary { background: var(--ink); border-color: var(--ink); color: #000; }
.btn--primary:hover { background: #fff; border-color: #fff; }
.btn--soon { color: var(--ink-2); border-color: var(--line-2); cursor: default; }
.btn--soon:hover { border-color: var(--line-2); }
.btn--soon svg { width: 18px; height: 18px; fill: currentColor; }
.btn--soon small { margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--line-2); font-size: var(--t-s); color: var(--ink-3); }
.btn--lg { min-height: 52px; padding: 0 26px; font-size: var(--t-l); }

/* ---------- Navigation ---------- */

.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: saturate(1.4) blur(20px); backdrop-filter: saturate(1.4) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 100%; width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.nav__brand { display: inline-flex; align-items: center; min-height: 44px; flex: none; }
.nav__logo { height: 32px; width: auto; }
.nav__logo--symbol { display: none; }
@media (max-width: 480px) {
  .nav__logo--full { display: none; }
  .nav__logo--symbol { display: block; }
}
.nav__links { display: flex; align-items: center; gap: 2px; font-size: var(--t-s); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav__links::-webkit-scrollbar { display: none; }
.nav__links a { flex: none; white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink-2); text-decoration: none; transition: color 0.2s; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--ink); }
.nav__links a:last-child { margin-right: -12px; }
.nav__links .nav__sec { display: none; }
.nav__links .nav__sec + a:not(.nav__sec) { margin-left: 10px; padding-left: 22px; border-left: 1px solid var(--line); min-height: 16px; }
@media (min-width: 860px) { .nav__links .nav__sec { display: inline-flex; } }
@media (max-width: 859px) { .nav__links .nav__sec + a:not(.nav__sec) { margin-left: 0; padding-left: 12px; border-left: 0; min-height: 44px; } }
@media (max-width: 480px) {
  .nav__links { gap: 0; font-size: 0.75rem; }
  .nav__links a, .nav__links .nav__sec + a:not(.nav__sec) { padding-inline: 8px; }
  .nav__links a:last-child { margin-right: -8px; }
}

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 40px 0 20px; width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.footer__brand { display: inline-flex; align-items: center; min-height: 44px; }
.footer__brand img { height: 44px; width: auto; }
.footer__links { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0; padding: 0; list-style: none; font-size: var(--t-m); }
.footer__links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-decoration: none; }
.footer__links a:hover { color: var(--ink); }
.footer__ig { gap: 8px; }
.footer__ig svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.footer__ig svg circle:last-child { fill: currentColor; stroke: none; }
.footer__legal { width: min(100% - 2 * var(--gutter), var(--max)); margin: 0 auto; padding: 0 0 48px; font-size: var(--t-s); color: var(--ink-3); }
.footer__legal p { margin: 0 0 4px; max-width: 80ch; }
main + .footer { margin-top: 0; }
.doc-page .footer, .manual + .footer { margin-top: var(--sec); }

/* ---------- Images ---------- */

.shot { margin: 0; }
.shot img { width: 100%; border-radius: var(--r-shot); box-shadow: 0 0 0 1px var(--line); background: var(--surface); }

/* =========================================================
   Landing
   ========================================================= */

.sec { position: relative; padding-block: var(--sec); }
.sec--band { background: var(--bg); }
.sec__head { max-width: 960px; margin-bottom: clamp(48px, 7vw, 96px); }
.sec__head--center { margin-inline: auto; text-align: center; }
.sec__head .label { margin-bottom: 24px; }
.sec__head p:not(.label) { margin: 28px 0 0; max-width: 40ch; font-size: var(--t-xl); line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.sec__head--center p:not(.label) { margin-inline: auto; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(48px, 8vw, 128px); align-items: center; }
.split p:not(.label) { margin: 28px 0 0; max-width: 40ch; font-size: var(--t-xl); line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.split .label { margin-bottom: 24px; }
.split h2 { font-size: clamp(2.5rem, 5.2vw, 4.75rem); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 44px 0 0; padding: 0; list-style: none; max-width: 480px; }
.facts li { padding: 14px 0; border-top: 1px solid var(--line); font-size: var(--t-m); color: var(--ink-2); }
.facts b { display: block; font-weight: 500; color: var(--ink); }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
}

/* reveal on scroll */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1.2s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal="2"] { transition-delay: 0.08s; }
.js [data-reveal="3"] { transition-delay: 0.16s; }

/* ---------- Devices: flat frames with a real black bezel and a thin edge; no gradients, no island ---------- */

.device { position: relative; container-type: inline-size; margin: 0; }
.device__frame {
  position: relative; padding: var(--bz); border-radius: calc(var(--dr) + var(--bz));
  background: #050505; box-shadow: 0 0 0 1.5px #3a3a3f, inset 0 0 0 1px #1c1c1f;
}
.device__screen { position: relative; overflow: hidden; border-radius: var(--dr); background: #0d1216; aspect-ratio: var(--ar); }
.device__screen > img, .device__screen > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.device--ipad { --ar: 1180 / 820; --dr: 1.7cqw; --bz: 2.2cqw; }
.device--phone-land { --ar: 874 / 402; --dr: 5.6cqw; --bz: 1.9cqw; }
.device--phone { --ar: 402 / 874; --dr: 12.5cqw; --bz: 4.2cqw; }

/* ---------- The story: hero, the pad, into the rail, the nineteen ---------- */

.story__track { position: relative; height: 1000vh; }
.story__anchor { position: absolute; top: 40%; left: 0; }
.story__pin { position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); overflow: hidden; }
.story__copy { position: absolute; z-index: 3; }
.story__copy--side { left: max(var(--gutter), calc((100% - var(--max)) / 2)); top: 50%; transform: translateY(-50%); width: min(660px, 52%); }
.story__copy--top { left: 50%; top: clamp(24px, 8vh, 88px); transform: translateX(-50%); width: min(92%, 900px); text-align: center; }
.beat { position: absolute; left: 0; right: 0; top: 0; transform: translateY(-50%); opacity: 0; visibility: hidden; }
.story__copy--top .beat { transform: none; }
.beat.is-vis { visibility: visible; }
.beat h2 { font-size: clamp(2.75rem, 6vw, 5.5rem); }
.beat p { margin: 24px 0 0; max-width: 34ch; font-size: var(--t-xl); line-height: 1.45; color: var(--ink-2); }
.beat .beat__h--line { font-size: clamp(2.25rem, 4.6vw, 4.25rem); }
.story__copy--top .beat p { margin: 16px auto 0; max-width: 46ch; }
.beat .label { margin-bottom: 28px; }
.hero__title { font-size: clamp(3rem, 5.6vw, 5.5rem); line-height: 0.98; letter-spacing: -0.05em; }
.store { display: inline-flex; align-items: center; gap: 14px; margin-top: 40px; padding: 8px 22px 8px 8px; border: 1px solid var(--line-2); border-radius: 999px; cursor: default; }
.store img { width: 44px; height: 44px; border-radius: 11px; }
.store b { display: block; font-size: var(--t-l); font-weight: 600; line-height: 1.1; }
.store small { display: block; font-size: var(--t-s); color: var(--ink-3); }
a.store { cursor: pointer; text-decoration: none; transition: border-color 0.3s var(--ease); }
a.store:hover { border-color: var(--ink-2); }

.story__ipad { --iw: min(1080px, 92vw, calc((100vh - var(--nav-h) - 300px) * 1.4)); position: absolute; z-index: 2; left: 50%; top: calc(50% + 90px); width: var(--iw); margin: calc(var(--iw) * -0.356) 0 0 calc(var(--iw) * -0.5); transform-origin: 0 0; will-change: transform, opacity; }
.story__ipad .device__frame { background: rgba(5, 5, 5, var(--frame, 1)); box-shadow: 0 0 0 1.5px rgba(58, 58, 63, var(--frame, 1)), inset 0 0 0 1px rgba(28, 28, 31, var(--frame, 1)); }
.story__ipad .device__screen { border-radius: calc(var(--dr) * var(--frame, 1)); }
.story__scrim { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: rgba(0, 0, 0, 0.62); }
.story__pad-shade { position: absolute; z-index: 2; pointer-events: none; background: radial-gradient(120% 90% at 30% 50%, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.5) 70%, rgba(0, 0, 0, 0.35)); border-radius: 8px; }
.beat--hero { text-shadow: 0 2px 28px rgba(0, 0, 0, 0.7); }
.beat--hero .hero__title { font-size: min(7rem, 6vw, calc(var(--fit-h, 600px) * 0.13)); }
.beat--hero .label { margin-bottom: 18px; color: var(--ink-2); }
.beat--hero .store { margin-top: 28px; }
.beat--hero .store { background: rgba(0, 0, 0, 0.55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); text-shadow: none; }
.story__rail { position: absolute; z-index: 2; left: 50%; top: 50%; width: min(1180px, 94vw); opacity: 0; will-change: transform, opacity; }
.story__rail img { width: 100%; border-radius: 14px; }

/* the rail opens into the nineteen, then closes into chain after chain */
.fxr { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.fxr__keys, .fxr__slots { margin: 0; padding: 0; list-style: none; }
.fxk { position: absolute; left: 0; top: 0; width: 120px; aspect-ratio: 288 / 299; background: url("media/key-frame.svg") center / 100% 100% no-repeat; transform-origin: 0 0; opacity: 0; will-change: transform, opacity; }
.fxk img { position: absolute; inset: 0; width: 100%; height: 100%; }
.fxr__tray { position: absolute; left: 0; top: 0; display: flex; opacity: 0; border-radius: 16px; background: #0c0f11; box-shadow: inset 0 0 0 1px #23282c; transform-origin: 0 0; }
.fxr__tray i { position: absolute; border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(201, 244, 39, 0.12); }
.fxr__slots .fxk { perspective: 600px; }
.fxk.is-flip { animation: fxk-flip 0.5s cubic-bezier(0.65, 0, 0.35, 1); }
@keyframes fxk-flip { 0% { filter: brightness(1); } 45% { filter: brightness(1.8); } 100% { filter: brightness(1); } }
.fxk.is-flip img { animation: fxk-flip-img 0.5s cubic-bezier(0.65, 0, 0.35, 1); }
@keyframes fxk-flip-img { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }

@media (max-width: 900px) {
  .story__track { height: 1000vh; }
  .story__copy--side { left: var(--gutter); right: var(--gutter); width: auto; top: 28px; transform: none; }
  .beat { transform: none; }
  .beat h2 { font-size: clamp(2rem, 9vw, 3.25rem); }
  .beat p { margin-top: 12px; font-size: var(--t-l); }
  .hero__title { font-size: clamp(2.25rem, 10.5vw, 3.5rem); }
  .beat .label { margin-bottom: 14px; }
  .store { margin-top: 20px; }
  .story__ipad { --iw: calc(100vw - 2 * var(--gutter)); top: 58%; }
}

/* reduced motion or no JavaScript: the story becomes a plain sequence */
.story--static .story__track { height: auto; }
.story--static .story__pin { position: static; height: auto; overflow: visible; display: grid; gap: 64px; padding: var(--sec) var(--gutter); }
.story--static .story__copy, .story--static .beat, .story--static .story__ipad, .story--static .story__rail { position: static; transform: none; translate: none; opacity: 1; visibility: visible; width: auto; margin-inline: auto; }
.story--static .story__ipad { width: min(900px, 92vw); margin: 0 auto; }
.story--static .fxr { display: none; }

/* ---------- Built to perform: a pinned diagram, one control lit per step, callouts that stay ---------- */

.perform__track { position: relative; height: 520vh; }
.perform__pin { position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); display: flex; flex-direction: column; justify-content: center; gap: clamp(24px, 4vh, 48px); width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.perform__head { text-align: center; }
.perform__head h2 { font-size: clamp(2.5rem, 5.5vw, 5rem); }
.perform__head p { margin: 14px 0 0; font-size: var(--t-xl); color: var(--ink-2); }
.perform__stage { position: relative; width: 100%; max-width: calc(76vh * 1.96); aspect-ratio: 1.96; margin-inline: auto; }
.perform__device { position: absolute; left: 15.5%; top: 1%; width: 69%; }
.spot { position: absolute; z-index: 2; border-radius: 1cqw; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(245, 245, 247, 0.55), 0 0 22px 6px rgba(201, 244, 39, 0.28), 0 0 60px 18px rgba(201, 244, 39, 0.10);
  transition: left 0.9s var(--ease), top 0.9s var(--ease), width 0.9s var(--ease), height 0.9s var(--ease), opacity 0.6s; }
.perform__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.perform__lines path { fill: none; stroke: #6e6e73; stroke-width: 1; vector-effect: non-scaling-stroke; transition: stroke 0.4s, opacity 0.6s; opacity: 0; }
.perform__lines path.is-in { opacity: 1; }
.perform__lines path.is-on { stroke: var(--ink); }
.perform__lines circle { fill: var(--ink); opacity: 0; transition: opacity 0.6s; }
.perform__lines circle.is-in { opacity: 1; }
.callouts { margin: 0; padding: 0; list-style: none; }
.callouts li { position: absolute; top: var(--y); width: 13.5%; opacity: 0; transform: translateY(12px); transition: opacity 0.6s var(--ease), transform 0.8s var(--ease), color 0.4s; color: var(--ink-3); }
.callouts li[data-side="left"] { left: 0; text-align: right; }
.callouts li[data-side="right"] { right: 0; }
.callouts li[data-side="below"] { width: 22%; text-align: center; translate: -50% 0; }
.callouts li.is-in { opacity: 1; transform: none; }
.callouts li.is-on { color: var(--ink); }
.callouts b { display: block; font-size: var(--t-l); font-weight: 600; }
.callouts span { display: block; margin-top: 4px; font-size: var(--t-s); line-height: 1.4; color: var(--ink-2); }
@media (max-width: 900px) {
  .perform__track { height: auto; }
  .perform__pin { position: static; height: auto; padding-block: var(--sec); }
  .perform__stage { aspect-ratio: auto; max-height: none; }
  .perform__device { position: relative; left: 0; top: 0; width: 100%; }
  .perform__lines { display: none; }
  .callouts { display: grid; gap: 16px; margin-top: 32px; counter-reset: c; }
  .callouts li, .callouts li[data-side] { position: static; width: auto; left: auto !important; translate: none; opacity: 1; transform: none; text-align: left; color: var(--ink); }
  .spot { display: none; }
}

/* ---------- Looper ---------- */

.looper__device { width: min(100%, 330px); margin-inline: auto; }
@media (min-width: 901px) { #looper .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }

/* ---------- Make sound, shape it ---------- */

.gen { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.gen__copy h3, .modes__head h3 { font-size: clamp(2rem, 3.6vw, 3.25rem); letter-spacing: -0.035em; }
.gen__copy p, .modes__head p { margin: 20px 0 0; max-width: 36ch; font-size: var(--t-xl); line-height: 1.45; color: var(--ink-2); }
.gen__keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 36px); margin: 0; padding: 0; list-style: none; }
.gen__keys .key { position: relative; display: block; aspect-ratio: 288 / 299; margin-bottom: 20px; background: url("media/key-frame.svg") center / 100% 100% no-repeat; filter: drop-shadow(0 18px 40px rgba(201, 244, 39, 0.08)); }
.gen__keys .key img { position: absolute; inset: 0; width: 100%; height: 100%; }
.gen__keys b { display: block; font-size: var(--t-l); font-weight: 600; }
.gen__keys li > span:last-child { display: block; margin-top: 4px; font-size: var(--t-m); color: var(--ink-2); }

.modes { margin-top: clamp(96px, 12vw, 160px); }
.modes__head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px clamp(40px, 6vw, 96px); align-items: end; }
.modes__head p { margin: 0; }
.modes__cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); margin-top: clamp(40px, 5vw, 64px); }
.mode { margin: 0; }
.mode dt { padding-bottom: 20px; border-bottom: 1px solid var(--line-2); font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -0.025em; }
.mode dd { margin: 0; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: var(--t-m); color: var(--ink-2); }
.mode dd b { display: block; margin-bottom: 2px; font-size: var(--t-l); font-weight: 500; color: var(--ink); }
@media (max-width: 900px) {
  .gen, .modes__head, .modes__cols { grid-template-columns: 1fr; }
}

/* ---------- USB audio and MIDI ---------- */

.io { display: grid; gap: 0; }
.io__ipad { width: min(100%, 640px); margin-inline: auto; }
.io__wires { width: 64%; height: clamp(48px, 7vw, 88px); margin-inline: auto; overflow: visible; }
.io__wires path { fill: none; stroke: #3a3a3e; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.io__wires .pulse { stroke: var(--accent); stroke-dasharray: 2 14; animation: wire 1.6s linear infinite; }
@keyframes wire { to { stroke-dashoffset: -16; } }
.io__gear { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 3vw, 40px); align-items: end; }
.io__gear figure { margin: 0; }
.io__gear img { width: 100%; }
.io__gear figcaption { margin-top: 16px; text-align: center; font-size: var(--t-m); color: var(--ink); }
.io__gear figcaption span { display: block; font-size: var(--t-s); color: var(--ink-3); }

/* ---------- Specifications ---------- */

.specs { margin: 0; border-top: 1px solid var(--line); }
.spec { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); gap: 8px 32px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.spec dt { font-size: var(--t-m); color: var(--ink-3); }
.spec dd { margin: 0; font-size: var(--t-l); color: var(--ink); }
.spec dd span { display: block; margin-top: 4px; font-size: var(--t-m); color: var(--ink-2); }
@media (max-width: 640px) { .spec { grid-template-columns: 1fr; } }
.cta-end .store { margin-top: 0; }
.cta-end { display: flex; flex-direction: column; align-items: center; gap: 32px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .hero__stage .device { transform: none; }
  .io__wires .pulse { animation: none; }
}

/* =========================================================
   Documents: support, privacy, terms
   ========================================================= */

.doc-hero { padding: clamp(56px, 9vw, 104px) 0 clamp(32px, 5vw, 56px); }
.doc-hero h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); line-height: 1; letter-spacing: -0.04em; }
.doc-hero .lede { margin-top: 20px; max-width: 44ch; }
.narrow { max-width: 820px; margin-left: max(var(--gutter), calc((100% - var(--max)) / 2)); margin-right: auto; }
.doc-meta strong { font-weight: 500; color: var(--ink-2); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 24px 0 0; padding: 0; list-style: none; font-size: var(--t-m); color: var(--ink-3); }

.doc { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(32px, 7vw, 104px); padding-top: clamp(32px, 5vw, 56px); border-top: 1px solid var(--line); }
.toc { position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; }
.toc p { margin: 0 0 12px; font-size: var(--t-m); color: var(--ink-3); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 6px 0; font-size: var(--t-m); color: var(--ink-3); text-decoration: none; transition: color 0.2s; }
.toc a:hover, .toc a[aria-current] { color: var(--ink); }

.prose { max-width: 700px; line-height: 1.7; color: var(--ink-2); }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 56px 0 14px; color: var(--ink); font-size: clamp(1.4rem, 2.2vw, 1.75rem); line-height: 1.2; letter-spacing: -0.025em; scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose h3 { margin: 32px 0 8px; color: var(--ink); font-size: var(--t-l); font-weight: 600; letter-spacing: -0.01em; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--ink-3); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a:not(.btn) { color: var(--ink); }
.summary { margin: 0 0 48px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.summary p { margin: 0; color: var(--ink); font-size: var(--t-xl); line-height: 1.4; letter-spacing: -0.012em; }
.summary ul { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; margin: 20px 0 0; padding: 0; list-style: none; font-size: var(--t-m); }
.summary li { margin: 0; }
.address { font-style: normal; }
@media (max-width: 900px) {
  .doc { grid-template-columns: 1fr; }
  .toc { display: none; }
  .summary ul { grid-template-columns: 1fr; }
}

/* Support */
.contact { margin: 0; border-top: 1px solid var(--line); }
.contact > div { display: grid; grid-template-columns: minmax(120px, 0.24fr) minmax(0, 1fr); gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.contact dt { color: var(--ink-3); font-size: var(--t-m); }
.contact dd { margin: 0; color: var(--ink-2); }
.contact dd a { color: var(--ink); }
@media (max-width: 640px) { .contact > div { grid-template-columns: 1fr; gap: 4px; } }
.faq-title { margin: 56px 0 24px; }
.faq { margin: 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 44px; padding: 18px 0;
  cursor: pointer; list-style: none; font-size: var(--t-xl); font-weight: 500; letter-spacing: -0.015em; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 24px; font-weight: 300; line-height: 1; color: var(--ink-3); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 24px; max-width: 64ch; color: var(--ink-2); }
.faq details > div p { margin: 0 0 12px; }

/* =========================================================
   Manual
   ========================================================= */

.manual { display: grid; grid-template-columns: 280px minmax(0, 1fr); width: min(100%, 1440px); margin-inline: auto; }
.manual__side { border-right: 1px solid var(--line); }
.manual__side-inner {
  position: sticky; top: var(--nav-h); max-height: calc(100dvh - var(--nav-h)); overflow: auto; overscroll-behavior: contain;
  padding: 32px 24px 56px var(--gutter); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.search { position: relative; }
.search input {
  width: 100%; height: 44px; padding: 0 14px 0 40px; border: 1px solid var(--line-2); border-radius: var(--r); background: none;
  font-size: var(--t-m); color: var(--ink); -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.search svg { position: absolute; left: 14px; top: 14px; width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.search-status { margin: 10px 0 0; font-size: var(--t-s); color: var(--ink-3); }
.search-status:empty { display: none; }
.chapters, .subnav, .results { list-style: none; margin: 0; padding: 0; }
.chapters { margin-top: 20px; }
.chapters > li > a { display: flex; gap: 12px; padding: 7px 0; font-size: var(--t-m); color: var(--ink-2); text-decoration: none; transition: color 0.2s; }
.chapters > li > a:hover { color: var(--ink); }
.chapters > li > a span { min-width: 1.6em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chapters > li[data-active] > a { color: var(--ink); }
.subnav { margin: 2px 0 10px 8px; border-left: 1px solid var(--line); }
.js .subnav { display: none; }
.js .chapters > li[data-active] .subnav { display: block; }
.subnav a { display: block; padding: 5px 0 5px 16px; font-size: var(--t-s); color: var(--ink-3); text-decoration: none; }
.subnav a:hover, .subnav a[aria-current] { color: var(--ink); }
.results li { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: var(--t-m); line-height: 1.45; }
.results a { color: var(--ink); text-decoration: none; font-weight: 500; }
.results small { display: block; margin-bottom: 3px; font-size: var(--t-s); color: var(--ink-3); }
.results p { margin: 6px 0 0; font-size: var(--t-s); color: var(--ink-3); }

.manual__main { min-width: 0; padding: clamp(40px, 6vw, 88px) clamp(20px, 5vw, 80px) 40px; }
.manual__article { max-width: 760px; margin-inline: auto; line-height: 1.7; color: var(--ink-2); }
.manual-cover { padding-bottom: 48px; margin-bottom: 64px; border-bottom: 1px solid var(--line); }
.manual-cover h1 { max-width: 12ch; color: var(--ink); font-size: clamp(2.5rem, 6vw, 4.25rem); line-height: 1; letter-spacing: -0.04em; }
.manual-cover .preface { margin-top: 24px; }
.manual-cover .preface p { max-width: 62ch; }
.manual-cover .preface p:first-child { padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--ink); font-size: var(--t-m); }
.manual-cover .preface strong { color: var(--ink); }
.manual-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.m-chapter { margin-bottom: 104px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.m-chapter__head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 28px; }
.m-chapter__num { font-size: var(--t-m); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.m-chapter__head h2 { margin: 0; color: var(--ink); font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.05; letter-spacing: -0.035em; }
.m-lesson { margin-bottom: 52px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.m-lesson h3 { margin: 0 0 14px; color: var(--ink); font-size: 1.4rem; line-height: 1.25; letter-spacing: -0.02em; }
.m-lesson h4 { margin: 26px 0 10px; color: var(--ink); font-size: var(--t-l); font-weight: 600; }
.manual__article p { margin: 0 0 16px; }
.manual__article strong { color: var(--ink); font-weight: 600; }
.manual__article ul, .manual__article ol { margin: 0 0 18px; padding-left: 22px; }
.manual__article li { margin: 6px 0; }
.manual__article li::marker { color: var(--ink-3); }
.manual__article blockquote { margin: 24px 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--line-2); color: var(--ink); }
.manual__article blockquote p { margin: 0; }
.manual__article blockquote strong { color: var(--ink); }
.manual__article code { padding: 2px 6px; border-radius: 4px; background: rgba(247, 245, 239, 0.08); color: var(--ink); font: 0.86em ui-monospace, "SF Mono", Menlo, monospace; }
.manual__article a:not(.btn) { color: var(--ink); }
.manual__article figure { margin: 28px 0 36px; }
.diagram { overflow: hidden; border-radius: var(--r); background: #090c0f; box-shadow: 0 0 0 1px var(--line); }
.diagram a { display: block; }
.diagram img { width: 100%; }
.manual__article figcaption { margin-top: 12px; font-size: var(--t-s); line-height: 1.55; color: var(--ink-3); }
.table-scroll { overflow-x: auto; margin: 22px 0 30px; }
.manual__article table { width: 100%; border-collapse: collapse; font-size: var(--t-m); line-height: 1.55; text-align: left; }
.manual__article th { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line-2); color: var(--ink-3); font-size: var(--t-s); font-weight: 500; vertical-align: bottom; }
.manual__article td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.manual__article td:first-child { width: 28%; min-width: 110px; color: var(--ink); font-weight: 500; }
.effect-index { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: -4px 0 40px; }
.effect-index a { display: inline-flex; align-items: center; min-height: 32px; font-size: var(--t-m); text-decoration: none; color: var(--ink-2); }
.effect-index a:hover { color: var(--ink); text-decoration: underline; }
.next-chapter {
  display: flex; align-items: center; gap: 16px; margin-top: 48px; padding: 20px 0; border-top: 1px solid var(--line);
  text-decoration: none; color: var(--ink); font-size: var(--t-xl); font-weight: 500; letter-spacing: -0.015em;
}
.next-chapter span:first-child { font-size: var(--t-m); font-weight: 400; color: var(--ink-3); }
.next-chapter span:last-child { margin-left: auto; color: var(--ink-2); }
.manual-toggle { display: none; }

@media (max-width: 960px) {
  .manual { display: block; }
  .manual__side { border: 0; }
  .manual-toggle {
    position: sticky; top: var(--nav-h); z-index: 40;
    display: flex; align-items: center; justify-content: space-between; width: 100%; height: 48px;
    padding: 0 var(--gutter); border: 0; border-bottom: 1px solid var(--line);
    background: rgba(7, 9, 11, 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    font-size: var(--t-m); font-weight: 500; cursor: pointer;
  }
  .manual-toggle::after { content: "+"; font-size: 22px; font-weight: 300; color: var(--ink-3); }
  .manual-toggle[aria-expanded="true"]::after { content: "\2212"; }
  .js .manual__side { display: none; position: fixed; z-index: 39; inset: calc(var(--nav-h) + 48px) 0 0; background: var(--bg); overflow: auto; }
  .js .manual__side.is-open { display: block; }
  .manual__side-inner { position: static; max-height: none; padding: 20px var(--gutter) 48px; }
  .chapters > li > a { padding: 11px 0; font-size: var(--t-l); }
  .subnav a { padding: 8px 0 8px 16px; font-size: var(--t-m); }
  .search input { font-size: 16px; }
  .scroll-lock { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

@media print {
  :root { --ink: #111; --ink-2: #333; --ink-3: #666; --line: #ccc; --line-2: #999; --bg: #fff; --surface: #fff; }
  body { background: #fff; color: #111; font-size: 10pt; }
  .nav, .footer, .manual__side, .manual-toggle, .manual-tools, .next-chapter, .effect-index, .skip, .toc { display: none !important; }
  .manual, .doc { display: block; }
  .manual__main { padding: 0; }
  .m-chapter { break-before: page; }
  .diagram { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  figure, tr { break-inside: avoid; }
  a { text-decoration: none; }
}

/* ---------- Home (randommachines.app/): one full-width section per app ----------
   Each app on its own ground, the grid idea in both: INK on the blueprint of its Blue theme, RMXY-1 on the dot grid
   of its XY pad. Same order in each: kicker, wordmark, one line, buttons, the iPad rising out of the section's bottom. */

.home .nav { position: absolute; inset: 0 0 auto; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.home .nav__inner { display: grid; grid-template-columns: 1fr auto 1fr; }
.home .nav__links { justify-self: end; }
.home-title { margin: 0; font-size: var(--t-s); font-weight: 500; letter-spacing: 0.01em; color: rgba(255, 255, 255, 0.74); white-space: nowrap; }
.home .nav__links a { color: rgba(255, 255, 255, 0.74); }
.home .nav__links a:hover { color: #fff; }
@media (max-width: 760px) {
  .home .nav { height: auto; }
  .home .nav__inner { grid-template-columns: 1fr auto; row-gap: 0; padding-top: 8px; }
  .home-title { grid-row: 2; grid-column: 1 / -1; padding: 2px 0 10px; }
}

.app { position: relative; display: flex; flex-direction: column; align-items: center; overflow: hidden; padding: clamp(88px, 9vw, 120px) var(--gutter) 0; text-align: center; }
.app:first-of-type { padding-top: clamp(150px, 15vw, 190px); }
.app .label { color: inherit; opacity: 0.72; }
.app__mark { display: block; width: auto; margin: 28px 0 0; }
.app__line { margin: 24px 0 0; font-size: clamp(1.375rem, 2vw, 1.875rem); font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.app__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.app .btn { border-color: currentColor; color: inherit; }
.app .btn--primary { background: currentColor; }
.app .btn--primary span { color: var(--app-bg); }
.app__media { width: min(100%, 1120px); margin-top: clamp(48px, 6vw, 80px); aspect-ratio: 100 / 50; overflow: hidden; }
.app__media .device { width: 100%; }

.app--ink {
  --app-bg: #1449b2;
  background-color: var(--app-bg); color: #f2f7ff;
  background-image: linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 26px 26px; background-position: center top;
}
.app--ink .app__mark { height: clamp(120px, 15vw, 200px); filter: brightness(0) invert(1); }
.app--ink :focus-visible { outline-color: #fff; }

.app--rmxy {
  --app-bg: #0b0e10;
  background-color: var(--app-bg); color: var(--ink);
  background-image: radial-gradient(rgba(245, 245, 247, 0.18) 1px, transparent 1.4px);
  background-size: 28px 28px; background-position: center top;
}
.app--rmxy .app__mark { height: clamp(72px, 8.6vw, 116px); margin: 40px 0 12px; }
@media (max-width: 480px) { .app .btn--lg { min-height: 44px; padding: 0 18px; font-size: var(--t-m); } }
