/* Homepage: dark hero, workflow canvas, AI workflow explainers */

/* ---------- Header over dark hero ---------- */
.has-dark-hero .site-header:not(.is-scrolled):not(.is-open) { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.has-dark-hero .site-header:not(.is-scrolled):not(.is-open) .logo,
.has-dark-hero .site-header:not(.is-scrolled):not(.is-open) .primary-nav a { color: #f3f1f6; }
.has-dark-hero .site-header:not(.is-scrolled):not(.is-open) .primary-nav a:hover { background: rgba(255,255,255,.08); }
.has-dark-hero .site-header:not(.is-scrolled):not(.is-open) .nav-toggle { color: #fff; border-color: rgba(255,255,255,.25); }

/* ---------- Hero ---------- */
.home-hero {
  --gx: 70%; --gy: 20%;
  position: relative; overflow: hidden; isolation: isolate;
  margin-top: calc(-1 * var(--header-h));
  padding: calc(var(--header-h) + clamp(48px, 7vw, 88px)) 0 clamp(64px, 8vw, 104px);
  background: #0f0e13; color: #c8c4d2;
}
.home-hero::before { /* dotted canvas grid */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
}
.home-hero::after { /* cursor-follow glow */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px circle at var(--gx) var(--gy), rgba(215, 66, 87, .28), transparent 60%),
    radial-gradient(900px circle at 10% 110%, rgba(255, 107, 107, .12), transparent 60%);
  transition: background .2s;
}
.home-hero h1 { color: #fff; max-width: 17ch; margin-inline: auto; text-wrap: balance; }
.home-hero h1 em { font-style: normal; background: linear-gradient(100deg, #ff6b7d 0%, #ff9a8b 60%, #ffc2b0 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-hero .lead { color: #b9b5c6; margin: 1.4rem auto 2.2rem; text-align: center; }
.hero-center { text-align: center; }
.hero-center .btn-row { justify-content: center; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px;
  padding: 6px 14px 6px 6px; border-radius: 999px; font-size: .86rem; color: #e6e3ec; text-decoration: none;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); transition: background .2s, border-color .2s;
}
.hero-pill:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); }
.hero-pill b { font: .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; background: var(--accent); color: #fff; padding: 4px 9px; border-radius: 999px; }
.btn-ghost-dark { color: #fff; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.04); }
.btn-ghost-dark:hover { border-color: rgba(255,255,255,.6); }

/* ---------- Workflow card ---------- */
.wf { margin-top: clamp(48px, 6vw, 72px); }
.wf-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 18px; }
.wf-tab {
  font: 600 .9rem var(--font-body); color: #b9b5c6; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.03);
  transition: color .2s, background .2s, border-color .2s, transform .15s;
}
.wf-tab:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.wf-tab:active { transform: scale(.97); }
.wf-tab[aria-selected="true"] { color: #fff; background: rgba(215,66,87,.2); border-color: rgba(255,120,135,.55); }

.wf-card {
  border-radius: 22px; overflow: hidden;
  background: linear-gradient(180deg, #1a1820, #141219);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05);
}
.wf-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.wf-dots { display: flex; gap: 6px; }
.wf-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.14); }
.wf-name { font: 600 .92rem var(--font-head); color: #fff; margin: 0; }
.wf-name-wrap { display: flex; align-items: center; gap: 10px; }
.wf-hint { font-size: .8rem; color: #8e8a9b; margin-left: auto; }
.wf-switch { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: #b9b5c6; cursor: pointer; background: none; border: 0; padding: 4px; font-family: inherit; }
.wf-switch span { width: 32px; height: 18px; border-radius: 999px; background: #3a3744; position: relative; transition: background .25s; }
.wf-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .25s cubic-bezier(.3,1.5,.6,1); }
.wf-switch[aria-checked="true"] span { background: #2fa86e; }
.wf-switch[aria-checked="true"] span::after { transform: translateX(14px); }
.wf-run { padding: 9px 16px; font-size: .86rem; }
.wf-run[disabled] { opacity: .75; cursor: default; }
.wf-run[disabled] .wf-run-ico { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }

.wf-viewport { position: relative; overflow: hidden; }
.wf-canvas {
  position: absolute; left: 0; top: 0; width: 980px; height: 440px; transform-origin: 0 0;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 20px 20px;
  transition: opacity .18s;
}
.wf-canvas.is-swapping { opacity: 0; }
.wf-edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.wf-edge { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 2; transition: stroke .3s, opacity .3s; }
.wf-edge--sub { stroke-dasharray: 5 5; stroke-width: 1.5; }
.wf-edge.is-live { stroke: #ff7a8a; }
.wf-edge.is-dim { opacity: .25; }
.wf-edge-label { fill: #a29eaf; font: 12px var(--font-mono); text-anchor: middle; }
.wf-packet { fill: #fff; filter: drop-shadow(0 0 6px #ff6b7d) drop-shadow(0 0 2px #ff6b7d); }

.wf-node {
  position: absolute; left: 0; top: 0; width: 196px; min-height: 64px;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left;
  border-radius: 14px; background: #24212c; border: 1px solid rgba(255,255,255,.12); color: #fff;
  font: inherit; cursor: grab; user-select: none; -webkit-user-select: none;
  box-shadow: 0 10px 24px -14px rgba(0,0,0,.8);
  transition: border-color .25s, box-shadow .25s, opacity .3s, background .25s;
}
@media (pointer: fine) { .wf-node { touch-action: none; } }
.wf-node:hover { border-color: rgba(255,255,255,.32); }
.wf-node:focus-visible { outline: 2px solid #ff7a8a; outline-offset: 3px; }
.wf-node.is-dragging { cursor: grabbing; z-index: 5; box-shadow: 0 24px 40px -16px rgba(0,0,0,.9), 0 0 0 1px rgba(255,122,138,.5); }
.wf-node--wide { width: 220px; min-height: 72px; background: linear-gradient(135deg, #2c2030, #24212c); border-color: rgba(255,122,138,.35); }
.wf-node--sub { width: 144px; min-height: 0; padding: 8px 10px; border-radius: 999px; gap: 6px; background: #1d1b24; }
.wf-node--sub .wf-txt strong { font-size: .78rem; font-weight: 600; }
.wf-node--sub .wf-ico { width: 20px; height: 20px; border-radius: 50%; }
.wf-node--sub .wf-ico svg { width: 12px; height: 12px; }
.wf-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #fff; }
.wf-ico svg { width: 18px; height: 18px; }
.wf-node--trigger .wf-ico { background: #3b2a12; color: #ffb547; }
.wf-node--agent .wf-ico { background: linear-gradient(135deg, #d74257, #ff7a6b); color: #fff; }
.wf-node--router .wf-ico { background: #16303a; color: #5ccfe6; }
.wf-node--action .wf-ico { background: #153325; color: #4fd18b; }
.wf-node--human .wf-ico { background: #2a2342; color: #a993ff; }
.wf-txt { display: grid; line-height: 1.25; min-width: 0; }
.wf-txt strong { font-size: .92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-txt small { font-size: .78rem; color: #8e8a9b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-badge { position: absolute; right: 8px; top: -9px; font: 11px var(--font-mono); padding: 2px 7px; border-radius: 999px; background: #2fa86e; color: #fff; opacity: 0; transform: translateY(4px) scale(.9); transition: opacity .25s, transform .25s cubic-bezier(.3,1.6,.6,1); }
.wf-badge:empty { display: none; }
.wf-node.is-done .wf-badge { opacity: 1; transform: none; }
.wf-node.is-running { border-color: #ff7a8a; box-shadow: 0 0 0 4px rgba(255,122,138,.15), 0 10px 24px -14px rgba(0,0,0,.8); }
.wf-node.is-running .wf-ico { animation: breathe .9s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.88); } }
.wf-node.is-done { border-color: rgba(79,209,139,.55); }
.wf-node.is-skipped { opacity: .35; }

.wf-tip {
  position: absolute; width: 240px; z-index: 10; pointer-events: none;
  padding: 10px 12px; border-radius: 10px; font-size: .78rem; line-height: 1.45; color: #1a1820; background: #fff;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(calc(-100% + 6px)); transition: opacity .15s, transform .15s;
}
.wf-tip.is-on { opacity: 1; transform: translateY(-100%); }
.wf-tip.is-below { transform: translateY(-6px); }
.wf-tip.is-below.is-on { transform: none; }

.wf-foot { display: flex; align-items: flex-start; gap: 16px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.18); min-height: 54px; }
.wf-foot-label { font: .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: #8e8a9b; padding-top: 3px; flex: none; }
.wf-log { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font: .82rem/1.5 var(--font-mono); color: #d8d5e0; }
.wf-log li { animation: logIn .3s ease both; }
.wf-log .ok { color: #4fd18b; }
.wf-log em { font-style: normal; color: #8e8a9b; margin-left: 4px; }
.wf-log .muted { color: #8e8a9b; }
@keyframes logIn { from { opacity: 0; transform: translateY(4px); } }
@media (max-width: 700px) {
  .wf-hint, .wf-switch { display: none; }
  .wf-foot { flex-direction: column; gap: 6px; }
  .wf-log { flex-direction: column; }
}

/* ---------- Integrations marquee ---------- */
.marquee-wrap { border-bottom: 1px solid var(--line); background: var(--surface); padding: 26px 0; }
.marquee-title { text-align: center; font-size: .86rem; color: var(--muted); margin-bottom: 16px; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 12px; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-weight: 600; font-size: .92rem; color: var(--ink-2); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); white-space: nowrap; transition: color .2s, border-color .2s; }
.marquee-track span:hover { color: var(--accent); border-color: rgba(215,66,87,.4); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Anatomy (interactive explainer) ---------- */
.anatomy { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.anatomy-list { display: grid; gap: 6px; }
.anatomy-btn {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; text-align: left; cursor: pointer;
  padding: 14px 16px; border-radius: 14px; border: 1px solid transparent; background: none; font: inherit; color: var(--ink-2);
  transition: background .2s, border-color .2s, color .2s;
}
.anatomy-btn:hover { background: var(--bg-alt); }
.anatomy-btn[aria-selected="true"] { background: #fff; border-color: var(--line-strong); box-shadow: var(--shadow); color: var(--ink); }
.anatomy-btn .n { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font: 700 .8rem var(--font-mono); background: var(--bg-alt); color: var(--ink); transition: background .2s, color .2s; }
.anatomy-btn[aria-selected="true"] .n { background: var(--accent); color: #fff; }
.anatomy-btn strong { display: block; font: 600 1.02rem var(--font-head); color: var(--ink); letter-spacing: -.01em; }
.anatomy-btn small { color: var(--muted); font-size: .86rem; }
.anatomy-btn svg { color: var(--muted); transition: transform .2s, color .2s; }
.anatomy-btn[aria-selected="true"] svg { color: var(--accent); transform: translateX(3px); }
.anatomy-panel { position: sticky; top: calc(var(--header-h) + 24px); background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: clamp(24px, 3.5vw, 40px); box-shadow: var(--shadow); min-height: 380px; }
.anatomy-panel[hidden] { display: none; }
.anatomy-panel h3 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
.anatomy-panel p { color: var(--muted); }
.anatomy-panel .chips { margin-top: 18px; }
.anatomy-panel .card-kicker { margin-bottom: 10px; }
.anatomy-panel.is-in { animation: panelIn .35s ease both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } }
.anatomy-example { margin-top: 22px; padding: 16px 18px; border-radius: 14px; background: #15141a; color: #d8d5e0; font: .82rem/1.6 var(--font-mono); overflow-x: auto; }
.anatomy-example b { color: #ff9aa6; font-weight: 400; }
.anatomy-example i { color: #4fd18b; font-style: normal; }
@media (max-width: 860px) { .anatomy { grid-template-columns: 1fr; } .anatomy-panel { position: static; min-height: 0; } }

/* ---------- Rules vs AI ---------- */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: stretch; }
.versus .card { padding: 32px; }
.versus ul { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.versus li { padding-left: 26px; position: relative; color: var(--ink-2); font-size: .97rem; }
.versus li::before { content: ""; position: absolute; left: 0; top: .55em; width: 12px; height: 2px; background: var(--accent); }
.versus-plus { display: grid; place-items: center; font: 600 1.6rem var(--font-head); color: var(--accent); }
.versus-note { text-align: center; margin-top: 28px; font: 600 1.15rem var(--font-head); color: var(--ink); letter-spacing: -.01em; }
@media (max-width: 860px) { .versus { grid-template-columns: 1fr; } .versus-plus { padding: 4px 0; } }

/* ---------- Why n8n ---------- */
.n8n-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.n8n-points { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.n8n-points .card { padding: 22px; }
.n8n-points h3 { font-size: 1.02rem; }
.n8n-points p { font-size: .92rem; }
@media (max-width: 960px) { .n8n-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .n8n-points { grid-template-columns: 1fr; } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,.1); border-radius: 22px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); position: relative; }
.stat { background: var(--dark); padding: 32px 28px; }
.stat b { display: block; white-space: nowrap; font: 600 clamp(1.6rem, 2.4vw, 2.1rem)/1 var(--font-head); color: #fff; letter-spacing: -.04em; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.stat > span { display: block; color: #fff; font-weight: 600; margin-bottom: 4px; }
.stat small { color: #8f8b9b; font-size: .86rem; }
@media (max-width: 860px) { .stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }

/* ---------- Process line ---------- */
.steps--progress { border-top-color: var(--line); position: relative; }
.steps--progress::after { content: ""; position: absolute; top: -1px; left: 0; height: 2px; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(0); transform-origin: left; transition: transform 1.6s cubic-bezier(.2,.7,.2,1); }
.steps--progress.is-in::after { transform: scaleX(1); }
.steps--progress .step::before { display: none; }
.wf-scrolls .wf-viewport { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.wf-scroll-hint { display: none; font-size: .78rem; color: #8e8a9b; padding: 8px 16px 0; }
.wf-scrolls .wf-scroll-hint { display: block; }
