/* Shared chrome and content styles for the subpages (guide, compare, support,
   compatibility, changelog, privacy, terms).

   The base, nav and footer rules are lifted verbatim from index.html's inline
   <style> so the chrome is pixel-identical across the site. index.html keeps
   its own inline copy — it is a self-contained design preview and was left
   untouched apart from its nav/footer hrefs. If the chrome changes, change it
   in both places (or lift index.html's inline styles into this file). */

*, *::before, *::after { box-sizing: border-box }
* { margin: 0; padding: 0 }
html { -webkit-text-size-adjust: 100% }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-fg);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased
}

a { color: var(--color-accent); text-decoration: none }
a:hover { text-decoration: underline }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter) }
@media (min-width: 768px) { .container { padding: 0 var(--space-8) } }

section { padding: var(--section-y) 0 }
.tint { background: var(--color-bg-2) }

h1, h2, h3 { font-weight: 600; letter-spacing: var(--tracking-tight); line-height: var(--leading-tight) }
h1 { font-size: var(--text-4xl) }
h2 { font-size: var(--text-2xl); margin-bottom: var(--space-6) }
@media (min-width: 768px) {
  h1 { font-size: var(--text-5xl) }
  h2 { font-size: var(--text-3xl) }
  body { font-size: var(--text-lg) }
}

.muted { color: var(--color-fg-2) }
.small { font-size: var(--text-sm) }
.caption { font-size: var(--text-xs); color: var(--color-fg-2) }
.measure { max-width: var(--measure) }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 28px; border-radius: 999px;
  font-size: 15px; font-weight: 500; line-height: 1; white-space: nowrap;
  border: 0; cursor: pointer;
  transition: transform 100ms ease-out, filter var(--dur-base)
}
.btn:hover { text-decoration: none; filter: brightness(1.06); transform: translateY(-1px) }
.btn:active { transform: scale(.98) }
.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-accent) 84%, #fff), var(--color-accent));
  color: var(--color-accent-fg);
  box-shadow: inset 0 1px 0 rgb(255 255 255/.25), 0 14px 30px -10px color-mix(in srgb, var(--color-accent) 60%, transparent)
}
.btn-secondary { background: var(--color-bg-2); color: var(--color-fg); box-shadow: inset 0 0 0 1px var(--color-border) }
.btn:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--color-accent); outline-offset: 2px
}

/* nav */
nav { border-bottom: 1px solid var(--color-border); position: sticky; top: 0; background: var(--color-bg); z-index: 10 }
nav .container { display: flex; align-items: center; height: 64px; gap: var(--space-6) }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: var(--text-xl); color: var(--color-fg) }
.logo:hover { text-decoration: none }
.mark { width: 24px; height: 24px; border-radius: 7px; background: var(--color-accent) }
nav .links { margin-left: auto; display: flex; align-items: center; gap: 28px }
nav .links a { color: var(--color-fg-2); font-size: var(--text-sm); font-weight: 500 }
nav .links a[aria-current="page"] { color: var(--color-fg) }
nav .links .btn {
  height: 36px; padding: 0 18px; font-size: var(--text-sm); color: var(--color-accent-fg);
  box-shadow: inset 0 1px 0 rgb(255 255 255/.25), 0 8px 18px -8px color-mix(in srgb, var(--color-accent) 60%, transparent)
}
@media (max-width: 767px) { nav .links a:not(.btn) { display: none } }

/* footer */
footer { border-top: 1px solid var(--color-border); padding: var(--space-12) 0 28px; background: var(--color-bg) }
.foot-cols { display: grid; gap: var(--space-8) }
@media (min-width: 700px) { .foot-cols { grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)) } }
.foot-col { display: grid; gap: 10px; align-content: start; justify-items: start }
.foot-col b { font-size: var(--text-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--color-fg-3) }
.foot-col a { color: var(--color-fg-2); font-size: var(--text-sm); font-weight: 500 }
.foot-col a:hover { color: var(--color-fg); text-decoration: none }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: var(--text-base); color: var(--color-fg) }
.foot-col-brand p { margin: 0; max-width: 26ch; color: var(--color-fg-2); font-size: var(--text-sm) }
.foot-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: var(--space-8); padding-top: 20px; border-top: 1px solid var(--color-border);
  font-size: var(--text-xs); color: var(--color-fg-3)
}

/* ---------- subpage chrome ---------- */

.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--color-border) }
.eyebrow {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-accent); margin-bottom: var(--space-3)
}
.page-head h1 { max-width: 18ch }
.page-head .lede { margin-top: var(--space-4); max-width: var(--measure); color: var(--color-fg-2); font-size: var(--text-lg) }
.page-main { padding: clamp(2.5rem, 6vw, 4rem) 0 }

/* prose — legal and long-form text */
.prose { max-width: var(--measure) }
.prose > * + * { margin-top: var(--space-4) }
.prose h2 { font-size: var(--text-xl); margin: var(--space-12) 0 var(--space-3); scroll-margin-top: 84px }
.prose h2:first-child { margin-top: 0 }
.prose h3 { font-size: var(--text-base); margin: var(--space-6) 0 var(--space-2) }
.prose p, .prose li { color: var(--color-fg-2); font-size: var(--text-base) }
.prose strong { color: var(--color-fg); font-weight: 600 }
.prose ul, .prose ol { padding-left: 1.25em; display: grid; gap: var(--space-2) }
.prose li::marker { color: var(--color-fg-3) }
.prose code {
  font-family: var(--font-mono); font-size: .9em; background: var(--color-bg-2);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 1px 5px
}

/* two-column layout with a sticky table of contents */
.with-toc { display: grid; gap: var(--space-8) }
@media (min-width: 900px) { .with-toc { grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-16) } }
.toc { display: none }
@media (min-width: 900px) {
  .toc { display: block; position: sticky; top: 88px; align-self: start }
  .toc b { display: block; font-size: var(--text-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--color-fg-3); margin-bottom: var(--space-3) }
  .toc a { display: block; padding: 5px 0; color: var(--color-fg-2); font-size: var(--text-sm); line-height: 1.35 }
  .toc a:hover { color: var(--color-fg); text-decoration: none }
}

/* cards */
.cards { display: grid; gap: var(--space-4) }
@media (min-width: 760px) { .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) } .cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
.card {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-6)
}
.tint .card { background: var(--color-bg) }
.card h3 { font-size: var(--text-base); margin-bottom: var(--space-2) }
.card p { color: var(--color-fg-2); font-size: var(--text-sm) }

/* numbered steps */
.steps { display: grid; gap: var(--space-6); counter-reset: step; max-width: 46rem }
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: var(--space-4); align-items: start }
.step::before {
  counter-increment: step; content: counter(step);
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-accent-soft); color: var(--color-accent);
  font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums
}
.step h3 { font-size: var(--text-base); margin-bottom: var(--space-1) }
.step p { color: var(--color-fg-2); font-size: var(--text-sm) }
.step p + p { margin-top: var(--space-2) }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--color-border); border-radius: var(--radius-lg) }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: var(--text-sm) }
caption { text-align: left; padding: var(--space-4) var(--space-4) 0; color: var(--color-fg-3); font-size: var(--text-xs) }
th, td { text-align: left; padding: 12px var(--space-4); border-bottom: 1px solid var(--color-border); vertical-align: top }
thead th { font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-fg-3); white-space: nowrap }
tbody th { font-weight: 500; color: var(--color-fg) }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0 }
td { color: var(--color-fg-2) }
.col-own { background: var(--color-accent-soft) }
th.col-own { color: var(--color-accent) }
.yes { color: var(--color-ok); font-weight: 500 }
.no { color: var(--color-fg-3) }

/* status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 500; white-space: nowrap
}
.pill-ok { background: color-mix(in srgb, var(--color-ok) 14%, transparent); color: var(--color-ok) }
.pill-warn { background: color-mix(in srgb, var(--color-warn) 14%, transparent); color: var(--color-warn) }
.pill-off { background: var(--color-bg-3); color: var(--color-fg-3) }

/* FAQ / disclosure */
.faq { display: grid; gap: 0; max-width: 46rem; border-top: 1px solid var(--color-border) }
.faq details { border-bottom: 1px solid var(--color-border) }
.faq summary {
  cursor: pointer; list-style: none; padding: var(--space-4) 36px var(--space-4) 0; position: relative;
  font-size: var(--text-base); font-weight: 500
}
.faq summary::-webkit-details-marker { display: none }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--color-fg-3); border-bottom: 2px solid var(--color-fg-3);
  transform: translateY(-70%) rotate(45deg); transition: transform var(--dur-base) var(--ease-out)
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(225deg) }
.faq details > p, .faq details > ul { color: var(--color-fg-2); font-size: var(--text-sm); padding-bottom: var(--space-4); max-width: var(--measure) }
.faq details > ul { padding-left: 1.25em; display: grid; gap: var(--space-2) }

/* changelog entries */
.releases { display: grid; gap: var(--space-12); max-width: 46rem }
.release { display: grid; gap: var(--space-3) }
.release-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3) }
.release-ver { font-size: var(--text-xl); font-weight: 600; letter-spacing: var(--tracking-tight) }
.release-date { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-fg-3) }
.release ul { display: grid; gap: var(--space-2); padding-left: 1.25em }
.release li { color: var(--color-fg-2); font-size: var(--text-sm) }
.release li::marker { color: var(--color-fg-3) }

/* callout */
.note {
  border-left: 3px solid var(--color-accent); background: var(--color-accent-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-4) var(--space-6); max-width: 46rem
}
.note p { color: var(--color-fg-2); font-size: var(--text-sm) }
.note b { color: var(--color-fg) }

/* closing CTA */
.cta { text-align: center }
.cta h2 { margin-bottom: var(--space-3) }
.cta p { color: var(--color-fg-2); margin-bottom: var(--space-6) }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: center }

.stack-8 > * + * { margin-top: var(--space-8) }
.stack-6 > * + * { margin-top: var(--space-6) }
.stack-4 > * + * { margin-top: var(--space-4) }


/* ---------- purchase + download flow ---------- */

/* A button whose config value is missing. Visible enough that you cannot ship
   it by accident, quiet enough not to look like an error to a visitor. */
[data-unconfigured] { opacity: .5; cursor: not-allowed }
[data-unconfigured]:hover { transform: none; filter: none }
[data-cfg][data-empty]::after { content: "—"; color: var(--color-fg-3) }

/* localhost-only setup banner from buy.js */
.setup-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 70;
  max-width: calc(100vw - 24px); padding: 10px 16px;
  border: 1px solid color-mix(in srgb, var(--color-warn) 45%, transparent);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-warn) 14%, var(--color-bg));
  color: var(--color-fg); font-size: var(--text-xs); line-height: 1.5;
  box-shadow: var(--shadow-2)
}
.setup-bar code {
  font-family: var(--font-mono); font-size: .95em;
  background: color-mix(in srgb, var(--color-fg) 8%, transparent);
  border-radius: var(--radius-sm); padding: 1px 5px
}

/* download page */
.dl-panel {
  display: grid; gap: var(--space-6); justify-items: center; text-align: center;
  border: 1px solid var(--color-border); border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-6); background: var(--color-bg-2)
}
.dl-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px;
  font-size: var(--text-xs); color: var(--color-fg-3)
}
.dl-meta span { white-space: nowrap }
.dl-hash { font-family: var(--font-mono); word-break: break-all }

/* ordered "what happens next" list */
.flow { display: grid; gap: var(--space-6); counter-reset: flow; max-width: 46rem }
.flow-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--space-4); align-items: start }
.flow-item::before {
  counter-increment: flow; content: counter(flow);
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--color-accent); color: var(--color-accent-fg);
  font-size: var(--text-xs); font-weight: 600
}
.flow-item h3 { font-size: var(--text-base); margin-bottom: 2px }
.flow-item p { color: var(--color-fg-2); font-size: var(--text-sm) }

/* An unset optional value should leave no trace, not an orphan dash. */
.dl-meta span:has([data-cfg][data-empty]) { display: none }
.dl-hash:has([data-cfg][data-empty]) { display: none }

/* ---------- brand lockup ---------- */
/* Two files, one per background: lockup-light.png has dark text (for light
   backgrounds), lockup-dark.png has white. Both are 410x72 web copies of the
   1036x182 masters Lockup-bk.png / Lockup.png, which stay in img/ as sources.
   Swapped across all three theme states — explicit light,
   explicit dark, and the system default where only the media query applies. */
.logo-lockup { display: block; width: auto; height: 24px }
.logo-lockup-dark { display: none }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-lockup-light { display: none }
  :root:not([data-theme="light"]) .logo-lockup-dark { display: block }
}
:root[data-theme="dark"] .logo-lockup-light { display: none }
:root[data-theme="dark"] .logo-lockup-dark { display: block }
.foot-brand .logo-lockup { height: 22px }
@media (max-width: 420px) { .logo-lockup { height: 21px } }
/* ---------- light/dark toggle ---------- */
/* Two icons, swapped by the same three-state rule the lockup uses. The icon
   shows the theme you will GET, not the one you are in: a moon while light,
   a sun while dark. */
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--color-border); border-radius: 50%;
  background: none; color: var(--color-fg-2); cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast)
}
.theme-btn:hover { color: var(--color-fg); background: var(--color-bg-2); border-color: var(--color-fg-3) }
.theme-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px }
.theme-btn .ti { display: block }
.theme-btn .ti-sun { display: none }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .ti-moon { display: none }
  :root:not([data-theme="light"]) .theme-btn .ti-sun { display: block }
}
:root[data-theme="dark"] .theme-btn .ti-moon { display: none }
:root[data-theme="dark"] .theme-btn .ti-sun { display: block }

/* ============================================================
   Subpage polish
   The home page carries its own rich layout; these rules give the
   nav/footer pages the same visual language — depth, accent and
   rhythm — instead of leaving them as plain documents.
   ============================================================ */

/* --- page header: a soft accent wash so the page opens with something --- */
.page-head {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(70ch 40ch at 12% -10%,
      color-mix(in srgb, var(--color-accent) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--color-bg-2), var(--color-bg));
}
.page-head::after {
  /* hairline that fades out, softer than a full border */
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent,
    color-mix(in srgb, var(--color-accent) 40%, var(--color-border)) 20%,
    var(--color-border) 60%, transparent);
}
.page-head .container { position: relative }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 25%, transparent);
  margin-bottom: var(--space-5, 1.25rem)
}
.eyebrow::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--color-accent)
}
.page-head h1 { max-width: 20ch; letter-spacing: -0.03em }

/* --- cards: lift them off the page --- */
.card {
  position: relative;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--color-fg) 3%, var(--color-bg)), var(--color-bg));
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base)
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: color-mix(in srgb, var(--color-accent) 30%, var(--color-border))
}
.card h3 { letter-spacing: -0.01em }

/* --- steps: a spine connecting the numbers, like a real walkthrough --- */
.steps { position: relative }
.step { position: relative; padding-bottom: var(--space-2) }
.step:not(:last-child)::after {
  content: "";
  position: absolute; left: 16px; top: 38px; bottom: -14px; width: 2px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--color-accent) 35%, transparent), transparent)
}
.step::before {
  box-shadow: 0 0 0 4px var(--color-bg),
              0 0 0 5px color-mix(in srgb, var(--color-accent) 22%, transparent);
  position: relative; z-index: 1
}

/* --- flow list on the thanks page gets the same spine --- */
.flow { position: relative }
.flow-item { position: relative; padding-bottom: var(--space-2) }
.flow-item:not(:last-child)::after {
  content: "";
  position: absolute; left: 13px; top: 34px; bottom: -14px; width: 2px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--color-accent) 35%, transparent), transparent)
}
.flow-item::before { position: relative; z-index: 1 }

/* --- tables: give the product's own column real presence --- */
.table-wrap {
  box-shadow: var(--shadow-1);
  background: var(--color-bg)
}
thead th {
  background: var(--color-bg-2);
  position: sticky; top: 0; z-index: 2
}
tbody tr { transition: background var(--dur-fast) }
tbody tr:hover { background: color-mix(in srgb, var(--color-fg) 3%, transparent) }
.col-own {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  box-shadow: inset 1px 0 0 color-mix(in srgb, var(--color-accent) 30%, transparent),
              inset -1px 0 0 color-mix(in srgb, var(--color-accent) 30%, transparent)
}
thead th.col-own {
  background: color-mix(in srgb, var(--color-accent) 18%, var(--color-bg-2));
  font-weight: 700
}

/* --- FAQ rows: clearer affordance --- */
.faq details { transition: background var(--dur-fast) }
.faq summary:hover { color: var(--color-accent) }
.faq details[open] { background: color-mix(in srgb, var(--color-fg) 2%, transparent) }
.faq details[open] summary { color: var(--color-fg) }

/* --- release entries: a marker in the margin --- */
.release { position: relative; padding-left: var(--space-6) }
.release::before {
  content: "";
  position: absolute; left: 0; top: 10px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--color-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 18%, transparent)
}

/* --- prose headings get a quiet accent rule --- */
.prose h2 { position: relative; padding-top: var(--space-3) }
.prose h2::before {
  content: ""; position: absolute; left: 0; top: 0; width: 28px; height: 2px;
  border-radius: 2px; background: var(--color-accent)
}

/* --- sticky TOC: show where you are --- */
.toc a { border-left: 2px solid transparent; padding-left: 10px; margin-left: -12px }
.toc a:hover { border-left-color: var(--color-accent) }

/* --- closing CTA: lift it out of the page flow --- */
.cta {
  position: relative;
  border-radius: var(--radius-xl);
  padding: var(--section-y) var(--space-6);
  background:
    radial-gradient(60ch 30ch at 50% 0%,
      color-mix(in srgb, var(--color-accent) 16%, transparent), transparent 70%),
    var(--color-bg-2);
  border: 1px solid var(--color-border)
}
section.tint:has(.cta) { background: var(--color-bg) }

/* --- note callouts --- */
.note {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--color-accent) 10%, transparent), transparent 80%),
    var(--color-bg-2)
}
