/* ==========================================================================
   WISER WORKFLOWS - Core Design System & Global Styles
   ========================================================================== */

:root {
  /* Color Palette - Wiser Workflows Blue & Gold (from WWlogo) */
  --bg-primary: #f0f4fa;
  --bg-secondary: #e6edf6;
  --bg-tertiary: #d8e4f0;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-glass: rgba(240, 244, 250, 0.75);

  --border-subtle: rgba(15, 32, 53, 0.08);
  --border-medium: rgba(15, 32, 53, 0.16);
  --border-glow: rgba(43, 108, 176, 0.25);

  --accent-cyan: #2b6cb0;           /* Steel Blue (primary) */
  --accent-cyan-glow: rgba(43, 108, 176, 0.25);
  --accent-indigo: #0f2035;         /* Deep Navy */
  --accent-violet: #c8a84b;         /* Logo Gold */
  --accent-emerald: #3a7dc9;        /* Light Steel Blue */
  --accent-emerald-glow: rgba(58, 125, 201, 0.22);
  --accent-amber: #d4a82a;          /* Bright Gold */

  --text-main: #0f2035;             /* Deep Navy */
  --text-muted: #2d4a6a;
  --text-dim: #5a7a9a;

  --gradient-primary: linear-gradient(135deg, #2b6cb0 0%, #c8a84b 100%);
  --gradient-emerald: linear-gradient(135deg, #3a7dc9 0%, #0f2035 100%);
  --gradient-dark-card: linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(224, 235, 248, 0.7) 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(43, 108, 176, 0.1), transparent 70%);

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow-cyan: 0 0 25px rgba(43, 108, 176, 0.2);
  --shadow-glow-indigo: 0 0 30px rgba(15, 32, 53, 0.15);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Layout */
  --container-max: 1240px;
  --header-height: 76px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient Background Light Mesh */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: 
    radial-gradient(circle at 15% 20%, rgba(43, 108, 176, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(200, 168, 75, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(58, 125, 201, 0.07) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Grid Pattern Overlay */
.grid-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black 40%, transparent 95%);
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 95%);
  pointer-events: none;
  z-index: 0;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.25rem); }
h2 { font-size: clamp(1.85rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.85rem); }
h4 { font-size: 1.25rem; }

p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Section Spacing */
.section {
  padding: 6.5rem 0;
  position: relative;
  z-index: 1;
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 4rem auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(43, 108, 176, 0.1);
  border: 1px solid rgba(43, 108, 176, 0.28);
  border-radius: var(--radius-full);
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.section-title {
  margin-bottom: 1rem;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

.text-gradient-emerald {
  background: var(--gradient-emerald);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header,
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  transition: all var(--transition-normal);
  background: rgba(240, 244, 250, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header.scrolled,
.header.scrolled {
  background: rgba(240, 244, 250, 0.97);
  border-bottom-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo,
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--text-main);
  text-decoration: none;
}

.logo-icon,
.logo-mark {
  width: 38px;
  height: 38px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--accent-cyan-glow);
  position: relative;
  overflow: hidden;
  color: #ffffff;
}

.logo-icon::after,
.logo-mark::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: var(--bg-secondary);
  border-radius: 9px;
  z-index: 1;
}

.logo-icon svg,
.logo-mark svg {
  position: relative;
  z-index: 2;
  color: var(--accent-cyan);
  width: 20px;
  height: 20px;
}

.brand-logo span span,
.logo-text span {
  color: var(--accent-cyan);
}

.nav-menu,
.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.65rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent-cyan);
  transition: width var(--transition-normal);
  border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-badge {
  display: inline-block;
  background: rgba(43, 108, 176, 0.15);
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  margin-left: 0.35rem;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Mobile Nav Toggle */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  padding: 0.5rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding-top: calc(var(--header-height) + 4.5rem);
  padding-bottom: 6rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 1rem;
  background: rgba(43, 108, 176, 0.1);
  border: 1px solid rgba(43, 108, 176, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.hero-badge .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.hero-title {
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero-description {
  font-size: 1.2rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  color: var(--text-muted);
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.metric-card h4 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-heading);
  margin-bottom: 0.25rem;
}

.metric-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Hero Interactive Visual Canvas / Workflow Card */
.hero-visual-card {
  background: var(--gradient-dark-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg), var(--shadow-glow-indigo);
  position: relative;
  backdrop-filter: blur(20px);
}

.visual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.window-dots {
  display: flex;
  gap: 6px;
}

.window-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.window-dots span:nth-child(1) { background: #ef4444; }
.window-dots span:nth-child(2) { background: var(--accent-amber); }
.window-dots span:nth-child(3) { background: var(--accent-emerald); }

.pipeline-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent-emerald);
  background: var(--accent-emerald-glow);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

/* Workflow Interactive Pipeline */
.workflow-pipeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.pipe-node {
  background: rgba(15, 32, 53, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-normal);
  position: relative;
}

.pipe-node:hover, .pipe-node.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px var(--accent-cyan-glow);
  transform: translateX(4px);
}

.node-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.node-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.node-icon.trigger { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.node-icon.agent { background: rgba(43, 108, 176, 0.2); color: var(--accent-cyan); }
.node-icon.action { background: rgba(200, 168, 75, 0.2); color: var(--accent-violet); }
.node-icon.sync { background: rgba(43, 108, 176, 0.2); color: var(--accent-emerald); }

.node-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.node-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.pipe-connector {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 12px;
  color: var(--text-dim);
}

.pipe-connector svg {
  width: 16px;
  height: 16px;
  animation: bounceDown 1.5s infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

.pipeline-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.live-speed {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  padding: 0.4rem 0;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent-cyan);
  transition: width var(--transition-normal);
  border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-badge {
  display: inline-block;
  background: rgba(43, 108, 176, 0.15);
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  margin-left: 0.25rem;
}

/* ==========================================================================
   Split-Screen & Responsive Header Layout
   ========================================================================== */
@media (max-width: 1120px) {
  .site-header,
  .header {
    height: auto !important;
    padding: 0.65rem 1rem 0.75rem !important;
  }

  .header-container {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem !important;
  }

  /* 1. Quick links on top, parallel with address bar */
  .nav-desktop,
  nav[aria-label="Main Navigation"],
  nav {
    order: 1 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }

  .nav-menu,
  .nav-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 1.1rem !important;
    width: 100% !important;
    position: static !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .nav-link {
    font-size: 0.85rem !important;
    white-space: nowrap !important;
    padding: 0.2rem 0 !important;
  }

  /* 2. Logo underneath the quick links (where the blue box is) */
  .brand-logo,
  .logo {
    order: 2 !important;
    margin: 0.25rem auto 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .logo-icon,
  .logo-mark {
    width: 32px !important;
    height: 32px !important;
  }

  .brand-logo span,
  .logo-text {
    font-size: 1.2rem !important;
  }

  .header-actions {
    display: none !important;
  }

  .menu-toggle,
  .mobile-menu-toggle {
    display: none !important;
  }

  /* Ensure hero & main content have clearance below the stacked header */
  main {
    padding-top: 8.5rem !important;
  }

  .hero-section,
  .page-hero {
    padding-top: 8.5rem !important;
  }
}

@media (max-width: 640px) {
  .nav-menu,
  .nav-list {
    gap: 0.75rem !important;
  }

  .nav-link {
    font-size: 0.78rem !important;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero-cta-group {
    flex-direction: column;
  }

  .hero-cta-group .btn {
    width: 100%;
    justify-content: center;
  }
}
