/* ============================================================================
   convertlyft marketing site — the CI run / build-log world.
   ----------------------------------------------------------------------------
   DIRECTION CONTRACT (seed 924875f2, owner-approved 2026-08-22)
   THESIS: the site speaks CI-run grammar — the product's own pipeline (watch →
   find → approve → ship → measure) is the page's form. It refuses the category
   default: dark SaaS hero + glowing dashboard mockup + gradient mesh.
   OWN-WORLD: a CI web UI in daylight — near-white canvas, hairline borders,
   run cards with status dots and durations, step rows with ✓/⚠/○ states,
   monospace for data, labels and log lines. Brand blue on the single CTA only;
   green = passed/win, amber = leak/awaiting approval, red = failing — semantic
   law, never decoration (brand commitment). 6px radius, 1px hairlines.
   STORY: the visitor watches a run mid-execution — "leak found · awaiting your
   approval" — understands the loop in one viewport, grades their own funnel
   free, starts the trial. Friction audit: every section either advances that
   understanding or offers the action; nothing else ships.
   FIRST VIEWPORT: left — plain-English headline, one brand-blue CTA, demoted
   URL field ("run a free check on your site"); right — a live run card whose
   steps check in sequence, one amber approval gate.
   FORM: CI run / build log — candidate 3 of the grounded list, seed 924875f2.
   FINISH: unreviewed and undocumented is unfinished; this build ends with the
   finish review, the verdict, and DESIGN.md.
   ----------------------------------------------------------------------------
   Tokens inherited from the approved theme (apps/web themePrimitives via
   wireframes/wire.css) — brand blue scale, grays, semantic colors are law.
   ========================================================================== */

:root {
  /* brand blue scale (brand law: primary CTA + interactive focus only) */
  --brand-50:  hsl(210, 100%, 95%);
  --brand-100: hsl(210, 100%, 90%);
  --brand-400: hsl(210, 98%, 48%);
  --brand-500: hsl(210, 98%, 42%);  /* primary CTA fill — 5.2:1 vs white */
  --brand-600: hsl(210, 98%, 34%);

  /* grays */
  --ink:   hsl(220, 30%, 10%);
  --mute:  hsl(220, 12%, 36%);
  --faint: hsl(220, 10%, 46%);
  --line:  hsl(220, 15%, 86%);
  --line-soft: hsl(220, 15%, 92%);

  /* grounds */
  --bg:    hsl(210, 20%, 99%);
  --paper: hsl(220, 35%, 97%);
  --white: #fff;

  /* semantic — meanings only */
  --win:       hsl(120, 59%, 30%);
  --win-bg:    hsl(120, 45%, 93%);
  --leak:      hsl(45, 91%, 25%);
  --leak-bg:   hsl(45, 95%, 92%);
  --leak-bar:  hsl(45, 90%, 45%);
  --broken:    hsl(0, 90%, 30%);
  --broken-bg: hsl(0, 80%, 95%);

  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, "Segoe UI", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  --r: 6px;            /* the world's corner — cards, runs, inputs */
  --r-sm: 4px;         /* chips, badges, bars */
}

/* manual dark theme toggle */
:root[data-theme="dark"] {
  --ink:       hsl(210, 20%, 95%);
  --mute:      hsl(210, 14%, 60%);
  --faint:     hsl(210, 12%, 50%);
  --line:      hsl(210, 15%, 30%);
  --line-soft: hsl(210, 15%, 20%);
  --bg:        hsl(210, 20%, 10%);
  --paper:     hsl(210, 20%, 15%);
  --white:     hsl(210, 20%, 15%);
  --win:       hsl(120, 70%, 60%);
  --win-bg:    hsl(120, 35%, 25%);
  --leak:      hsl(45, 85%, 55%);
  --leak-bg:   hsl(45, 60%, 25%);
  --leak-bar:  hsl(45, 80%, 45%);
  --broken:    hsl(0, 75%, 55%);
  --broken-bg: hsl(0, 50%, 25%);
}

:root[data-theme="light"] {
  --ink:       hsl(220, 30%, 10%);
  --mute:      hsl(220, 12%, 36%);
  --faint:     hsl(220, 10%, 46%);
  --line:      hsl(220, 15%, 86%);
  --line-soft: hsl(220, 15%, 92%);
  --bg:        hsl(210, 20%, 99%);
  --paper:     hsl(220, 35%, 97%);
  --white:     #fff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 200ms, color 200ms;
}

html { transition: background-color 200ms; }

::selection { background: var(--brand-100); }

/* ---------- typography ---------- */

h1 { font-size: 40px; line-height: 1.08; letter-spacing: -0.03em; max-width: 22ch; font-weight: 650; }
h2 { font-size: 26px; letter-spacing: -0.02em; line-height: 1.18; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
.lede { font-size: 17.5px; line-height: 1.5; color: var(--ink); max-width: 54ch; margin-top: 16px; }
.body { font-size: 15px; color: var(--mute); max-width: 62ch; margin-top: 10px; }
code { font-family: var(--mono); font-size: 0.9em; }

/* section eyebrow — the world's command-line grammar, always paired with a
   plain-English heading right after (voice law: the heading carries meaning) */
.klabel {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.02em; color: var(--faint); margin-bottom: 14px;
  display: block;
}
.klabel b { color: var(--mute); font-weight: 600; }

/* ---------- layout ---------- */

.page { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

section.block { padding: 76px 0 8px; }
section.block.alt {
  background: var(--paper); border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding-left: 24px; padding-right: 24px; padding-bottom: 76px;
  margin-left: -24px; margin-right: -24px;
}

.grid { display: grid; gap: 24px; margin-top: 32px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid.c4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
  h2 { font-size: 22px; }
  section.block { padding: 56px 0 8px; }
}

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px;
  transition: background-color 200ms, border-color 200ms;
}
.card h3 { margin-bottom: 6px; }
.card p { font-size: 13.5px; color: var(--mute); margin-top: 4px; }

/* ---------- header / footer ---------- */

header.nav {
  display: flex; align-items: center; gap: 24px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 20;
}
.wordmark {
  color: var(--ink); text-decoration: none;
  font-weight: 700; letter-spacing: -0.02em; font-size: 18px;
  display: inline-flex; align-items: center; gap: 8px;
}
.wordmark::before { /* the run-status dot, always green: the system is up */
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--win); flex: none;
}
header.nav .links { display: flex; gap: 22px; margin-left: auto; font-size: 13.5px; }
header.nav .links a { color: var(--mute); text-decoration: none; white-space: nowrap; }
header.nav .links a:hover { color: var(--ink); }
header.nav .links a.cur { color: var(--ink); font-weight: 600; }
header.nav .btn { flex: none; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  header.nav { gap: 14px; position: static; padding: 12px 0; }
  header.nav .links { gap: 14px; font-size: 13px; }
}
@media (max-width: 640px) {
  /* one row: wordmark · ≡ · CTA; the links drop into a panel under it (CSS-only, no JS needed on legal pages) */
  header.nav { flex-wrap: wrap; }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center; order: 2; margin-left: auto;
    width: 36px; height: 34px; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white);
  }
  header.nav .btn.small, header.nav #themeToggle { order: 3; margin-left: 0; }
  header.nav .links { display: none; order: 4; width: 100%; margin-left: 0; flex-direction: column; gap: 0; border-top: 1px solid var(--line); margin-top: 4px; }
  .menu-check:checked ~ .links { display: flex; }
  header.nav .links a { padding: 11px 0; font-size: 15px; border-bottom: 1px solid var(--line-soft); }
}

footer {
  margin-top: 88px; border-top: 1px solid var(--line);
  padding: 32px 0 64px; font-size: 14px; color: var(--mute);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 40px; align-items: start;
}
footer a { color: inherit; text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }
footer .fcol a, footer .fcol span { color: var(--ink); }
footer .fcol span.fhead { color: var(--faint); }
footer .fcol a[href^="mailto"] { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
footer a.cur { color: var(--ink); font-weight: 600; }
footer .fcol { display: flex; flex-direction: column; gap: 7px; }
footer .fhead { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
footer .fbase { grid-column: 1 / -1; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: 18px; }
footer .fmeta { font-size: 14px; color: var(--mute); }
@media (max-width: 640px) { footer { grid-template-columns: 1fr 1fr; gap: 24px 20px; } footer .fmeta { margin-left: 0; width: 100%; } }


/* ---------- actions ---------- */

.btn {
  display: inline-block; border-radius: var(--r); border: 1px solid var(--line);
  padding: 12px 24px; font-family: inherit; font-size: 14.5px; font-weight: 600;
  color: var(--ink); background: var(--white); text-decoration: none; cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.btn:hover { transform: scale(1.02); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.btn.brand {
  background: var(--brand-500); border-color: var(--brand-500); color: #fff;
  box-shadow: 0 1px 2px rgba(2, 106, 212, 0.25);
}
.btn.brand:hover { background: var(--brand-600); border-color: var(--brand-600); box-shadow: 0 8px 20px rgba(2, 106, 212, 0.35); }
.btn.ghost { color: var(--mute); font-weight: 500; }
.btn.ghost:hover { color: var(--ink); border-color: var(--faint); }
.btn.small { padding: 7px 14px; font-size: 12.5px; }

.tlink {
  color: var(--brand-500); font-size: 14px; font-weight: 500;
  text-decoration: none; background: linear-gradient(to right, currentColor 0%, currentColor 100%) no-repeat;
  background-size: 0% 2px; background-position: 0 100%; transition: background-size 200ms ease;
}
.tlink:hover { color: var(--brand-600); background-size: 100% 2px; }

.risk { font-size: 12.5px; color: var(--mute); margin-top: 10px; }
.risk a { color: var(--brand-500); }

/* ---------- the run card — the world's signature component ---------- */

.run {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  overflow: hidden;
}
.run-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 12.5px; color: var(--mute);
  background: var(--paper);
}
.run-head b { color: var(--ink); font-weight: 600; }
.run-head .dur { margin-left: auto; color: var(--faint); }

/* status pill — CI badge grammar */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 200ms, color 200ms;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.pass { color: var(--win); background: var(--win-bg); }
.pill.gate { color: var(--leak); background: var(--leak-bg); }
.pill.fail { color: var(--broken); background: var(--broken-bg); }
.pill.demo {
  color: var(--mute); background: var(--white); border: 1px dashed var(--line);
  font-weight: 500;
}
.pill.demo::before { display: none; }

/* step rows — the build log itself */
.steps { list-style: none; }
.steps li {
  display: grid; grid-template-columns: 22px 132px 1fr auto; gap: 12px;
  align-items: baseline; padding: 11px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.steps li:first-child { border-top: 0; }
.steps .glyph { font-family: var(--mono); font-size: 13px; text-align: center; }
.steps .name { font-weight: 600; font-family: var(--mono); font-size: 12.5px; }
.steps .what { color: var(--mute); font-size: 13px; }
.steps .time { font-family: var(--mono); font-size: 11.5px; color: var(--faint); text-align: right; }

.steps li.pass .glyph { color: var(--win); }
.steps li.gated { background: var(--leak-bg); }
.steps li.gated .glyph { color: var(--leak); }
.steps li.gated .what { color: var(--leak); font-weight: 500; }
.steps li.queued { color: var(--faint); }
.steps li.queued .name, .steps li.queued .what { color: var(--faint); font-weight: 500; }
.steps li.fail .glyph { color: var(--broken); }

@media (max-width: 640px) {
  .steps li { grid-template-columns: 20px 1fr auto; }
  .steps .what { grid-column: 2 / -1; margin-top: 2px; }
  .steps .time { grid-column: 3; grid-row: 1; } /* keep the token on the name's row (was auto-placed to row 3, col 1) */
}

/* run steps animate in once, on view — the run "executes"; never motion-gated:
   without JS or with reduced motion every state is already final and visible */
@media (prefers-reduced-motion: no-preference) {
  .run.play .steps li { opacity: 0; transform: translateY(4px); transition: opacity 300ms ease, transform 300ms ease; }
  .run.play .steps li.on { opacity: 1; transform: none; }
}

/* log block — expandable output under a step, or standalone mono block */
.log {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 14px 16px; color: var(--mute);
  overflow-x: auto;
}
.log .l-pass { color: var(--win); }
.log .l-leak { color: var(--leak); }
.log .l-dim { color: var(--faint); }

/* ---------- funnel bars (product truth, framed as run output) ---------- */

.fbar { display: grid; grid-template-columns: 110px 1fr 68px; gap: 10px; align-items: center; margin: 8px 0; font-size: 12.5px; }
.fbar .fname { color: var(--mute); font-family: var(--mono); font-size: 12px; }
.fbar .track { background: var(--paper); border-radius: var(--r-sm); height: 18px; overflow: hidden; }
.fbar .fill { display: block; background: var(--brand-400); height: 100%; border-radius: var(--r-sm); }
.fbar .val { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; }
.fbar.leak .fill { background: var(--leak-bar); }
.fbar.leak .fname { color: var(--leak); font-weight: 600; }
.fbar.leak .val { color: var(--leak); font-weight: 600; }
@media (max-width: 480px) { .fbar { grid-template-columns: 88px 1fr 56px; } }

/* semantic flag chip (kept from the approved build) */
.flag {
  display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em; padding: 2px 8px; border-radius: var(--r-sm);
}
.flag.leak { color: var(--leak); background: var(--leak-bg); }
.flag.win { color: var(--win); background: var(--win-bg); }
.flag.broken { color: var(--broken); background: var(--broken-bg); }
.flag.demo { color: var(--mute); background: var(--paper); border: 1px dashed var(--line); font-weight: 500; }

/* ---------- proof strip ---------- */

.proof { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.proof .chip {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--white);
  padding: 10px 14px; font-size: 13px; color: var(--mute);
  display: inline-flex; gap: 8px; align-items: baseline;
}
.proof .chip::before { content: "✓"; font-family: var(--mono); color: var(--win); font-weight: 600; }
.proof .chip b { color: var(--ink); font-weight: 600; }

/* ---------- pipeline (the 7-step chain as a run diagram) ---------- */

.pipe { display: flex; gap: 0; margin-top: 28px; flex-wrap: wrap; }
.pipe .pstep {
  flex: 1 1 130px; border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; margin: 4px; background: var(--white); position: relative;
}
.pipe .pstep .n { font-family: var(--mono); font-size: 11px; color: var(--mute); }
.pipe .pstep .t { font-size: 13.5px; font-weight: 600; margin-top: 4px; }
.pipe .pstep p { font-size: 12.5px; color: var(--mute); margin-top: 4px; }
.pipe .pstep.gate { border-color: var(--leak-bar); background: var(--leak-bg); }
.pipe .pstep.gate .t { color: var(--leak); }

/* ---------- forms ---------- */

.inputrow { display: flex; gap: 8px; margin-top: 16px; max-width: 480px; flex-wrap: wrap; }
.inputrow .field, .inputrow input.field {
  flex: 1; min-width: 200px; border: 1.5px solid var(--line); border-radius: var(--r);
  padding: 11px 13px; color: var(--ink); font-size: 14px; background: var(--white);
  font-family: var(--mono);
}
.inputrow .field::placeholder { color: var(--faint); }
.inputrow .field:focus { outline: 2px solid var(--brand-400); outline-offset: 1px; border-color: var(--brand-400); }
.inputrow .btn { flex: none; }
.inputrow.center { margin-left: auto; margin-right: auto; justify-content: center; }

/* ---------- shared final CTA — "start the run" ---------- */

.cta {
  text-align: center; padding: 56px 24px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
}
.cta .klabel { margin-bottom: 10px; }
.cta .cta-body { max-width: 48ch; margin-left: auto; margin-right: auto; }
.cta .btn { margin-top: 20px; }
