/* Infrapilot: the tokens, type and pieces every page shares.

   One 672px column with 24px gutters under a 48px sticky header. The docs keep the same reading
   column and add a rail on each side (docs.css). Neutral greys only: hierarchy comes from three
   text tones, structure from 1px hairlines. No shadows, no accent colour.

   Type is Geist (400, 500, 600) with Geist Mono for code, in five sizes only:
     12  labels, meta, code blocks      15  body
     14  secondary text, controls       16  section headings, lead text
                                        24  page headings
   Headings and labels are tracked -0.025em.

   Radii: 4px for code and tags, 12px for app icons and containers, pills for actions and fields.
   Icons: 14px in navigation, 16px beside link and button text. */

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #FAFAFA;
  --fg: #171717;                     /* primary text */
  --fg-2: #707070;                   /* secondary text */
  --fg-3: rgb(112 112 112 / 0.6);    /* tertiary text */
  --line: #E5E5E5;                   /* hairlines */
  --fill: #F5F5F5;                   /* code blocks, hover */

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --track: -0.025em;

  --column: 672px;
  --gutter: 24px;
  --header: 48px;

  --r-code: 4px;
  --r-icon: 12px;
  --r-pill: 9999px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0A0A;
    --fg: #EDEDED;
    --fg-2: #A3A3A3;
    --fg-3: rgb(163 163 163 / 0.6);
    --line: #262626;
    --fill: #171717;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 24px); }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 15px/24px var(--sans);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; letter-spacing: var(--track); }
h1 { font-size: 24px; line-height: 32px; font-weight: 600; }
h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
h3 { font-size: 15px; line-height: 24px; font-weight: 500; }
h4 { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--fg-2); }
p { margin: 0 0 16px; }
b, strong { font-weight: 500; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--fg-3); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
code, pre, kbd, samp { font-family: var(--mono); }
code { font-size: 14px; background: var(--fill); border-radius: var(--r-code); padding: 1px 4px; }
pre {
  margin: 0 0 16px; padding: 12px 16px; background: var(--fill); border-radius: var(--r-code);
  font-size: 12px; line-height: 20px; overflow-x: auto;
}
pre code { background: none; padding: 0; font-size: inherit; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
::selection { background: var(--line); color: var(--fg); }

/* text tones and sizes */
.muted { color: var(--fg-2); }
.faint { color: var(--fg-3); }
.small, .fine { font-size: 14px; line-height: 20px; }
.fine { color: var(--fg-2); }
.tiny { font-size: 12px; line-height: 16px; }
.small code, .fine code, .tiny code { font-size: 12px; }
.label { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: var(--track); color: var(--fg-2); }
.lede { font-size: 16px; line-height: 24px; color: var(--fg-2); margin: 8px 0 24px; }
.mono { font-family: var(--mono); }

/* ------------------------------------------------------------------- layout */
.col { width: 100%; max-width: calc(var(--column) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.top { position: sticky; top: 0; z-index: 20; height: var(--header); background: var(--bg); border-bottom: 1px solid var(--line); }
.top > .col { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; letter-spacing: var(--track); text-decoration: none; color: var(--fg); white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; min-width: 0; }
.nav a, .nav button.link {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px;
  font-size: 14px; line-height: 20px; letter-spacing: var(--track); color: var(--fg-2); text-decoration: none; white-space: nowrap;
}
.nav a:hover, .nav button.link:hover, .nav a[aria-current="page"] { color: var(--fg); }
.nav .btn { margin-left: 8px; }
.top .signin { margin-left: 8px; }

/* Keyboard users can jump past the header. */
.skip { position: absolute; left: 16px; top: -48px; z-index: 30; height: 32px; padding: 0 14px; display: inline-flex; align-items: center;
        font-size: 14px; background: var(--bg); border: 1px solid var(--fg); border-radius: var(--r-pill); text-decoration: none; }
.skip:focus { top: 8px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* On a narrow screen the four links fold into a menu; the way in stays visible. */
.menu { display: none; }
.menu summary { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-right: -8px;
                list-style: none; cursor: pointer; color: var(--fg-2); border-radius: var(--r-pill); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover, .menu[open] summary { color: var(--fg); }
.menu-panel { position: absolute; top: var(--header); left: 0; right: 0; padding: 0 var(--gutter) 8px;
              background: var(--bg); border-bottom: 1px solid var(--line); }
.menu-panel a { display: flex; align-items: center; gap: 8px; height: 44px; font-size: 15px; letter-spacing: var(--track);
                color: var(--fg); text-decoration: none; border-top: 1px solid var(--line); }
.menu-panel a:first-child { border-top: 0; }
.menu-panel .icon { width: 14px; height: 14px; color: var(--fg-2); }
@media (max-width: 680px) {
  .top .nav { display: none; }
  .top .signin { margin-left: auto; }
  .menu { display: block; }
}

main.col { padding-top: 48px; padding-bottom: 96px; }

/* -------------------------------------------------------------------- icons */
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav .icon, .tabs .icon { width: 14px; height: 14px; }
.app-icon { display: block; width: 48px; height: 48px; border-radius: var(--r-icon); flex: none; }
.app-icon rect { fill: var(--fg); }
.app-icon .glyph-fill { fill: var(--bg); }
.brand .mark { width: 23px; height: 13px; flex: none; fill: currentColor; }

/* ------------------------------------------------------------------ actions */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px;
  font: 500 14px/20px var(--sans); letter-spacing: var(--track); white-space: nowrap;
  color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: var(--r-pill);
  cursor: pointer; text-decoration: none; transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--fill); }
.btn.primary { border-color: var(--fg); }
.btn.small { height: 28px; padding: 0 12px; }
.btn.large { height: 40px; padding: 0 20px; font-size: 15px; line-height: 24px; }
.btn[disabled], .btn[aria-disabled="true"] { color: var(--fg-3); border-color: var(--line); background: transparent; cursor: not-allowed; }
.btn.small .icon { margin-left: -2px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline;
        text-decoration-color: var(--fg-3); text-underline-offset: 3px; }
.link:hover { text-decoration-color: currentColor; }
.arrow { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: var(--track); text-decoration: none; }
.arrow:hover { text-decoration: underline; text-decoration-color: var(--fg-3); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------- fields */
input[type=text], input[type=email], input[type=tel], input[type=url], select {
  height: 36px; padding: 0 14px; max-width: 100%;
  font: 400 14px/20px var(--sans); color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-pill);
}
textarea {
  display: block; width: 100%; padding: 10px 14px; resize: vertical;
  font: 400 14px/20px var(--sans); color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-icon);
}
input::placeholder, textarea::placeholder { color: var(--fg-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fg); }
label.f, .f { display: block; margin: 0 0 8px; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: var(--track); color: var(--fg-2); }

/* -------------------------------------------------------------------- tags */
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; vertical-align: 1px;
  font: 500 12px/16px var(--sans); letter-spacing: var(--track); white-space: nowrap;
  color: var(--fg-2); border: 1px solid var(--line); border-radius: var(--r-code);
}
.tag.strong, .tag.failed { color: var(--fg); border-color: var(--fg-2); }
.brand .stage { margin-left: -2px; font-weight: 500; }  /* the product's stage beside its name */

/* ---------------------------------------------------------------- ledger rows */
/* One ledger event per row: the time, who acted, what changed, and why. */
.entries { border-bottom: 1px solid var(--line); }
.entry { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.entry time { font: 400 12px/16px var(--mono); color: var(--fg-3); padding-top: 1px; }
.entry .who { display: block; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: var(--track); color: var(--fg-2); }
.entry .what { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.entry .what b { font-weight: 500; }
.entry .why { margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--fg-2); overflow-wrap: anywhere; }
.entry.refused .what .text { text-decoration: line-through; text-decoration-color: var(--fg-3); color: var(--fg-2); }
.entry .what .tag { margin-left: 6px; }

/* ------------------------------------------------------------------- meters */
/* A value against its limit: the bar is secondary text, darkening to primary when it matters. */
.meter { display: block; position: relative; height: 4px; background: var(--line); }
.meter > i { position: absolute; inset: 0 auto 0 0; max-width: 100%; background: var(--fg-2); }
.meter.hot > i { background: var(--fg); }
.meter > u { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--fg-3); }  /* where Pilot starts acting */

/* ---------------------------------------------------------- key/value rows */
.rows { margin: 0; border-top: 1px solid var(--line); }
.rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rows dt { font-size: 14px; line-height: 20px; color: var(--fg-2); }
.rows dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

/* -------------------------------------------------------- server-rendered pages */
.eyebrow { margin: 0 0 8px; }
.notice { margin: 24px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-icon); }
.notice.denied, .notice.expired { border-color: var(--fg-2); }
.notice strong { font-weight: 600; }
table.facts { border-collapse: collapse; width: 100%; margin: 8px 0 24px; font-size: 14px; line-height: 20px; }
table.facts th { text-align: left; font-weight: 400; color: var(--fg-2); padding: 8px 16px 8px 0; vertical-align: top; border-top: 1px solid var(--line); width: 40%; }
table.facts td { padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.answer-page h2 { margin: 32px 0 8px; }
form.answer { margin: 24px 0 8px; padding: 16px; border: 1px solid var(--fg); border-radius: var(--r-icon); }
form.answer textarea { margin-bottom: 16px; }
form.answer .actions { margin-bottom: 16px; }
form.answer .btn { min-width: 112px; }
form.answer .fine { margin: 0; }

/* request access (the landing page's section, and the page a refused submission comes back on) */
form.access { margin: 24px 0 0; }
form.access .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(208px, 1fr)); gap: 16px; margin-bottom: 16px; }
form.access input, form.access select { width: 100%; }
form.access .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
form.access .fine { margin: 16px 0 0; }

/* outbox (development) */
.mail { padding: 16px 0; border-top: 1px solid var(--line); }
.mail header { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.mail header time { margin-left: auto; font: 400 12px/16px var(--mono); color: var(--fg-3); }
.mail h3 { margin: 0 0 8px; }
.mail pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.mail a { overflow-wrap: anywhere; font-size: 14px; }

/* ---------------------------------------------------------------- code blocks */
/* A block of code with its name above it and a button that copies it. */
.codeblock { position: relative; margin: 0 0 16px; background: var(--fill); border-radius: var(--r-code); }
.codeblock pre { margin: 0; background: none; }
.code-head { display: flex; align-items: center; height: 36px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line);
             font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: var(--track); color: var(--fg-2); }
.codeblock .c { color: var(--fg-3); }
.copy { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 24px; min-width: 24px; padding: 0 4px;
        font: 500 12px/16px var(--sans); letter-spacing: var(--track); color: var(--fg-2); background: var(--fill);
        border: 0; border-radius: var(--r-code); cursor: pointer; }
.copy:hover, .copy.done { color: var(--fg); }
.copy .icon { width: 14px; height: 14px; }
.code-head .copy { margin-left: auto; }
.codeblock > .copy { position: absolute; top: 8px; right: 8px; }

/* -------------------------------------------------------- rendered Markdown */
.md { min-width: 0; }
.md h1 { margin-bottom: 16px; }
.md h2 { margin: 40px 0 12px; }
.md h3 { margin: 32px 0 8px; }
.md h4 { margin: 24px 0 8px; font-size: 14px; line-height: 20px; color: var(--fg); }
.md :is(h2, h3, h4) .anchor { text-decoration: none; }
.md :is(h2, h3, h4) .anchor::after { content: "#"; margin-left: 8px; font-weight: 400; color: var(--fg-3); opacity: 0; transition: opacity .12s; }
.md :is(h2, h3, h4) .anchor:hover::after, .md :is(h2, h3, h4) .anchor:focus-visible::after { opacity: 1; }
.md ul, .md ol { padding-left: 20px; margin: 0 0 16px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--fg-3); }
.md .table { overflow-x: auto; margin: 0 0 24px; }
.md table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.md th, .md td { padding: 8px 16px 8px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.md th:last-child, .md td:last-child { padding-right: 0; }
.md th { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: var(--track); color: var(--fg-2); white-space: nowrap; }
.md td code, .md th code { font-size: 12px; }
.md td:first-child code { white-space: nowrap; }
.md a code { text-decoration: inherit; }
.md blockquote { margin: 0 0 24px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-icon); color: var(--fg-2); }
.md blockquote p { margin: 0; }
.md .codeblock { margin-bottom: 24px; }

/* A page of prose: the manifesto. */
.prose h1 { margin-bottom: 24px; text-wrap: balance; }
.prose > p:first-of-type, .prose > p:nth-of-type(2) { font-size: 16px; }
.prose h2 { margin-top: 48px; }
.prose p { color: var(--fg-2); }
.prose-close { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------- footer */
.foot { border-top: 1px solid var(--line); }
.foot .col { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 24px; padding-bottom: 48px; }
.foot .nav { margin-left: 0; flex-wrap: wrap; }
.foot .nav a { padding: 0 8px 0 0; }
.foot small { flex-basis: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; }
}
