/* ═══════════════════════════════════════════════════════
   WORKFLOWS PAGE — vertical-specific n8n examples
   Inherits root tokens + nav + grain + cursor styles
   from style.css; this file adds page-specific layout.
   ═══════════════════════════════════════════════════════ */

.page-workflows {
  background: #0a0a0b;
  color: var(--ink);
  min-height: 100vh;
}

/* No 3D canvas on this page — clear background */
.page-workflows main {
  position: relative;
  z-index: 2;
}

/* Workflows nav variant — solid background, no transparency */
.nav--workflows {
  background: rgba(10, 10, 11, 0.92);
  border-bottom: 1px solid rgba(244, 241, 236, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-back {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  justify-self: end;
  transition: color 0.25s ease;
}

.nav-back:hover { color: var(--accent); }

/* ─── Hero ──────────────────────────────────────────── */

.wf-hero {
  padding: 12rem 2.5rem 6rem;
  text-align: center;
  max-width: 60rem;
  margin: 0 auto;
}

.wf-hero__label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

.wf-hero__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}

.wf-hero__title em {
  color: var(--ink-muted);
  font-style: italic;
}

.wf-hero__lede {
  max-width: 36rem;
  margin: 0 auto 3rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

/* ─── Hero pillars (engine / data / website-on-top) ── */

.wf-hero__lede strong {
  color: var(--ink);
  font-weight: 500;
}

.wf-hero__pillars {
  list-style: none;
  margin: 3rem auto 3.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 60rem;
  text-align: left;
}

.wf-hero__pillars li {
  position: relative;
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  border: 1px solid rgba(244, 241, 236, 0.08);
  background: linear-gradient(
    180deg,
    rgba(20, 20, 24, 0.5) 0%,
    rgba(14, 14, 18, 0.5) 100%
  );
  border-left: 2px solid var(--accent);
}

.wf-hero__pillars li strong {
  display: block;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--ink);
  margin: 0.5rem 0 0.4rem;
  font-size: 0.95rem;
}

.wf-hero__pillars li span:not(.wf-pillar__num) {
  font-size: 0.825rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.wf-pillar__num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--accent);
}

@media (max-width: 800px) {
  .wf-hero__pillars { grid-template-columns: 1fr; }
}

/* ─── Per-workflow disclaimer ───────────────────────── */

.wf-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  max-width: 56rem;
  margin: 0 auto 2rem;
  padding: 0.95rem 1.2rem;
  border: 1px solid rgba(212, 55, 40, 0.20);
  background: linear-gradient(
    135deg,
    rgba(212, 55, 40, 0.06) 0%,
    rgba(212, 55, 40, 0.01) 100%
  );
  font-size: 0.825rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.wf-disclaimer strong {
  color: var(--ink);
  font-weight: 500;
}

.wf-disclaimer__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(212, 55, 40, 0.18);
}

/* ─── CTA assurances list ────────────────────────────── */

.wf-cta__assurances {
  list-style: none;
  margin: 0 auto 2.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 28rem;
  text-align: left;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.wf-cta__assurances li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wf-cta__check {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid rgba(92, 228, 140, 0.4);
  background: rgba(92, 228, 140, 0.10);
  color: #5ce48c;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ─── Tabs ──────────────────────────────────────────── */

.wf-tabs {
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid rgba(244, 241, 236, 0.08);
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.6);
}

.wf-tab {
  padding: 0.6rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  border-radius: 999px;
  transition: color 0.3s ease, background 0.3s ease;
}

.wf-tab:hover { color: var(--ink); }

.wf-tab.is-active {
  color: var(--ink);
  background: linear-gradient(
    135deg,
    rgba(212, 55, 40, 0.25) 0%,
    rgba(212, 55, 40, 0.10) 100%
  );
  border: 1px solid rgba(212, 55, 40, 0.4);
}

/* ─── Workflow section ──────────────────────────────── */

.wf {
  padding: 6rem 2.5rem;
  max-width: 90rem;
  margin: 0 auto;
  border-top: 1px solid rgba(244, 241, 236, 0.06);
}

.wf-head {
  max-width: 56rem;
  margin: 0 auto 3.5rem;
}

.wf-vert {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.wf-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.85rem, 3.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 1.25rem;
}

.wf-summary {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-muted);
  font-weight: 300;
  max-width: 46rem;
  margin-bottom: 2rem;
}

.wf-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(244, 241, 236, 0.08);
  background: rgba(20, 20, 24, 0.5);
}

.wf-meta div { display: flex; flex-direction: column; gap: 0.4rem; }
.wf-meta dt {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-dim);
}
.wf-meta dd {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}

@media (max-width: 720px) {
  .wf-meta { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Canvas wrapper for the SVG workflow ────────── */

.wf-canvas-wrap {
  position: relative;
  border: 1px solid rgba(244, 241, 236, 0.08);
  background:
    radial-gradient(ellipse at center, rgba(212,55,40,0.04) 0%, transparent 70%),
    linear-gradient(180deg, #0e0e14 0%, #08080c 100%);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 241, 236, 0.15) transparent;
}

.wf-canvas-wrap::-webkit-scrollbar { height: 8px; }
.wf-canvas-wrap::-webkit-scrollbar-track { background: transparent; }
.wf-canvas-wrap::-webkit-scrollbar-thumb {
  background: rgba(244, 241, 236, 0.15);
  border-radius: 4px;
}

.wf-canvas {
  min-width: 1400px;
  height: 720px;
  position: relative;
}

.wf-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ─── SVG node styling ──────────────────────────── */

.wf-node {
  cursor: pointer;
}

.wf-node-tile {
  fill: #14141c;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
  transition: filter 0.25s ease, transform 0.25s ease;
}

.wf-node:hover .wf-node-tile {
  filter: drop-shadow(0 0 20px var(--node-color, rgba(212,55,40,0.7)));
}

.wf-node-stripe {
  /* coloured top accent stripe — set via inline fill */
}

.wf-node-icon {
  pointer-events: none;
}

.wf-node-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  fill: var(--ink);
  text-anchor: middle;
}

.wf-node-op {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--ink-muted);
  text-anchor: middle;
}

.wf-node-key {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-anchor: start;
}

.wf-edge {
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.wf-edge-glow {
  fill: none;
  stroke-width: 6;
  opacity: 0.18;
  filter: blur(2px);
  pointer-events: none;
}

.wf-edge-dashed {
  stroke-dasharray: 6, 5;
  opacity: 0.55;
}

.wf-edge-label {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--ink-dim);
  text-anchor: middle;
  pointer-events: none;
}

.wf-spark {
  pointer-events: none;
  filter: drop-shadow(0 0 4px currentColor);
}

/* Branch group divider line (for switch nodes) */
.wf-branch-bg {
  fill: rgba(244, 241, 236, 0.02);
  stroke: rgba(244, 241, 236, 0.06);
  stroke-dasharray: 4, 4;
}

.wf-branch-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  fill: var(--ink-dim);
  text-anchor: start;
}

/* ─── Tooltip ─────────────────────────────────────── */

.wf-tip {
  position: fixed;
  pointer-events: none;
  padding: 0.65rem 0.85rem;
  background: rgba(14, 14, 16, 0.96);
  border: 1px solid rgba(244, 241, 236, 0.12);
  border-left: 2px solid var(--accent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink);
  max-width: 18rem;
  line-height: 1.4;
  z-index: 100;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.wf-tip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.wf-tip strong {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

/* ─── Bottom CTA ──────────────────────────────────── */

.wf-cta {
  padding: 8rem 2.5rem 6rem;
  text-align: center;
  max-width: 50rem;
  margin: 0 auto;
  border-top: 1px solid rgba(244, 241, 236, 0.06);
}

.wf-cta__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.wf-cta__title em {
  color: var(--accent);
  font-style: italic;
}

.wf-cta__lede {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-muted);
  margin-bottom: 2.5rem;
}

.wf-cta__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.wf-cta__back-row {
  margin-top: 2rem;
  text-align: center;
}

.wf-cta__back {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 0.25s ease;
}
.wf-cta__back:hover { color: var(--ink); }

/* Ghost variant of the CTA — for secondary actions (phone) */
.examples-cta--ghost {
  border-color: rgba(244, 241, 236, 0.18) !important;
  background: linear-gradient(
    135deg,
    rgba(244, 241, 236, 0.04) 0%,
    rgba(244, 241, 236, 0.01) 100%
  ) !important;
}
.examples-cta--ghost .examples-cta__arrow { color: var(--ink-muted); }
.examples-cta--ghost:hover {
  border-color: rgba(244, 241, 236, 0.45) !important;
  background: linear-gradient(
    135deg,
    rgba(244, 241, 236, 0.08) 0%,
    rgba(244, 241, 236, 0.02) 100%
  ) !important;
  box-shadow: 0 18px 40px -22px rgba(244, 241, 236, 0.25) !important;
}
.examples-cta--ghost:hover .examples-cta__arrow { color: var(--ink); }

/* Toast — shown after copy-to-clipboard */
.sf-toast {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translate(-50%, 14px);
  padding: 0.85rem 1.25rem;
  background: rgba(14, 14, 16, 0.96);
  border: 1px solid rgba(244, 241, 236, 0.12);
  border-left: 2px solid var(--accent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
}
.sf-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ─── Reveal-on-scroll ───────────────────────────── */

.wf-canvas-wrap, .wf-head, .wf-cta {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.wf-canvas-wrap.is-visible,
.wf-head.is-visible,
.wf-cta.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Responsive ─────────────────────────────────── */

@media (max-width: 900px) {
  .wf { padding: 4rem 1.5rem; }
  .wf-hero { padding: 8rem 1.5rem 4rem; }
  .wf-tabs { flex-wrap: wrap; }
  .nav--workflows { padding: 1rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wf-canvas-wrap, .wf-head, .wf-cta {
    opacity: 1;
    transform: none;
  }
}
