/* Workflow canvas. n8n-shaped node graph for use-case pages.
   Renders horizontal node chain with curved bezier connectors, click-to-detail
   side panel, pan/zoom/fullscreen controls. Mobile collapses to vertical stack. */

.wf {
  position: relative;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background-color: #1a1d2a;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.10) 1px, transparent 0);
  background-size: 22px 22px;
  overflow: hidden;
  margin-top: 1.5rem;
  isolation: isolate;
}

.wf-stage {
  position: relative;
  width: 100%;
  min-height: 360px;
  padding: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2.5rem);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  display: flex;
  align-items: center;
}

.wf-stage::-webkit-scrollbar { height: 8px }
.wf-stage::-webkit-scrollbar-track { background: transparent }
.wf-stage::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 4px }

.wf-graph {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  width: max-content;
  min-width: 100%;
  padding: 1rem 0;
}

.wf-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.wf-edges path {
  fill: none;
  stroke: rgba(255,255,255,.40);
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke .25s var(--ease);
}

.wf-edges path.is-ai {
  stroke: rgba(106,166,255,.7);
  stroke-dasharray: 0;
}

.wf-node {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 200px;
  background: #0f1119;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 1rem 1.05rem;
  cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s var(--ease);
  font-family: var(--f-sans);
  text-align: left;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  overflow: hidden;
}

.wf-node::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(106,166,255,.18), transparent 55%);
  opacity: 0;
  transition: opacity .25s var(--ease);
  pointer-events: none;
  z-index: 0;
}

.wf-node > * { position: relative; z-index: 1 }

.wf-node:hover {
  border-color: rgba(106,166,255,.32);
  transform: translateY(-2px);
}

.wf-node:hover::before { opacity: 1 }

.wf-node.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(106,166,255,.16);
}

.wf-node-head {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.wf-node-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(106,166,255,.14);
  color: var(--accent-2);
  flex: 0 0 auto;
}

.wf-node-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round }

.wf-node-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: currentColor;
}


.wf-led {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(238,240,244,.45);
  box-shadow: 0 0 8px rgba(238,240,244,.18);
  z-index: 2;
}

.wf-node[data-type="manual"] .wf-led,
.wf-node[data-type="human"] .wf-led {
  background: rgba(238,240,244,.45);
  box-shadow: 0 0 8px rgba(238,240,244,.18);
}

.wf-node[data-type="semi-auto"] .wf-led,
.wf-node[data-type="ai-human"] .wf-led {
  background: #f2c58a;
  box-shadow: 0 0 10px rgba(242,197,138,.55);
}

.wf-node[data-type="automated"] .wf-led,
.wf-node[data-type="auto"] .wf-led {
  background: #6cd99a;
  box-shadow: 0 0 10px rgba(108,217,154,.55);
}

.wf-node[data-type="ai"] .wf-led {
  background: #c4b5fd;
  box-shadow: 0 0 10px rgba(196,181,253,.6);
}

.wf-node-title {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: 1.02rem;
  line-height: 1.2;
  letter-spacing: -.015em;
  color: var(--fg);
}

.wf-node-tools {
  display: flex;
  gap: .35rem;
}

.wf-tool {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  display: grid;
  place-items: center;
  color: var(--fg-2);
  flex: 0 0 auto;
}

.wf-tool svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wf-tool img {
  width: 14px;
  height: 14px;
  display: block;
  filter: brightness(0) invert(1);
  opacity: .82;
}

.wf-tool.is-more {
  font-family: var(--f-sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--fg-2);
}


/* Toolbar (zoom / fit / fullscreen) */
.wf-toolbar {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 4;
  display: flex;
  gap: 4px;
  background: rgba(11,12,17,.76);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
}

.wf-toolbar button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--fg-2);
  cursor: pointer;
  font-family: var(--f-sans);
  font-size: .85rem;
  transition: background .2s, color .2s;
}

.wf-toolbar button:hover { background: rgba(255,255,255,.06); color: var(--fg) }

.wf-toolbar svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round }

.wf-legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 3;
  display: flex;
  gap: .4rem;
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.wf-title {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(11,12,17,.72);
  backdrop-filter: blur(10px);
  font-family: var(--f-sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--fg);
}

.wf-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  display: inline-block;
}

.wf-legend span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11,12,17,.6);
  backdrop-filter: blur(10px);
}

.wf-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(238,240,244,.45);
  box-shadow: 0 0 6px rgba(238,240,244,.2);
  display: inline-block;
}

.wf-legend i[data-led="semi-auto"] { background: #f2c58a; box-shadow: 0 0 6px rgba(242,197,138,.55) }
.wf-legend i[data-led="automated"] { background: #6cd99a; box-shadow: 0 0 6px rgba(108,217,154,.55) }
.wf-legend i[data-led="ai"] { background: #c4b5fd; box-shadow: 0 0 6px rgba(196,181,253,.6) }

/* Detail panel */
.wf-detail {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 92%);
  background: rgba(13,14,19,.96);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--line);
  z-index: 5;
  transform: translateX(100%);
  transition: transform .35s var(--ease);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wf-detail.is-open { transform: translateX(0) }

.wf-detail-head {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.wf-detail-headcopy { flex: 1; min-width: 0 }

.wf-detail-eyebrow {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: .5rem;
}

.wf-detail-title {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--fg);
}

.wf-detail-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.wf-detail-close:hover { background: rgba(255,255,255,.06); color: var(--fg) }
.wf-detail-close svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.6 }

.wf-detail-body {
  padding: 1.25rem 1.5rem 2rem;
  overflow-y: auto;
  flex: 1;
}

.wf-detail-section { margin-top: 1.25rem }
.wf-detail-section:first-child { margin-top: 0 }

.wf-detail-section h4 {
  font-family: var(--f-sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: .65rem;
}

.wf-detail-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.wf-detail-activities li {
  font-size: .9rem;
  color: var(--fg-2);
  line-height: 1.5;
  padding-left: 1rem;
  position: relative;
}

.wf-detail-activities li::before {
  content: "";
  position: absolute;
  left: 0; top: .65rem;
  width: 6px; height: 1px;
  background: var(--fg-3);
}

.wf-detail-tools {
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: .55rem !important;
}

.wf-detail-tools li {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .82rem;
  color: var(--fg);
  padding: .4rem .75rem .4rem .45rem;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
}

.wf-detail-tools .wf-tool {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}

.wf-detail-tools .wf-tool svg { width: 13px; height: 13px }
.wf-detail-tools .wf-tool img { width: 13px; height: 13px }

/* KPI strip */
.wf-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 1.5rem;
}

.wf-kpi {
  padding: 1.25rem 1.4rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.wf-kpi-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.wf-kpi-value {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: 2.1rem;
  letter-spacing: -.025em;
  line-height: 1;
  color: var(--fg);
}

.wf-kpi-sub {
  font-size: .78rem;
  color: var(--fg-2);
  line-height: 1.4;
}

.wf-kpi.is-improved .wf-kpi-value { color: var(--accent-2) }

.wf-kpi-delta {
  font-size: .72rem;
  font-weight: 500;
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.wf-illustrative {
  font-size: .72rem;
  color: var(--fg-3);
  margin-top: .85rem;
  letter-spacing: .04em;
}

/* Complication node-bullets (.jstep style without rail) */
.cmp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.cmp-node {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  padding: 1.75rem 1.75rem 1.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cmp-node-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(106,166,255,.08);
  border: 1px solid rgba(106,166,255,.18);
  color: var(--accent-2);
  margin-bottom: .25rem;
}

.cmp-node-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cmp-node-title {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 1.9vw, 1.65rem);
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--fg);
}

.cmp-node-body {
  font-size: .95rem;
  color: var(--fg-2);
  line-height: 1.5;
}

/* Playbook CTA variant */
.cta.cta-playbook h2 { color: var(--fg) }

/* Fullscreen */
.wf:fullscreen,
.wf:-webkit-full-screen {
  border-radius: 0;
  border: 0;
  background-color: #1a1d2a;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.10) 1px, transparent 0);
  background-size: 22px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wf:fullscreen .wf-stage {
  height: 100vh;
  display: flex;
  align-items: center;
  padding: 4rem 3rem;
}

.wf:fullscreen .wf-graph {
  margin: auto;
  gap: 5rem;
}

.wf:fullscreen .wf-node { width: 240px }
.wf:fullscreen .wf-node-title { font-size: 1.15rem }

/* Mobile: vertical stack */
@media (max-width: 720px) {
  .wf-graph {
    flex-direction: column;
    align-items: stretch;
    gap: 2rem;
    width: 100%;
    padding: 0 .5rem;
  }
  .wf-node { width: 100% }
  .wf-stage { overflow-x: hidden }
  .wf-edges { display: none }
  .wf-graph .wf-node + .wf-node::before {
    content: "";
    position: absolute;
    top: -1.55rem;
    left: 50%;
    width: 1px;
    height: 1.5rem;
    background: rgba(255,255,255,.14);
  }
  .wf-detail { width: 100%; border-left: 0; border-top: 1px solid var(--line) }
  .wf-legend { position: static; padding: 1rem 1rem 0 }
}

/* When fullscreen on mobile, force horizontal */
.wf:fullscreen .wf-graph {
  flex-direction: row;
  align-items: center;
  width: max-content;
}
.wf:fullscreen .wf-node { width: 240px }
.wf:fullscreen .wf-edges { display: block }
.wf:fullscreen .wf-graph .wf-node + .wf-node::before { display: none }
.wf:fullscreen .wf-stage { overflow-x: auto }

/* === Mobile fullscreen prompt ("We recommend desktop...") === */
.wf-fs-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.wf-fs-modal__backdrop { position: absolute; inset: 0; background: rgba(8, 10, 16, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.wf-fs-modal__panel { position: relative; max-width: 420px; width: 100%; background: var(--bg, #0f1218); border: 1px solid var(--line, rgba(255,255,255,0.08)); border-radius: 14px; padding: 1.75rem 1.5rem 1.5rem; box-shadow: 0 24px 60px rgba(0,0,0,0.55); color: var(--fg, #eef0f4); }
.wf-fs-modal__eyebrow { font-family: var(--f-mono, ui-monospace, monospace); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent, #6aa6ff); margin: 0 0 0.85rem; }
.wf-fs-modal__title { font-family: var(--f-serif, Georgia, serif); font-weight: 300; font-size: 1.35rem; line-height: 1.2; letter-spacing: -0.018em; color: var(--fg, #eef0f4); margin: 0 0 0.85rem; text-wrap: balance; }
.wf-fs-modal__body { font-size: 0.9rem; line-height: 1.55; color: var(--fg-2, rgba(238,240,244,0.72)); margin: 0 0 1.5rem; }
.wf-fs-modal__actions { display: flex; flex-direction: column; gap: 0.6rem; }
.wf-fs-modal__btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.75rem 1.1rem; border-radius: 999px; border: 1px solid var(--line, rgba(255,255,255,0.12)); background: transparent; color: var(--fg, #eef0f4); font-family: inherit; font-size: 0.9rem; font-weight: 500; text-decoration: none; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.wf-fs-modal__btn:hover { border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.04); }
.wf-fs-modal__btn--primary { background: var(--fg, #eef0f4); color: var(--bg, #0b0c11); border-color: transparent; }
.wf-fs-modal__btn--primary:hover { background: #fff; color: #0b0c11; }
.wf-fs-modal__btn--ghost { color: var(--fg-3, rgba(238,240,244,0.5)); }
body.wf-fs-modal-open { overflow: hidden; }
