/* Ableton + Serum 2 Guide. Ivory on near-black, ivory is the one accent. */
:root {
  --ground: #141414; --raise: #1E1D1B; --raise2: #262522; --ivory: #F2EBDD; --soft: #B5AFA3;
  --line: rgba(242, 235, 221, .14); --ink: #141414;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-card: 22px; --r-mid: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ground); }
body { margin: 0; background: var(--ground); color: var(--ivory); font: 17px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.wrap { max-width: 680px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 12px) 20px calc(env(safe-area-inset-bottom) + 32px); }
.soft { color: var(--soft); }
:focus-visible { outline: 2px solid var(--ivory); outline-offset: 2px; }

/* top bar */
.bar { display: flex; align-items: center; gap: 8px; min-height: 48px; margin-bottom: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 14px 0 8px; border-radius: 999px;
  background: var(--raise); border: 1px solid var(--line); text-decoration: none; font-size: 15px; color: var(--ivory); cursor: pointer; }
.back svg { width: 18px; height: 18px; }
.bar .spacer { flex: 1; }
.iconbtn { width: 40px; height: 40px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.iconbtn svg { width: 18px; height: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--soft); font-size: 15px; text-decoration: none; }
.brand svg { width: 22px; height: auto; color: var(--ivory); }

/* home */
.hero { padding: 28px 0 8px; }
h1 { font-size: 40px; line-height: 1.05; letter-spacing: -.035em; font-weight: 700; margin: 0 0 10px; overflow-wrap: anywhere; }
.page h1 { font-size: 34px; }
.lede { font-size: 19px; line-height: 1.45; color: var(--soft); margin: 0 0 20px; }
.search { position: relative; margin: 20px 0 8px; }
.search input { width: 100%; height: 60px; border-radius: 999px; border: 1px solid var(--line); background: var(--raise);
  color: var(--ivory); font: 19px var(--font); padding: 0 52px 0 54px; -webkit-appearance: none; appearance: none; outline: none; }
.search input::placeholder { color: var(--soft); opacity: 1; }
.search input:focus { border-color: rgba(242, 235, 221, .45); background: var(--raise2); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search .glass { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--soft); pointer-events: none; }
.search .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0;
  background: none; color: var(--soft); border-radius: 999px; cursor: pointer; display: none; }
.search.has .clear { display: block; }
.try { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--raise);
  border: 1px solid var(--line); font-size: 15px; text-decoration: none; color: var(--ivory); cursor: pointer; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip:active, .row:active, .step-nav a:active { background: var(--raise2); }

.sections { margin: 28px 0 0; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.row .txt { flex: 1; min-width: 0; }
.row .t { font-size: 19px; font-weight: 600; letter-spacing: -.01em; display: block; }
.row .d { font-size: 15px; color: var(--soft); display: block; margin-top: 2px; }
.row .n { font-size: 15px; color: var(--soft); }
.row svg.chev { width: 16px; height: 16px; color: var(--soft); flex: none; }
.row.small { padding: 14px 0; }
.row.small .t { font-size: 17px; }
.row.small .d { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* results */
.results { margin-top: 8px; }
.results .count { font-size: 15px; color: var(--soft); margin: 12px 0 0; }
.hit { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.hit .where { font-size: 13px; color: var(--soft); display: block; }
.hit .t { font-size: 18px; font-weight: 600; display: block; margin: 2px 0 4px; }
.hit .t .sub { font-weight: 400; color: var(--soft); }
.hit .snip { font-size: 15px; color: var(--soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
mark { background: none; color: var(--ivory); font-weight: 600; }
.empty { padding: 28px 0; color: var(--soft); }

/* section list */
.group-h { font-size: 15px; font-weight: 600; color: var(--soft); margin: 28px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cards { display: grid; gap: 8px; margin-top: 12px; }
.rcard { display: block; padding: 18px; border-radius: var(--r-card); background: var(--raise); border: 1px solid var(--line); text-decoration: none; }
.rcard .k { font-size: 13px; color: var(--soft); }
.rcard .t { font-size: 20px; font-weight: 650; letter-spacing: -.015em; display: block; margin: 2px 0 4px; }
.rcard .d { font-size: 15px; color: var(--soft); }

/* guide page */
.kicker { font-size: 15px; color: var(--soft); margin: 16px 0 6px; }
.meta-line { font-size: 15px; color: var(--soft); margin: -8px 0 16px; }
.chips-h { font-size: 13px; color: var(--soft); margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.toc { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px 24px; padding: 0 20px 4px; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc .chip { flex: none; }
figure.shot { margin: 0 0 12px; border-radius: var(--r-mid); overflow: hidden; background: #2a2a2a; border: 1px solid var(--line); cursor: zoom-in; }
figure.shot img { display: block; width: 100%; height: auto; margin: 0 auto; }
figure.shot.narrow { display: flex; justify-content: center; padding: 12px; }
figure.shot.narrow img { width: auto; max-width: 100%; }
figure.shot.wide { overflow-x: auto; overscroll-behavior-x: contain; }
figure.shot.wide img { width: auto; max-width: none; height: var(--h); }
.shots-more { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px 12px; padding: 0 20px 4px; scrollbar-width: none; }
.shots-more::-webkit-scrollbar { display: none; }
.shots-more figure { flex: none; width: 78%; margin: 0; }
.shots-more figcaption { font-size: 13px; color: var(--soft); padding: 6px 2px 0; }
.shot-hint { font-size: 13px; color: var(--soft); margin: 0 0 24px; }

.content { margin-top: 8px; }
.content h3 { font-size: 22px; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; margin: 36px 0 12px; scroll-margin-top: 16px; }
.content h4 { font-size: 18px; font-weight: 650; margin: 24px 0 8px; scroll-margin-top: 16px; }
.content p { margin: 0 0 14px; }
.content b { font-weight: 650; color: var(--ivory); }
.content code { font: 15px ui-monospace, Menlo, monospace; background: var(--raise); padding: 1px 6px; border-radius: 6px; }
.content a.dev { font-weight: 650; text-decoration: underline; text-decoration-color: rgba(242,235,221,.35); text-underline-offset: 3px; }
.content .flash { animation: flash 1.6s ease-out; border-radius: 8px; }
@keyframes flash { 0% { background: rgba(242,235,221,.18); } 100% { background: transparent; } }

/* numbered steps as clean cards */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
ol.steps > li { counter-increment: step; position: relative; background: var(--raise); border: 1px solid var(--line);
  border-radius: var(--r-mid); padding: 14px 16px 14px 56px; min-height: 56px; overflow-wrap: anywhere; }
ol.steps > li::before { content: counter(step); position: absolute; left: 14px; top: 13px; width: 28px; height: 28px; border-radius: 999px;
  border: 1.5px solid var(--ivory); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
/* facts: hairline rows, no boxes */
ul.facts { list-style: none; padding: 0; margin: 0 0 16px; border-top: 1px solid var(--line); }
ul.facts > li { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
ul.facts ul.facts { border-top: 0; margin: 8px 0 0; padding-left: 14px; border-left: 1px solid var(--line); }
ul.facts ul.facts > li { padding: 6px 0; border-bottom: 0; font-size: 16px; color: var(--soft); }
ul.facts ul.facts > li b { color: var(--ivory); }
ol.steps ul.facts { border-top: 0; margin: 8px 0 0; }
ol.steps ul.facts > li { border: 0; padding: 4px 0; font-size: 16px; color: var(--soft); }
.itip { display: block; margin-top: 6px; font-size: 15px; color: var(--soft); }
.itip b, .meta b { color: var(--ivory); font-weight: 650; margin-right: 4px; }
.meta { display: block; margin-top: 4px; font-size: 15px; color: var(--soft); }
p.tip, p.note { background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-mid); padding: 14px 16px; }
p.tip b:first-child, p.note b:first-child { display: block; font-size: 13px; color: var(--soft); font-weight: 600; margin-bottom: 2px; }
/* table rows become control cards */
.ctls { display: grid; gap: 8px; margin: 0 0 16px; }
.ctl { background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-mid); padding: 14px 16px; overflow-wrap: anywhere; }
.ctl-n { font-weight: 700; font-size: 17px; }
.ctl-d { font-size: 16px; margin-top: 2px; }

/* back / next */
.step-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 40px 0 0; }
.step-nav a { display: flex; flex-direction: column; justify-content: center; min-height: 64px; padding: 10px 18px; border-radius: 22px;
  background: var(--raise); border: 1px solid var(--line); text-decoration: none; min-width: 0; }
.step-nav a.next { text-align: right; }
.step-nav .k { font-size: 13px; color: var(--soft); }
.step-nav .t { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-nav .ghost { visibility: hidden; }
.up { display: flex; justify-content: center; margin-top: 16px; }

footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
  color: var(--soft); font-size: 15px; }
footer svg { width: 18px; height: auto; color: var(--soft); }
footer .off { margin-left: auto; font-size: 13px; }

/* picture viewer */
#viewer { position: fixed; inset: 0; background: rgba(10,10,10,.97); z-index: 10; display: flex; flex-direction: column; }
#viewer[hidden] { display: none; }
.viewer-x { align-self: flex-end; margin: calc(env(safe-area-inset-top) + 12px) 16px 8px; height: 40px; padding: 0 18px; border-radius: 999px;
  background: var(--ivory); color: var(--ink); border: 0; font-weight: 600; cursor: pointer; }
.viewer-in { flex: 1; overflow: auto; display: flex; align-items: center; -webkit-overflow-scrolling: touch; }
.viewer-in img { display: block; margin: auto; max-width: none; height: auto; }
@media (min-width: 700px) { h1 { font-size: 52px; } .page h1 { font-size: 44px; } }
