/* Workflow tools landing page — no framework, no build step. */

:root {
  color-scheme: light;
  --bg: #fafaf8;
  --bg-2: #f1f1ed;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #5d5d58;
  --line: #dcdcd6;
  --accent: #b5461e;          /* burnt orange: warm, not n8n's */
  --accent-ink: #ffffff;
  --code-bg: #14161c;
  --code-fg: #e6e6e3;
  --info: #2a6f9e;
  --warn: #b8760c;
  --error: #b83a2a;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131417;
    --bg-2: #1a1b20;
    --surface: #1f2026;
    --text: #ecebe7;
    --muted: #a3a29c;
    --line: #2f3037;
    --accent: #e8794a;
    --accent-ink: #131417;
    --code-bg: #0d0e12;
    --code-fg: #e6e6e3;
    --info: #6fb3e0;
    --warn: #e2a93b;
    --error: #ef7b6c;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131417;
  --bg-2: #1a1b20;
  --surface: #1f2026;
  --text: #ecebe7;
  --muted: #a3a29c;
  --line: #2f3037;
  --accent: #e8794a;
  --accent-ink: #131417;
  --code-bg: #0d0e12;
  --code-fg: #e6e6e3;
  --info: #6fb3e0;
  --warn: #e2a93b;
  --error: #ef7b6c;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--mono); font-size: .92em; }
p code { background: var(--bg-2); padding: .05em .35em; border-radius: 4px; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); font-weight: 700; max-width: 22ch; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 700; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.wrap.narrow { max-width: 760px; }
.row { display: flex; align-items: center; gap: 16px; }

.skip {
  position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink);
  padding: 8px 12px; border-radius: 6px; z-index: 100;
}
.skip:focus { left: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .row { min-height: 56px; }
.brand { text-decoration: none; display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.brand-mark { display: block; }
.brand-mark rect { fill: var(--accent); }
.brand-mark circle { fill: var(--accent-ink); }
.brand-mark path { stroke: var(--accent-ink); }
.brand-text { font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; white-space: nowrap; }
.site-nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.site-nav a { color: var(--text); text-decoration: none; font-size: .95rem; }
.site-nav a:hover { color: var(--accent); }
@media (max-width: 640px) { .site-nav { display: none; } }

.theme-toggle {
  margin-left: auto; display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; cursor: pointer;
}
.site-nav + .theme-toggle { margin-left: 0; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* Sections */
section { padding-block: clamp(48px, 7vw, 96px); }
section + section { border-top: 1px solid var(--line); }
.section-lede { color: var(--muted); max-width: 64ch; margin: 0 0 32px; }

.eyebrow { color: var(--accent); font-weight: 600; font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 12px; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 60ch; margin: 0 0 24px; }
.hero-note { color: var(--muted); font-size: .95rem; margin: 14px 0 0; }

.btn {
  display: inline-block; padding: 11px 18px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: .98rem;
  cursor: pointer; font-family: inherit; line-height: 1.2;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { color: var(--accent-ink); filter: brightness(1.08); }
.btn-small { padding: 9px 14px; font-size: .92rem; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero visual with overlaid findings */
.hero-visual { margin: 40px 0 0; }
.hero-canvas {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: #f5f5f5; aspect-ratio: 1600 / 746;
}
.hero-canvas img { width: 100%; height: 100%; object-fit: cover; }
.finding {
  position: absolute; left: var(--x); top: var(--y); transform: translate(0, -50%);
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: clamp(.55rem, 1.05vw, .8rem); line-height: 1;
  background: rgba(20, 22, 28, .92); color: #e6e6e3; padding: 6px 9px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12); box-shadow: 0 2px 8px rgba(0,0,0,.25);
  white-space: nowrap; max-width: calc(100% - var(--x) - 8px); overflow: hidden; text-overflow: ellipsis;
}
.finding::before {
  content: ""; position: absolute; left: -7px; top: 50%; width: 10px; height: 10px; transform: translateY(-50%);
  border-radius: 50%; background: currentColor; opacity: 0;
}
/* Positions live here, not in style attributes: the CSP (style-src 'self') blocks inline styles. */
.finding-info { --x: 12%; --y: 19%; }
.finding-warn { --x: 56%; --y: 87%; }
.finding-sev { font-weight: 700; text-transform: lowercase; }
.finding-info .finding-sev { color: #8ec5ea; }
.finding-warn .finding-sev { color: #f0bb4c; }
figcaption { color: var(--muted); font-size: .9rem; margin-top: 10px; }

/* Problem */
.problem p { font-size: 1.08rem; margin: 0; }

/* Tool cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 800px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); min-width: 0;
}
.card h3 { margin: 0 0 4px; }
.tagline { margin: 0; color: var(--muted); }
.card-shot { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--code-bg); }
.card-shot img { width: 100%; }
.facts { margin: 0; padding-left: 18px; color: var(--text); font-size: .95rem; }
.facts li + li { margin-top: 4px; }
.card-note { margin: 0; color: var(--muted); font-size: .88rem; }
.cmd {
  margin: 0; background: var(--code-bg); color: var(--code-fg); border-radius: 8px; padding: 12px 14px;
  font-family: var(--mono); font-size: .8rem; line-height: 1.5; overflow-x: auto; white-space: pre;
}
.card .btn-small { align-self: flex-start; margin-top: auto; }

/* Diagram */
.diagram-wrap { margin: 0; }
.diagram { width: 100%; height: auto; max-width: 860px; display: block; margin: 0 auto; color: var(--muted); font-family: var(--font); }
.diagram .node rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.diagram .node-center rect { stroke: var(--accent); stroke-width: 2; }
.diagram .node-title { fill: var(--text); font-size: 17px; font-weight: 700; }
.diagram .node-sub { fill: var(--muted); font-size: 12px; }
.diagram .labels rect { fill: var(--bg-2); stroke: var(--line); stroke-width: 1; }
.diagram .labels text { fill: var(--text); font-size: 12px; font-family: var(--mono); }
.diagram .edges { color: var(--muted); }

/* Try it */
.try-disclaimer {
  border-left: 3px solid var(--accent); padding: 6px 12px; margin: -16px 0 24px; color: var(--muted); font-size: .95rem; max-width: 70ch;
}
/* The canvas is the point of this section, so it comes first and takes the full width. */
.try-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.try-output { order: -1; }
.try-input label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
textarea#wf-json {
  width: 100%; min-height: 160px; resize: vertical; font-family: var(--mono); font-size: .82rem; line-height: 1.45;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
textarea#wf-json:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.try-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.try-status { min-height: 1.4em; margin: 10px 0 0; font-size: .92rem; color: var(--muted); }
.try-status.is-error { color: var(--error); }
.try-status.is-ok { color: var(--text); }
.try-output {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px;
  min-height: 420px; display: flex; align-items: center; justify-content: center;
}
.wf-empty { color: var(--muted); font-size: 1rem; margin: 0; }
/* The element draws a light canvas in both themes; its monochrome icons use currentColor, so pin it. */
workflow-render#wf-canvas { color: #1f2328; display: block; width: 100%; height: 560px; border-radius: 6px; overflow: hidden; }
workflow-render#wf-canvas[hidden] { display: none; }
@media (max-width: 860px) { workflow-render#wf-canvas { height: 420px; } }

/* Works with */
.chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .chips { grid-template-columns: minmax(0, 1fr); } }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.chips strong { font-size: 1.02rem; }
.chips span { color: var(--muted); font-size: .9rem; }

/* Status */
.status p { margin: 0 0 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding-block: 36px; }
.origin { font-weight: 600; margin: 0 0 12px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.footer-links a { color: var(--text); }
.fine { color: var(--muted); font-size: .88rem; margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

body { overflow-x: hidden; }
.try-input, .try-output { min-width: 0; }
