/* GrainFed — no framework, no build step, one stylesheet.
   The site is built the way the software is.

   The palette is the logo's: one hot orange, one near-black, and white. Orange
   is for things you can press and for marks of emphasis; it is never body text,
   because orange text on white does not reach a readable contrast. Where text
   sits on orange it is black, which does. */

:root {
  color-scheme: light dark;

  --orange: #ff3b00;
  --orange-ink: #c92f00;        /* orange dark enough to read as a link on white */
  --ink: #111111;

  --bg: #ffffff;
  --fg: #151515;
  --muted: #5d5d63;
  --line: rgba(17, 17, 17, 0.12);
  --card: #ffffff;
  --subtle: #fff3ed;            /* the faintest orange: a warm paper */
  --link: var(--orange-ink);
  --accent: var(--orange);
  --ok: #17703f;
  --code-bg: #f6f3f1;
  --radius: 14px;
  --measure: 68ch;

  --display: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round",
    "Hiragino Maru Gothic ProN", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0f;
    --fg: #ececec;
    --muted: #a0a0a8;
    --line: rgba(255, 255, 255, 0.14);
    --card: #171718;
    --subtle: #1c1411;
    --link: #ff7a4d;
    --ok: #56c98c;
    --code-bg: #181819;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 22px;
}

::selection { background: var(--orange); color: var(--ink); }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

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

header.site {
  background: var(--bg);
  border-bottom: 3px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand { margin-right: auto; display: block; line-height: 0; }
.brand img { height: 38px; width: auto; display: block; }

nav.site { display: flex; gap: 4px; flex-wrap: wrap; }

nav.site a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

nav.site a:hover { color: var(--fg); background: var(--subtle); }

nav.site a[aria-current="page"] { color: var(--ink); background: var(--orange); }

/* ---------- typography ---------- */

main.wrap { padding-top: 48px; padding-bottom: 80px; }

h1, h2, h3 { font-family: var(--display); }

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
}

h2 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 56px 0 14px;
  padding-top: 0;
  position: relative;
}

/* a short orange bar, the one decoration: it is the logo's horn in a ruler */
h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: var(--orange);
  margin-bottom: 14px;
}

h3 { font-size: 1.08rem; font-weight: 800; margin: 28px 0 8px; }

p, ul, ol { max-width: var(--measure); }

a { color: var(--link); text-underline-offset: 3px; }

.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 28px;
}

.muted { color: var(--muted); }

small.note {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
  max-width: var(--measure);
}

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

.hero { text-align: center; padding: 8px 0 0; }
.hero h1 { font-size: 3.4rem; max-width: 19ch; margin: 0 auto 18px; }
.hero h1 em { font-style: normal; color: var(--orange); }
.hero .lede { max-width: 56ch; margin: 0 auto 26px; }
.hero .btns { justify-content: center; margin-bottom: 8px; }
.hero .kicker { margin-bottom: 14px; }

/* the stage: the product, large, on a warm ground */
.stage {
  position: relative;
  margin: 34px -22px 0;
  padding: 38px 38px 0;
  background: linear-gradient(180deg, var(--subtle), transparent 92%);
  border-radius: 28px 28px 0 0;
}

/* a browser window and a phone, drawn in CSS around real screenshots */
.window {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px -18px rgba(17, 17, 17, 0.35), 0 2px 6px rgba(17, 17, 17, 0.08);
}
.window::before {
  content: "";
  display: block;
  height: 30px;
  background:
    radial-gradient(circle at 16px 15px, #ff5f57 5px, transparent 5.5px),
    radial-gradient(circle at 34px 15px, #febc2e 5px, transparent 5.5px),
    radial-gradient(circle at 52px 15px, #28c840 5px, transparent 5.5px),
    var(--code-bg);
  border-bottom: 1px solid var(--line);
}
.window img, .phone img { display: block; width: 100%; height: auto; }

.phone {
  width: 220px;
  border: 8px solid #1b1b1d;
  border-radius: 34px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 60px -16px rgba(17, 17, 17, 0.5);
}

.stage .window { max-width: 880px; margin: 0 auto; }
.stage .phone { position: absolute; right: 7%; bottom: -26px; }

@media (max-width: 860px) {
  .hero h1 { font-size: 2.5rem; }
  .stage { margin: 28px -22px 0; padding: 22px 16px 0; }
  .stage .phone { width: 130px; border-width: 5px; border-radius: 22px; right: 4%; bottom: -16px; }
}

/* ---------- a feature shown beside its screen ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 44px;
  align-items: center;
  margin: 72px 0;
}
.split.flip { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.split.flip .copy { order: 2; }
.split h2 { margin-top: 0; }
.split .copy ul { padding-left: 1.1em; margin: 12px 0 0; }
.split .copy li { margin: 0 0 7px; }
.split .copy p { margin: 0 0 10px; }

@media (max-width: 800px) {
  .split, .split.flip { grid-template-columns: 1fr; gap: 22px; margin: 52px 0; }
  .split.flip .copy { order: 0; }
}

/* ---------- a row of small screens ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 22px;
  margin: 26px 0;
}
.gallery figure { margin: 0; }
.gallery figcaption { font-size: 14.5px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.gallery figcaption b { color: var(--fg); font-family: var(--display); font-weight: 800; display: block; font-size: 15.5px; }
.gallery .window img { aspect-ratio: 1050 / 640; object-fit: cover; object-position: top left; }
.gallery .window { box-shadow: 0 10px 28px -14px rgba(17, 17, 17, 0.35); }

.gallery.two, .cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .gallery.two, .cards.two { grid-template-columns: 1fr; } }

/* ---------- a band: the one place orange is a whole background ---------- */

.band {
  background: var(--orange);
  color: var(--ink);
  border-radius: 24px;
  padding: 38px 34px;
  margin: 72px 0 0;
}
.band h2 { margin: 0 0 8px; color: var(--ink); }
.band h2::before { background: var(--ink); }
.band p { max-width: 58ch; margin: 0 0 6px; }
.band .btn { background: var(--ink); border-color: var(--ink); color: #fff; }
.band .btn.secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.band .btn.secondary:hover { background: var(--ink); color: #fff; }
.band a { color: var(--ink); }

/* a quiet strip for the plumbing, which matters but is not the pitch */
.under {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
  margin: 18px 0;
  font-size: 15px;
  color: var(--muted);
}
.under b { display: block; color: var(--fg); font-family: var(--display); font-weight: 800; margin-bottom: 4px; }

.kicker {
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--orange-ink);
  margin: 0 0 12px;
}

@media (prefers-color-scheme: dark) { .kicker { color: var(--link); } }

/* ---------- figures ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin: 30px 0 8px;
}

.stat {
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  padding: 18px 20px;
}

.stat b {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.1rem;
  line-height: 1.1;
  color: var(--orange);
  letter-spacing: -0.02em;
}

.stat span { display: block; font-size: 14px; color: #d4d4d8; margin-top: 4px; line-height: 1.4; }

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

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius);
  padding: 15px 17px;
  overflow-x: auto;
  font-size: 14.5px;
  line-height: 1.55;
}

pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* ---------- cards and grids ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 16px;
  margin: 22px 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--orange);
  border-radius: var(--radius);
  padding: 16px 20px 18px;
}

.card h3 { margin: 0 0 6px; font-size: 1.02rem; }
.card p { margin: 0; font-size: 15px; color: var(--muted); max-width: none; }

/* ---------- the before/after block ---------- */

.swap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 26px 0;
}

.swap > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--card);
}

.swap > div + div {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 6px 6px 0 var(--orange);
}

.swap > div + div code { color: #fff; }
.swap > div + div .label { color: var(--orange); }

.swap .label {
  font-family: var(--display);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.swap code { background: none; border: 0; padding: 0; font-size: 14px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  background: var(--orange);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15.5px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 2px solid var(--orange);
  transition: transform 0.08s ease;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }

.btn.secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--fg);
}

.btn.secondary:hover { background: var(--fg); color: var(--bg); }

.btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0; }

/* ---------- tables ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 15px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: var(--display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 800;
  border-bottom: 2px solid var(--orange);
}

.tablewrap { overflow-x: auto; }

/* ---------- callouts ---------- */

.callout {
  border: 1px solid var(--line);
  border-left: 6px solid var(--orange);
  border-radius: var(--radius);
  background: var(--subtle);
  padding: 16px 20px;
  margin: 26px 0;
  max-width: var(--measure);
}

.callout p { margin: 0; }
.callout p + p { margin-top: 10px; }
.callout.ok { border-left-color: var(--ok); }

/* ---------- the change log ---------- */

.entry {
  border-top: 1px solid var(--line);
  padding: 22px 0 6px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 28px;
}

.entry:first-of-type { border-top: 0; }

.entry > h3 { margin: 0; font-size: 1.05rem; }
.entry > h3 small {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.entry ul { margin: 0 0 14px; padding-left: 1.15em; }
.entry li { margin: 0 0 8px; }
.entry p { margin: 0 0 12px; }

@media (max-width: 720px) { .entry { grid-template-columns: 1fr; } }

/* ---------- server directory ---------- */

.server {
  border: 1px solid var(--line);
  border-left: 6px solid var(--orange);
  border-radius: var(--radius);
  background: var(--card);
  padding: 20px 22px;
  margin: 18px 0;
}

.server h3 { margin: 0 0 4px; font-size: 1.2rem; }
.server h3 a { text-decoration: none; }
.server .meta { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.server p { max-width: none; }

.pill {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--subtle);
  color: var(--muted);
  margin-right: 6px;
}

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

footer.site {
  background: var(--ink);
  color: #c9c9ce;
  font-size: 14px;
  padding: 34px 0 44px;
  border-top: 3px solid var(--orange);
}

footer.site .wrap {
  display: flex;
  gap: 14px 22px;
  flex-wrap: wrap;
  align-items: center;
}

footer.site .mark { height: 30px; width: auto; display: block; margin-right: 8px; }
footer.site a { color: #e9e9ec; text-decoration: none; }
footer.site a:hover { color: var(--orange); }
footer.site .spacer { margin-left: auto; }

@media (max-width: 640px) {
  h1 { font-size: 2rem; }
  .brand img { height: 30px; }
  header.site { position: static; }
  nav.site a { font-size: 14px; padding: 5px 9px; }
  header.site .wrap { gap: 8px; }
  footer.site .spacer { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
