/* THE SITE'S OWN PAGES.
 *
 * WHAT THIS FILE IS. A small design layer for a WEBSITE, built entirely on the
 * application's tokens and in the application's voice. Not a second design
 * system, and not a copy of a settings screen either -- both of those have been
 * tried here and both were wrong.
 *
 * THE TWO FAILURES THIS FILE IS THE ANSWER TO:
 *
 *   1. A marketing page in its own type scale: a 38px headline over 15px body
 *      in a 1208px column. It shared the product's colours and looked nothing
 *      like it, because the product contains no such sizes.
 *   2. A literal reproduction of the product's #/account screen: 720px column,
 *      20px maximum, name-and-description rows. Coherent, and dull -- a
 *      preferences pane with a headline. The owner's word was "ugly".
 *
 * The resolution is the one a designer would reach for: take the product's
 * SYSTEM, not a screenshot of one of its screens, and compose a page with it.
 *
 * WHAT THE SYSTEM IS, measured out of the product's own stylesheet:
 *
 *   ground #f4f7fa, sheets white, hairlines at 7% and 12% ink
 *   radius 3px -- near-square, everywhere, no pills
 *   IBM Plex Sans for speech, JetBrains Mono for DATA and identity
 *   11px tracked caps (0.12em) for labels, 13px body, 12.5px quiet
 *   five role colours used as 7-8px dots, never as fills
 *   hairlines instead of boxes; air instead of borders
 *   NO shadows and NO gradients in the light theme
 *   and exactly ONE large element per screen -- the 46px ring numeral
 *
 * That last one is the licence for a display headline. The product is not
 * uniformly small; it is uniformly quiet with a single loud thing. A landing
 * page gets the same: one display line, and everything under it in the
 * product's own sizes.
 */

/* ============================================================ 1. THE PAGE */

.site-body {
  overflow: auto;
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.site-main { flex: 1 1 auto; width: 100%; }

/* ONE CONTAINER, ONE LEFT EDGE, EVERY SECTION, EVERY PAGE.
 *
 * Including the inner pages. They used to centre a 720px column while the home
 * page ran flush left, which is two grids on one site and reads as two sites
 * however well each is drawn. The product's own document screens do centre
 * their shell -- correct inside a window the program owns entirely, and wrong
 * for a page with a masthead, a footer and four siblings to agree with. */
.site-wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: clamp(var(--page-gutter), 4vw, 40px);
}

/* Short last lines are broken away from, not reworded away. `pretty` lets the
   engine trade a slightly earlier break on the line above for a last line that
   holds more than one word, which removes every widow this site had without
   touching a sentence. */
.site-lede,
.site-step p,
.site-notice span,
.site-cell p { text-wrap: pretty; }

/* Sections are separated by a hairline and air -- the way the product separates
   anything from anything. No cards, no bands of colour. */
.site-section { padding-block: clamp(28px, 4vw, 52px); }
.site-section + .site-section { border-top: 1px solid var(--line-2); }

/* =========================================================== 2. THE VOICE */

/* The section label: the product's 11px tracked caps, and the single most
   recognisable piece of its typography. */
.site-label {
  margin: 0 0 var(--s5);
  font-size: 11px;
  font-weight: 640;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--ink-25);
}

/* THE ONE LOUD THING. Sized against the product's own largest element -- the
   46px agent-count numeral on its home screen -- and given the same weight and
   negative tracking that numeral carries. */
.site-display {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 640;
  line-height: 1.06;
  letter-spacing: -0.022em;
  color: var(--ink);
  max-width: 18ch;
}

.site-lede {
  margin: var(--s5) 0 0;
  max-width: 56ch;
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink-2);
}

.site-body-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ============================================================= 3. THE HERO */

.site-hero-block {
  display: grid;
  /* 320, NOT 300. Measured at 300: the features page's widest term
     (Permission levels) plus the engines value (codex, claude and local in
     12.5px mono with the product's own middot separators) left the value 14px
     short, and the row wrapped to 2 lines while every other spec row on the
     site sat at 1. The block is shared by every page, so all five stay
     identical. */
  grid-template-columns: minmax(0, 640px) minmax(0, 320px);
  justify-content: space-between;
  gap: clamp(var(--s5), 5vw, 64px);
  align-items: start;
  padding-block: clamp(40px, 6vw, 72px) clamp(32px, 4.5vw, 56px);
}

.site-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  margin-top: clamp(var(--s5), 3vw, 36px);
}
/* `.ctl-btn` is the product's control and it takes two things from the browser
   rather than from the stylesheet -- horizontal padding (a <button> UA default,
   which is why the product only restores it inside `.setup-actions`) and no
   underline. On an <a> both are lost. Restored with the product's own value. */
.site-actions .ctl-btn {
  padding-inline: var(--s4);
  text-decoration: none;
}
/* The primary control, in the product's own three values, lifted from
   `.graph-open-btn` -- its "Open agent detail" button: border tinted 38% toward
   the coordinator colour, background 7%, text in FULL INK. */
.ctl-btn.is-primary {
  border-color: color-mix(in oklab, var(--c-coordinator) 38%, var(--line-2));
  background: color-mix(in oklab, var(--c-coordinator) 7%, var(--sheet));
  color: var(--ink);
}
.ctl-btn.is-primary:hover {
  border-color: color-mix(in oklab, var(--c-coordinator) 58%, var(--line-2));
  background: color-mix(in oklab, var(--c-coordinator) 14%, var(--sheet));
  color: var(--ink);
}

/* ------------------------------------------------------- the spec block
 *
 * The hero's right-hand anchor, and the page's clearest borrowing: the product
 * states values in mono against quiet labels, so the facts a visitor most wants
 * are set as data rather than as prose. It also gives the hero something to
 * balance against, which a single left column never had. */

.site-spec { border-top: 1px solid var(--line-2); }
.site-spec dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  /* NO COLUMN GAP. The term and the value each carry the row's hairline, so a
     gap between them cuts that hairline into two segments with a hole in the
     middle -- which is what this drew before, and it read as a broken rule
     rather than a table. The separation is padding on the term instead, so the
     two borders meet and the row underlines once. */
  gap: 0;
}
.site-spec dt,
.site-spec dd {
  margin: 0;
  padding-block: var(--s3);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.4;
}
.site-spec dt {
  font-size: 11px;
  font-weight: 640;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  padding-right: var(--s5);
}
.site-spec dd {
  font-family: var(--font-mono);
  color: var(--ink-2);
  text-align: right;
}

/* ============================================================= 5. THE STEPS
 *
 * A numbered sequence, the numbers in mono and dimmed. The product numbers
 * nothing, but it does set every identifier in mono against quiet ink, and a
 * sequence is an identifier. Hairlines between, as everywhere else. */

.site-steps { display: grid; gap: 0; }
.site-step {
  display: grid;
  grid-template-columns: 3ch minmax(0, 1fr);
  gap: var(--s4);
  align-items: baseline;
  padding-block: var(--s3);
  border-top: 1px solid var(--line);
}

/* THE THIRD COLUMN, WHICH COSTS NO PAGE.
 *
 * Measured before this existed: every row of this section was 1160px wide with
 * its text ending at 631px -- 589px of nothing, four times over, the largest
 * unused area on the site. A row with a fact to state now states it out there
 * instead of the page growing to hold it.
 *
 * The reflow was measured too: 630px of slack at 1280, 298 at 900, 59 at 640.
 * So the column holds to 900px and collapses under it, where the note becomes
 * a line beneath rather than a column beside. */
.site-step.has-note { grid-template-columns: 11ch minmax(0, 1fr) minmax(0, 250px); }
.site-step-note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-3);
  text-align: right;
}
@media (max-width: 900px) {
  /* THE NOTE GOES BESIDE THE ROUTE, NOT UNDER THE ROW.
     Stacked as its own block it cost a line on every row -- five extra lines on
     a phone, which is exactly the page growth this round is meant to avoid.
     Route on the left, note on the right, the sentence beneath both: the same
     three pieces of information in two lines instead of three. */
  .site-step.has-note {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "route note" "text text";
    gap: var(--s1) var(--s3);
  }
  .site-step.has-note > span { grid-area: route; }
  .site-step.has-note > p { grid-area: text; }
  .site-step.has-note > .site-step-note { grid-area: note; text-align: right; }
}
.site-step:first-child { border-top: 1px solid var(--line-2); }
.site-step span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  /* NOT --ink-4. The product uses that grey for numerals inside a dense screen
     a person is already reading closely; measured on this ground at 12px it is
     3.19:1, under the 4.5:1 a page of text owes anybody. --ink-3 is the next
     step up the product's own scale and clears it. */
  color: var(--ink-3);
}
.site-step p {
  margin: 0;
  max-width: 68ch;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}
.site-step p b { font-weight: 640; color: var(--ink); }

/* ============================================================ 6. THE NOTICE
 *
 * The product's own `.fleet-profile-status`: a left rule in a status colour, no
 * background, no box. It is how the program says something important without
 * shouting, and it is the right shape for the one paragraph on this site that
 * has to be unambiguous. */

.site-notice {
  display: grid;
  gap: var(--s1);
  max-width: 78ch;
  padding: var(--s2) 0 var(--s2) var(--s3);
  border-left: 2px solid var(--s-warn);
  color: var(--ink-3);
}
.site-notice strong {
  font-size: 13px;
  font-weight: 620;
  line-height: 1.35;
  color: var(--ink-2);
}
.site-notice span { font-size: 12.5px; line-height: 1.45; }
/* When the notice closes a section that already had content above it. */
.site-notice-spaced { margin-top: clamp(var(--s5), 3vw, 40px); }

/* ============================================================ 8. LEGAL PAGES
 *
 * Emitted by tools/publish-legal.mjs, one per counsel-cleared document, in the
 * site's shell. The elements are bare h2/h3/p/ul from converted markdown, so
 * they are given the site's own scale here: reading measure, 13px body, the
 * tracked-caps label carrying the title. Nothing else on the site uses bare
 * elements inside a section, so the scope class keeps these rules from
 * touching anything but the documents. */
.site-legal { max-width: 72ch; }
.site-legal h2, .site-legal h3, .site-legal h4 {
  margin: var(--s5) 0 var(--s3);
  font-size: 15px;
  font-weight: 640;
  line-height: 1.3;
  color: var(--ink);
}
.site-legal h2 { font-size: 16px; }
.site-legal p {
  margin: 0 0 var(--s3);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}
.site-legal ul { margin: 0 0 var(--s3); padding-left: 1.2em; }
.site-legal li { font-size: 13px; line-height: 1.6; color: var(--ink-2); margin-bottom: var(--s1); }
.site-legal code { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.site-legal a { color: var(--ink-2); }
.site-legal a:hover { color: var(--ink); }
/* TABLES AND CODE BLOCKS IN A PUBLISHED DOCUMENT.
 *
 * Added because the privacy policy contains one of each, and until the
 * publisher learned to render them they came out as paragraphs of literal pipe
 * characters and three backticks. Found by rendering the real document and
 * reading the output.
 *
 * Ruled like the spec block in the hero -- a hairline under every row and
 * nothing else. No borders around cells, no zebra striping, no fill: the
 * product separates rows with a single hairline and this is the same table
 * seen in a document. */
.site-legal table {
  width: 100%;
  margin: 0 0 var(--s4);
  border-collapse: collapse;
  border-top: 1px solid var(--line-2);
}
.site-legal th,
.site-legal td {
  padding: var(--s2) var(--s3) var(--s2) 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: left;
  vertical-align: top;
  color: var(--ink-2);
}
.site-legal th {
  font-size: 11px;
  font-weight: 640;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
/* A table is the one thing in a legal document that can be wider than the
   reading measure, so it scrolls inside itself rather than pushing the page. */
.site-legal .table-scroll { overflow-x: auto; }

.site-legal pre {
  margin: 0 0 var(--s4);
  padding: var(--s3);
  overflow-x: auto;
  border-left: 2px solid var(--line-2);
  background: var(--sheet);
}
.site-legal pre code {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  white-space: pre;
}

.site-legal-meta {
  margin-top: var(--s5);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

/* =============================================================== 8. THE FOOT */

.site-foot {
  border-top: 1px solid var(--line);
  padding-block: var(--s5) calc(var(--s5) * 2);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
}
.site-foot a { color: var(--ink-3); text-decoration: none; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }
.site-foot-links { margin: var(--s2) 0 0; display: flex; flex-wrap: wrap; gap: 0 var(--s4); }
/* A LINE OF TEXT IS NOT A TAP TARGET. These measured 16px tall on a phone; the
   floor is 24. The padding is vertical only, so the row still reads as a line
   of links rather than as a set of buttons. */
.site-foot-links a { display: inline-block; padding-block: var(--s2); }

/* ============================================================== 9. NARROW */

@media (max-width: 860px) {
  /* The spec block stops competing with the headline for the same line and
     goes underneath it, still as data. */
  .site-hero-block { grid-template-columns: minmax(0, 1fr); }
  .site-display { max-width: none; }
}

@media (max-width: 520px) {
  .site-actions .ctl-btn { flex: 1 1 auto; justify-content: center; }
}
