/* Pigeonpost — one stylesheet, no dependencies, no fonts to fetch.
   White background throughout, on purpose: the product is infrastructure, not a brand experience. */

:root {
  --navy: #16326b;
  --navy-hover: #1d4185;
  --blue: #2563eb;
  --green: #22c55e;
  --ink: #14181f;
  --body: #444c58;
  --muted: #6b7480;
  --rule: #e6e9ee;
  --wash: #f7f9fb;

  /* The raised surface, as against `--wash`, the recessed ground. It was `#fff` written out, which
     is the same thing right up until the page has to be dark. */
  --ground: #fff;
  --edge: #cfd5de;
  --card-edge-hover: #d3dae4;
  --shadow-card: rgba(20, 24, 31, .06);

  /* The syntax tones in the shell examples, and the two price tags. */
  --t-flag: #7c3aed;
  --t-str: #15803d;
  --t-path: #b45309;
  --t-pkg: #0f766e;
  --free-fill: #eaf6ee;
  --free-text: #15803d;
  --paid-fill: #eef2ff;
  --paid-text: #4338ca;

  /* The account page (account.css) has no tokens of its own and reads these. */
  --warn-text: #92400e;
  --warn-fill: #fffbeb;
  --warn-edge: #fde68a;
  --bad: #c0362c;
  /* The toast carries white text in both appearances, so its fill cannot be `--ink`: in the dark
     that token is nearly white, and white on white is a message nobody reads. */
  --toast-fill: #14181f;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Dark. Re-derived from the light palette rather than inverted, so the greys keep their order and
   their spacing and the navy lifts to a blue that survives on a dark ground. The values are the
   phone's, from `apps/ios/Pigeonpost/Design/Theme.swift`. */
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #4a73d6;
    --navy-hover: #5f85e0;
    --blue: #6c9bff;
    --green: #34d06a;
    --ink: #f4f6f9;
    --body: #c6ccd6;
    --muted: #949ba6;
    --rule: #2c313a;
    --wash: #16191f;
    --ground: #0f1216;
    --edge: #454c58;
    --card-edge-hover: #3a404b;
    --shadow-card: rgba(0, 0, 0, .5);

    --t-flag: #b490f5;
    --t-str: #4ade80;
    --t-path: #e9a23b;
    --t-pkg: #2dd4bf;
    --free-fill: #16281c;
    --free-text: #4ade80;
    --paid-fill: #1d2140;
    --paid-text: #a5b4fc;

    --warn-text: #e9a23b;
    --warn-fill: #2a2318;
    --warn-edge: #4a3a1e;
    --bad: #fda4af;
    --toast-fill: #2e333b;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }

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

header {
  padding: 44px 0 0;
}
header img { width: 232px; max-width: 62vw; height: auto; display: block; }

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

.hero { padding: 40px 0 8px; }
.hero h1 {
  font-size: clamp(30px, 5.2vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.022em;
  color: var(--ink);
  font-weight: 700;
  margin: 0 0 18px;
  max-width: 17ch;
}
.hero p.lede {
  font-size: 19px;
  color: var(--body);
  margin: 0 0 26px;
  max-width: 58ch;
}

.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 550;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-hover); }
.btn-secondary { border-color: var(--rule); color: var(--ink); }
.btn-secondary:hover { border-color: var(--edge); background: var(--wash); }

/* Brand marks inline in links. They inherit link colour so they sit in the text
   rather than announcing themselves — except npm, which is only recognisable red. */
.mark { width: 1.05em; height: 1.05em; flex: none; fill: currentColor; }
.mark-npm { fill: #cb3837; width: 1.5em; height: 1.5em; }
.btn-secondary .mark-npm { fill: #cb3837; }

/* ---- code ---- */

pre {
  background: var(--wash);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font: 13.5px/1.7 var(--mono);
  color: var(--ink);
  margin: 22px 0;
}
pre .c { color: var(--muted); }
/* lightweight shell highlighting — hand-tokenised, no runtime dependency */
.hl .t-cmd  { color: var(--navy); font-weight: 650; }
.hl .t-sub  { color: var(--blue); }
.hl .t-flag { color: var(--t-flag); }
.hl .t-str  { color: var(--t-str); }
.hl .t-path { color: var(--t-path); }
.hl .t-pkg  { color: var(--t-pkg); }
.hl .t-arg  { color: var(--ink); }
.hl .t-out  { color: var(--muted); }

/* numbered quickstart steps */
.steps { margin-top: 22px; }
.step { margin: 0 0 24px; }
.step:last-child { margin-bottom: 0; }
.step h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 650; flex: none;
}
.step p { font-size: 15.5px; }
.step pre { margin: 12px 0 0; }
.step-note { font-size: 14px; color: var(--muted); margin-top: 10px; }
.muted-note { font-size: 14.5px; color: var(--muted); }
code {
  font: 0.9em/1 var(--mono);
  background: var(--wash);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.5px 5px;
  color: var(--ink);
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* ---- sections ---- */

section { padding: 40px 0; border-top: 1px solid var(--rule); }
section:first-of-type { border-top: 0; }

h2 {
  font-size: 13px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 20px;
}
h3 {
  font-size: 17px;
  color: var(--ink);
  font-weight: 620;
  margin: 0 0 6px;
}
p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.grid { display: grid; gap: 26px 30px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid p { font-size: 15.5px; margin: 0; }

/* "What makes it different" — the plain grid becomes cards so the section reads as a lineup of
   distinct properties rather than a wall of paragraphs. */
.feature-grid { gap: 16px; }
.feature-grid > div {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 20px 20px 22px;
  background: var(--ground);
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.feature-grid > div:hover {
  border-color: var(--card-edge-hover);
  box-shadow: 0 8px 26px var(--shadow-card);
  transform: translateY(-2px);
}
.feature-grid h3 { display: flex; align-items: baseline; gap: 9px; margin-bottom: 9px; }
.feature-grid h3::before {
  content: "";
  width: 8px; height: 8px; flex: none;
  border-radius: 50%;
  background: linear-gradient(var(--blue), var(--navy));
  transform: translateY(-1px);
}
.k-inline { font: .92em var(--mono); color: var(--navy); }

/* small state pills next to a tier's name */
.tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 20px; vertical-align: middle; margin-left: 7px; position: relative; top: -1px;
}
.tag-free { background: var(--free-fill); color: var(--free-text); }
.tag-paid { background: var(--paid-fill); color: var(--paid-text); }

.addr {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
.addr > div { padding: 20px; }
.addr > div + div { border-left: 1px solid var(--rule); }
.addr .k { font: 13px/1.5 var(--mono); color: var(--navy); word-break: break-all; margin-bottom: 10px; }
.addr p { font-size: 14.5px; margin: 0; }

.addr-3 { grid-template-columns: repeat(3, 1fr); }
.addr h3 { font-size: 16px; }

@media (max-width: 700px) {
  .addr-3 { grid-template-columns: 1fr; }
  .addr-3 > div + div { border-left: 0; border-top: 1px solid var(--rule); }
}
@media (max-width: 560px) {
  .addr { grid-template-columns: 1fr; }
  .addr > div + div { border-left: 0; border-top: 1px solid var(--rule); }
}

/* ---- legal pages ---- */

.legal { padding: 34px 0 0; }
.legal h1 { font-size: 30px; color: var(--ink); letter-spacing: -0.02em; margin: 0 0 6px; }
.legal .updated { color: var(--muted); font-size: 14.5px; margin: 0 0 34px; }
.legal h2 {
  font-size: 17px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-weight: 620;
  margin: 34px 0 10px;
}
.legal ul { margin: 0 0 16px; padding-left: 22px; }
.legal li { margin-bottom: 7px; }
.legal table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 15px; }
.legal th, .legal td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.legal th { font-weight: 600; color: var(--ink); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }

/* What each inbox holds, beside the handle tiers — the comparison is the point, so the paid row
   carries the emphasis and the caption reads as a heading rather than a label. */
.tiers { border-collapse: collapse; width: 100%; max-width: 520px; margin: 26px auto 10px; font-size: 15px; }
.tiers caption { text-align: left; font-weight: 600; color: var(--ink); padding-bottom: 8px; }
.tiers th, .tiers td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); }
.tiers th { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tiers td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tiers tbody tr:last-child td { border-bottom: 0; }
.tiers-note { max-width: 520px; margin: 0 auto; color: var(--muted); font-size: 14px; }

/* A four-column table has nowhere to go on a phone; let it scroll rather than
   squeeze the page. */
@media (max-width: 620px) {
  .legal table { display: block; overflow-x: auto; white-space: nowrap; }
  .legal td, .legal th { white-space: normal; min-width: 130px; }
}

.note {
  background: var(--wash);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--navy);
  border-radius: 0 8px 8px 0;
  padding: 15px 18px;
  margin: 22px 0;
  font-size: 15.5px;
}

.back { display: inline-block; margin-bottom: 26px; font-size: 15px; }

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

footer {
  border-top: 1px solid var(--rule);
  margin-top: 24px;
  padding: 30px 0 60px;
  font-size: 14.5px;
  color: var(--muted);
}
footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-bottom: 14px; }
footer nav a { display: inline-flex; align-items: center; gap: 7px; }
footer a { color: var(--body); }
footer a:hover { color: var(--blue); }
