/*
 * The layout of one page, and nothing else.
 *
 * tokens.css sits next to this file, copied whole from the application, and owns every
 * colour, radius and elevation here. No Tailwind: the utilities need a compiler, and this
 * build deliberately has no dependency to run one.
 *
 * The design language is the in-app landing page's: structure from space and rules rather
 * than borders and shadows, one accent, 400 and 500 only, and mono uppercase eyebrows.
 */

/* tokens.css's --font-sans names --font-public-sans, which next/font defines inside the
   application and nothing defines here — an undefined var() with no fallback invalidates
   the whole declaration, so font-family would resolve to nothing at all. The site states
   its own stack instead of pulling the face from a third party to look identical. */
:root {
  --site-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--site-sans);
  /* The scale is restated in px because tokens.css declares it inside `@theme`, which is
     Tailwind's namespace and invisible to a browser. Same six sizes as the app. */
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.022em;
}

h1 {
  font-size: clamp(25px, 4.2vw, 42px);
  max-width: 21ch;
}
h2 {
  font-size: clamp(21px, 2.6vw, 30px);
  max-width: 30ch;
}
h3 {
  font-size: 15px;
  letter-spacing: -0.012em;
}

p {
  margin: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

a {
  color: inherit;
}

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.lead {
  font-size: 17px;
  color: var(--muted-foreground);
  max-width: 58ch;
}

.narrow {
  max-width: 48ch;
}

.meta {
  font-size: 12px;
  color: var(--faint);
}

.caption,
.col p {
  font-size: 13px;
  color: var(--muted-foreground);
  max-width: 54ch;
}

/* The skip link exists for the keyboard, so it is off-screen rather than absent. */
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 8px;
  z-index: 1;
  background: var(--card);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
  max-width: var(--page);
  margin-inline: auto;
  padding: 18px var(--gutter);
}

.brand {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.topbar-note {
  font-size: 12px;
  color: var(--faint);
}

.langs {
  margin-left: auto;
  display: flex;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.langs a {
  color: var(--faint);
  text-decoration: none;
}
.langs a[aria-current] {
  color: var(--foreground);
}

.band {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: var(--page);
  margin-inline: auto;
  padding: clamp(48px, 7vw, 92px) var(--gutter);
  border-top: 1px solid var(--rule);
}

/* The hero states the ground the bands below sit on, so it carries no rule of its own. */
.hero {
  border-top: 0;
  padding-top: clamp(28px, 4vw, 48px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 10px;
}

.cmd {
  background: var(--secondary);
  color: var(--foreground);
  padding: 9px 13px;
  border-radius: var(--radius);
  font-size: 13px;
}

/* A link, not a block: inside a column of stretched flex children it has to be told the
   width of its own words. */
.col > .cta {
  align-self: flex-start;
}

.cta {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

/* The six statuses, read from the tokens: the palette is the claim, so it is not
   restated in hex here any more than it is in the application. */
.statuses {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}
.statuses span {
  height: 3px;
  width: clamp(26px, 7vw, 54px);
}
.s-backlog {
  background: var(--status-backlog);
}
.s-todo {
  background: var(--status-todo);
}
.s-progress {
  background: var(--status-progress);
}
.s-review {
  background: var(--status-review);
}
.s-done {
  background: var(--status-done);
}
.s-canceled {
  background: var(--status-canceled);
}

.steps {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 44px;
}

/* minmax(0, 1fr) rather than the default auto track, here and on .cols: an auto track is
   sized from the widest thing inside it, and one <pre> holding a shell command is enough
   to push the whole page sideways at 375px. */
.step {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px 0;
}

.step + .step {
  border-top: 1px solid var(--rule);
  padding-top: 44px;
}

.step-n {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--faint);
}

/* A fixed box, always: the media is hosted elsewhere and the build never checks it, so an
   unreachable host has to leave a page that is thinner instead of one that has collapsed.
   Every caption is written to read without its capture for the same reason. */
.shot-box {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--secondary);
  border-radius: var(--panel-radius);
  margin: 6px 0 10px;
}
.shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  margin-top: 26px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.col {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.col.soft {
  background: var(--accent-soft);
  border-radius: var(--panel-radius);
  padding: 26px;
}

.dbs,
.ports,
.checklist {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted-foreground);
  display: grid;
  gap: 5px;
}
.dbs,
.ports {
  list-style: none;
  padding-left: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  /* A host and a path have nowhere to break on a narrow screen unless told. */
  overflow-wrap: anywhere;
}

.checklist code {
  color: var(--foreground);
}

.promise {
  color: var(--accent-ink);
}

.block {
  margin: 0;
  background: var(--secondary);
  border-radius: var(--panel-radius);
  padding: 16px 18px;
  /* Wrapped rather than scrolled: a command half-hidden behind a scrollbar is a command
     the reader copies wrong. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
}

.landing {
  margin-top: 30px;
  padding-left: 16px;
  border-left: 2px solid var(--primary);
  font-size: clamp(17px, 2.2vw, 21px);
  max-width: 36ch;
}

.closing h2 {
  max-width: 24ch;
}

.footer {
  border-top: 1px solid var(--rule);
  padding-block: 26px 40px;
}
.footer .captures {
  flex-basis: 100%;
  max-width: 76ch;
}

@media (min-width: 700px) {
  .two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 40px;
  }
  .step {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas:
      "n    shot"
      "head shot"
      "cap  shot";
    grid-template-rows: auto auto 1fr;
    column-gap: clamp(24px, 4vw, 56px);
  }
  .step-n {
    grid-area: n;
  }
  .step h3 {
    grid-area: head;
  }
  .step .shot-box {
    grid-area: shot;
    margin: 0;
  }
  .step .caption {
    grid-area: cap;
  }
}

@media (min-width: 1000px) {
  .four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
  }
  /* A rule between two columns, not a card around each: the same decision the app's
     own sections take. */
  .four > .col + .col,
  .two > .col + .col:not(.soft) {
    border-left: 1px solid var(--rule);
    padding-left: 30px;
  }
  .four > .col {
    padding-right: 30px;
  }
  .two {
    gap: 40px;
  }
}

/*
 * The wiki: the same page, given a column.
 *
 * Nothing below introduces a colour, a radius or a shadow the landing page does not
 * already use — a documentation page that looked like a different product would be the
 * one thing this whole build exists to prevent. What it adds is a second axis: an index
 * that stays put, and a body long enough to need headings that a reader can aim at.
 */

.topbar-link {
  font-size: 12px;
  color: var(--faint);
  text-decoration: none;
}
.topbar-link:hover {
  color: var(--foreground);
}

.doc-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  max-width: var(--page);
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(48px, 7vw, 92px);
}

/* On a phone the index is six rows above the article, which is shorter than the first
   paragraph it would otherwise push down; it becomes a column at the width where one
   fits beside the text. */
.doc-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.doc-nav a {
  font-size: 13px;
  color: var(--muted-foreground);
  text-decoration: none;
}
.doc-nav a:hover {
  color: var(--foreground);
}
/* The current page is stated by weight and ink, not by a filled row: the column is a
   list of destinations, and a highlighted band would make it look like a control. */
.doc-nav a[aria-current] {
  color: var(--foreground);
  font-weight: 500;
}

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

.doc-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(28px, 4vw, 44px) 0 clamp(30px, 4vw, 44px);
}

.doc-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(30px, 4vw, 44px) 0;
  border-top: 1px solid var(--rule);
}

.doc-section h2 {
  max-width: 34ch;
}

/* 68ch rather than the landing page's 58: that one is a sequence of claims read standing
   up, this one is prose read sitting down, and a measure tuned for a headline makes a
   paragraph of six sentences look like a column of confetti. */
.doc-section p,
.doc-section li {
  font-size: 14px;
  color: var(--muted-foreground);
  max-width: 68ch;
}

.doc-section strong {
  color: var(--foreground);
  font-weight: 500;
}

.doc-section code {
  color: var(--foreground);
}

.doc-section ul,
.doc-section ol {
  margin: 2px 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
}

/* A command is not prose and does not take the prose measure: the 68ch above is tuned for
   sentences, and a `docker run` capped at it wraps in the middle of a variable name where
   the reader has to reassemble the line themselves. It takes the column. */
.doc-section .block {
  max-width: none;
}

/* A caveat is not a decoration, so it is a rule and an ink rather than a tinted box with
   an icon: the same device the landing page uses for its one closing statement. */
.note {
  padding-left: 16px;
  border-left: 2px solid var(--primary);
}
.note p {
  color: var(--foreground);
}

/* Two columns of short pairs — a key and what it does, a variable and what it is for.
   Not a <table>: every row here is two cells and nothing spans, so a grid reflows to one
   column on a phone where a table would have to scroll sideways. */
.kv {
  margin: 4px 0 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 18px;
  font-size: 13px;
  color: var(--muted-foreground);
  max-width: 68ch;
}
.kv dt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--foreground);
  overflow-wrap: anywhere;
}
.kv dd {
  margin: 0;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 26px;
  border-top: 1px solid var(--rule);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 14px;
  text-decoration: none;
}
.pager .pager-next {
  margin-left: auto;
  text-align: right;
}

@media (min-width: 900px) {
  .doc-frame {
    grid-template-columns: 178px minmax(0, 1fr);
    gap: clamp(28px, 5vw, 64px);
  }
  .doc-nav {
    /* `start` rather than a pixel offset: the bar is not fixed, so the column scrolls
       away with it and then stops, which is where a reader expects an index to sit. */
    position: sticky;
    top: 28px;
    align-self: start;
    padding-top: clamp(28px, 4vw, 44px);
    border-top: 0;
  }
}
