/* Nixup website: one quiet palette, light and dark from the system setting. */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f6;
  --text: #18181b;
  --muted: #55565c;
  --faint: #8b8c92;
  --border: #e4e4e2;
  --border-strong: #cfcfcc;
  --code-bg: #f6f6f5;
  --code-comment: #8b8c92;
  --button-bg: #18181b;
  --button-text: #ffffff;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --wide: 1120px;
  --header: 60px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f10;
    --bg-soft: #151517;
    --text: #ececed;
    --muted: #a3a4aa;
    --faint: #75767c;
    --border: #262629;
    --border-strong: #38383c;
    --code-bg: #141416;
    --code-comment: #75767c;
    --button-bg: #ececed;
    --button-text: #0f0f10;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[id] { scroll-margin-top: calc(var(--header) + 20px); }

a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; font-weight: 600; margin: 0; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }
ul, ol { padding-left: 1.25em; margin: 0 0 1em; }
li + li { margin-top: 0.35em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }

code, kbd, pre { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.08em 0.35em;
  overflow-wrap: anywhere;
}

pre {
  position: relative;
  margin: 0 0 1.25em;
  padding: 16px 18px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.6;
  font-size: 13.5px;
  tab-size: 2;
}
pre code { font-size: inherit; }
pre .c { color: var(--code-comment); }

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font: 500 12px/1 var(--font);
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 9px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
pre:hover .copy, .copy:focus-visible { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }

table { width: 100%; border-collapse: collapse; margin: 0 0 1.25em; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.table-wrap { overflow-x: auto; margin: 0 0 1.25em; border: 1px solid var(--border); border-radius: 8px; }
.table-wrap table { margin: 0; }
.table-wrap tr:last-child td { border-bottom: 0; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--bg); padding: 8px 12px; border: 1px solid var(--border); }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand svg { width: 26px; height: 26px; flex: none; }

.nav { display: flex; align-items: center; gap: 26px; font-size: 14.5px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 640px) {
  .nav { gap: 18px; }
  .nav .optional { display: none; }
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--button-bg);
  background: var(--button-bg);
  color: var(--button-text);
  white-space: nowrap;
}
.button:hover { opacity: 0.88; }
.button.secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.button.secondary:hover { opacity: 1; border-color: var(--text); }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; }

/* Landing page */

.hero { padding: 88px 0 80px; border-bottom: 1px solid var(--border); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; }
.eyebrow { font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.hero h1 { font-size: clamp(34px, 5vw, 50px); letter-spacing: -0.03em; line-height: 1.08; margin-bottom: 22px; }
.lead { font-size: 18.5px; color: var(--muted); max-width: 34em; margin-bottom: 30px; }
.hero .fineprint { margin: 22px 0 0; font-size: 13.5px; color: var(--faint); }
.hero pre { margin: 0; font-size: 13px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 8px 24px -12px rgba(0, 0, 0, 0.08); }
.file-tab { display: flex; align-items: center; justify-content: space-between; font: 12.5px/1 var(--mono); color: var(--faint); padding: 0 2px 10px; }
@media (max-width: 960px) {
  .hero { padding: 56px 0; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

.section { padding: 88px 0; border-bottom: 1px solid var(--border); }
.section.soft { background: var(--bg-soft); }
@media (max-width: 760px) { .section { padding: 60px 0; } }

.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -0.025em; margin-bottom: 14px; }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14.5px;
  color: var(--muted);
  background: var(--bg);
}
.notice strong { color: var(--text); }
.notice svg { flex: none; width: 18px; height: 18px; margin-top: 3px; }
.notice p { margin: 0; }
.notice-bar { padding: 20px 0; border-bottom: 1px solid var(--border); }

.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.principles h3 { font-size: 17px; margin-bottom: 8px; }
.principles p { color: var(--muted); font-size: 15.5px; margin: 0; }
.principles .num { font: 500 13px/1 var(--mono); color: var(--faint); display: block; margin-bottom: 16px; }
@media (max-width: 860px) { .principles { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.card { background: var(--bg); padding: 28px 26px 26px; display: flex; flex-direction: column; }
.card h3 { font-size: 16.5px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; margin: 0 0 16px; }
.card .more { margin-top: auto; font-size: 14px; text-decoration: none; color: var(--text); }
.card .more:hover { text-decoration: underline; }
.card code { font-size: 0.82em; }
@media (max-width: 940px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: minmax(0, 1fr); } .card { padding: 22px 20px; } }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); gap: 36px; } }
.split h3 { font-size: 17px; margin-bottom: 14px; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 44px; margin: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 500 13px/1 var(--mono);
  color: var(--muted);
  background: var(--bg);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 1px; background: var(--border); }
.steps p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { position: relative; padding-left: 26px; color: var(--muted); font-size: 15.5px; }
.checklist li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--faint); }
.checklist li strong { color: var(--text); }

.cta { text-align: center; }
.cta h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -0.025em; margin-bottom: 14px; }
.cta p { color: var(--muted); font-size: 17px; margin: 0 auto 28px; max-width: 34em; }
.cta .buttons { justify-content: center; }

/* Footer */

.site-footer { padding: 48px 0 56px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 22px; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { color: var(--text); }
.site-footer .credits { flex-basis: 100%; font-size: 13px; color: var(--faint); margin: 0; max-width: 72em; }

/* Documentation page */

.docs { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 64px; padding-top: 48px; padding-bottom: 96px; }
@media (max-width: 900px) { .docs { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 28px; } }

.toc { position: sticky; top: calc(var(--header) + 32px); align-self: start; max-height: calc(100vh - var(--header) - 48px); overflow-y: auto; font-size: 14px; }
.toc summary { display: none; }
.toc .group { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin: 22px 0 8px; }
.toc .group:first-of-type { margin-top: 0; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 4px 0 4px 12px; border-left: 1px solid var(--border); color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--text); border-left-color: var(--text); }
@media (max-width: 900px) {
  .toc { position: static; max-height: none; border: 1px solid var(--border); border-radius: 8px; padding: 0 16px; }
  .toc summary { display: block; cursor: pointer; padding: 12px 0; font-weight: 500; color: var(--text); }
  .toc details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 14px; }
  .toc details[open] { padding-bottom: 14px; }
}

.prose { max-width: 760px; }
.prose > header { margin-bottom: 40px; }
.prose h1 { font-size: clamp(30px, 4vw, 40px); letter-spacing: -0.03em; margin-bottom: 14px; }
.prose h2 { font-size: 25px; letter-spacing: -0.02em; margin: 64px 0 16px; padding-top: 36px; border-top: 1px solid var(--border); }
.prose h3 { font-size: 18px; margin: 36px 0 12px; }
.prose section:first-of-type > h2 { margin-top: 0; padding-top: 0; border-top: 0; }
.prose p, .prose li { color: var(--muted); }
.prose p strong, .prose li strong, .prose a { color: var(--text); }
.prose .lead { font-size: 18px; margin-bottom: 24px; }
.prose ul li::marker { color: var(--faint); }
.prose .notice { margin: 0 0 28px; }
.prose .table-wrap td:first-child { white-space: nowrap; }

.prose ol li::marker { color: var(--faint); font-variant-numeric: tabular-nums; }
.prose .table-wrap td code { overflow-wrap: normal; }

/* Docs: notes and warnings, in the page's own grays */

.callout { margin: 0 0 1.25em; padding: 14px 16px 14px 18px; border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: 0 8px 8px 0; background: var(--bg-soft); font-size: 15px; }
.callout > :last-child { margin-bottom: 0; }
.callout .label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.callout.warn { border-left-color: var(--text); }
.callout.warn .label { color: var(--text); }

/* Docs: a few words and what they mean */

.terms { margin: 0 0 1.25em; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.terms div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.terms div:last-child { border-bottom: 0; }
.terms dt { font-weight: 600; color: var(--text); font-size: 15px; }
.terms dd { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 600px) { .terms div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* Docs: the parts of Nixup, side by side (one under the other on a small screen) */

.parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin: 8px 0 1.5em; }
.parts > div { position: relative; border: 1px solid var(--border-strong); border-radius: 8px; padding: 14px 14px 12px; background: var(--bg); font-size: 14px; }
.parts > div:not(:last-child)::after { content: "\2192"; position: absolute; right: -22px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 16px; }
.parts strong { display: block; color: var(--text); font-size: 14.5px; margin-bottom: 4px; }
.parts span { display: block; color: var(--muted); line-height: 1.5; }
.parts code { font-size: 0.85em; }
@media (max-width: 1000px) {
  .parts { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .parts > div:not(:last-child)::after { content: "\2193"; right: auto; left: 50%; top: auto; bottom: -21px; transform: translateX(-50%); }
}

/* Docs: the steps of a build, with the line after which the phone changes */

.flow { list-style: none; padding: 0; margin: 0 0 1.5em; counter-reset: flow; }
.flow > li { counter-increment: flow; position: relative; padding: 0 0 16px 44px; margin: 0; }
.flow > li::before {
  content: counter(flow);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 500 13px/1 var(--mono);
  color: var(--muted);
  background: var(--bg);
}
.flow > li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 1px; background: var(--border); }
.flow > li strong { color: var(--text); }
.flow > li.changes::before { background: var(--text); color: var(--bg); border-color: var(--text); }
.flow > li.gate { counter-increment: none; padding: 4px 0 20px 44px; }
.flow > li.gate::before { content: ""; width: 28px; height: 0; border: 0; border-top: 1px dashed var(--text); top: 16px; border-radius: 0; background: none; }
.flow > li.gate::after { display: none; }
.flow > li.gate span { display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text); border: 1px dashed var(--text); border-radius: 4px; padding: 3px 8px; }

/* Docs: more detail, folded until opened */

.prose details.more { margin: 0 0 1.25em; border: 1px solid var(--border); border-radius: 8px; }
.prose details.more > summary { cursor: pointer; padding: 11px 16px; font-size: 15px; font-weight: 500; color: var(--text); list-style: none; }
.prose details.more > summary::-webkit-details-marker { display: none; }
.prose details.more > summary::before { content: "+"; display: inline-block; width: 18px; color: var(--faint); font-family: var(--mono); }
.prose details.more[open] > summary::before { content: "\2212"; }
.prose details.more[open] > summary { border-bottom: 1px solid var(--border); }
.prose details.more > .body { padding: 16px 16px 4px; }
.prose details.more > .body > pre:last-child, .prose details.more > .body > .table-wrap:last-child { margin-bottom: 12px; }

.page-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--border); font-size: 14.5px; }
.page-nav a { text-decoration: none; color: var(--muted); }
.page-nav a:hover { color: var(--text); }

.split h3.spaced { margin-top: 36px; }
.split .note { color: var(--muted); font-size: 15px; margin: 0; }
