/* Landing-page demo. Status colors retain Forge's existing meaning. */
:root { --text-tertiary: #a1a5b7; }

#try-forge { scroll-margin-top: 6rem; }
.forge-demo { position: relative; z-index: 1; padding: 2rem 0 5rem; }
.forge-demo .section-heading { max-width: 760px; margin-bottom: .75rem; }
.demo-intro { max-width: 660px; color: #b8bccb; margin-bottom: 1.75rem; }
.demo-panel { border: 1px solid #41475d; border-radius: 14px; overflow: hidden; background: #0f1117; }
.demo-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 1rem; padding: 1.5rem; border-bottom: 1px solid #353b4e; background: #1a1d27; }
.demo-field { margin-right: auto; }
.demo-field label { display: block; font-size: .875rem; font-weight: 600; color: #e8e9ed; margin-bottom: .45rem; }
.demo-field select { font: inherit; color: #e8e9ed; color-scheme: dark; background: #0f1117; border: 1px solid #72788b; border-radius: 6px; min-height: 44px; padding: .45rem 2.5rem .45rem .75rem; cursor: pointer; }
.demo-action { font: inherit; font-size: .875rem; font-weight: 600; min-height: 44px; border: 1px solid #707789; border-radius: 6px; padding: .65rem 1rem; color: #e8e9ed; background: transparent; cursor: pointer; }
.demo-action-primary { background: #5457d6; border-color: #8e91ff; color: #fff; }
.demo-action:hover:not(:disabled) { border-color: #bec3d9; background: #292f43; }
.demo-action-primary:hover:not(:disabled) { background: #6265e6; }
.demo-action:disabled { opacity: .55; cursor: default; }
.demo-panel :focus-visible { outline: 3px solid #b7baff; outline-offset: 4px; }
.demo-graph { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 38px; padding: 28px; background-image: radial-gradient(#44495b 1px, transparent 1px); background-size: 20px 20px; }
.demo-edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.demo-edge { fill: none; stroke: #717991; stroke-width: 2; }
.demo-edge[data-state="stale"] { stroke: #eab308; }
.demo-edge[data-state="running"] { stroke: #60a5fa; }
.demo-node { position: relative; min-width: 0; border: 1px solid #586177; border-top: 3px solid #4ade80; border-radius: 8px; padding: 1rem; background: #1a1d27; }
.demo-node h3 { font-size: 1rem; font-weight: 650; line-height: 1.4; margin: .35rem 0; }
.demo-node-type { color: #b8bccb; font-size: .6875rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.demo-node-detail { display: block; color: #b8bccb; font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: .75rem; overflow-wrap: anywhere; }
.demo-node-state { display: flex; align-items: center; gap: .4rem; margin-top: .85rem; font-size: .8125rem; font-weight: 600; color: #86efac; }
.demo-node-state::before { content: ''; width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.demo-node[data-state="stale"] { border-color: #9d7d28; border-top-color: #eab308; }
.demo-node[data-state="stale"] .demo-node-state { color: #facc15; }
.demo-node[data-state="running"] { border-color: #549bea; border-top-color: #60a5fa; }
.demo-node[data-state="running"] .demo-node-state { color: #93c5fd; }
.demo-node[data-state="complete"] .demo-node-state { color: #86efac; }
.demo-node-preview { grid-column: 1; }
.demo-branch-note { position: relative; grid-column: 2 / 4; align-self: center; color: #b8bccb; font-size: .875rem; max-width: 370px; padding: .65rem 1rem; background: #0f1117; border-left: 2px solid #717991; }
.demo-branch-note strong { display: block; color: #e8e9ed; margin-bottom: .25rem; font-weight: 600; }
.demo-readout { display: flex; gap: 1.2rem; align-items: start; padding: 1.25rem 1.5rem; border-top: 1px solid #353b4e; background: #1a1d27; }
.demo-count { white-space: nowrap; font-weight: 650; color: #e8e9ed; }
.demo-count span { display: block; font-weight: 400; font-size: .75rem; color: #b8bccb; }
.demo-message { font-size: .875rem; color: #cbd0df; }
.demo-footnote { margin-top: .8rem; color: #a1a5b7; font-size: .8125rem; }
.demo-noscript { margin-top: 1rem; color: #cbd0df; }
.status-dot.running svg circle { transform-origin: 7px 7px; animation: forge-status-spin 1s linear infinite; }
@keyframes forge-status-spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; margin-left: auto; }
  .demo-graph { gap: 24px 22px; padding: 22px; }
  .demo-node { padding: .75rem; }
}
@media (max-width: 620px) {
  .demo-toolbar { padding: 1.15rem; gap: .8rem; }
  .demo-field { width: 100%; }
  .demo-field select { width: 100%; }
  .demo-action { flex: 1; }
  .demo-graph { grid-template-columns: 1fr; padding: 20px; gap: 22px; }
  .demo-edges { display: none; }
  .demo-node { padding: 1rem; }
  .demo-node-cluster::before, .demo-node-heatmap::before { content: '\2193'; position: absolute; top: -27px; left: 50%; color: #b8bccb; font-size: 1.1rem; }
  .demo-node-preview { border-left: 3px solid #717991; }
  .demo-node-preview::before { content: 'Input: Load CSV'; display: block; color: #b8bccb; font-size: .75rem; margin-bottom: .7rem; }
  .demo-branch-note { grid-column: 1; max-width: none; padding-left: .8rem; }
  .demo-readout { flex-direction: column; gap: .6rem; padding: 1.15rem; }
  .demo-count span { display: inline; margin-left: .35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .status-dot.running svg circle { animation: none; }
  .canvas-mock .conn-line { stroke-dashoffset: 0; }
  .canvas-mock .handle-dot { opacity: .5; }
}
