/* ---- Design tokens ------------------------------------------------ */
:root {
  --bg:        #ffffff;
  --bg-soft:   #f6f7f9;
  --text:      #16181d;
  --text-mute: #5c6270;
  --border:    #e3e6ea;
  --accent:    #2f6df6;
  --accent-fg: #ffffff;
  --radius:    12px;
  --maxw:      1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0e1014;
    --bg-soft:   #16191f;
    --text:      #e9ecf1;
    --text-mute: #99a1b0;
    --border:    #262b34;
    --accent:    #5b8cff;
    --accent-fg: #0e1014;
  }
}

/* ---- Base --------------------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.125rem; }
p  { margin: 0 0 1rem; }

a { color: inherit; }

section { max-width: var(--maxw); margin: 0 auto; padding: 5rem 1.5rem; }

/* ---- Header ------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: var(--maxw); margin: 0 auto;
  padding: 1rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
}
.brand { font-weight: 700; text-decoration: none; letter-spacing: -0.02em; }
.site-header nav { display: flex; align-items: center; gap: 1.25rem; }
.site-header nav a { color: var(--text-mute); text-decoration: none; font-size: .9375rem; }
.site-header nav a:hover { color: var(--text); }

/* ---- Buttons ------------------------------------------------------ */
.btn {
  display: inline-block;
  padding: .7rem 1.25rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600; font-size: .9375rem;
  text-decoration: none;
  transition: opacity .15s ease, transform .15s ease;
}
.btn:hover { opacity: .9; transform: translateY(-1px); }
.btn-sm    { padding: .45rem .85rem; font-size: .875rem; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }

/* ---- Hero --------------------------------------------------------- */
.hero { padding-top: 4rem; padding-bottom: 6rem; }
.eyebrow {
  display: inline-block;
  margin-bottom: 1rem; padding: .25rem .7rem;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-mute); font-size: .8125rem; font-weight: 500;
}
.lede { max-width: 34rem; font-size: 1.125rem; color: var(--text-mute); }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* ---- Features ----------------------------------------------------- */
.features { background: var(--bg-soft); max-width: none; }
.features > * { max-width: var(--maxw); margin-inline: auto; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  padding: 1.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg);
}
.card p { margin: 0; color: var(--text-mute); font-size: .9375rem; }

/* ---- Prose / contact ---------------------------------------------- */
.prose p { max-width: 38rem; color: var(--text-mute); }
.contact { text-align: center; }
.contact p { color: var(--text-mute); }

/* ---- Footer ------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
}
.site-footer p { margin: 0; color: var(--text-mute); font-size: .875rem; }

/* ---- Small screens ------------------------------------------------ */
@media (max-width: 560px) {
  .site-header nav a:not(.btn) { display: none; }
  section { padding: 3.5rem 1.25rem; }
}

/* ---- Download ----------------------------------------------------- */
.hero-note { margin-top: 1rem; color: var(--text-mute); font-size: .875rem; }

.dl-panel {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 1.75rem;
}
.dl-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem;
}
.dl-head h3 { margin: 0 0 .35rem; font-size: 1.25rem; }
.tag {
  display: inline-block; vertical-align: middle;
  margin-left: .4rem; padding: .1rem .5rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg);
  color: var(--text-mute); font-size: .75rem; font-weight: 500; letter-spacing: 0;
}
.dl-meta { margin: 0; color: var(--text-mute); font-size: .875rem; }
.dl-body { color: var(--text-mute); font-size: .9375rem; max-width: 60ch; }

code {
  padding: .1rem .35rem;
  border-radius: 5px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .875em;
}

.dl-hash {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem;
  margin: 1.25rem 0 .5rem;
  padding: .75rem .9rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg);
  overflow-x: auto;
}
.dl-hash-label {
  color: var(--text-mute); font-size: .75rem; font-weight: 600; letter-spacing: .06em;
}
.dl-hash code { background: none; padding: 0; font-size: .8125rem; word-break: break-all; }

.dl-verify { color: var(--text-mute); font-size: .8125rem; margin-bottom: 1.25rem; }

.dl-note {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.dl-note summary {
  cursor: pointer; font-size: .9375rem; font-weight: 600;
  color: var(--text);
}
.dl-note summary:hover { color: var(--accent); }
.dl-note p {
  margin-top: .85rem; color: var(--text-mute); font-size: .875rem; max-width: 62ch;
}

.dl-links { margin: 1.25rem 0 0; font-size: .875rem; color: var(--text-mute); }
.dl-links a { color: var(--accent); text-decoration: none; }
.dl-links a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .dl-panel { padding: 1.25rem; }
  .dl-head .btn { width: 100%; text-align: center; }
}

/* ---- Decorative chart motifs -------------------------------------- */
/* These carry no data. They are the shapes of the methods, drawn thin
   and recessive, with no values on them. Colour comes from currentColor
   so both themes derive from the same tokens. */

.hero { position: relative; overflow: hidden; }
.hero > *:not(.hero-bg) { position: relative; z-index: 1; }

.hero-bg {
  position: absolute;
  top: 50%; right: -2%;
  transform: translateY(-50%);
  width: min(48%, 540px);
  height: auto;
  z-index: 0;
  pointer-events: none;
  color: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-bg .hb-grid    { stroke: var(--text-mute); stroke-width: 1; opacity: .16; }
.hero-bg .hb-ipr     { stroke: currentColor; stroke-width: 2.5; opacity: .40; }
.hero-bg .hb-tpr     { stroke: currentColor; stroke-width: 2.5; opacity: .26; }
.hero-bg .hb-drop    { stroke: currentColor; stroke-width: 1.5; opacity: .22; stroke-dasharray: 3 5; }
.hero-bg .hb-op circle { fill: currentColor; opacity: .38; }

/* The hero text must win. Below the breakpoint the motif would sit
   under the paragraph, so it goes away entirely rather than fight it. */
@media (max-width: 860px) {
  .hero-bg { display: none; }
}

.card-chart {
  display: block;
  width: 100%; height: 46px;
  margin-bottom: 1rem;
  color: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.card-chart .cc-axis  { stroke: var(--text-mute); stroke-width: 1.25; opacity: .35; }
.card-chart .cc-a     { stroke: currentColor; stroke-width: 2; opacity: .9; }
.card-chart .cc-b     { stroke: currentColor; stroke-width: 2; opacity: .45; }
.card-chart .cc-muted { stroke: var(--text-mute); stroke-width: 1.5; opacity: .3; }
.card-chart .cc-dash  { stroke: currentColor; stroke-width: 2; opacity: .45; stroke-dasharray: 4 4; }
.card-chart .cc-tick  { stroke: var(--text-mute); stroke-width: 1.25; opacity: .3; }
.card-chart .cc-dot   { fill: currentColor; }
.card-chart .cc-pt circle { fill: currentColor; opacity: .55; }
.card-chart .cc-bar rect  { fill: currentColor; opacity: .55; }
.card-chart .cc-fill  { fill: currentColor; opacity: .07; stroke: none; }

/* Forced-colours (Windows high contrast): decoration should not survive
   as mystery shapes competing with the text. */
@media (forced-colors: active) {
  .hero-bg { display: none; }
  .card-chart { opacity: .4; }
}

/* ---- External links ----------------------------------------------- */
/* Visually hidden, but read aloud - the arrow alone does not tell a
   screen-reader user the link leaves the page. */
.vh {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.ext-mark {
  display: inline-block;
  margin-left: .3em;
  font-size: .85em;
  line-height: 1;
  transform: translateY(-1px);
}

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

.dl-alt {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-mute); font-size: .9375rem;
}
