/* Design System Tokens */
:root {
  /* Color Palette (User requested: #0470b8, #eb630d, black, white) */
  --primary: #0470b8;
  --primary-glow: rgba(4, 112, 184, 0.15);
  --accent: #eb630d;
  --accent-glow: rgba(235, 99, 13, 0.2);
  
  /* Theme-dependent tokens (Default: Dark Mode) */
  --bg-main: #07090e;
  --bg-second: #0d111a;
  --bg-card: rgba(17, 22, 34, 0.65);
  --bg-card-hover: rgba(22, 28, 45, 0.85);
  --bg-terminal: #0b0c10;
  
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(4, 112, 184, 0.4);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #07090e;
  
  --shadow-glow: 0 0 30px rgba(4, 112, 184, 0.25);
  --shadow-accent-glow: 0 0 30px rgba(235, 99, 13, 0.3);
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme overrides */
.light-theme {
  --bg-main: #f8fafc;
  --bg-second: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-terminal: #1e293b;
  
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(4, 112, 184, 0.6);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --shadow-glow: 0 10px 30px rgba(4, 112, 184, 0.1);
  --shadow-accent-glow: 0 10px 30px rgba(235, 99, 13, 0.15);
}

/* General Reset & Layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Ambient glows */
.glow-bg {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.12;
  transition: opacity 0.3s ease;
}
.light-theme .glow-bg {
  opacity: 0.05;
}
.glow-blue {
  top: 10%;
  left: -100px;
  background-color: var(--primary);
}
.glow-orange {
  top: 40%;
  right: -100px;
  background-color: var(--accent);
}

/* Typography & Helpers */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
}

.text-gradient-blue {
  background: linear-gradient(135deg, #0470b8 30%, #4da2db 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-orange {
  background: linear-gradient(135deg, #eb630d 30%, #ff8e42 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.font-mono {
  font-family: var(--font-mono);
}

/* Button & Badge Styles */
.badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--primary-glow);
  border: 1px solid rgba(4, 112, 184, 0.3);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 100px;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: #ff751f;
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent-glow);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text-main);
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}
.btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-hover);
}

/* Header Styles */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 100;
  background: rgba(7, 9, 14, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: height 0.3s ease, background 0.3s ease;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-main);
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
}

.logo span {
  background: linear-gradient(135deg, var(--text-main) 50%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  gap: 32px;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-menu a:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Hide inactive theme icon */
.sun-icon { display: block; }
.moon-icon { display: none; }
.light-theme .sun-icon { display: none; }
.light-theme .moon-icon { display: block; }

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

/* Hero Section */
.hero {
  padding-top: 160px;
  padding-bottom: 100px;
  position: relative;
}

.hero-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 560px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}

.hero-features-list {
  display: flex;
  gap: 24px;
}

.hero-feat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

/* Code Terminal Widget */
.code-terminal {
  background-color: var(--bg-terminal);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  width: 100%;
}

.terminal-header {
  background-color: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-red { background-color: #ef4444; }
.dot-yellow { background-color: #f59e0b; }
.dot-green { background-color: #10b981; }

.terminal-title {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.terminal-body {
  padding: 24px;
  font-size: 0.85rem;
  color: #d1d5db;
  line-height: 1.6;
}

.c-gray { color: #6b7280; }
.c-blue { color: #3b82f6; }
.c-orange { color: #eb630d; }
.c-yellow { color: #f59e0b; }
.c-green { color: #10b981; }

/* Features Grid */
.features-section {
  padding: 100px 0;
  background-color: var(--bg-second);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  transition: var(--transition);
  cursor: default;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background-color: var(--primary-glow);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 24px;
  transition: var(--transition);
}

.feature-card:hover .feature-icon {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 15px var(--primary);
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

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

/* Glass panel */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Simulator Section */
.simulator-section {
  padding: 100px 0;
}

.simulator-card {
  padding: 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.simulator-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}

.simulator-controls .btn-secondary.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.simulator-viewport {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Flow chart styles */
.flow-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 20px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  position: relative;
  min-height: 200px;
}

.node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 5;
  width: 180px;
  transition: var(--transition);
  opacity: 0.5;
}

.node.active {
  opacity: 1;
}

.node-icon {
  width: 56px;
  height: 56px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 12px;
  transition: var(--transition);
}

.node.active .node-icon {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-glow);
  box-shadow: var(--shadow-glow);
}

.node.failed .node-icon {
  border-color: #ef4444;
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.node.success .node-icon {
  border-color: var(--accent);
  color: var(--accent);
  background-color: var(--accent-glow);
  box-shadow: var(--shadow-accent-glow);
}

.node-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.node-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.node.active .node-status {
  color: var(--text-main);
}

.flow-line {
  flex-grow: 1;
  height: 2px;
  background-color: var(--border);
  position: relative;
  margin: 0 -10px;
  z-index: 1;
  overflow: hidden;
}

.flow-line.active {
  background-color: var(--primary-glow);
}

.pulse-dot {
  position: absolute;
  top: -4px;
  left: 0;
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  display: none;
}

@keyframes flowRight {
  0% { left: 0%; }
  100% { left: 100%; }
}

@keyframes flowLeft {
  0% { left: 100%; }
  100% { left: 0%; }
}

.flow-line.running .pulse-dot {
  display: block;
  animation: flowRight 1.5s infinite linear;
}

.flow-line.running-back .pulse-dot {
  display: block;
  animation: flowLeft 1.5s infinite linear;
}

/* Terminal Log inside Simulator */
.terminal-container {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-terminal);
}

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

.status-indicator {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-weight: 600;
}

.status-indicator.ready {
  background-color: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.status-indicator.running {
  background-color: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.status-indicator.success {
  background-color: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-indicator.failed {
  background-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.sim-terminal-log {
  padding: 16px;
  font-size: 0.85rem;
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-line {
  color: #d1d5db;
}

.log-line.system-msg { color: #6b7280; }
.log-line.info-msg { color: #3b82f6; }
.log-line.success-msg { color: #10b981; }
.log-line.warning-msg { color: #f59e0b; }
.log-line.error-msg { color: #ef4444; }

/* Code Tabs Section */
.docs-section {
  padding: 100px 0;
  background-color: var(--bg-second);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.code-tabs-wrapper {
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.02);
}

.tab-btn {
  background: none;
  border: none;
  padding: 16px 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: rgba(4, 112, 184, 0.05);
}

.tabs-content {
  padding: 24px;
  background-color: var(--bg-terminal);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

pre {
  overflow-x: auto;
  line-height: 1.5;
  font-size: 0.85rem;
}

/* Pricing Grid */
.pricing-section {
  padding: 100px 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.pricing-card {
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
  position: relative;
}

.pricing-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-hover);
}

.pricing-card.featured {
  border-color: var(--accent);
  background-color: rgba(235, 99, 13, 0.03);
}

.featured-badge {
  position: absolute;
  top: -12px;
  background-color: var(--accent);
  color: #ffffff;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 100px;
  text-transform: uppercase;
}

.plan-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.plan-price {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.plan-price span {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
}

.plan-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.plan-features {
  list-style: none;
  width: 100%;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.plan-features li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--primary);
  border-radius: 50%;
}

.pricing-card.featured .plan-features li::before {
  background-color: var(--accent);
}

.pricing-card .btn {
  width: 100%;
}

/* FAQ Accordion */
.faq-section {
  padding: 100px 0;
}

.faq-accordion {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  transition: var(--transition);
}

.faq-item summary {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item .chevron {
  transition: transform 0.3s ease;
}

.faq-item[open] .chevron {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 24px 20px 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-top: 1px solid transparent;
}

.faq-item[open] {
  border-color: var(--border-hover);
  background-color: var(--bg-card-hover);
}

/* Footer */
.main-footer {
  background-color: var(--bg-second);
  border-top: 1px solid var(--border);
  padding: 60px 0 20px 0;
}

.footer-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand {
  max-width: 320px;
}

.footer-brand .logo {
  margin-bottom: 16px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.footer-links h4 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: var(--text-main);
}

.footer-links a {
  display: block;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
  transition: var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-cta {
    justify-content: center;
  }
  .hero-features-list {
    justify-content: center;
  }
  .hero-visual {
    max-width: 600px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
  }
  
  .mobile-menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--text-main);
    border-radius: 4px;
    transition: var(--transition);
  }
  
  /* Mobile nav menu open state */
  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
    padding: 30px 24px;
    gap: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  }

  .mobile-menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -7px);
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .flow-container {
    flex-direction: column;
    gap: 20px;
    padding: 30px;
  }
  
  .flow-line {
    width: 2px;
    height: 30px;
    margin: -5px 0;
  }
  
  .flow-line.running .pulse-dot {
    animation: flowDown 1.5s infinite linear;
    left: -4px;
    top: 0;
  }
  
  @keyframes flowDown {
    0% { top: 0%; }
    100% { top: 100%; }
  }
}
