/* BassDesign marketing site. Layout: "workbench on graph paper": a calm column of copy beside live plots;
   the plot surface (graph paper + mono readouts) is the signature, everything else stays quiet.
   Colour/type tokens are the app's (app/src/ui/tokens.css) so site and calculator read as one product. */
:root {
  --bg: #edf0f4; --panel: #ffffff; --panel-2: #f5f7fa; --ink: #0f1b2d; --muted: #5b6b80; --line: #d6dde6;
  --grid: #e3e8ef; --grid-major: #c9d2de; --accent: #2f5bff; --accent-ink: #ffffff; --accent-soft: #e4eaff;
  --accent-2: #d93f78; --good: #128a5b; --warn: #b77800; --bad: #cf3434;
  --shadow: 0 1px 2px rgb(15 27 45 / 6%), 0 8px 24px rgb(15 27 45 / 6%);
  --font-display: 'Bricolage Grotesque', 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 10px; --r-sm: 6px; --wrap: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a0f18; --panel: #111926; --panel-2: #0d1520; --ink: #e6ecf5; --muted: #8a9ab2; --line: #213048;
    --grid: #152033; --grid-major: #1f2d45; --accent: #7390ff; --accent-ink: #0a0f18; --accent-soft: #1a2647;
    --accent-2: #ff6fa5; --good: #3ccf8e; --warn: #f2b33d; --bad: #ff6464;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 30px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0a0f18; --panel: #111926; --panel-2: #0d1520; --ink: #e6ecf5; --muted: #8a9ab2; --line: #213048;
  --grid: #152033; --grid-major: #1f2d45; --accent: #7390ff; --accent-ink: #0a0f18; --accent-soft: #1a2647;
  --accent-2: #ff6fa5; --good: #3ccf8e; --warn: #f2b33d; --bad: #ff6464;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 30px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box }
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto } *, *::before, *::after { animation: none !important; transition: none !important } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--font-body); -webkit-font-smoothing: antialiased }
a { color: var(--accent); text-underline-offset: 3px }
a:hover { text-decoration-thickness: 2px }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px }
img, svg { max-width: 100% }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; margin: 0 }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.3rem); font-weight: 700 }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 700 }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em }
p { margin: 0 }
code, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px) }
.eyebrow { font: 500 12px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted) }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; z-index: 9 }
.skip:focus { left: 16px }

/* ---------- header ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line) }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 22px/1 var(--font-display); letter-spacing: -0.02em }
.brand svg { width: 34px; height: 34px; flex: none }
.brand b { color: var(--accent); font-weight: inherit }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500 }
.nav a:hover, .nav a[aria-current='page'] { color: var(--ink) }
.nav a.btn-primary, .nav a.btn-primary:hover { color: var(--accent-ink) }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; font: 600 15px/1 var(--font-body); text-decoration: none; cursor: pointer; transition: transform .15s, background .15s }
.btn:active { transform: translateY(1px) }
.btn-primary { background: var(--accent); color: var(--accent-ink) }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)) }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line) }
.btn-ghost:hover { border-color: var(--muted) }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px }
@media (max-width: 760px) { .top { position: static } .nav a:not(.btn) { display: none } .top .wrap { gap: 12px } }

/* ---------- graph paper (signature) ---------- */
.paper {
  background-color: var(--panel);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: -1px -1px;
}
.plot { width: 100%; height: auto; display: block; overflow: visible }
.plot .g { stroke: var(--grid); stroke-width: 1 }
.plot .gM { stroke: var(--grid-major); stroke-width: 1 }
.plot .ax { fill: var(--muted); font: 500 11px var(--font-mono) }
.plot .main { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round }
.plot .fill { fill: var(--accent); opacity: .1 }
.plot .ref { fill: none; stroke: var(--accent-2); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; opacity: .9 }
.plot .mk { stroke: var(--muted); stroke-dasharray: 3 3 }
.plot .mt { fill: var(--ink); font: 600 11px var(--font-mono) }

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(40px, 6vw, 72px) }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(28px, 5vw, 64px); align-items: center }
.hero h1 em { font-style: normal; color: var(--accent) }
.hero .lede { margin-top: 22px; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 34em }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px }
.hero .proof { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px }
.hero .proof li::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 8px; vertical-align: 2px }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr) } }

/* Instrument card: a live plot with readouts and sliders. */
.instrument { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; background: var(--panel) }
.instrument-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line) }
.instrument-head .eyebrow { color: var(--ink) }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line) }
.seg button { border: 0; background: transparent; color: var(--muted); font: 600 13px/1 var(--font-body); padding: 7px 12px; border-radius: 999px; cursor: pointer; min-height: 32px }
.seg button[aria-pressed='true'] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 12%) }
.readouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line) }
.readout { padding: 12px 16px; border-right: 1px solid var(--line) }
.readout:last-child { border-right: 0 }
.readout .k { font: 500 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted) }
.readout .v { font: 500 26px/1.1 var(--font-mono); margin-top: 6px; font-variant-numeric: tabular-nums }
.readout .v small { font-size: 12px; color: var(--muted); margin-left: 3px }
.instrument .plotwrap { padding: 8px 10px 0 }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 16px 0; font-size: 12.5px; color: var(--muted) }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--accent); vertical-align: 4px; margin-right: 6px }
.legend i.ref { border-top: 2px dotted var(--accent-2) }
.sliders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; padding: 14px 16px 18px }
.slider label { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 500 }
.slider label output { font-family: var(--font-mono); color: var(--accent) }
input[type='range'] { width: 100%; accent-color: var(--accent); margin: 8px 0 0; height: 28px }
.note { font-size: 12.5px; color: var(--muted); padding: 0 16px 14px }

/* ---------- sections ---------- */
.section { padding-block: clamp(56px, 8vw, 104px) }
.section + .section { border-top: 1px solid var(--line) }
.section-head { display: grid; gap: 14px; max-width: 46rem; margin-bottom: clamp(28px, 4vw, 48px) }
.section-head p { color: var(--muted); font-size: 1.08rem }

.types { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none }
.types li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 14.5px; font-weight: 500 }
.types svg { width: 26px; height: 18px; color: var(--accent) }
.strip { padding-block: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel-2) }
.strip .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden }
.feature { background: var(--panel); padding: 26px 24px 28px; display: grid; gap: 10px; align-content: start }
.feature .tag { font: 500 11.5px/1 var(--font-mono); color: var(--accent); letter-spacing: .06em }
.feature p { color: var(--muted); font-size: 15.5px }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 560px) { .features { grid-template-columns: minmax(0, 1fr) } }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 36px); counter-reset: s; margin: 0; padding: 0; list-style: none }
.steps li { counter-increment: s; display: grid; gap: 10px; align-content: start; padding-top: 18px; border-top: 2px solid var(--ink) }
.steps li::before { content: counter(s, decimal-leading-zero); font: 500 13px var(--font-mono); color: var(--accent) }
.steps p { color: var(--muted); font-size: 15.5px }
@media (max-width: 760px) { .steps { grid-template-columns: minmax(0, 1fr) } }

.free { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start }
.free h2 { font-size: clamp(2rem, 4.4vw, 3.4rem) }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; border-top: 1px solid var(--line) }
.checks li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px }
.checks li::before { content: ''; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%; background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.6 2.5L13 6.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat }
.checks b { font-weight: 600 }
.checks span { color: var(--muted) }
@media (max-width: 760px) { .free { grid-template-columns: minmax(0, 1fr) } }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px }
.card { display: grid; gap: 10px; align-content: start; padding: 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s }
.card:hover { border-color: var(--accent); transform: translateY(-2px) }
.card p { color: var(--muted); font-size: 15px }
.card .meta { font: 500 12px var(--font-mono); color: var(--muted) }
.card .go { font-weight: 600; font-size: 14.5px; color: var(--accent) }
.cards.tools .card { border-top: 3px solid var(--accent) }

.faq { max-width: 50rem; display: grid; gap: 0; border-top: 1px solid var(--line) }
.faq details { border-bottom: 1px solid var(--line) }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; font: 600 1.08rem/1.35 var(--font-body) }
.faq summary::-webkit-details-marker { display: none }
.faq summary::after { content: '+'; font: 400 1.5rem/1 var(--font-mono); color: var(--accent) }
.faq details[open] summary::after { content: '−' }
.faq details p { padding: 0 0 20px; color: var(--muted); max-width: 44rem }

.final { text-align: left; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: clamp(28px, 4vw, 44px); border-radius: 16px; background: var(--ink); color: var(--bg) }
.final h2 { color: var(--bg); max-width: 22ch }
.final .btn-primary { background: var(--bg); color: var(--ink) }

/* ---------- footer ---------- */
.foot { padding-block: 40px 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px }
.foot .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 28px }
.foot h4 { margin: 0 0 10px; font: 600 13px var(--font-body); color: var(--ink) }
.foot ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px }
.foot a { color: var(--muted); text-decoration: none }
.foot a:hover { color: var(--ink) }
.foot .brand { font-size: 19px; margin-bottom: 10px }
@media (max-width: 760px) { .foot .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) } .foot .wrap > :first-child { grid-column: 1 / -1 } }

/* ---------- tool pages ---------- */
.tool-hero { padding-block: clamp(32px, 5vw, 56px) 8px }
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 6px }
.crumbs a { color: var(--muted) }
.tool-hero p.lede { margin-top: 14px; color: var(--muted); font-size: 1.12rem; max-width: 42rem }
.tool { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 0; margin-block: 28px 8px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow) }
.tool-in { padding: 20px; border-right: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; background: var(--panel) }
.tool-out { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; min-width: 0 }
@media (max-width: 860px) { .tool { grid-template-columns: minmax(0, 1fr) } .tool-in { border-right: 0; border-bottom: 1px solid var(--line) } }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0 }
.field.full { grid-column: 1 / -1 }
.field label { font-size: 13px; font-weight: 600 }
.field label span { font-weight: 400; color: var(--muted) }
.inp { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2); min-height: 44px }
.inp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.inp input, .inp select { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; color: var(--ink); font: 500 16px var(--font-mono); padding: 10px 12px; outline: none }
.inp select { font-family: var(--font-body) }
.inp .u { padding-right: 12px; color: var(--muted); font: 500 13px var(--font-mono) }
.err { color: var(--bad); font-size: 14px; min-height: 0 }
.err:empty { display: none }
.hint { font-size: 14px; color: var(--muted); padding: 0 16px 16px }
.tool-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--panel-2) }
.tool-foot p { font-size: 13.5px; color: var(--muted); max-width: 36rem }
.linkbtn { border: 0; background: none; color: var(--accent); font: 600 13px var(--font-body); padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px }

/* ---------- prose (guides) ---------- */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: clamp(32px, 5vw, 72px); padding-block: 8px 72px }
@media (max-width: 960px) { .article { grid-template-columns: minmax(0, 1fr) } .toc { display: none } }
.prose { max-width: 42rem; font-size: 18px; line-height: 1.7 }
.prose > * + * { margin-top: 1.1em }
.prose h2 { font-size: 1.75rem; margin-top: 2.2em; scroll-margin-top: 90px }
.prose h3 { margin-top: 1.8em }
.prose .lede { font-size: 1.22rem; line-height: 1.55; color: var(--ink); padding-left: 18px; border-left: 3px solid var(--accent) }
.prose ul, .prose ol { padding-left: 1.3em }
.prose li + li { margin-top: .35em }
.prose code { font-size: .88em; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px }
.prose .table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel) }
.prose table { border-collapse: collapse; width: 100%; font-size: 15.5px; line-height: 1.45 }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top }
.prose th { font: 600 13px var(--font-body); background: var(--panel-2) }
.prose tr:last-child td { border-bottom: 0 }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--line); color: var(--muted) }
.prose .callout { padding: 16px 18px; border-radius: var(--r); background: var(--accent-soft); font-size: 16.5px }
.prose .formula { padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--line); overflow-x: auto }
.prose .formula code { display: block; border: 0; background: none; padding: 0; font-size: 16px; white-space: pre-wrap }
.prose .formula p { margin-top: 8px; font-size: 15px; color: var(--muted) }
.prose .cta-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel) }
.prose .cta-box p { font-size: 16px; margin: 0 }
.prose .faq { margin-top: 1em }
.byline { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; font: 500 13px var(--font-mono); color: var(--muted) }
.toc { position: sticky; top: 96px; align-self: start; font-size: 14px }
.toc ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; border-left: 1px solid var(--line) }
.toc a { display: block; padding-left: 14px; color: var(--muted); text-decoration: none; line-height: 1.35 }
.toc a:hover { color: var(--ink) }
.toc .card { margin-top: 24px; padding: 20px; color: var(--ink) }
.related { margin-top: 56px }
@media (max-width: 560px) { .plot .ax { font-size: 18px } .plot .mt { font-size: 17px } .plot .main { stroke-width: 4 } }
