/* StakdTrax — layout: one centred column (1120px) of full-bleed bands; help is sidebar | article | on-this-page.
   Palette comes from the app icon: three rows of amber bars on a blue-black ground. Dark first, light mirrored. */
:root {
  --bg: #0d0f14;
  --bg-alt: #12151c;
  --surface: #181c25;
  --line: #262c38;
  --fg: #ece8e1;
  --muted: #9da3b0;
  --amber: #ffb55e;
  --amber-mid: #a47641;
  --amber-dim: #634c31;
  --link: #ffc27d;
  --on-amber: #1a1206;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 32px rgba(0, 0, 0, .35);
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
  --step-4: clamp(2.4rem, 1.5rem + 4vw, 4.2rem);
  --radius: 14px;
  --gutter: 20px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f4f1; --bg-alt: #ebe9e4; --surface: #ffffff; --line: #dcd8d0; --fg: #15171c; --muted: #5a5f6b;
    --amber: #ffb55e; --amber-mid: #c98a3e; --amber-dim: #ecd2ad; --link: #8a4f0c; --on-amber: #1a1206;
    --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 10px 28px rgba(20, 20, 30, .08);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f4f1; --bg-alt: #ebe9e4; --surface: #ffffff; --line: #dcd8d0; --fg: #15171c; --muted: #5a5f6b;
  --amber: #ffb55e; --amber-mid: #c98a3e; --amber-dim: #ecd2ad; --link: #8a4f0c; --on-amber: #1a1206;
  --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 10px 28px rgba(20, 20, 30, .08);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; letter-spacing: -.01em; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-4); font-weight: 800; }
h2 { font-size: var(--step-3); font-weight: 800; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0; }
strong { font-weight: 600; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--amber); color: var(--on-amber); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }
.eyebrow { font: 500 var(--step--1)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--amber); }
.lede { font-size: var(--step-1); color: var(--muted); max-width: 60ch; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5em; padding: .8em 1.3em; border-radius: 999px;
  background: var(--amber); color: var(--on-amber); font-weight: 600; text-decoration: none; line-height: 1.1;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255, 181, 94, .25); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--amber-mid); box-shadow: none; }
.btn-sm { padding: .55em 1em; font-size: var(--step--1); }

/* header */
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line);
}
.head-row { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none;
  font: 800 1.2rem/1 var(--display); letter-spacing: -.01em; }
.brand img { border-radius: 8px; }
.nav { display: flex; gap: 4px 18px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--muted); text-decoration: none; font-size: var(--step--1); font-weight: 600; padding: 6px 0; }
.nav a:hover, .nav a[aria-current] { color: var(--fg); }
.nav a[aria-current] { box-shadow: 0 2px 0 var(--amber); }
.lang { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px; text-decoration: none;
  font: 500 .75rem/1 var(--mono); letter-spacing: .06em; }
.lang span { padding: 5px 8px; border-radius: 999px; color: var(--muted); }
.lang .on { background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.lang:hover { border-color: var(--amber-mid); }
.lang:hover .off { color: var(--amber); }
@media (max-width: 640px) {
  .head-row { gap: 12px; }
  .nav .nav-extra { display: none; }
  .brand span { font-size: 1.05rem; }
}
@media (max-width: 480px) { .site-head .btn-sm { display: none; } .nav { gap: 4px 12px; } }

/* hero */
.hero { padding-block: clamp(48px, 8vw, 96px) clamp(48px, 7vw, 88px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero h1 { font-size: clamp(2.3rem, 1.5rem + 3.2vw, 3.8rem); }
.hero h1 span { color: var(--amber); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { font-size: var(--step--1); color: var(--muted); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

/* the stack demo: three phones, one sound, sliding into line */
.stack-demo {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px;
  box-shadow: var(--shadow); display: grid; gap: 14px; min-width: 0;
}
.stack-demo figcaption { display: flex; align-items: center; gap: 10px; font: 500 var(--step--1)/1.2 var(--mono); color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber-mid); flex: none; transition: background .4s; }
.stack-demo.aligned .dot { background: #4cc38a; box-shadow: 0 0 0 4px rgba(76, 195, 138, .15); }
.track { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 4.6em; align-items: center; gap: 12px; }
.track-label { display: grid; line-height: 1.2; min-width: 0; }
.track-label b { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-label span { font: 500 .72rem/1.3 var(--mono); color: var(--muted); }
.bars { display: flex; align-items: center; gap: 3px; height: 64px; overflow: hidden; border-left: 1px dashed var(--line); padding-left: 4px; }
.bars i {
  flex: 1 0 auto; width: 6px; max-width: 9px; border-radius: 9px; height: calc(var(--h) * 100%);
  background: var(--row); transform: translateX(var(--x, 0)); transition: transform 1.6s cubic-bezier(.2, .8, .2, 1);
}
.r1 { --row: var(--amber-dim); --x: 26px; }
.r2 { --row: var(--amber-mid); --x: -18px; }
.r3 { --row: var(--amber); --x: 0px; }
.stack-demo.aligned .bars i { transform: translateX(0); }
.off { font: 500 .8rem/1 var(--mono); text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.stack-demo.aligned .off { color: var(--fg); }
.demo-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px;
  font: 500 var(--step--1)/1 var(--mono); color: var(--muted); }
.replay { font: inherit; color: var(--link); background: none; border: 0; padding: 4px; cursor: pointer; }
@media (max-width: 420px) { .track { grid-template-columns: 5.6em minmax(0, 1fr) 4.2em; gap: 8px; } .bars { height: 48px; gap: 2px; } }
@media (prefers-reduced-motion: reduce) { .bars i { transition: none; } .btn { transition: none; } }

/* bands */
.band { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.band-alt { background: var(--bg-alt); }
.band h2 { max-width: 22ch; }
.section-lede { color: var(--muted); font-size: var(--step-1); max-width: 62ch; margin-top: 16px; }
.more { display: inline-block; margin-top: 32px; font-weight: 600; }
.aside { margin-top: 28px; color: var(--muted); max-width: 70ch; }

.numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 44px 0 0; border-top: 1px solid var(--line); }
.numbers > div { padding: 24px 24px 0 0; display: grid; gap: 10px; align-content: start; }
.numbers > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.numbers dt { font: 500 var(--step--1)/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.numbers dd { margin: 0; font: 800 clamp(2rem, 1.4rem + 2.4vw, 3.1rem)/1 var(--display); color: var(--amber); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.numbers p { color: var(--muted); }
@media (max-width: 760px) {
  .numbers { grid-template-columns: minmax(0, 1fr); }
  .numbers > div, .numbers > div + div { padding: 22px 0; border-left: 0; border-bottom: 1px solid var(--line); }
}

.steps { list-style: none; counter-reset: step; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.steps li { counter-increment: step; position: relative; display: grid; gap: 8px; align-content: start; padding-top: 52px; }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font: 500 .95rem/1 var(--mono); border: 1.5px solid var(--amber-mid); color: var(--amber);
}
.steps li:last-child::before { background: var(--amber); color: var(--on-amber); border-color: var(--amber); }
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 18px; left: 46px; right: 0; height: 1px; background: var(--line); }
.steps p { color: var(--muted); font-size: .98rem; }
@media (max-width: 900px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .steps li { padding: 4px 0 0 56px; }
  .steps li:not(:last-child)::after { top: 44px; bottom: -18px; left: 18px; right: auto; width: 1px; height: auto; }
}

.groups { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.group { background: var(--bg-alt); padding: 26px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.group h3 a { color: var(--fg); text-decoration: none; }
.group h3 a::after { content: " →"; color: var(--amber); }
.group h3 a:hover { color: var(--amber); }
.group .who { font: 500 .78rem/1.5 var(--mono); color: var(--amber-mid); }
.group p:last-child { color: var(--muted); font-size: .98rem; }
@media (max-width: 900px) { .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .groups { grid-template-columns: minmax(0, 1fr); } }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }
.checks { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 16px; }
.checks li { position: relative; padding-left: 30px; color: var(--muted); }
.checks li strong { color: var(--fg); }
.checks li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 14px; height: 8px; border-left: 2px solid var(--amber); border-bottom: 2px solid var(--amber); transform: rotate(-45deg); }
.shots { list-style: none; margin: 0; padding: 4px 4px 16px; display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; min-width: 0; }
.shots li { scroll-snap-align: start; }
.shots img { border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
@media (max-width: 600px) { .shots { grid-auto-columns: 62%; } }

.faq-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; }
@media (max-width: 800px) { .faq-wrap { grid-template-columns: minmax(0, 1fr); } }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 36px 18px 0; position: relative; font: 600 var(--step-1)/1.3 var(--display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font: 400 1.6rem/1 var(--body); color: var(--amber); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); padding-bottom: 20px; max-width: 65ch; }

.cta-band { background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--amber) 12%, var(--bg)) 0%, var(--bg) 60%); }
.cta-inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.cta-inner img { border-radius: 22px; }
.cta-inner p { color: var(--muted); margin-top: 10px; max-width: 60ch; }
.cta-inner h2 { font-size: var(--step-2); max-width: none; }
@media (max-width: 760px) { .cta-inner { grid-template-columns: minmax(0, 1fr); } }

.support-band { padding-block: clamp(40px, 5vw, 64px); }
.support-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; }
.support-inner h2 { font-size: var(--step-1); max-width: none; }
.support-inner p { color: var(--muted); margin-top: 8px; max-width: 62ch; }

/* footer */
.site-foot { border-top: 1px solid var(--line); padding-block: 48px 28px; background: var(--bg-alt); font-size: var(--step--1); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.foot-brand p { color: var(--muted); margin-top: 12px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 48px; }
.foot-nav div { display: grid; gap: 8px; align-content: start; }
.foot-nav h2 { font: 500 .75rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.foot-nav a { color: var(--fg); text-decoration: none; }
.foot-nav a:hover { color: var(--amber); }
.foot-legal { margin-top: 36px; color: var(--muted); font-size: .8rem; }

/* long-form and help prose */
.longform { padding-block: 56px 88px; }
.longform .prose { max-width: 70ch; margin-inline: auto; }
.longform h1 { font-size: var(--step-3); margin-block: 10px 18px; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--step-2); margin-top: 2.2em; scroll-margin-top: 84px; }
.prose h3 { font-size: var(--step-1); margin-top: 1.8em; scroll-margin-top: 84px; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--amber-mid); }
.prose code { font: 500 .88em var(--mono); background: var(--surface); padding: .1em .35em; border-radius: 5px; }
.anchor { float: left; margin-left: -1.1em; width: 1.1em; color: var(--amber-mid); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
.note { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 10px; padding: 16px 18px; }
.note > * + * { margin-top: .7em; }
.fig { margin: 1.6em 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; justify-items: center; }
.fig img { border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.fig-screen img { width: 300px; border-radius: 28px; box-shadow: var(--shadow); }
.fig figcaption { font-size: var(--step--1); color: var(--muted); text-align: center; max-width: 52ch; }

/* help layout */
.help-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 48px; padding-block: 36px 80px; align-items: start; }
.help-side, .help-toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); max-height: calc(100vh - 100px); overflow: auto; font-size: var(--step--1); }
.help-side h2, .help-toc h2 { font: 500 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 8px; }
.help-side ul, .help-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; }
.help-side a, .help-toc a { display: block; padding: 5px 10px; border-radius: 7px; color: var(--fg); text-decoration: none; line-height: 1.35; }
.help-side a:hover, .help-toc a:hover { background: var(--surface); }
.help-side a[aria-current] { background: var(--surface); color: var(--amber); font-weight: 600; box-shadow: inset 2px 0 0 var(--amber); }
.help-toc a { color: var(--muted); }
.help-toc a.active { color: var(--fg); box-shadow: inset 2px 0 0 var(--amber); }
.topics > summary { display: none; }
.help-article { min-width: 0; max-width: 72ch; }
.help-article h1 { font-size: var(--step-3); margin-top: 10px; }
.help-article .lede { margin-top: 12px; }
.help-article .prose { margin-top: 28px; }
.crumbs { font-size: var(--step--1); color: var(--muted); }
.crumbs a { color: var(--muted); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.pager a { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--fg); font-weight: 600; display: grid; gap: 2px; }
.pager a:hover { border-color: var(--amber-mid); }
.pager span { font: 500 .72rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pager .next { grid-column: 2; text-align: right; }
@media (max-width: 1100px) { .help-layout { grid-template-columns: 230px minmax(0, 1fr); } .help-toc { display: none; } }
@media (max-width: 800px) {
  .help-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 20px; }
  .help-side { position: static; max-height: none; overflow: visible; }
  .topics { border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; }
  .topics > summary { display: block; cursor: pointer; padding: 12px 14px; font-weight: 600; }
  .topics nav { padding: 0 6px 10px; }
  .fig-screen img { width: 260px; }
}

/* search */
.search { position: relative; }
.search input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--fg); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px 11px 38px; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239da3b0' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 13px 50%;
}
.search input:focus { border-color: var(--amber-mid); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 22%, transparent); }
.search-results { list-style: none; margin: 8px 0 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); display: grid; gap: 2px; max-height: 60vh; overflow: auto; }
.help-side .search-results { position: absolute; left: 0; right: 0; z-index: 5; }
.search-results a { display: grid; gap: 2px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--fg); }
.search-results a:hover, .search-results a:focus { background: var(--bg-alt); }
.search-results b { font-weight: 600; }
.search-results small { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.search-results mark { background: color-mix(in srgb, var(--amber) 30%, transparent); color: inherit; border-radius: 3px; }
.search-results .empty { padding: 10px; color: var(--muted); }

.help-home { padding-block: 48px 88px; }
.help-hero { display: grid; gap: 18px; max-width: 680px; }
.help-hero h1 { font-size: var(--step-4); }
.help-hero .search input { font-size: 1.1rem; padding-block: 15px; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 48px; margin-top: 56px; }
@media (max-width: 760px) { .topic-grid { grid-template-columns: minmax(0, 1fr); } }
.topic-group h2 { font: 500 .75rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--amber); margin-bottom: 12px; }
.topic-group ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.topic-group a { display: grid; gap: 2px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--fg); }
.topic-group a:hover strong { color: var(--amber); }
.topic-group span { color: var(--muted); font-size: .95rem; }
