/* Nodes / Node Flow page */

.nodes-page-hero {
  padding: calc(var(--section-pad) - 20px) 0 32px;
}

.nodes-page-hero .section-head {
  max-width: 720px;
}

.nodes-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.nodes-toc a {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nodes-toc a:hover {
  color: var(--text);
  border-color: var(--accent);
}

.nodes-section {
  padding: var(--section-pad) 0;
  scroll-margin-top: 88px;
}

.nodes-section:nth-child(even) {
  background: color-mix(in srgb, var(--card-bg) 50%, var(--bg));
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.nodes-section-head {
  max-width: 640px;
  margin-bottom: 40px;
}

.nodes-section-head h2 {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.nodes-section-head p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.nodes-catalog {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.node-type-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.node-type-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-color));
  transform: translateY(-2px);
}

.node-type-card.soon {
  opacity: 0.65;
}

.node-type-card h3 {
  font-size: 17px;
  font-weight: 700;
}

.node-type-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
}

.node-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.node-type-tag .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-green { background: #4ade80; }
.dot-blue { background: #60a5fa; }
.dot-teal { background: #2dd4bf; }
.dot-red { background: #f87171; }
.dot-mixed { background: linear-gradient(135deg, #4ade80 50%, #60a5fa 50%); }

.handles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.handle-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
}

.handle-card .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 2px solid color-mix(in srgb, var(--bg) 80%, transparent);
}

.handle-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.handle-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.handles-note {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  max-width: 720px;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.example-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.example-card h3 {
  font-size: 20px;
  font-weight: 700;
}

.example-card > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.example-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--border-color));
  background: color-mix(in srgb, var(--accent) 4%, var(--card-bg));
}

.example-node {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg);
  white-space: nowrap;
}

.example-node.highlight {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
}

.example-arrow {
  color: var(--muted);
  font-size: 14px;
  user-select: none;
}

.example-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.example-steps li {
  font-size: 13px;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
}

.example-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.nodes-cta {
  text-align: center;
  padding: calc(var(--section-pad) - 20px) 0 var(--section-pad);
}

.nodes-cta h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  margin-bottom: 12px;
}

.nodes-cta p {
  color: var(--muted);
  margin-bottom: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.nodes-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

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

  .handles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nodes-catalog,
  .examples-grid,
  .handles-grid {
    grid-template-columns: 1fr;
  }
}

html[data-theme="light"] .nodes-toc a,
:root[data-theme="light"] .nodes-toc a {
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

html[data-theme="light"] .node-type-card,
html[data-theme="light"] .handle-card,
html[data-theme="light"] .example-card,
:root[data-theme="light"] .node-type-card,
:root[data-theme="light"] .handle-card,
:root[data-theme="light"] .example-card {
  box-shadow: var(--shadow-sm);
}

html[data-theme="light"] .nodes-section:nth-child(even),
:root[data-theme="light"] .nodes-section:nth-child(even) {
  background: var(--bg-muted);
}

html[data-theme="light"] .nodes-section-head p,
html[data-theme="light"] .node-type-card p,
html[data-theme="light"] .node-type-tag,
html[data-theme="light"] .handle-card p,
html[data-theme="light"] .handles-note,
html[data-theme="light"] .example-card > p,
html[data-theme="light"] .example-steps li,
html[data-theme="light"] .example-arrow,
html[data-theme="light"] .nodes-cta p,
:root[data-theme="light"] .nodes-section-head p,
:root[data-theme="light"] .node-type-card p,
:root[data-theme="light"] .node-type-tag,
:root[data-theme="light"] .handle-card p,
:root[data-theme="light"] .handles-note,
:root[data-theme="light"] .example-card > p,
:root[data-theme="light"] .example-steps li,
:root[data-theme="light"] .example-arrow,
:root[data-theme="light"] .nodes-cta p {
  color: #555555;
}

html[data-theme="light"] .example-node.highlight,
:root[data-theme="light"] .example-node.highlight {
  color: var(--accent-text);
  border-color: #b8e600;
  background: rgba(214, 255, 63, 0.35);
}

html[data-theme="light"] .example-steps li::before,
:root[data-theme="light"] .example-steps li::before {
  background: #b8e600;
}
