:root {
  --font-mono: 'Space Mono', monospace;

  /* Light Mode Palette - Gaslamp Inverted */
  --color-bg: #ffffff;
  --color-fg: #111111;
  --color-accent: #0066cc;
  /* Technical Blue for accent */
  --color-border: #cccccc;
  --color-surface: #f4f4f4;
  --color-shadow: rgba(0, 0, 0, 0.1);

  --spacing-unit: 8px;
  --container-width: 1200px;
}

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
  background-color: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-mono);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border-radius: 0 !important;
  /* Sharp corners per Gaslamp style */
}

/* Layout Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -1px;
}

/* Header */
.header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  z-index: 100;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -1px;
  text-transform: uppercase;
  border: 1px solid transparent;
  padding: 4px 8px;
  color: var(--color-fg);
}

.logo:hover {
  border-color: var(--color-fg);
  background: var(--color-surface);
}

.nav a {
  margin-left: 24px;
  font-size: 0.9rem;
  text-transform: uppercase;
  opacity: 0.7;
  transition: opacity 0.2s;
  font-weight: 500;
}

.nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Hero Section */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  /* Dotted grid pattern for technical feel */
  background-image: radial-gradient(var(--color-border) 1px, transparent 1px);
  background-size: 20px 20px;
}

.heroSplit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  position: relative;
  z-index: 1;
  align-items: center;
}

.heroLeft {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.headline {
  font-size: 4rem;
  /* Larger impact */
  line-height: 1;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 24px;
  letter-spacing: -3px;
  position: relative;
}

/* Blinking cursor effect on headline */
.headline::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 4rem;
  background: var(--color-accent);
  margin-left: 10px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.subheadline {
  font-size: 1.25rem;
  opacity: 0.8;
  margin-bottom: 48px;
  max-width: 600px;
  line-height: 1.7;
}

.ctaGroup {
  display: flex;
  gap: 16px;
}

.buttonPrimary,
.buttonSecondary {
  padding: 16px 32px;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid var(--color-fg);
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* Chamfered corners */
  clip-path: polygon(0 0,
      100% 0,
      100% calc(100% - 10px),
      calc(100% - 10px) 100%,
      0 100%);
  position: relative;
  overflow: hidden;
}

.buttonPrimary {
  background: var(--color-fg);
  color: var(--color-bg);
}

.buttonPrimary:hover {
  background: var(--color-accent);
  /* Active technical blue */
  border-color: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 102, 204, 0.3);
}

.buttonSecondary {
  background: transparent;
  color: var(--color-fg);
}

.buttonSecondary:hover {
  background: var(--color-surface);
  transform: translateY(-2px);
}

/* Terminal Mockup */
.terminalWindow {
  width: 100%;
  max-width: 500px;
  background: #1e1e1e;
  border: 1px solid var(--color-fg);
  /* Solid extrusion shadow */
  box-shadow: 15px 15px 0 var(--color-border);
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  color: #eeeeee;
  transition: transform 0.3s;
}

.terminalWindow:hover {
  transform: translate(-2px, -2px);
  box-shadow: 17px 17px 0 var(--color-accent);
}

.terminalHeader {
  background: #333;
  padding: 8px 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  color: #aaa;
  border-bottom: 1px solid #444;
}

.terminalBody {
  padding: 24px;
  color: #00ff00;
  white-space: pre-wrap;
  min-height: 300px;
  overflow-y: auto;
}

/* Sections */
.section {
  padding: 120px 0;
  border-bottom: 1px solid var(--color-border);
}

.sectionTitle {
  font-size: 2.5rem;
  margin-bottom: 80px;
  /* Side marker */
  border-left: 8px solid var(--color-accent);
  padding-left: 24px;
  line-height: 1;
}

/* Features Grid */
.featuresGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

.featureCard {
  border: 1px solid var(--color-border);
  padding: 40px;
  background: var(--color-bg);
  transition: all 0.3s;
  /* Chamfered top-right and bottom-left */
  clip-path: polygon(0 0,
      calc(100% - 20px) 0,
      100% 20px,
      100% 100%,
      20px 100%,
      0 calc(100% - 20px));
  position: relative;
}

.featureCard::before {
  /* Decorative corner accent */
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: var(--color-border);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  transition: background 0.3s;
}

.featureCard:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
  border-color: var(--color-accent);
}

.featureCard:hover::before {
  background: var(--color-accent);
}

.featureTitle {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--color-fg);
}

.featureDesc {
  font-size: 1rem;
  opacity: 0.7;
  line-height: 1.6;
}

/* Stack Diagram (Legacy - kept for reference if needed, but we are moving to Agent Grid) */
.stack-container {
  background: var(--color-surface);
  padding: 40px;
  border: 1px solid var(--color-border);
  clip-path: polygon(0 0,
      100% 0,
      100% calc(100% - 30px),
      calc(100% - 30px) 100%,
      0 100%);
}

/* Multi-Panel Agent Carousel */
.agent-carousel-container {
  overflow: hidden;
  width: 100%;
  position: relative;
  /* Fade mask at edges */
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  padding: 20px 0;
}

.agent-track {
  display: flex;
  gap: 30px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 10px;
  /* Space for shadows */
  width: 100%;
  /* Ensure it fits container */
}

/* Hide scrollbar for Chrome/Safari/Opera */
.agent-track::-webkit-scrollbar {
  display: none;
}

.agent-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 30px;
  display: flex;
  flex-direction: column;
  width: 350px;
  flex-shrink: 0;
  transition: all 0.3s;
  text-decoration: none;
  color: var(--color-fg);
  /* Slight chamfer */
  clip-path: polygon(0 0,
      100% 0,
      100% 100%,
      20px 100%,
      0 calc(100% - 20px));
  scroll-snap-align: center;
}

.agent-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  transform: translateY(-5px);
}

.agent-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.agent-icon {
  font-size: 2rem;
  color: var(--color-accent);
}

.agent-info {
  display: flex;
  flex-direction: column;
}

.agent-name {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1rem;
  letter-spacing: -0.5px;
}

.agent-desc {
  font-size: 0.75rem;
  opacity: 0.7;
  line-height: 1.4;
}

/* Code Snippet Styles */
.connection-code {
  background: #f4f4f4;
  padding: 15px;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  color: #333;
  border-left: 3px solid var(--color-accent);
  overflow-x: auto;
  position: relative;
}

.connection-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 5px;
  display: block;
  font-weight: 700;
}

.code-line {
  display: block;
}

.keyword {
  color: #d73a49;
}

.string {
  color: #032f62;
}

.function {
  color: #6f42c1;
}

/* Stack Diagram */
.stack-item {
  position: relative;
}

.stack-arrow {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-border);
}

.stack-box {
  background: var(--color-bg);
  border: 1px solid var(--color-fg);
  padding: 20px;
  text-align: center;
  position: relative;
  transition: all 0.3s;
}

/* Specific styling for stack items based on inline styles I will remove/replace in HTML */
.stack-box.channels {
  border-color: var(--color-fg);
}

.stack-box.gateway {
  border-color: var(--color-accent);
  background: rgba(0, 102, 204, 0.03);
}

.stack-box.vm {
  border-style: dashed;
  border-color: var(--color-fg);
  background: #fafafa;
}

.stack-box::after {
  /* Tech looking label tab */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: currentColor;
}

.stack-box.channels::after {
  background: var(--color-fg);
}

.stack-box.gateway::after {
  background: var(--color-accent);
}

.stack-box.vm::after {
  background: #999;
}

/* Scroll Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

/* Footer */
.footer {
  padding: 80px 0;
  text-align: center;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

/* Carousel Controls */
.carousel-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-fg);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.2rem;
}

.nav-btn:hover {
  background: var(--color-fg);
  color: var(--color-bg);
  border-color: var(--color-fg);
}

.nav-btn:active {
  transform: scale(0.95);
}

.carousel-dots {
  display: flex;
  gap: 12px;
}

.dot {
  width: 10px;
  height: 10px;
  background: var(--color-border);
  cursor: pointer;
  transition: all 0.2s;
  /* Diamond shape for industrial feel */
  transform: rotate(45deg);
}

.dot.active {
  background: var(--color-accent);
  transform: rotate(45deg) scale(1.2);
}

.dot:hover {
  background: var(--color-fg);
}

@media (max-width: 900px) {
  .heroSplit {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .headline {
    font-size: 2.5rem;
  }
}