/* The static landing page (home.html). Spacing in powers of two only. */
:root {
  --brand: #00ad95;
  /* Teal 700: white text on it and it on --bg pass 4.5:1; the logo teal does not. */
  --accent: #0f766e;
  --accent-text: #0f766e;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #18181b;
  --muted: #52525b;
  --line: #e4e4e7;
  --dot: #d4d4d8;
  color-scheme: light;
}
:root.dark {
  --bg: #0a0a0b;
  --surface: #17171a;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --line: #27272a;
  --dot: #27272a;
  --accent-text: #2dd4bf;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Inter, system-ui, ui-sans-serif, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg) radial-gradient(var(--dot) 1px, transparent 1px) 0 0 /
    16px 16px;
}
/* :where(:not(#docs *)) skips docs.html's React guide, laid out by Tailwind, and adds no specificity */
a:where(:not(#docs *)) {
  color: inherit;
}
main:where(:not(#docs *)) {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 16px;
}
section:where(:not(#docs *)) {
  padding: 64px 0 0;
}
:is(h1, h2, h3):where(:not(#docs *)) {
  line-height: 1.2;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
  /* Said outright: references.html also loads Tailwind, whose reset unbolds headings */
  font-weight: 700;
}
h1:where(:not(#docs *)) {
  font-size: clamp(2rem, 5vw, 3.25rem);
  max-width: 16ch;
}
h2:where(:not(#docs *)) {
  font-size: 1.75rem;
}
h3:where(:not(#docs *)) {
  font-size: 1.0625rem;
  margin-bottom: 8px;
}
p:where(:not(#docs *)) {
  margin: 0 0 16px;
}

/* docs.html: the slot React mounts the docs search in */
.docs-search {
  display: flex;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1024px;
  margin: 0 auto;
  padding: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  text-decoration: none;
}
.bar-end {
  display: flex;
  align-items: center;
  gap: 16px;
}
header.bar {
  flex-wrap: wrap;
}
.site-nav {
  display: flex;
  gap: 16px;
  margin-right: auto;
  padding-left: 16px;
}
.site-nav a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}
/* Phones: the nav takes its own row under the logo and buttons */
@media (max-width: 560px) {
  header.bar {
    gap: 8px;
  }
  .site-nav {
    order: 3;
    width: 100%;
    padding-left: 0;
  }
  .docs-search {
    order: 4;
    flex-basis: 100%;
  }
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
  gap: 16px;
}
.plans article {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
}
.plans article.featured {
  border-color: var(--accent);
}
.plans ul {
  flex: 1;
  margin: 0 0 32px;
  padding-left: 16px;
  color: var(--muted);
}
.plans li {
  margin-bottom: 8px;
}
.plans li:first-child strong {
  color: var(--text);
}
.plans .button {
  align-self: flex-start;
}
.plans .contact {
  margin: 8px 0 0;
  color: var(--muted);
}

/* references.html: the steps under the hero, and the cards React mounts in #refs */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(256px, 1fr));
  gap: 16px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  color: var(--muted);
}
.steps li {
  counter-increment: step;
  display: flex;
  gap: 8px;
}
.steps li::before {
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
}
.steps strong {
  color: var(--text);
}
/* Two by two on a laptop, one column on a phone */
.refs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(384px, 100%), 1fr));
  gap: 16px;
}
.refs article {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
}
.refs article > p {
  color: var(--muted);
}
.refs .ref-tag {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-text);
}
.ref-map {
  margin: 0 0 16px;
  padding: 16px 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.refs .ref-learn {
  flex: 1;
}
.ref-learn strong {
  color: var(--text);
}
.ref-answer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px 16px;
  font: inherit;
  text-align: left;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.ref-answer:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}
.ref-question {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: var(--text);
}
.ref-hint {
  font-size: 0.8125rem;
  color: var(--accent-text);
}
.ref-blur {
  filter: blur(4px);
  user-select: none;
}
.refs .button {
  align-self: flex-start;
}
/* Mirrors the app's HeroUI lg Switch: moon thumb on the right in dark, sun on the left in light. */
.theme-toggle {
  display: inline-flex;
  width: 48px;
  height: 28px;
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--dot);
  cursor: pointer;
}
.theme-toggle[hidden] {
  display: none;
}
.theme-toggle .thumb {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  color: #18181b;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
  transition: transform 0.2s;
}
.theme-toggle svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.theme-toggle .sun {
  opacity: 0.7;
}
:root.dark .theme-toggle {
  background: var(--accent);
}
:root.dark .theme-toggle .thumb {
  transform: translateX(20px);
}
:root:not(.dark) .theme-toggle .moon,
:root.dark .theme-toggle .sun {
  display: none;
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}
html {
  scroll-behavior: smooth;
  /* Room for the scroll bar from first paint: /references is short until its cards mount */
  scrollbar-gutter: stable;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .theme-toggle .thumb {
    transition: none;
  }
}
footer.bar {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
footer nav {
  display: flex;
  gap: 16px;
}

.kicker {
  color: var(--accent-text);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
}
.lead {
  font-size: 1.1875rem;
  color: var(--muted);
  max-width: 60ch;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}
.button {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  /* Pinned: on /references HeroUI's own .button (text-sm, h-9) loads after first paint */
  font-size: 1rem;
  line-height: 1.5;
  height: auto;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
/* Same press as the app's HeroUI button: shrink 3%, eased only when motion is welcome */
.button:active {
  transform: scale(0.97);
}
@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: transform 250ms ease;
  }
}
.button.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.button:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 16px;
}
.features article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.features p,
.faq dd,
.uses li {
  color: var(--muted);
}
.features p {
  margin: 0;
  font-size: 0.9375rem;
}
.features h3 {
  font-size: 1.1875rem;
}

.uses {
  padding-left: 16px;
  margin: 0;
}
.uses li {
  margin-bottom: 8px;
}
.uses strong,
.faq dt {
  color: var(--text);
}

.faq dt {
  font-weight: 600;
  margin-top: 16px;
}
.faq dd {
  margin: 4px 0 0;
  max-width: 72ch;
}

.demo figure {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface) radial-gradient(var(--dot) 1px, transparent 1px) 0
    0 / 16px 16px;
  overflow-x: auto;
}
/* min-width: below it labels get unreadable, so phones scroll the figure instead */
.demo svg {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
}
/* Node colours and shapes copy the editor canvas (styles/theme.ts, nodes/BaseNode.tsx). */
.demo {
  --n-surface: #ffffff;
  --n-foot: #ffffff;
  --n-head: #eaecf0;
  --n-text: #0f1117;
  --n-muted: #656c81;
  --n-track: #d3d6df;
  --n-chip: #d3d6df;
  --t-primary: #00ad95;
  --t-secondary: #3b82f6;
  --t-tertiary: #f59e0b;
  --t-danger: #ef4444;
  --t-danger-text: #b91c1c; /* red-700: red-500 text on white misses 4.5:1 */
}
:root.dark .demo {
  --n-surface: #212531;
  --n-foot: #161922;
  --n-head: #2f3441;
  --n-text: #f6f7f9;
  --n-muted: #878da1;
  --n-track: #464c5d;
  --n-chip: #2f3441;
  --t-primary: #00d2b4;
  --t-danger: #f87171;
  --t-danger-text: #f87171;
}
.demo-node.primary {
  --tone: var(--t-primary);
}
.demo-node.secondary {
  --tone: var(--t-secondary);
}
.demo-node.tertiary {
  --tone: var(--t-tertiary);
}
.demo-node.danger {
  --tone: var(--t-danger);
}
.demo-edges path {
  fill: none;
  stroke: var(--t-primary);
  stroke-width: 2;
}
.demo-edge-label rect {
  fill: var(--n-chip);
}
.demo-edge-label text {
  fill: var(--t-primary);
  font:
    600 10px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  text-anchor: middle;
}
.demo-node .card {
  fill: var(--n-surface);
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.12));
}
.demo-node .head {
  fill: var(--n-head);
}
.demo-node .foot {
  fill: var(--n-foot);
  transition: fill 0.2s;
}
.demo-node.busy .foot {
  fill: color-mix(in srgb, var(--t-tertiary) 15%, var(--n-foot));
}
.demo-node use {
  color: var(--tone);
  fill: currentColor;
}
.demo-node .t {
  fill: var(--n-text);
  font-size: 13px;
  font-weight: 600;
}
.demo-node .s {
  fill: var(--n-muted);
  font:
    10px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  text-transform: uppercase;
}
.demo-node.busy .s {
  fill: var(--t-tertiary);
  font-weight: 600;
}
.demo-node .dot {
  fill: var(--t-tertiary);
  visibility: hidden;
}
.demo-node.busy .dot {
  visibility: visible;
}
.demo-node.blocked .foot {
  fill: color-mix(in srgb, var(--t-danger) 15%, var(--n-foot));
}
.demo-node.blocked .s {
  fill: var(--t-danger-text);
}
.demo-node.blocked .dot {
  fill: var(--t-danger);
}
.demo-node .handle {
  fill: var(--t-primary);
  stroke: var(--bg);
  stroke-width: 2;
}
.demo-node.primary .in,
.demo-node.danger .out {
  display: none;
}
.demo-node .track {
  fill: var(--n-track);
}
.demo-node .demo-bar {
  fill: var(--tone);
}
.demo figure:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}
/* Speed control sits outside the scrolling figure, so it stays in the corner on phones. */
.demo-stage {
  position: relative;
}
.demo-speed {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
}
.demo-speed[hidden] {
  display: none;
}
.demo-speed button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.demo-speed button:hover:not(:disabled) {
  background: var(--line);
}
.demo-speed button:disabled {
  color: var(--muted);
  opacity: 0.5;
  cursor: default;
}
.demo-speed button:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}
.demo-speed output {
  min-width: 32px;
  text-align: center;
  font:
    600 0.8125rem ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  color: var(--muted);
}
#demo-tokens circle {
  fill: var(--t-primary);
  stroke: var(--n-surface);
  stroke-width: 1.5;
}

.end {
  text-align: center;
}
.end .actions {
  justify-content: center;
}
.end .lead {
  margin-inline: auto;
}
