/*
 * The product page, wearing the product's clothes.
 *
 * Every token below is lifted verbatim from the dashboard's `app.css`, and the
 * three rules that file sets for itself are kept here rather than reinterpreted:
 *
 * 1. **No colour carries meaning.** Black, white, and five greys. The dashboard
 *    is monochrome because worker states (running, queued, blocked, four kinds
 *    of failure) are exactly the set a red/green palette renders illegibly to
 *    the ~8% of men with a deficiency. A marketing page has no states to
 *    confuse, but it is the same product and it should look like it.
 * 2. **Hairlines, never shadows.** One pixel of `--rule` does every job a card
 *    and a drop shadow would have done.
 * 3. **The micro-label is the voice.** 9–11px, uppercase, 0.09em tracking, grey.
 *    It is how the dashboard names a thing without spending a line on it.
 *
 * What is different, and deliberately so: the dashboard is an instrument panel
 * at 100vh with no decorative whitespace, and this is a page you read. So the
 * density is relaxed — full-bleed sections divided by hairlines, an asymmetric
 * spec-sheet grid with the label column on the left — while the materials stay
 * exactly the same. Nothing here is rounded, gradient, or drop-shadowed.
 */

:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --g1: #f6f6f6;
  --g2: #ededed;
  --g3: #d8d8d8;
  --g4: #8a8a8a;
  --g5: #5b5b5b;
  --rule: #e2e2e2;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "IBM Plex Mono", Menlo, Consolas, monospace;
  --bar-h: 46px;
  --pad: clamp(18px, 4.5vw, 56px);
  --label-col: 232px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0a0a0a;
  --ink: #f2f2f2;
  --g1: #141414;
  --g2: #1c1c1c;
  --g3: #303030;
  --g4: #7d7d7d;
  --g5: #a6a6a6;
  --rule: #262626;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
p,
ul,
ol,
figure,
table {
  margin: 0;
}

code {
  font: 400 0.92em/1.15 var(--mono);
  color: var(--ink);
  background: var(--g1);
  border: 1px solid var(--rule);
  padding: 0 4px;
  white-space: nowrap;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------------- bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.bar-id {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  /* The wordmark is two words now. It shrinks the tagline beside it before it
     gives up any of itself, and it never takes a second line — the bar is a
     fixed 46px and a wrapped name pushes straight through the rule. */
  flex: 0 1 auto;
}

.mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  flex: none;
}

.bar-name {
  font: 600 13px/1 var(--sans);
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex: none;
}

.bar-repo {
  font: 400 11px/1 var(--mono);
  color: var(--g4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.bar-nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
}

.bar-nav a {
  font: 500 10px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g4);
  text-decoration: none;
  padding: 4px 0;
}

.bar-nav a:hover {
  color: var(--ink);
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.ghost {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid var(--rule);
  padding: 4px 9px;
  cursor: pointer;
  line-height: 1;
  font: 500 11px/1 var(--sans);
  color: inherit;
  text-decoration: none;
}

.ghost:hover {
  border-color: var(--g4);
}

#theme {
  width: 30px;
  justify-content: center;
}

/* ------------------------------------------------------------------ hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  border-bottom: 1px solid var(--rule);
}

.hero-copy {
  padding: clamp(40px, 7vw, 88px) var(--pad) clamp(36px, 6vw, 72px);
  border-right: 1px solid var(--rule);
  align-self: center;
}

/*
 * The display face is the monospace stack, not the sans.
 *
 * The one type decision on the page that is a decision. This product's whole
 * vocabulary — w-001, +18/−1, a7c6376179, git diff — is monospaced, and setting
 * the headline in the same face makes the page read as the instrument rather
 * than as an advertisement for one. Tight tracking and 0.98 leading keep it from
 * reading as code.
 */
/*
 * Sized against the column it sits in, not the viewport it sits on.
 *
 * The hero's copy column is 42.5% of the page, so a headline scaled at 3.6vw
 * outgrew it between roughly 1000 and 1330px and broke its own lines. 3vw
 * clears the longest line — "Summon a fleet," and "you can't beat." are both
 * fifteen characters — at every width the two-column hero is used at, and the
 * hero stacks below 1100 where it stops being enough. The second clause runs to
 * 29 characters, which is why it is set on three lines rather than two: on two
 * it would have to come down to about 30px to fit, and the display face is the
 * whole point of this headline.
 */
h1 {
  font: 500 clamp(28px, 3vw, 46px) / 1 var(--mono);
  letter-spacing: -0.035em;
  margin-bottom: 22px;
}

.lede {
  font-size: 16px;
  line-height: 1.7;
  color: var(--g5);
  max-width: 46ch;
}

.hero-cta {
  display: flex;
  gap: 10px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 9px 16px;
  font: 500 12px/1 var(--sans);
  letter-spacing: 0.02em;
  text-decoration: none;
}

.btn:hover {
  background: var(--paper);
  color: var(--ink);
}

.btn-quiet {
  background: none;
  color: var(--ink);
  border-color: var(--rule);
}

.btn-quiet:hover {
  background: none;
  border-color: var(--ink);
}

/* ------------------------------------------------------------ hero: viz */

.hero-viz {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.viz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px var(--pad);
  border-bottom: 1px solid var(--rule);
}

.viz-head h2,
.spec-label h2 {
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--g5);
}

.viz-meta {
  font: 400 11px/1 var(--mono);
  color: var(--g4);
}

.viz-body {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 10px var(--pad);
  min-height: 300px;
}

.graph {
  display: block;
  width: 100%;
  height: auto;
}

.viz-rows {
  display: none;
  list-style: none;
  padding: 0;
  width: 100%;
}

/* Nodes, edges and glyphs: the dashboard's own SVG classes, unchanged. */
.n-box {
  fill: var(--paper);
  stroke: var(--g3);
  stroke-width: 1;
}

.n-box.is-root {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.n-title {
  font: 600 11.5px/1 var(--mono);
  fill: var(--ink);
}

.n-sub {
  font: 400 9.5px/1 var(--mono);
  fill: var(--g4);
}

.n-tag {
  font: 600 8.5px/1 var(--sans);
  letter-spacing: 0.08em;
  fill: var(--g5);
  text-transform: uppercase;
}

.edge {
  fill: none;
  stroke: var(--g3);
  stroke-width: 1;
}

.edge.is-live {
  stroke: var(--ink);
  stroke-width: 1.4;
}

.edge.is-dep {
  stroke: var(--g4);
  stroke-dasharray: 2 3;
}

.n-meter-bg {
  fill: var(--g2);
}

.n-meter-fg {
  fill: var(--ink);
}

/*
 * The two live glyphs move, and nothing else on the page does.
 *
 * Straight from the dashboard: the only two states where work is actually
 * happening are the only two things that animate, so "is anything running?" is
 * answerable from across the room. Motion sits on top of the shape and never
 * carries meaning alone — with reduced motion on, the dot is a filled dot and
 * the ring is a dashed ring, and both still read correctly.
 */
.g-active {
  animation: glyph-blink 1.5s ease-in-out infinite;
}

@keyframes glyph-blink {
  50% {
    opacity: 0.18;
  }
}

.g-queued {
  transform-box: view-box;
  transform-origin: 6px 6px;
  animation: glyph-spin 3.2s linear infinite;
}

@keyframes glyph-spin {
  to {
    transform: rotate(360deg);
  }
}

.stat-strip {
  display: flex;
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 14px;
  min-width: 74px;
  flex: 1;
  background: var(--paper);
}

.stat-wide {
  min-width: 104px;
}

.stat-k {
  font: 600 9px/1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--g4);
}

.stat-v {
  font: 500 15px/1.1 var(--mono);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  list-style: none;
  padding: 9px var(--pad);
  font: 400 11px/1 var(--sans);
  color: var(--g5);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ------------------------------------------------------ spec-sheet rows */

/*
 * The spec sheet: a label column, the text, and a margin for the marginalia.
 *
 * The third column is why the page does not run out of ideas at 1440px. The
 * asides in it are the notes that qualify a claim rather than make one — what
 * `Tests:` is actually measuring, why there is no `worker_review` tool — which
 * is exactly what a margin is for on a printed spec. Below 1180px there is no
 * margin to write in, so they fall under the text they belong to.
 */
.spec {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 1180px) {
  .spec {
    grid-template-columns: var(--label-col) minmax(0, 640px) minmax(0, 1fr);
  }

  .spec-aside {
    padding: clamp(34px, 5vw, 62px) var(--pad) clamp(34px, 5vw, 62px) 0;
  }

  /*
   * The aside stays where it is put.
   *
   * It used to be sticky, tracking the reader down a long section. A note that
   * slides along beside the text it qualifies gets read twice — once as text,
   * once as movement — and the movement wins. Set once, at the top of its
   * column, level with the section label: printed marginalia, which is what it
   * was always pretending to be.
   */
  .spec-aside .footnote {
    border-top: 0;
    border-left: 1px solid var(--rule);
    margin-top: 10px;
    padding: 2px 0 2px 20px;
    max-width: 34ch;
    line-height: 2;
  }
}

.spec-label {
  padding: clamp(34px, 5vw, 62px) 20px clamp(34px, 5vw, 62px) var(--pad);
  border-right: 1px solid var(--rule);
}

/* The label sits at the head of its section and stays there, like the aside
   opposite it. Both edges hold still while the text between them moves. */
.spec-note {
  font: 400 12px/1.6 var(--mono);
  color: var(--g5);
  margin-top: 8px;
  max-width: 26ch;
}

.spec-body {
  padding: clamp(34px, 5vw, 62px) var(--pad);
  max-width: 76ch;
}

.spec-aside {
  padding: 0 var(--pad) clamp(30px, 4vw, 46px);
}

.spec-aside .footnote {
  margin: 0;
}

.spec-body > p + p,
.spec-body > p + div,
.spec-body > div + p,
.spec-body > p + pre,
.spec-body > pre + p,
.spec-body > p + ol,
.spec-body > p + ul,
.spec-body > p + table,
.spec-body > table + p,
.spec-body > p + figure,
.spec-body > figure + p,
.spec-body > figure + ul {
  margin-top: 22px;
}

.spec-body p {
  color: var(--g5);
}

.claim {
  font: 500 clamp(18px, 2vw, 22px) / 1.35 var(--sans);
  letter-spacing: -0.015em;
  color: var(--ink) !important;
  max-width: 34ch;
}

.footnote {
  font-size: 13.5px;
  line-height: 2;
  color: var(--g5) !important;
  border-top: 1px solid var(--rule);
  padding-top: 22px;
  max-width: 60ch;
}

/* ---------------------------------------------------------- the meters */

.meters {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.meter-k {
  font: 600 10px/1 var(--sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--g5);
}

.meter-v {
  font: 500 12px/1 var(--mono);
  color: var(--g4);
}

.meter-track {
  height: 14px;
  background: var(--g2);
  border: 1px solid var(--rule);
}

.meter-fill {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--ink);
}

/* Grow to scale once seen, so the 50× is watched rather than read. */
.meters.is-armed .meter-fill {
  width: 0;
  transition: width 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.meters.is-armed.is-shown .meter-fill {
  width: var(--w);
}

/* ------------------------------------------------------------- the wire */

/*
 * The client diagram: the hero's grammar, one tier up.
 *
 * Capped at its own 420px instead of filling the column. Its labels are the
 * dashboard's 11px mono, and stretched across a 640px text column they would
 * render at seven pixels — a picture of a diagram rather than a diagram. Sat on
 * the code panel's grey so the paper-filled boxes read as boxes.
 */
.wire {
  border: 1px solid var(--rule);
  background: var(--g1);
  padding: 16px 18px;
}

.wire svg {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
}

/* ------------------------------------------------------------- the loop */

.steps {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.steps li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}

/* The glyph holds column one; the prose stacks in column two. Without this the
   paragraph falls to the next row and re-flows inside a 26px track. */
.steps li > .step-glyph {
  grid-column: 1;
  grid-row: 1;
}

.steps li > h3,
.steps li > p {
  grid-column: 2;
}

.steps h3 {
  font: 600 15px/1.35 var(--sans);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.steps p {
  font-size: 14.5px;
}

.step-glyph {
  margin-top: 2px;
}

/* ----------------------------------------------------------- the result */

.result,
.cmd {
  margin: 0;
  background: var(--g1);
  border: 1px solid var(--rule);
  padding: 18px 20px;
  font: 400 12.5px/1.75 var(--mono);
  color: var(--g5);
}

.result code,
.cmd code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/*
 * The result soft-wraps; the command scrolls.
 *
 * A result line is long because the renderer writes one long line and a
 * terminal wraps it — so wrapping is the faithful rendering, and clipping the
 * summary is not. A command is different: a wrapped shell line reads as two
 * commands, so that one keeps its own line and scrolls if it must.
 */
.result code {
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.cmd {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cmd code {
  white-space: pre;
}

.r-k {
  color: var(--ink);
  font-weight: 600;
}

.cmd {
  font-size: 12.5px;
  color: var(--ink);
}

/* ------------------------------------------------------------- the tools */

.tools {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--rule);
}

.tools tr {
  border-bottom: 1px solid var(--rule);
}

.tools th,
.tools td {
  text-align: left;
  vertical-align: top;
  padding: 11px 0;
  font-weight: 400;
}

.tools th {
  width: 21ch;
  padding-right: 18px;
}

.tools th code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12.5px;
  font-weight: 600;
}

.tools td {
  font-size: 14px;
  color: var(--g5);
}

/* ------------------------------------------------------------- the limits */

.limits,
.facts {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.limits li,
.facts li {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14.5px;
  color: var(--g5);
}

.lim-k {
  font-weight: 600;
  color: var(--ink);
}

/* --------------------------------------------------------------- install */

.spec-install {
  border-bottom: 0;
}

/* One command per client, each under the micro-label that names it. */
.cmds {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cmd-k {
  display: block;
  font: 600 10px/1 var(--sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--g5);
  margin-bottom: 8px;
}

/* ------------------------------------------------------------------ foot */

.foot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px var(--pad);
  border-top: 1px solid var(--rule);
  font: 500 11px/1 var(--sans);
}

.foot-sep {
  width: 1px;
  height: 11px;
  background: var(--rule);
  margin: 0 4px;
}

.foot-note {
  font: 400 11px/1 var(--mono);
  color: var(--g4);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-copy {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
}

@media (max-width: 860px) {
  :root {
    --label-col: 176px;
  }

  .bar-nav {
    display: none;
  }

  .bar-actions {
    margin-left: auto;
  }
}

/* The tagline is the first thing overboard: the wordmark and the two controls
   are the bar's job, and "claude → opencode" is said again in the footer. */
@media (max-width: 560px) {
  .bar-repo {
    display: none;
  }
}

/*
 * Below this the graph's 11px type would render at about 5px, so the graph is
 * not shrunk — it is replaced by the dashboard's other view of the same state,
 * the worker rows. Same glyphs, same ids, same meters; a list instead of a map.
 */
@media (max-width: 760px) {
  .graph {
    display: none;
  }

  .viz-rows {
    display: block;
  }

  .viz-body {
    min-height: 0;
    padding: 0;
    align-items: stretch;
  }

  .row {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px var(--pad);
    border-bottom: 1px solid var(--rule);
  }

  .row-id {
    font: 600 12px/1.3 var(--mono);
  }

  .row-task {
    font: 400 11px/1.4 var(--mono);
    color: var(--g4);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .row-state {
    font: 600 9px/1 var(--sans);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--g4);
  }
}

@media (max-width: 620px) {
  /*
   * The spec sheet collapses here; the steps do NOT. A 26px glyph column still
   * fits at 320px, and collapsing it puts the glyph and the heading in the same
   * track with nothing between them.
   */
  .spec {
    grid-template-columns: minmax(0, 1fr);
  }

  .spec-label {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 22px var(--pad) 0;
  }

  .spec-body {
    padding-top: 26px;
  }

  .spec-aside {
    padding-inline: var(--pad);
  }

  .steps li {
    column-gap: 10px;
  }

  .stat {
    min-width: 0;
    padding: 8px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .g-active,
  .g-queued {
    animation: none;
  }

  .meters.is-armed .meter-fill {
    width: var(--w);
    transition: none;
  }

  * {
    scroll-behavior: auto;
  }
}
