:root {
  --bg: #ffffff;
  --band: #f5f5f7;
  --surface: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --link: #0066cc;
  --button: #0071e3;
  --busy: #bf4800;
  --done: #248a3d;
  --apple: #e0383e;
  --chrome: rgba(255, 255, 255, 0.72);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --band: #101011;
    --surface: #1c1c1e;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --line: #424245;
    --link: #2997ff;
    --button: #0071e3;
    --busy: #ff9f0a;
    --done: #30d158;
    --apple: #ff453a;
    --chrome: rgba(22, 22, 23, 0.72);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --band: #101011;
  --surface: #1c1c1e;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --line: #424245;
  --link: #2997ff;
  --button: #0071e3;
  --busy: #ff9f0a;
  --done: #30d158;
  --apple: #ff453a;
  --chrome: rgba(22, 22, 23, 0.72);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 48px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.47 var(--sans);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 6px;
}

code { font-family: var(--mono); font-size: 0.88em; letter-spacing: 0; }

h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; }

.wrap {
  width: 100%;
  max-width: 1072px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* A full-bleed gray band whose content still lines up with .wrap */
.band {
  max-width: none;
  background: var(--band);
  padding-inline: max(24px, calc((100% - 1024px) / 2));
}

/* Header: a thin translucent bar, content scrolls underneath */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 48px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.0625rem;
}
.brand:hover { text-decoration: none; }
.brand img { display: block; }

.top nav { display: flex; gap: 28px; font-size: 0.75rem; letter-spacing: -0.01em; }
.top nav a { color: var(--ink); opacity: 0.8; }
.top nav a:hover { opacity: 1; text-decoration: none; }

/* Hero */

.hero { padding-block: 88px 120px; text-align: center; }

.hero-copy { display: flex; flex-direction: column; align-items: center; }

.icon {
  display: block;
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--muted);
}

.hero h1 {
  font-size: clamp(2.75rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-weight: 700;
  max-width: 13ch;
}

.lede {
  margin: 24px 0 0;
  max-width: 32em;
  font-size: 1.3rem;
  line-height: 1.42;
  letter-spacing: 0.004em;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 32px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 980px;
  background: var(--button);
  color: #fff;
  font-size: 1.0625rem;
  transition: transform 0.1s ease-out, background 0.2s;
}
.button:hover { background: #0077ed; text-decoration: none; }
.button:active { transform: scale(0.97); }

.more { font-size: 1.0625rem; }
.more::after { content: " \203A"; }

/* The tree: commits on a branch growing into devices */

.tree {
  width: 100%;
  max-width: 560px;
  margin: 80px auto 0;
  padding: 28px 32px 30px 28px;
  background: var(--surface);
  border-radius: 28px;
  text-align: left;
}

.branch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.branch-name {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 2px 10px;
  background: var(--bg);
  border-radius: 999px;
}

.status {
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.3s;
}
.status[data-tone="busy"] { color: var(--busy); }
.status[data-tone="done"] { color: var(--done); }

.commits, .devices { list-style: none; margin: 0; padding: 0; }

.commits li {
  position: relative;
  display: grid;
  grid-template-columns: 12px auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  margin-left: 4px;
  font-size: 0.94rem;
}

/* branch line through the commits */
.commits li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.commits li:first-child::before { top: 50%; }

.fruit {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
}
.commits li:last-child .fruit { background: var(--apple); border-color: var(--apple); }

.commits code { color: var(--muted); }
.commits .msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.commits li.new { animation: grow 0.5s cubic-bezier(.2, .8, .2, 1); }
@keyframes grow {
  from { opacity: 0; transform: translateY(6px); }
}

.devices { margin-left: 4px; }

.devices li {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0 9px 40px;
}

/* trunk segment beside each device, and a stem out to it */
.devices li::before,
.devices li::after {
  content: "";
  position: absolute;
  background: var(--line);
  transition: background 0.4s;
}
.devices li::before { left: 5px; top: 0; bottom: 0; width: 2px; }
.devices li:last-child::before { bottom: 50%; }
.devices li::after { left: 5px; top: 50%; width: 24px; height: 2px; margin-top: -1px; }

.devices li:is([data-state="installing"], [data-state="installed"])::after { background: var(--done); }

.devices svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.devices svg.sim { stroke-dasharray: 2.5 2; }

.name { display: flex; flex-direction: column; line-height: 1.25; font-weight: 500; font-size: 0.94rem; min-width: 0; }
.name small { font-weight: 400; font-size: 0.78rem; color: var(--muted); letter-spacing: -0.005em; }

.state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}
.state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}
.state::after { content: "Up to date"; }

[data-state="queued"] .state::after { content: "Queued"; }
[data-state="building"] .state { color: var(--busy); }
[data-state="building"] .state::after { content: "Building"; }
[data-state="installing"] .state { color: var(--done); }
[data-state="installing"] .state::before { animation: pulse 1s ease-in-out infinite; }
[data-state="installing"] .state::after { content: "Installing"; }
[data-state="installed"] .state { color: var(--done); }
[data-state="installed"] .state::before { background: currentColor; }
.tree[data-run="running"] [data-state="installed"] .state::after { content: "Installed"; }
.tree[data-run="fresh"] [data-state="installed"] .state::after { content: "Launched"; }

@keyframes pulse {
  50% { transform: scale(0.6); opacity: 0.5; }
}

/* Sections */

.how, .example, .details, .install { padding-block: 112px; }

h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.005em;
  line-height: 1.08;
  font-weight: 700;
  text-align: center;
}

h3 { font-size: 1.1875rem; line-height: 1.26; letter-spacing: 0.01em; }

.example .eyebrow { text-align: center; }

/* How it works */

.steps {
  counter-reset: step;
  list-style: none;
  margin: 64px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 48px 40px;
}

.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 14px;
  font-family: var(--display);
  font-size: 2.5rem;
  font-weight: 200;
  line-height: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.steps p, .details dd, .install p, .needs { color: var(--muted); }
.steps p { margin: 8px 0 0; }

/* Example */

.example-intro { max-width: 640px; margin-inline: auto; }
.example-intro p { margin: 20px 0 0; color: var(--muted); text-align: center; }
.example-intro h2 + p { margin-top: 28px; font-size: 1.1875rem; }

.log { list-style: none; max-width: 600px; margin: 72px auto 0; padding: 0; }

.log li {
  position: relative;
  display: grid;
  grid-template-columns: 3.25rem 10px minmax(0, 1fr);
  gap: 0 20px;
  padding-bottom: 36px;
}
.log li:last-child { padding-bottom: 0; }

.log time {
  grid-column: 1;
  grid-row: 1;
  padding-top: 1px;
  color: var(--muted);
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}

/* a dot per step, joined by the same line as the hero's branch */
.log li::before {
  content: "";
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--bg);
}
.log li::after {
  content: "";
  position: absolute;
  left: calc(3.25rem + 20px + 4px);
  top: 19px;
  bottom: -5px;
  width: 2px;
  background: var(--line);
}
.log li:last-child::after { display: none; }

.log li[data-kind="push"]::before { background: var(--apple); border-color: var(--apple); }
.log li[data-kind="install"]::before { background: var(--done); border-color: var(--done); }

.log li > div { grid-column: 3; grid-row: 1; }
.log h3 { font-size: 1.0625rem; letter-spacing: -0.022em; }
.log p { margin: 4px 0 0; color: var(--muted); }
.log code { color: var(--ink); }

/* Details */

.details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 64px;
  max-width: 860px;
  margin: 64px auto 0;
}
.details dt { font-family: var(--display); font-weight: 600; font-size: 1.1875rem; letter-spacing: 0.01em; }
.details dd { margin: 8px 0 0; }

/* Install */

.install { display: flex; flex-direction: column; align-items: center; }
.install > p { margin: 20px 0 0; max-width: 34em; text-align: center; font-size: 1.1875rem; }

.install pre {
  width: 100%;
  max-width: 600px;
  margin: 48px 0 64px;
  padding: 24px 28px;
  background: var(--surface);
  border-radius: 18px;
  overflow-x: auto;
  line-height: 1.75;
}
.install pre code { font-size: 0.9rem; }

.install h3 { width: 100%; max-width: 600px; }

.needs { width: 100%; max-width: 600px; margin: 12px 0 0; padding-left: 1.2em; }
.needs li + li { margin-top: 6px; }

footer {
  padding-block: 20px 32px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: -0.01em;
}
footer p { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); }

/* Responsive */

@media (max-width: 960px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .wrap { padding-inline: 16px; }
  .band { padding-inline: 16px; }
  .top nav a:not(:last-child) { display: none; }
  .hero { padding-block: 56px 80px; }
  .lede { font-size: 1.1875rem; }
  .tree { margin-top: 56px; padding: 22px 18px 24px 16px; border-radius: 22px; }
  .steps, .details dl { grid-template-columns: minmax(0, 1fr); }
  .how, .example, .details, .install { padding-block: 80px; }
  .steps, .details dl { margin-top: 48px; gap: 36px; }
  .example-intro p, .install > p { text-align: left; }
  .install pre { margin: 36px 0 48px; padding: 20px; border-radius: 16px; }
  .log { margin-top: 56px; }
  .log li { grid-template-columns: 3rem 10px minmax(0, 1fr); gap: 0 14px; }
  .log li::after { left: calc(3rem + 14px + 4px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .top { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
