/**
 * AGautomations — Design Refresh
 * Modern Dark Tech — same gold/black palette, new visual language
 * Loaded last: all rules override previous cascade
 */

/* ============================================
   Foundation Fixes (from design review)
   ============================================ */

html {
  color-scheme: dark;
}

.button,
.nav-link,
.menu-toggle,
.float-cta,
.calc-slider {
  touch-action: manipulation;
}

.button:focus-visible,
.nav-link:focus-visible,
.menu-toggle:focus-visible,
.float-cta:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

/* ============================================
   Mobile Hamburger Menu
   ============================================ */

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid rgba(154, 123, 79, 0.3);
  border-radius: 0.375rem;
  cursor: pointer;
  padding: 9px;
  transition: border-color var(--transition-base);
  flex-shrink: 0;
}

.menu-toggle:hover {
  border-color: var(--color-gold);
}

.menu-line {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--color-gold);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}

.menu-toggle.open .menu-line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.menu-toggle.open .menu-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-toggle.open .menu-line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 199;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.nav-overlay.visible {
  display: block;
}

@media (max-width: 767px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(300px, 80vw);
    height: 100dvh;
    background: rgba(0, 0, 0, 0.97);
    border-left: 1px solid rgba(154, 123, 79, 0.2);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: var(--space-2xl) var(--space-xl);
    gap: var(--space-xl);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    margin: 0;
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-link {
    font-size: var(--font-size-xl);
    font-family: 'Playfair Display', serif;
    color: rgba(255, 255, 255, 0.85);
    padding: var(--space-xs) 0;
  }

  .nav-link::after {
    display: none; /* remove hover underline inside mobile menu */
  }

  .nav-link:hover {
    color: var(--color-gold);
    opacity: 1;
  }

  /* Hide header CTA button on mobile (in menu instead) */
  .header-content > .button {
    display: none;
  }
}

/* ============================================
   Hero — accent line under h1
   ============================================ */

.hero h1 {
  position: relative;
  padding-bottom: var(--space-lg);
}

.hero h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 56px;
  height: 2px;
  background: var(--gradient-gold);
  border-radius: 1px;
}

/* Hero subtitle — cleaner Inter rendering */
.hero-subtitle {
  font-size: clamp(1rem, 0.5vw + 0.9rem, 1.2rem);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.7;
}

/* Brand name woven into body copy — stylized signature, never a title */
.brand-mark {
  font-family: 'Playfair Display', 'Times New Roman', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.12em;
  letter-spacing: 0.005em;
  background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 45%, var(--color-gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  position: relative;
  padding: 0 0.05em 0.1em;
  white-space: nowrap;
}

.brand-mark::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(184, 149, 110, 0.55) 25%,
    rgba(184, 149, 110, 0.55) 75%,
    transparent 100%);
}

/* Bigger in hero subtitle — primary placement */
.hero-subtitle .brand-mark {
  font-size: 1.4em;
  font-weight: 600;
}

@media (max-width: 480px) {
  .brand-mark {
    white-space: normal;
  }
}

/* ============================================
   n8n Canvas — 3D tilt on mousemove
   ============================================ */

.n8n-float-canvas {
  transition: transform 0.12s ease, box-shadow 0.2s ease;
  will-change: transform;
}

/* ============================================
   Process — horizontal timeline (desktop)
   ============================================ */

@media (min-width: 1024px) {
  .process-grid {
    display: flex;
    gap: 0;
    position: relative;
    align-items: flex-start;
  }

  /* Connecting line through badge centers */
  .process-grid::before {
    content: '';
    position: absolute;
    top: calc(var(--space-lg) + 26px); /* padding-top + half badge (52/2) */
    left: 12.5%;
    right: 12.5%;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(154, 123, 79, 0.4) 8%,
      rgba(154, 123, 79, 0.4) 92%,
      transparent
    );
    z-index: 0;
    pointer-events: none;
  }

  .process-step {
    flex: 1;
    text-align: center;
    border: none;
    border-radius: 0;
    padding: var(--space-lg) var(--space-md);
    background: transparent;
  }

  .process-step:hover {
    border: none;
    box-shadow: none;
    transform: translateY(-4px);
    background: rgba(154, 123, 79, 0.03);
    border-radius: 0.5rem;
  }

  .process-number {
    margin: 0 auto var(--space-md);
    position: relative;
    z-index: 1;
    background: var(--color-gray-dark); /* punches through connecting line */
  }

  .process-step h3,
  .process-step p {
    text-align: center;
  }
}

/* Animated dot travelling along the connecting line */
@media (min-width: 1024px) {
  .process-grid::after {
    content: '';
    position: absolute;
    top: calc(var(--space-lg) + 23px); /* center of line - 3px */
    left: 12.5%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-gold);
    box-shadow: 0 0 8px rgba(154, 123, 79, 0.7);
    z-index: 1;
    animation: process-dot-travel 5s ease-in-out infinite;
    pointer-events: none;
  }
}

@keyframes process-dot-travel {
  0%   { left: 12.5%;  opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { left: 87.5%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .process-grid::after { animation: none; opacity: 0; }
}

/* ============================================
   Benefit cards — left-border style
   ============================================ */

.benefit-card {
  padding: var(--space-lg) var(--space-lg) var(--space-lg) calc(var(--space-lg) - 2px);
  background: transparent;
  border: none;
  border-left: 2px solid rgba(154, 123, 79, 0.25);
  border-radius: 0;
  position: relative;
  transition: border-color var(--transition-base), background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

.benefit-card::before {
  display: none; /* remove previous top accent line */
}

.benefit-card:hover {
  border-left-color: var(--color-gold);
  background: rgba(154, 123, 79, 0.04);
  transform: translateX(4px);
  box-shadow: none;
}

/* ============================================
   Stats — bordered cells
   ============================================ */

.stats-grid {
  gap: 0;
  border: 1px solid rgba(154, 123, 79, 0.08);
  border-radius: 0.5rem;
  overflow: hidden;
}

.stat-item {
  border-right: 1px solid rgba(154, 123, 79, 0.08);
  padding: var(--space-xl) var(--space-lg);
}

.stat-item:last-child {
  border-right: none;
}

@media (min-width: 768px) {
  .stat-item:not(:last-child)::after {
    display: none; /* remove old dividers */
  }
}

@media (max-width: 767px) {
  .stats-grid {
    border-radius: 0.5rem;
  }

  .stat-item {
    border-right: none;
    border-bottom: 1px solid rgba(154, 123, 79, 0.08);
  }

  .stats-grid > .stat-item:nth-child(odd) {
    border-right: 1px solid rgba(154, 123, 79, 0.08);
  }

  .stat-item:last-child,
  .stats-grid > .stat-item:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

/* Larger, more dramatic stat numbers */
.stat-number {
  font-size: clamp(2.5rem, 5vw + 0.5rem, 4rem);
  font-variant-numeric: tabular-nums;
}

/* ============================================
   Case study cards — category left accent
   ============================================ */

.case-study-card:nth-child(1) { border-left: 3px solid rgba(59, 130, 246, 0.5); }
.case-study-card:nth-child(2) { border-left: 3px solid rgba(16, 185, 129, 0.5); }
.case-study-card:nth-child(3) { border-left: 3px solid rgba(139, 92, 246, 0.5); }

/* ============================================
   Final CTA — animated ambient gradient
   ============================================ */

@keyframes cta-ambient {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

.final-cta {
  background: linear-gradient(135deg, #060606 0%, #141414 45%, #080808 100%);
  background-size: 200% 200%;
  animation: cta-ambient 12s ease infinite;
}

@media (prefers-reduced-motion: reduce) {
  .final-cta { animation: none; }
}

/* ============================================
   Section titles — refined
   ============================================ */

.section-title {
  padding-bottom: 20px;
  margin-bottom: var(--space-md);
}

/* ============================================
   Scroll-to-top button
   ============================================ */

.back-to-top {
  position: fixed;
  bottom: 32px;
  left: 32px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(154, 123, 79, 0.35);
  color: var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease, border-color var(--transition-base), background var(--transition-base);
  z-index: 999;
  pointer-events: none;
  touch-action: manipulation;
  text-decoration: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: rgba(154, 123, 79, 0.15);
  border-color: var(--color-gold);
  opacity: 1;
}

.back-to-top svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 480px) {
  .back-to-top {
    bottom: 20px;
    left: 16px;
  }
}

/* ============================================
   Cursor spotlight on hero canvas (desktop)
   ============================================ */

.hero-canvas-spotlight {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(154, 123, 79, 0.1) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  z-index: 2;
  opacity: 0;
}

.n8n-float-canvas:hover .hero-canvas-spotlight {
  opacity: 1;
}

/* ============================================
   Active nav indicator (scroll-spy)
   ============================================ */

.nav-link.active {
  color: var(--color-gold);
}

.nav-link.active::after {
  transform: scaleX(1);
}

/* ============================================
   Ticker — refined hover
   ============================================ */

.ticker-item:hover {
  color: rgba(154, 123, 79, 0.85);
}

/* ============================================
   Miscellaneous polish
   ============================================ */

/* Slightly larger, bolder benefit headings */
.benefit-card h3 {
  font-size: clamp(1.1rem, 1vw + 0.9rem, 1.35rem);
}

/* Process step heading */
.process-step h3 {
  font-size: var(--font-size-base);
  letter-spacing: 0.01em;
}

/* Results number bolder */
.result-number {
  font-size: clamp(2rem, 4vw, 2.5rem);
}

/* Smooth image placeholder corners */
.case-study-image {
  border-radius: 0;
}

/* ============================================
   Process Teaser — compact card linking to full flow
   ============================================ */

.process-teaser {
  padding: var(--space-xl) 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.process-teaser .container {
  position: relative;
  z-index: 1;
}

@media (min-width: 1200px) {
  .process-teaser .container {
    max-width: 1340px;
  }
}

.teaser-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 18%, rgba(0,0,0,0.4) 38%, #000 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 18%, rgba(0,0,0,0.4) 38%, #000 70%);
}

.teaser-bg .tb-node {
  filter: drop-shadow(0 0 4px rgba(212, 178, 122, 0.7));
}

@keyframes tb-node-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.4); }
}

.teaser-bg .tb-pulse-1 {
  transform-box: fill-box;
  transform-origin: center;
  animation: tb-node-pulse 3.6s ease-in-out infinite;
}
.teaser-bg .tb-pulse-2 {
  transform-box: fill-box;
  transform-origin: center;
  animation: tb-node-pulse 4.4s ease-in-out infinite;
  animation-delay: 1.1s;
}
.teaser-bg .tb-pulse-3 {
  transform-box: fill-box;
  transform-origin: center;
  animation: tb-node-pulse 5s ease-in-out infinite;
  animation-delay: 2.2s;
}

@media (prefers-reduced-motion: reduce) {
  .teaser-bg .tb-pulse-1,
  .teaser-bg .tb-pulse-2,
  .teaser-bg .tb-pulse-3 {
    animation: none;
  }
}

.teaser-card {
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--space-xl) * 1.4) calc(var(--space-xl) * 1.15);
  border: 1px solid rgba(154, 123, 79, 0.22);
  border-radius: 1.1rem;
  background:
    radial-gradient(ellipse at top right, rgba(154, 123, 79, 0.08), transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(154, 123, 79, 0.05), transparent 60%),
    rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(154, 123, 79, 0.05) inset;
}

@media (min-width: 900px) {
  .teaser-card {
    padding: calc(var(--space-xl) * 1.6) calc(var(--space-xl) * 1.85);
  }
}

.teaser-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(154, 123, 79, 0.5), transparent);
}

.teaser-head {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.teaser-eyebrow {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold);
  font-weight: 600;
}

.teaser-title {
  font-family: 'Playfair Display', 'Times New Roman', Georgia, serif;
  font-size: clamp(1.7rem, 2.4vw + 0.7rem, 2.2rem);
  line-height: 1.25;
  color: var(--color-text-primary);
  margin: 0;
  font-weight: 500;
}

.teaser-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
  border-top: 1px solid rgba(154, 123, 79, 0.12);
  border-bottom: 1px solid rgba(154, 123, 79, 0.12);
}

.teaser-steps::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 12.5%;
  right: 12.5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(154, 123, 79, 0.25), rgba(154, 123, 79, 0.25), transparent);
  transform: translateY(-0.5px);
  pointer-events: none;
  z-index: 0;
}

.teaser-step {
  padding: calc(var(--space-md) * 1.35) var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  position: relative;
  z-index: 1;
  background: var(--color-gray-dark);
}

.teaser-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 30%;
  bottom: 30%;
  right: 0;
  width: 1px;
  background: rgba(154, 123, 79, 0.1);
}

.ts-num {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--color-gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ts-label {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: center;
  letter-spacing: 0.01em;
}

.ts-desc {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(230, 230, 230, 0.82);
  text-align: center;
  max-width: 26ch;
  margin-top: 0.2rem;
}

.teaser-link {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 1rem 2.25rem;
  border-radius: 0.6rem;
  background: linear-gradient(135deg, var(--color-gold-dark) 0%, var(--color-gold) 50%, var(--color-gold-light) 100%);
  background-size: 200% 100%;
  background-position: 0% 50%;
  border: 1px solid rgba(184, 149, 110, 0.5);
  box-shadow:
    0 4px 16px rgba(154, 123, 79, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transition: gap 0.25s ease, transform 0.25s ease, box-shadow 0.3s ease, background-position 0.4s ease;
  position: relative;
  overflow: hidden;
  margin-top: var(--space-sm);
}

.teaser-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}

.teaser-link:hover {
  gap: 0.9rem;
  transform: translateY(-2px);
  background-position: 100% 50%;
  box-shadow:
    0 8px 28px rgba(154, 123, 79, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.teaser-link:hover::before {
  left: 100%;
}

.teaser-link svg {
  transition: transform 0.25s ease;
  width: 18px;
  height: 18px;
}

.teaser-link:hover svg {
  transform: translateX(3px);
}

@media (max-width: 640px) {
  .teaser-card {
    padding: var(--space-md) var(--space-md);
  }

  .teaser-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .teaser-steps::before {
    display: none;
  }

  .teaser-step:nth-child(odd)::after {
    content: '';
    position: absolute;
    top: 30%;
    bottom: 30%;
    right: 0;
    width: 1px;
    background: rgba(154, 123, 79, 0.1);
  }

  .teaser-step:nth-child(even)::after {
    display: none;
  }

  .teaser-step:nth-child(-n+2) {
    border-bottom: 1px solid rgba(154, 123, 79, 0.08);
  }

  .teaser-link {
    align-self: stretch;
    justify-content: center;
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* ============================================
   Benefit cards — icons
   ============================================ */

.benefit-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.benefit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  background: rgba(154, 123, 79, 0.08);
  border: 1px solid rgba(154, 123, 79, 0.18);
  color: var(--color-gold);
  margin-bottom: 0.25rem;
  transition: background var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}

.benefit-card:hover .benefit-icon {
  background: rgba(154, 123, 79, 0.14);
  border-color: var(--color-gold);
  transform: scale(1.05);
}

.benefit-card p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ============================================
   Services Page — ambient backgrounds + section variation
   ============================================ */

.services-list,
.process-flow-section,
.tool-showcase {
  position: relative;
  overflow: hidden;
}

.services-list::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(154, 123, 79, 0.08) 1px, transparent 0);
  background-size: 32px 32px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(180deg, transparent 0%, black 15%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 15%, black 85%, transparent 100%);
}

.services-list > .container {
  position: relative;
  z-index: 1;
}

.process-flow-section {
  background: linear-gradient(180deg, var(--color-gray-darkest) 0%, #0d0d0d 50%, var(--color-gray-darkest) 100%);
}

.process-flow-section::before {
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(154, 123, 79, 0.07) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  pointer-events: none;
  z-index: 0;
}

.process-flow-section::after {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(154, 123, 79, 0.05) 0%, transparent 70%);
  bottom: -160px;
  left: -160px;
  pointer-events: none;
  z-index: 0;
}

.process-flow-section > .container {
  position: relative;
  z-index: 1;
}

.tool-showcase {
  background: linear-gradient(180deg, var(--color-gray-dark) 0%, #0a0a0a 100%);
}

.tool-showcase::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(154, 123, 79, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 123, 79, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  z-index: 0;
}

.tool-showcase > .container {
  position: relative;
  z-index: 1;
}

.before-after {
  position: relative;
  overflow: hidden;
}

.before-after::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(154, 123, 79, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.before-after > .container {
  position: relative;
  z-index: 1;
}

/* ============================================
   Before / After — transformation cards (redesign)
   ============================================ */

.before-after .comparison-grid {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 1200px;
  margin: 0 auto;
}

.before-after .comparison-card {
  position: relative;
  background: linear-gradient(145deg, rgba(20,20,20,0.9) 0%, rgba(10,10,10,0.95) 100%);
  border: 1px solid rgba(154,123,79,0.18);
  border-radius: 16px;
  padding: 3rem 2.75rem 2.5rem;
  overflow: visible;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.before-after .comparison-card:hover {
  border-color: rgba(154,123,79,0.45);
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 0 0 1px rgba(154,123,79,0.12) inset;
}

.comparison-tag {
  position: absolute;
  top: -14px;
  left: 2.25rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  background: #0a0a0a;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(154,123,79,0.45);
}

.comparison-saved {
  position: absolute;
  top: -14px;
  right: 2.25rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  background: linear-gradient(135deg, rgba(154,123,79,0.22) 0%, rgba(154,123,79,0.08) 100%);
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(154,123,79,0.4);
  backdrop-filter: blur(6px);
}

.comparison-saved strong {
  color: var(--color-gold-light);
  font-weight: 700;
  margin-right: 0.22rem;
}

.comparison-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 2rem;
}

.comparison-side {
  position: relative;
  padding: 1.75rem 1.75rem;
  border-radius: 12px;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.comparison-side > p {
  flex: 1;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.comparison-side.comparison-before {
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.05);
}

.comparison-side.comparison-after {
  background: linear-gradient(145deg, rgba(80,180,120,0.07) 0%, rgba(80,180,120,0.02) 100%);
  border: 1px solid rgba(80,180,120,0.22);
}

.comparison-side-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comparison-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comparison-icon svg {
  width: 22px;
  height: 22px;
}

.comparison-icon--x {
  background: rgba(220,90,90,0.14);
  color: rgba(230,130,130,0.95);
  border: 1px solid rgba(220,90,90,0.32);
}

.comparison-icon--check {
  background: rgba(80,180,120,0.14);
  color: rgba(120,210,150,0.95);
  border: 1px solid rgba(80,180,120,0.32);
}

.before-after .comparison-label {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0;
  color: rgba(255,255,255,0.55);
}

.comparison-after .comparison-label {
  color: rgba(120,210,150,0.95);
}

.before-after .comparison-card p {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.85);
  margin: 0;
}

.comparison-after p {
  color: rgba(255,255,255,0.94);
}

.comparison-arrow {
  align-self: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-gold-dark) 0%, var(--color-gold-light) 100%);
  color: #0a0a0a;
  box-shadow: 0 0 0 5px rgba(154,123,79,0.08), 0 6px 24px rgba(154,123,79,0.4);
  flex-shrink: 0;
}

.comparison-arrow svg {
  width: 28px;
  height: 28px;
}

@media (max-width: 768px) {
  .before-after .comparison-card {
    padding: 3rem 1.25rem 1.5rem;
  }
  .comparison-tag {
    left: 1rem;
    font-size: 0.66rem;
  }
  .comparison-saved {
    top: 22px;
    right: 1rem;
    font-size: 0.66rem;
  }
  .comparison-split {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .comparison-arrow {
    transform: rotate(90deg);
    width: 38px;
    height: 38px;
    margin: 0.25rem auto;
  }
}

/* ============================================
   Service Visualization — workflow node graphs
   ============================================ */

.service-viz {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 240px;
  border-radius: 0.75rem;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(154, 123, 79, 0.06), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(154, 123, 79, 0.04), transparent 60%),
    linear-gradient(135deg, #0d0d0d 0%, #141414 50%, #0d0d0d 100%);
  border: 1px solid rgba(154, 123, 79, 0.18);
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(154, 123, 79, 0.04) inset;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.service-viz:hover {
  transform: translateY(-4px);
  border-color: rgba(154, 123, 79, 0.35);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.6),
    0 0 32px rgba(154, 123, 79, 0.1),
    0 0 0 1px rgba(154, 123, 79, 0.08) inset;
}

.sv-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(154, 123, 79, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 123, 79, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.sv-orb {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.sv-orb-tl { top: -80px; left: -60px; background: rgba(154, 123, 79, 0.18); }
.sv-orb-tr { top: -80px; right: -60px; background: rgba(154, 123, 79, 0.16); }
.sv-orb-bl { bottom: -80px; left: -60px; background: rgba(154, 123, 79, 0.16); }
.sv-orb-br { bottom: -80px; right: -60px; background: rgba(154, 123, 79, 0.18); }

.sv-wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.sv-wire {
  fill: none;
  stroke: rgba(154, 123, 79, 0.55);
  stroke-width: 1.5;
}

.sv-wire-glow {
  fill: none;
  stroke: rgba(154, 123, 79, 0.18);
  stroke-width: 6;
}

.sv-dot {
  fill: var(--color-gold-light);
  filter: drop-shadow(0 0 4px rgba(184, 149, 110, 0.8));
}

.sv-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem 0.5rem 0.5rem;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(154, 123, 79, 0.35);
  border-radius: 0.4rem;
  z-index: 2;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(154, 123, 79, 0.05) inset;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  white-space: nowrap;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.service-viz:hover .sv-node {
  border-color: rgba(154, 123, 79, 0.55);
}

.sv-icon {
  width: 32px;
  height: 32px;
  border-radius: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(154, 123, 79, 0.25) 0%, rgba(125, 99, 64, 0.35) 100%);
  color: #fff;
  flex-shrink: 0;
  border: 1px solid rgba(154, 123, 79, 0.3);
}

.sv-n--input .sv-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.4) 100%);
  border-color: rgba(96, 165, 250, 0.4);
}

.sv-n--out .sv-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(5, 150, 105, 0.4) 100%);
  border-color: rgba(52, 211, 153, 0.4);
}

.sv-n--branch .sv-icon {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(124, 58, 237, 0.4) 100%);
  border-color: rgba(167, 139, 250, 0.4);
}

.sv-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.01em;
}

.sv-tag {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(154, 123, 79, 0.55);
  z-index: 2;
}

@media (max-width: 640px) {
  .service-viz {
    min-height: 220px;
  }

  .sv-name {
    font-size: 0.68rem;
  }

  .sv-icon {
    width: 26px;
    height: 26px;
  }

  .sv-icon svg {
    width: 16px;
    height: 16px;
  }

  .sv-node {
    padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sv-dot {
    display: none;
  }
}

/* ============================================
   ROI Calculator — black bg (deco lines now shared in components.css)
   ============================================ */

.roi-calculator {
  background: linear-gradient(180deg, #000 0%, var(--color-gray-darkest) 50%, #000 100%) !important;
}

/* ============================================
   n8n YouTube video card
   ============================================ */

.n8n-video-card {
  position: relative;
  display: block;
  width: 100%;
  max-width: 700px;
  margin: var(--space-xl) auto 0;
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(154, 123, 79, 0.25);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.7);
  background: rgba(154, 123, 79, 0.06);
  cursor: pointer;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.n8n-video-card:hover,
.n8n-video-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(212, 178, 122, 0.55);
  box-shadow: 0 26px 50px -20px rgba(0, 0, 0, 0.8);
}

.n8n-video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.n8n-video-card:hover .n8n-video-thumb {
  transform: scale(1.03);
}

.n8n-video-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}

.n8n-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
  transition: transform var(--transition-base), opacity var(--transition-base);
  opacity: 0.92;
  z-index: 1;
}

.n8n-video-card:hover .n8n-video-play,
.n8n-video-card:focus-visible .n8n-video-play {
  transform: translate(-50%, -50%) scale(1.08);
  opacity: 1;
}

.n8n-video-caption {
  max-width: 700px;
  margin: var(--space-sm) auto 0;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(230, 230, 230, 0.55);
  line-height: 1.5;
}

.n8n-video-caption a {
  color: var(--color-gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 178, 122, 0.35);
  transition: border-color var(--transition-base), color var(--transition-base);
}

.n8n-video-caption a:hover,
.n8n-video-caption a:focus-visible {
  color: #e6c896;
  border-bottom-color: rgba(212, 178, 122, 0.8);
}

@media (max-width: 640px) {
  .n8n-video-play svg {
    width: 54px;
    height: auto;
  }
}

/* Service features — bigger, centered, 2 columns (override components.css) */
.services-list .service-features {
  grid-template-columns: 1fr;
  max-width: 760px;
  margin: 1.25rem auto 0;
  gap: 0.85rem 1.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .services-list .service-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

.services-list .service-features li {
  padding-left: 0;
  font-size: 1.08rem;
  line-height: 1.55;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.55rem;
}

.services-list .service-features li::before {
  position: static;
  font-size: 1.15rem;
  color: var(--color-gold, #C9A472);
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .services-list .service-features li {
    font-size: 1rem;
  }
}

/* Service divider — "Or we can build:" between Custom and the rest */
.service-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 1rem;
  position: relative;
}

.service-divider::before,
.service-divider::after {
  content: "";
  flex: 1;
  height: 0;
  border-top: 1.5px dashed rgba(212, 178, 122, 0.45);
}

.service-divider-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(230, 230, 230, 0.78);
  white-space: nowrap;
  padding: 0 0.4rem;
  font-style: italic;
}

@media (max-width: 640px) {
  .service-divider {
    margin: 2rem auto;
    gap: 0.85rem;
  }
  .service-divider-text {
    font-size: 0.85rem;
  }
}
