/* ─────────────────────────────────────────────────────────────
   Openflow — site styles
   Shared across landing + docs. Stays under a couple hundred
   lines on purpose; if it grows past that, something is wrong
   with the component model, not the spec.
   ───────────────────────────────────────────────────────────── */

/* ── Base ───────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--iron-0);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--copper-deep); color: var(--highlight); }

/* Lamp-from-above vignette. Subtle. The page's only gradient.  */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, oklch(28% 0.025 50) 0%, transparent 70%);
}
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Focus rings live in one color so the page has a single accent. */
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; border-radius: 4px; }

/* ── Nav ────────────────────────────────────────────────────── */
nav.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--rhythm-sm) 0;
  font-family: var(--mono);
  font-size: 13px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.brand-prompt { color: var(--copper); }
.brand-name {
  font-weight: 600;
  color: var(--highlight);
}
.brand-cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--copper);
  margin-left: 4px;
  vertical-align: -1px;
  animation: blink 1.2s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

nav.top ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  color: var(--ash);
}
nav.top li { padding: 4px 0; }
nav.top li + li:not(.star)::before {
  content: ' / ';
  margin: 0 8px;
  color: var(--iron-3);
}
nav.top a { color: inherit; text-decoration: none; transition: color var(--ease-fast); }
nav.top a:hover { color: var(--highlight); }
nav.top a[aria-current="page"] { color: var(--copper); }

nav.top .star {
  margin-left: 18px;
  padding: 6px 11px;
  border: 1px solid var(--iron-3);
  border-radius: 4px;
  color: var(--copper);
  transition: border-color var(--ease-fast);
}
nav.top .star:hover { border-color: var(--copper); color: var(--copper-glow); }

/* ── Banner / dateline ─────────────────────────────────────── */
.banner {
  margin-top: 80px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--copper);
  letter-spacing: 0.04em;
}
.banner b { color: var(--ash); font-weight: 400; }

/* ── Hero ──────────────────────────────────────────────────── */
h1.hero {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(36px, 5.6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--highlight);
  margin: 16px 0 0;
  max-width: 16ch;
}
h1.hero .copper { color: var(--copper); }
h1.hero .punct  { color: var(--ash); }

.lede {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ash);
  margin: 32px 0 0;
  max-width: 56ch;
}
.lede strong { color: var(--bone); font-weight: 500; }

/* ── CTA row ───────────────────────────────────────────────── */
.cta-row {
  margin: var(--rhythm-md) 0 0;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--copper-deep);
  color: var(--highlight);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--copper);
  border-radius: 4px;
  transition: background var(--ease-fast);
}
.btn-primary:hover { background: var(--copper); }
.btn-primary svg { width: 14px; height: 14px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--iron-3);
  background: transparent;
  color: var(--bone);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  border-radius: 4px;
  transition: border-color var(--ease-fast), color var(--ease-fast);
}
.btn-ghost:hover { border-color: var(--copper); color: var(--copper-glow); }

.install {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--iron-1);
  border: 1px solid var(--iron-3);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--bone);
}
.install .prompt { color: var(--copper); }
.install button {
  background: none; border: none; cursor: pointer;
  color: var(--ash);
  padding: 0; margin-left: 8px;
  font-family: var(--mono); font-size: 11px;
  transition: color var(--ease-fast);
}
.install button:hover { color: var(--copper-glow); }
.install button.copied { color: var(--copper); }

/* ── Status panel (hero visual) ────────────────────────────── */
.status {
  margin-top: var(--rhythm-lg);
  padding: 24px 28px;
  border: 1px solid var(--iron-3);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--iron-1) 0%, var(--iron-0) 100%);
  font-family: var(--mono);
  font-size: 12.5px;
}
.status-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ash);
}
.status-label .pulse {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--copper);
}
.status-label .pulse::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 8px var(--copper);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  50% { opacity: 0.4; box-shadow: 0 0 12px var(--copper); }
}
.status-rows {
  display: grid;
  grid-template-columns: 1.4fr auto auto auto auto;
  gap: 6px 24px;
  font-size: 12.5px;
  color: var(--bone);
}
.status-rows .h {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ash);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--iron-3);
}
.status-rows .name { color: var(--highlight); }
.status-rows .ok   { color: var(--copper); }
.status-rows .dim  { color: var(--ash); }
.status-rows .warn { color: oklch(72% 0.13 80); }

/* ── Section heading ───────────────────────────────────────── */
.section { margin-top: var(--rhythm-2xl); }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: var(--rhythm-md);
  font-family: var(--mono);
}
.section-head .frame { color: var(--copper); }
.section-head h2 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.005em;
  color: var(--highlight);
  margin: 0;
}
.section-intro {
  font-family: var(--sans);
  color: var(--ash);
  font-size: 15.5px;
  line-height: 1.6;
  max-width: 60ch;
  margin: -16px 0 var(--rhythm-md);
}

/* ── Diff grid ─────────────────────────────────────────────── */
.diff-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--iron-3);
  border: 1px solid var(--iron-3);
  border-radius: 6px;
  overflow: hidden;
}
@media (max-width: 800px) { .diff-list { grid-template-columns: 1fr; } }
.diff-item {
  padding: 32px 32px 40px;
  background: var(--iron-0);
}
.diff-item .ix {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--copper);
  letter-spacing: 0.08em;
}
.diff-item h3 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.005em;
  color: var(--highlight);
  margin: 14px 0 12px;
}
.diff-item p {
  font-family: var(--sans);
  color: var(--ash);
  margin: 0;
  max-width: 46ch;
  font-size: 15px;
}
.diff-item p + p { margin-top: 12px; }
code, .diff-item code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--iron-2);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--bone);
}

/* ── Flow diagram ──────────────────────────────────────────── */
.flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  background: var(--iron-3);
  border: 1px solid var(--iron-3);
  border-radius: 6px;
  overflow: hidden;
  font-family: var(--mono);
}
.flow-step {
  display: grid;
  grid-template-columns: 80px 1.2fr 1fr;
  gap: 24px;
  align-items: center;
  padding: 28px 32px;
  background: var(--iron-0);
}
@media (max-width: 800px) {
  .flow-step { grid-template-columns: 60px 1fr; }
  .flow-step .flow-detail { grid-column: 1 / -1; padding-left: 84px; }
}
.flow-step .ix {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--copper);
  letter-spacing: 0.08em;
}
.flow-step h3 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--highlight);
  margin: 0 0 4px;
}
.flow-step p {
  font-family: var(--sans);
  color: var(--ash);
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 40ch;
}
.flow-detail {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ash);
  line-height: 1.6;
}
.flow-detail .arrow { color: var(--copper); }
.flow-detail b { color: var(--bone); font-weight: 500; }

/* ── Install tiles ─────────────────────────────────────────── */
.install-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 800px) { .install-grid { grid-template-columns: 1fr; } }
.install-tile {
  border: 1px solid var(--iron-3);
  border-radius: 6px;
  padding: 22px 22px 26px;
  background: var(--iron-0);
  transition: border-color var(--ease-fast);
}
.install-tile:hover { border-color: var(--iron-3); }
.install-tile .ix {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--copper);
}
.install-tile h4 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 16px;
  color: var(--highlight);
  margin: 10px 0 14px;
}
.install-tile p {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ash);
  margin: 0 0 16px;
  line-height: 1.55;
}
.install-tile pre {
  margin: 0;
  padding: 12px 14px;
  background: var(--iron-1);
  border: 1px solid var(--iron-3);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--bone);
  overflow-x: auto;
  white-space: pre;
}
.install-tile pre .prompt { color: var(--copper); }
.install-tile pre .comment { color: var(--ash); }

/* ── "Built on" credits ────────────────────────────────────── */
.credits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  font-family: var(--mono);
}
@media (max-width: 800px) { .credits { grid-template-columns: repeat(2, 1fr); } }
.credit {
  padding: 22px;
  border: 1px solid var(--iron-3);
  border-radius: 6px;
  background: var(--iron-0);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--ease-fast);
}
.credit:hover { border-color: var(--copper); }
.credit b {
  display: block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--highlight);
  margin-bottom: 6px;
}
.credit span {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ash);
  line-height: 1.5;
}

/* ── Footer ────────────────────────────────────────────────── */
footer.bottom {
  margin: var(--rhythm-2xl) 0 var(--rhythm-md);
  padding-top: var(--rhythm-sm);
  border-top: 1px dashed var(--iron-3);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ash);
  flex-wrap: wrap;
  gap: 16px;
}
footer.bottom a { color: var(--ash); text-decoration: none; transition: color var(--ease-fast); }
footer.bottom a:hover { color: var(--copper); }
footer.bottom .copper { color: var(--copper); }

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
