/* Поток — сайт-кейс внедрения автоматизации на n8n */
:root {
  --bg: #f3f5fb;
  --paper: #ffffff;
  --ink: #0d1330;
  --ink-2: #4a5170;
  --muted: #858ba3;
  --line: #e2e6f0;
  --line-2: #cfd5e3;
  --accent: #2b5cff;
  --accent-2: #1e46d6;
  --accent-soft: #e8eeff;
  --dark: #0b1030;
  --dark-2: #151b44;
  --hot: #ff6a3d;
  --warm: #e9a100;
  --cold: #8d95ab;
  --good: #11935f;
  --r: 20px;
  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 24px; border-radius: 14px; border: 1px solid transparent; font-weight: 500; font-size: 16px; text-decoration: none; white-space: nowrap; transition: background .2s, transform .15s, border-color .2s; }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 10px 28px rgba(43, 92, 255, .28); }
.btn-accent:hover { background: var(--accent-2); }
.btn-ghost { background: var(--paper); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-sm { height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }

/* ---------- Шапка ---------- */
.header { position: sticky; top: 0; z-index: 50; background: rgba(243, 245, 251, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.header.scrolled { border-color: var(--line); }
.header .wrap { display: flex; align-items: center; gap: 30px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 22px; text-decoration: none; letter-spacing: -.02em; }
.logo svg { width: 32px; height: 32px; }
.nav { display: flex; gap: 24px; }
.nav a { text-decoration: none; font-size: 15px; color: var(--ink-2); }
.nav a:hover { color: var(--accent); }
.header-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.tg-link { font-size: 15px; text-decoration: none; color: var(--ink-2); }
@media (max-width: 1000px) { .nav, .tg-link { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: 60px 0 80px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--accent); background: var(--accent-soft); padding: 6px 12px; border-radius: 99px; }
h1 { font-size: clamp(36px, 4.6vw, 58px); line-height: 1.04; letter-spacing: -.035em; margin: 18px 0 18px; font-weight: 600; }
h1 span { color: var(--accent); }
.lead { font-size: 19px; color: var(--ink-2); margin: 0 0 28px; max-width: 580px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.metrics { display: grid; grid-template-columns: repeat(3, auto); gap: 32px; margin-top: 36px; justify-content: start; }
.metrics b { display: block; font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.metrics span { font-size: 14px; color: var(--muted); }
@media (max-width: 980px) { .hero .wrap { grid-template-columns: 1fr; } .metrics { grid-template-columns: repeat(3, 1fr); gap: 16px; } }

.flow-card { background: var(--dark); border-radius: 28px; padding: 28px; color: #fff; position: relative; overflow: hidden; box-shadow: 0 30px 70px rgba(11, 16, 48, .25); }
.flow-card::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 18px 18px; }
.flow-head { position: relative; display: flex; justify-content: space-between; font-size: 13px; color: #9aa3c7; margin-bottom: 18px; }
.flow-head b { color: #fff; font-weight: 500; }
.mini-flow { position: relative; display: grid; gap: 14px; }
.mini-step { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; background: var(--dark-2); border: 1px solid #262e62; border-radius: 16px; padding: 12px 14px; opacity: .45; transition: opacity .35s, border-color .35s; }
.mini-step.on { opacity: 1; border-color: #3f57d9; }
.mini-step .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.mini-step b { display: block; font-weight: 500; }
.mini-step small { color: #9aa3c7; font-size: 13px; }
.mini-step .t { font: 12px var(--mono); color: #9aa3c7; }
.mini-step.on .t { color: #7cf0b4; }

/* ---------- Секции ---------- */
.section { padding: 96px 0; }
.section.white { background: var(--paper); }
.section.dark { background: var(--dark); color: #fff; }
.head { max-width: 780px; margin-bottom: 44px; }
.eyebrow { display: inline-block; font-size: 14px; font-weight: 500; color: var(--accent); margin-bottom: 12px; }
.dark .eyebrow { color: #8ea6ff; }
h2 { font-size: clamp(30px, 3.8vw, 46px); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 600; }
.head p { margin: 0; color: var(--ink-2); font-size: 18px; }
.dark .head p { color: #b3bad8; }
@media (max-width: 640px) { .section { padding: 64px 0; } }

.pains { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pain { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.pain b { display: block; font-size: 34px; font-weight: 600; color: var(--hot); letter-spacing: -.02em; }
.pain h3 { margin: 6px 0 8px; font-size: 18px; font-weight: 500; }
.pain p { margin: 0; color: var(--ink-2); font-size: 15px; }
@media (max-width: 980px) { .pains { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .pains { grid-template-columns: 1fr; } }

/* ---------- Демо: холст ---------- */
.demo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.demo-form { display: grid; grid-template-columns: 280px minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; }
.demo-send { display: flex; flex-direction: column; }
.demo-send textarea.input { min-height: 132px; }
@media (max-width: 960px) { .demo-form { grid-template-columns: 1fr 1fr; } .demo-form > div:first-child { grid-column: 1 / -1; } .demo-form .samples { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .demo-form { grid-template-columns: 1fr; } .demo-form .samples { grid-template-columns: 1fr; } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.panel h3 { margin: 0 0 12px; font-size: 17px; font-weight: 500; }
.samples { display: grid; gap: 8px; margin-bottom: 14px; }
.sample { text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.sample b { display: block; font-weight: 500; font-size: 15px; }
.sample span { color: var(--muted); }
.sample.active { border-color: var(--accent); background: var(--accent-soft); }
.field { display: grid; gap: 4px; margin-bottom: 10px; }
.field > span { font-size: 12px; color: var(--muted); }
.input { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 9px 11px; outline: none; font-size: 15px; }
.input:focus { border-color: var(--accent); }
textarea.input { min-height: 84px; resize: vertical; line-height: 1.45; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin: 6px 0 12px; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.speed { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 10px; }
.speed button { border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 3px 8px; font-size: 12px; }
.speed button.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.canvas-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.canvas-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.canvas-top b { font-weight: 500; }
.canvas-top .status { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.canvas-top .status i { width: 8px; height: 8px; border-radius: 50%; background: var(--cold); }
.canvas-top .status.running i { background: var(--warm); animation: blink 1s infinite; }
.canvas-top .status.ok i { background: var(--good); }
@keyframes blink { 50% { opacity: .3; } }
.canvas-scroll { overflow-x: auto; background: #f7f8fc; background-image: radial-gradient(#d7dcea 1px, transparent 1px); background-size: 20px 20px; }
.canvas-size { position: relative; margin: 0 auto; }
.canvas { position: absolute; left: 0; top: 0; width: 1230px; height: 430px; transform-origin: 0 0; }
.canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.edge { fill: none; stroke: #b7bfd3; stroke-width: 2; }
.edge.active { stroke: var(--accent); stroke-dasharray: 6 5; animation: flow .6s linear infinite; }
.edge.done { stroke: var(--accent); }
@keyframes flow { to { stroke-dashoffset: -22; } }
.edge-label { font: 11px var(--font); fill: var(--ink-2); stroke: #f7f8fc; stroke-width: 5px; paint-order: stroke; stroke-linejoin: round; }
.node { position: absolute; width: 148px; height: 62px; overflow: visible; background: var(--paper); border: 1.5px solid var(--line-2); border-radius: 14px; display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; padding: 0 10px; cursor: pointer; text-align: left; transition: border-color .2s, box-shadow .2s, opacity .2s; }
.node:hover { border-color: var(--ink-2); }
.node .nico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 11px var(--font); color: #fff; }
.node > span:nth-child(2) { min-width: 0; }
.node b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; font-weight: 500; line-height: 1.2; }
.node small { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.2; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node.run { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(43, 92, 255, .18); }
.node.done { border-color: var(--good); }
.node.skip { opacity: .4; }
.node.selected { box-shadow: 0 0 0 3px var(--ink); }
.node .badge { position: absolute; top: -9px; right: -9px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--good); color: #fff; font-size: 11px; font-weight: 600; display: none; place-items: center; }
.node.done .badge { display: grid; }
.node.fail .badge { display: grid; background: var(--hot); }

.outputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
@media (max-width: 760px) { .outputs { grid-template-columns: 1fr; } }
.out { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-height: 170px; }
.out h4 { margin: 0 0 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.out .empty { color: var(--muted); font-size: 14px; }
.tg { background: #dde7f0; border-radius: 14px; padding: 12px; }
.tg .bubble { background: #fff; border-radius: 12px 12px 12px 4px; padding: 9px 11px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; max-width: 100%; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.tg .bubble + .bubble { margin-top: 8px; }
.tg .from { font-size: 12px; font-weight: 600; color: #2a7ab8; margin-bottom: 2px; }
.sheet { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sheet th, .sheet td { border: 1px solid #dfe3ea; padding: 5px 7px; text-align: left; white-space: nowrap; }
.sheet th { background: #f1f3f4; font-weight: 500; color: #555; }
.sheet tr.new td { background: #e9f7ef; animation: flash 1.2s ease; }
@keyframes flash { from { background: #b8ecd0; } }
.sheet-wrap { overflow-x: auto; }
.crm { border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 14px; }
.crm .stage { display: inline-block; font-size: 12px; background: #e3f6fd; color: #0a7aa8; border-radius: 6px; padding: 2px 8px; margin-bottom: 6px; }
.pre { background: #0f1433; color: #cfd6ff; border-radius: 12px; padding: 12px; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; margin: 0; max-height: 260px; overflow: auto; }
.tier { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 99px; }
.tier.hot { background: #ffe9e1; color: #c33f15; }
.tier.warm { background: #fff3d1; color: #8a5d00; }
.tier.cold { background: #eceef4; color: #5a6178; }
.tier.spam { background: #eceef4; color: #5a6178; text-decoration: line-through; }
.node-detail { margin-top: 14px; }
.node-detail .nd-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.node-detail code { font: 12px var(--mono); background: var(--bg); padding: 2px 6px; border-radius: 6px; color: var(--ink-2); }
.io { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
@media (max-width: 760px) { .io { grid-template-columns: 1fr; } }
.io h5 { margin: 0 0 6px; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Workflow-файлы ---------- */
.wf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.wf { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.wf h3 { margin: 0; font-size: 19px; font-weight: 500; }
.wf p { margin: 0; color: var(--ink-2); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; padding: 3px 9px; border-radius: 8px; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.wf .row { display: flex; gap: 10px; align-items: center; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.wf .file { font: 13px var(--mono); color: var(--muted); }
.wf.wf-wide { grid-column: 1 / -1; }
@media (max-width: 860px) { .wf-grid { grid-template-columns: 1fr; } }

/* ---------- До / после ---------- */
.compare { width: 100%; border-collapse: collapse; background: var(--dark-2); border-radius: var(--r); overflow: hidden; }
.compare th, .compare td { padding: 16px 20px; text-align: left; border-bottom: 1px solid #262e62; }
.compare th { color: #9aa3c7; font-weight: 400; font-size: 14px; }
.compare td:nth-child(2) { color: #ff9b7a; }
.compare td:nth-child(3) { color: #7cf0b4; font-weight: 500; }
.compare tr:last-child td { border-bottom: 0; }
.compare-wrap { overflow-x: auto; border-radius: var(--r); }
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px; }
.why div { background: var(--dark-2); border: 1px solid #262e62; border-radius: var(--r); padding: 22px; }
.why h3 { margin: 0 0 6px; font-size: 18px; font-weight: 500; }
.why p { margin: 0; color: #b3bad8; font-size: 15px; }
@media (max-width: 860px) { .why { grid-template-columns: 1fr; } }

/* ---------- Пакеты ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 28px; display: flex; flex-direction: column; }
.plan.best { border: 2px solid var(--accent); box-shadow: 0 24px 60px rgba(43, 92, 255, .12); }
.plan .lbl { align-self: flex-start; font-size: 12px; font-weight: 500; color: #fff; background: var(--accent); padding: 4px 10px; border-radius: 99px; margin-bottom: 10px; }
.plan h3 { margin: 0; font-size: 22px; font-weight: 500; }
.plan .for { color: var(--muted); font-size: 15px; margin: 4px 0 18px; min-height: 46px; }
.plan .price { font-size: 38px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.plan .price small { font-size: 15px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.plan .term { font-size: 14px; color: var(--muted); margin: 8px 0 18px; }
.plan ul { list-style: none; margin: 0 0 24px; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; gap: 9px; font-size: 15px; }
.plan li { display: flex; gap: 8px; }
.plan li .i { color: var(--accent); width: 18px; height: 18px; margin-top: 3px; }
.plan .btn { margin-top: auto; }
.support { margin-top: 16px; background: var(--paper); border: 1px dashed var(--line-2); border-radius: 18px; padding: 18px 22px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
@media (max-width: 960px) { .plans { grid-template-columns: 1fr; } .plan .for { min-height: 0; } }

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: s; }
.step { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.step::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.step h3 { margin: 0 0 6px; font-size: 17px; font-weight: 500; }
.step p { margin: 0; font-size: 14px; color: var(--ink-2); }
.step small { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
@media (max-width: 1000px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

.stack { display: flex; flex-wrap: wrap; gap: 8px; }
.stack span { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; font-size: 15px; }

.faq { display: grid; gap: 10px; max-width: 900px; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 0 22px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 30px 18px 0; font-weight: 500; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--accent); font-weight: 300; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0 0 18px; color: var(--ink-2); }

.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.contact-form { background: var(--paper); border-radius: 24px; padding: 28px; color: var(--ink); display: grid; gap: 10px; }
.contact-form .input { padding: 12px 14px; }
.contact-result { margin-top: 6px; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }

.footer { padding: 48px 0 40px; font-size: 14px; color: var(--muted); }
.footer .wrap { display: grid; gap: 18px; }
.footer-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer-links { display: flex; gap: 8px 22px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; opacity: 0; transition: .2s; pointer-events: none; z-index: 90; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
