/* Benchwire landing page */

:root {
  --charcoal: #15181d;
  --charcoal-2: #1c2027;
  --charcoal-3: #252a33;
  --paper: #f2efe8;
  --paper-2: #e8e4da;
  --amber: #e0962f;       /* accent on dark */
  --amber-ink: #9a5a0c;   /* accent text on light */
  --red: #ff7a66;
  --green: #7fc79a;

  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 4px;
}

/* Section themes: each sets its own ink/background tokens */
.dark {
  --bg: var(--charcoal);
  --ink: var(--paper);
  --ink-2: #b4b0a6;
  --line: #333943;
  --line-soft: #242931;
  --accent: var(--amber);
  --accent-ink: var(--amber);
  --panel: var(--charcoal-2);
  background: var(--bg);
  color: var(--ink);
}
.light {
  --bg: var(--paper);
  --ink: var(--charcoal);
  --ink-2: #4f4c45;
  --line: #cfc9bc;
  --line-soft: #e0dbd0;
  --accent: var(--amber);
  --accent-ink: var(--amber-ink);
  --panel: #faf8f3;
  background: var(--bg);
  color: var(--ink);
}
.light.alt { border-top: 1px solid var(--line); }
.dark.deep { background: #101317; }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--charcoal);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 3.8vw, 3rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); max-width: 22ch; }
h3 { font-size: 1.2rem; font-weight: 500; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: var(--font-mono); }
code { font-size: 0.9em; }

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
summary:focus-visible, pre:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-2); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 100;
  background: var(--amber); color: var(--charcoal);
  padding: 8px 12px; font-weight: 600; border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }

/* Labels / tags */
.eyebrow, .kicker, .tag, .step-n, .idx, label, .form-note, .scope-note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.eyebrow, .kicker {
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 0.9rem;
}
.kicker::before { content: "// "; opacity: 0.7; }
.tag {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--accent);
  color: var(--accent-ink);
  border-radius: 2px;
  text-transform: uppercase;
  font-size: 0.72rem;
  line-height: 1.5;
}

/* Grid-line motif */
.grid-bg {
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(21, 24, 29, 0.94);
  backdrop-filter: blur(6px);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 1.15rem;
  text-decoration: none;
}
.brand-mark { width: 26px; height: 26px; color: var(--ink-2); }
nav { margin-left: auto; }
.nav-links { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-2);
  text-decoration: none;
}
.nav-links a:hover { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  background: var(--amber); color: var(--charcoal);
  border: 1px solid var(--amber); border-radius: var(--radius);
  font: 600 1rem/1 var(--font-body);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { background: #eba84a; border-color: #eba84a; }
.btn[disabled] { opacity: 0.7; cursor: progress; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 0.9rem; }

/* Hero */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 104px); border-bottom: 1px solid var(--line); }
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 46ch; margin-bottom: 1.75rem; }

/* Scope visual */
.scope, .pr-comment {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 20px 50px rgba(0,0,0,0.35);
}
.scope-head, .pr-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-2);
}
.scope-svg { display: block; width: 100%; height: auto; }
.grid-minor { stroke: #20252d; stroke-width: 1; }
.grid-major path { stroke: #2d333d; stroke-width: 1; fill: none; }
.regress-band { fill: rgba(224, 150, 47, 0.08); stroke: rgba(224, 150, 47, 0.55); stroke-dasharray: 4 4; }
.hatch { stroke: rgba(224, 150, 47, 0.35); stroke-width: 2; }
.trace { fill: none; stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.trace-base { stroke: #9aa3ad; }
.trace-head { stroke: var(--amber); }
.annot line { stroke: var(--amber); stroke-width: 1; }
.annot text { fill: var(--amber); font: 500 12px var(--font-mono); }
.annot .annot-dim { fill: #b4b0a6; font-weight: 400; }
.axis text { fill: #8a8f98; font: 11px var(--font-mono); }

.scope-foot {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.8rem;
}
.legend { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend code { color: var(--ink); font-size: 1em; }
.swatch { width: 18px; height: 2px; display: inline-block; }
.swatch-base { background: #9aa3ad; }
.swatch-head { background: var(--amber); height: 3px; }
.readout { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.readout div {
  flex: 1 1 auto;
  border: 1px solid var(--line); border-radius: 3px;
  padding: 6px 10px;
}
.readout dt { color: var(--ink-2); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.readout dd { margin: 0; color: var(--ink); white-space: nowrap; }
.readout .fail { border-color: var(--red); }
.readout .fail dd { color: var(--red); font-weight: 500; }
.scope-note { color: var(--ink-2); margin: 10px 0 0; font-size: 0.75rem; }

/* Forms */
.waitlist { max-width: 560px; }
.field-row { display: flex; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-email { flex: 1; }
label { color: var(--ink-2); }
input, select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  background: var(--charcoal);
  color: var(--paper);
  border: 1px solid #4a515c;
  border-radius: var(--radius);
  font: 400 1rem var(--font-body);
}
select { padding-right: 32px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #b4b0a6 50%), linear-gradient(135deg, #b4b0a6 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input::placeholder { color: #7d828b; }
input:hover, select:hover { border-color: #6a717c; }
input[aria-invalid="true"] { border-color: var(--red); }
.field-error { min-height: 1.4em; margin: 6px 0 0; color: var(--red); font-size: 0.9rem; }
.field-error:empty { min-height: 0; margin: 0; }

.optional { margin-top: 14px; }
.optional summary {
  cursor: pointer; color: var(--ink-2);
  font-family: var(--font-mono); font-size: 0.82rem;
  list-style: none; display: block;
  padding: 4px 0;
}
.optional summary::-webkit-details-marker { display: none; }
.optional summary::before { content: "+"; color: var(--accent); display: inline-block; width: 1ch; margin-right: 8px; }
.optional[open] summary::before { content: "−"; }
.optional-fields {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin-top: 10px;
}
.form-note { margin: 14px 0 0; color: var(--ink-2); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-success {
  border: 1px solid var(--amber);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: 18px 20px;
  background: rgba(224, 150, 47, 0.07);
  max-width: 560px;
}
.form-success:focus { outline: none; }
.form-success h3 { margin-bottom: 0.3em; }
.form-success p { margin: 0; color: var(--ink-2); }
.form-success .status { font-family: var(--font-mono); font-size: 0.8rem; color: var(--amber); margin-bottom: 6px; }

/* Sections */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-lede { color: var(--ink-2); max-width: 60ch; font-size: 1.1rem; }

.problems, .steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 0; }
.problems { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.problems li { padding: 24px 28px 8px 0; }
.problems li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.problems p, .steps p { color: var(--ink-2); }
.idx, .step-n { display: block; color: var(--accent-ink); margin-bottom: 14px; }

.steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.steps li {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px 12px;
}
.steps li + li::before {
  /* connector between steps */
  content: ""; position: absolute; left: -17px; top: 32px; width: 16px; height: 1px; background: var(--amber-ink);
}
.step-n { text-transform: uppercase; }

.get-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.features { margin: 32px 0 0; }
.features div { padding: 16px 0; border-top: 1px solid var(--line); }
.features dt { font-family: var(--font-head); font-weight: 500; font-size: 1.1rem; margin-bottom: 4px; }
.features dt::before { content: "▸ "; color: var(--accent); }
.features dd { margin: 0; color: var(--ink-2); }

.pr-comment { position: sticky; top: 84px; }
.pr-bot { color: var(--ink); }
.pr-body { padding: 16px 16px 6px; }
.pr-status { margin-bottom: 4px; }
.status-dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--red); }
.pr-meta { font-size: 0.85rem; color: var(--ink-2); }
.pr-meta code { color: var(--ink); }
.table-scroll { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.82rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { color: var(--ink-2); font-weight: 400; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.05em; }
tbody th { font-weight: 400; color: var(--ink); }
td.ok { color: var(--green); }
td.bad { color: var(--red); font-weight: 500; }
.pr-link { font-family: var(--font-mono); font-size: 0.85rem; color: var(--amber); margin: 14px 0 8px; }
.pr-comment .scope-note { padding: 0 16px 14px; margin: 0; }

/* Code */
.code-grid {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 20px; margin-top: 36px; align-items: start;
}
.code { margin: 0; background: #0c0e11; border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.code figcaption {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.code .file { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-2); overflow-wrap: anywhere; }
pre {
  margin: 0; padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.85rem; line-height: 1.65;
  color: #d8d4ca;
}
pre .k { color: #e8b56a; }
pre .s { color: #a8d0a0; }
pre .c { color: #7d828b; }

/* FAQ */
.faq-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 64px); }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 20px 0;
  font-family: var(--font-head); font-weight: 500; font-size: 1.15rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--font-mono); color: var(--accent-ink); font-size: 1.2rem; flex: none;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-2); max-width: 65ch; }
.faq details p:last-child { padding-bottom: 12px; }

/* Final CTA */
.cta { border-top: 1px solid var(--line); }
.cta-inner { max-width: 760px; }
.cta h2 { max-width: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.brand-small { font-family: var(--font-head); font-weight: 600; }

/* Responsive */
@media (max-width: 1000px) {
  .hero-inner, .get-grid { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li + li::before { display: none; }
  .pr-comment { position: static; }
  .code-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  nav { margin-left: auto; }
  .problems { grid-template-columns: minmax(0, 1fr); border-top: 0; }
  .problems li, .problems li + li { padding: 20px 0 4px; border-left: 0; border-top: 1px solid var(--line); }
  .faq-wrap { grid-template-columns: minmax(0, 1fr); }
  .optional-fields { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  th, td { padding: 8px 6px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .field-row { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .btn-small { width: auto; }
  .header-inner { gap: 12px; }
  .readout div { flex-basis: 40%; }
}
