/* Design System & Global Styles for rnvtechnologies.com */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

/* Dynamic rotating gradient angle */
@property --gradient-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

:root {
  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* Theme variables - Dark Mode (Default) */
  --bg-primary: #030712;
  --bg-secondary: #080f25;
  --bg-surface: rgba(13, 20, 38, 0.55);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #00f0ff;
  --accent-secondary: #3b82f6;
  --accent-glow: rgba(0, 240, 255, 0.15);
  --accent-rgb: 0, 240, 255;
  
  --glass-shadow: rgba(0, 0, 0, 0.4);
  --card-hover-bg: rgba(255, 255, 255, 0.02);

  /* WhatsApp Branding */
  --wa-green: #25d366;
  --wa-glow: rgba(37, 211, 102, 0.25);
  
  --transition-speed: 0.3s;
  --border-radius: 16px;
}

[data-theme="light"] {
  /* Theme variables - Light Mode */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-surface: rgba(255, 255, 255, 0.7);
  --border-color: rgba(15, 23, 42, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-primary: #2563eb;
  --accent-secondary: #0ea5e9;
  --accent-glow: rgba(37, 99, 235, 0.1);
  --accent-rgb: 37, 99, 235;
  
  --glass-shadow: rgba(15, 23, 42, 0.06);
  --card-hover-bg: rgba(15, 23, 42, 0.02);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.6;
}

/* Interactive Canvas Background */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.8;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem);
}

.glass {
  background: var(--bg-surface);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px var(--glass-shadow);
  transition: border-color var(--transition-speed), background-color var(--transition-speed);
}

/* Header & Navigation */
header {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - clamp(2rem, 8vw, 6rem));
  max-width: 1200px;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--accent-primary);
}

nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition-speed);
  position: relative;
}

nav a:hover, nav a.active {
  color: var(--text-primary);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width var(--transition-speed);
}

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

/* Dropdown Menu Styling */
.dropdown {
  position: relative;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.dropdown-chevron {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition-speed) ease;
}

.dropdown:hover .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  width: 190px;
  padding: 0.6rem 0;
  border-radius: 12px !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dropdown-menu.glass {
  background: rgba(8, 15, 37, 0.96) !important;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(4px);
}

.dropdown-menu li {
  width: 100%;
}

.dropdown-menu li a {
  display: block !important;
  padding: 0.6rem 1.25rem !important;
  color: #94a3b8 !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  transition: background var(--transition-speed), color var(--transition-speed) !important;
  text-align: left;
}

.dropdown-menu li a::after {
  display: none !important; /* Remove line draw from sub-links */
}

.dropdown-menu li a:hover {
  background: rgba(0, 240, 255, 0.08) !important;
  color: #00f0ff !important;
}

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

/* Compact Swipe Switch Toggle */
.theme-swipe-toggle {
  position: relative;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-color);
  cursor: pointer;
  width: 58px;
  height: 30px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  padding: 0;
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .theme-swipe-toggle {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.swipe-track-icons {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  pointer-events: none;
  z-index: 1;
}

.swipe-track-icons svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2.5;
  transition: opacity 0.3s;
}

/* Sliding Active Knob */
.swipe-knob {
  position: absolute;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, var(--accent-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

[data-theme="light"] .swipe-knob {
  transform: translateX(28px);
  background: var(--accent-primary);
}

/* Style the SVG injected by JS inside the knob */
.swipe-knob svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  color: #030712;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .swipe-knob svg {
  color: #ffffff;
  transform: rotate(360deg);
}

/* Ensure the header text and links are always light/readable on dark navy glass */
header nav a {
  color: #94a3b8 !important;
}

header nav a:hover, header nav a.active {
  color: #00f0ff !important;
}

/* Forcing header to stay dark navy glass in light mode for high logo contrast */
[data-theme="light"] header {
  background: rgba(8, 15, 37, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Align and scale header buttons to match the swipe toggle height */
header .btn {
  padding: 0.45rem 1.25rem !important;
  font-size: 0.85rem !important;
  line-height: 1.2 !important;
}

header .btn-container {
  box-shadow: 0 0 10px var(--accent-glow) !important;
}

/* Hero Section */
.hero {
  padding-top: 12rem;
  padding-bottom: 6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  max-width: 900px;
  margin-bottom: 1.5rem;
  letter-spacing: -2px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-primary) 70%, var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  max-width: 600px;
  margin-bottom: 3rem;
}

/* Buttons with glowing borders & transitions */
.btn-container {
  position: relative;
  border-radius: 30px;
  padding: 1px;
  background: linear-gradient(var(--gradient-angle), var(--accent-primary), var(--accent-secondary), transparent);
  animation: rotate-grad 4s linear infinite;
  display: inline-block;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 2rem;
  border-radius: 29px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.btn-primary {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 30px;
  padding: 0.9rem 2rem;
  box-shadow: none;
}

.btn-secondary:hover {
  background-color: var(--card-hover-bg);
  border-color: var(--text-secondary);
}

/* Sections Structure */
section {
  padding: 6rem 0;
  position: relative;
  z-index: 1;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Grid & Cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.card {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-speed), border-color var(--transition-speed);
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* AI Sandbox Simulator & Visual Workspace */
.sandbox-wrapper {
  max-width: 1000px;
  margin: 0 auto;
}

.terminal-header {
  background: #111827;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #64748b;
}

.terminal-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #10b981;
  background: #030712;
  border-bottom-left-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  min-height: 280px;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.5;
}

.terminal-line {
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.terminal-prompt {
  color: var(--accent-primary);
}

/* Interactive SVG Workflow Sandbox */
.workflow-visualizer {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  align-items: center;
  margin-top: 4rem;
}

.nodes-container {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 900px;
  position: relative;
  padding: 1rem 0;
}

.node {
  width: clamp(70px, 10vw, 100px);
  height: clamp(70px, 10vw, 100px);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  z-index: 2;
  position: relative;
  text-align: center;
  box-shadow: 0 4px 20px var(--glass-shadow);
  transition: transform var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed), background var(--transition-speed);
}

.node.active {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 25px rgba(var(--accent-rgb), 0.6), inset 0 0 10px rgba(var(--accent-rgb), 0.3) !important;
  background: rgba(var(--accent-rgb), 0.08) !important;
  transform: scale(1.12);
}

.node.active svg {
  color: var(--accent-primary) !important;
}

.node:hover {
  transform: scale(1.1);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.3);
}


.node span {
  position: absolute;
  bottom: -2rem;
  width: 120px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  pointer-events: none;
}

.workflow-connector {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px;
  transform: translateY(-50%);
  z-index: 1;
}

.connector-line {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 3;
  stroke-dasharray: 8 6;
  animation: dash 30s linear infinite;
}

.connector-line-active {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 3;
  stroke-dasharray: 8 6;
  stroke-dashoffset: 0;
  animation: dash 15s linear infinite;
  opacity: 0;
  transition: opacity 0.5s ease;
}

@keyframes dash {
  to {
    stroke-dashoffset: -1000;
  }
}

/* Chatbot Widget & Collapsible Container */
.chat-widget-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.chat-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px var(--glass-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  transition: transform var(--transition-speed), border-color var(--transition-speed);
  position: relative;
}

.chat-toggle-btn:hover {
  transform: scale(1.05);
  border-color: var(--accent-primary);
}

.chat-toggle-btn svg {
  width: 28px;
  height: 28px;
  transition: transform 0.5s;
}

.chat-open .chat-toggle-btn svg {
  transform: rotate(90deg);
}

.pulse-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}

.chat-box {
  width: 380px;
  height: 520px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-open .chat-box {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.chat-avatar svg {
  width: 18px;
  height: 18px;
}

.chat-header-info h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
}

.chat-header-info span {
  font-size: 0.75rem;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-header-info span::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
}

.chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.msg {
  max-width: 80%;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.4;
  animation: message-fade 0.3s forwards;
}

@keyframes message-fade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-bot {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  white-space: pre-line;
}

.msg-typing {
  display: flex;
  gap: 4px;
  padding: 0.6rem 1rem;
  align-self: flex-start;
}
.msg-typing .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.2s infinite;
}
.msg-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.msg-typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.msg-user {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.chat-input-area {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
}

.chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.6rem 1.2rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-speed);
}

.chat-input:focus {
  border-color: var(--accent-primary);
}

.chat-send-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-speed);
}

.chat-send-btn:hover {
  transform: scale(1.1);
}

.chat-send-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Floating WhatsApp Widget */
.whatsapp-widget-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 1000;
}

.whatsapp-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px var(--glass-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wa-green);
  transition: transform var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
  position: relative;
  text-decoration: none;
}

.whatsapp-btn:hover {
  transform: scale(1.05);
  border-color: var(--wa-green);
  box-shadow: 0 0 20px var(--wa-glow);
}

.whatsapp-btn svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.whatsapp-pulse {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--wa-green);
  opacity: 0;
  animation: whatsapp-ring 2s infinite;
  pointer-events: none;
}

@keyframes whatsapp-ring {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* Scroll Reveal Base Class */
.reveal {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  filter: blur(5px);
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), filter 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* Footer styling */
footer {
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  background-color: rgba(0, 0, 0, 0.2);
  margin-top: 6rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr);
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 360px;
}

.footer-info p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-links h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--transition-speed);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Tabs & Tool Layouts */
.tools-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-speed);
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn.active {
  color: var(--accent-primary);
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1rem;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

/* WhatsApp QR Generator Styling */
.wa-results-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  justify-content: center;
}
@media (max-width: 650px) {
  .wa-results-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Mobile Hamburger Toggle button */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1010;
  padding: 10px;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-toggle span {
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
  pointer-events: none;
}
.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Drawer Overlay navigation */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  z-index: 1005;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  border-radius: 0 !important;
  border-top: none;
  border-bottom: none;
  border-right: none;
  background: rgba(8, 15, 37, 0.98) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
  pointer-events: none;
}
.mobile-drawer.open {
  transform: translateX(0);
  pointer-events: auto;
}
.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.mobile-drawer-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-speed);
  outline: none;
  touch-action: manipulation;
  min-width: 44px;
  min-height: 44px;
}
.mobile-drawer-close:hover {
  color: var(--text-primary);
}
.mobile-drawer-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem 0;
}
.mobile-drawer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.drawer-link {
  display: block;
  padding: 0.8rem 2rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 500;
  transition: all var(--transition-speed);
  border-left: 3px solid transparent;
  text-align: left;
  touch-action: manipulation;
}
.drawer-link:hover, .drawer-link.active {
  color: var(--text-primary);
  background: rgba(255,255,255,0.02);
  border-left-color: var(--accent-primary);
}

/* Drawer collapsible sub-sections */
.drawer-dropdown-btn {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.8rem 2rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: color var(--transition-speed);
  outline: none;
}
.drawer-dropdown-btn:hover {
  color: var(--text-primary);
}
.drawer-dropdown-btn .dropdown-chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-speed);
}
.drawer-dropdown.active .drawer-dropdown-btn {
  color: var(--text-primary);
}
.drawer-dropdown.active .dropdown-chevron {
  transform: rotate(180deg);
}
.drawer-dropdown-menu {
  list-style: none;
  display: none;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.drawer-dropdown.active .drawer-dropdown-menu {
  display: block;
}
.drawer-dropdown-menu .drawer-link {
  padding-left: 3.5rem;
  font-size: 0.95rem;
}

/* Sticky Bottom Action bar for phones */
.mobile-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 0.8rem 1.5rem;
  display: none;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 0 !important;
  border-left: none;
  border-right: none;
  border-bottom: none;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
}
.btn-wa-sticky {
  flex: 1;
  background-color: var(--wa-green);
  color: #030712;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 12px var(--wa-glow);
}
.btn-wa-sticky:active {
  transform: scale(0.98);
}
.btn-sticky-getintouch {
  flex: 1;
  padding: 0.75rem !important;
  font-size: 0.95rem !important;
  border-radius: 8px !important;
}

/* Services Grid Layout Controls (ensures perfect alignment) */
#services .grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
  #services .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive Overrides */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  header {
    width: 100%;
    top: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    padding: 1rem 1.5rem;
  }
  
  nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* Services Grid Swipe Snap Carousel */
  #services .grid-3 {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.25rem;
    padding: 0.5rem 0.25rem 1.5rem 0.25rem;
    -webkit-overflow-scrolling: touch;
  }
  #services .grid-3::-webkit-scrollbar {
    height: 4px;
  }
  #services .grid-3::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 2px;
  }
  #services .card {
    flex: 0 0 clamp(280px, 80vw, 360px);
    scroll-snap-align: start;
    margin: 0;
  }

  .nodes-container {
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    height: 600px;
    padding: 0;
  }

  .node span {
    position: relative;
    bottom: auto;
    display: block;
    margin-top: 0.5rem;
  }

  .workflow-connector {
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    transform: translateX(-50%);
  }
}

@media (max-width: 600px) {
  .mobile-sticky-cta {
    display: flex;
  }
  
  .whatsapp-widget-container {
    display: none !important;
  }
  
  /* Shift chatbot button above the sticky cta */
  .chat-widget-container {
    bottom: 5.5rem !important;
  }
}

@media (max-width: 480px) {
  .chat-box {
    width: calc(100vw - 2rem);
    height: 480px;
  }
  
  .chat-widget-container {
    right: 1rem;
    bottom: 5.5rem;
  }
}

