/* CSS Variables */
:root {
  /* Colors */
  --bg-primary: #0a0a0c;
  --bg-secondary: #121216;
  --bg-tertiary: #1a1a20;

  --accent-cyan: #00d2ff;
  --accent-blue: #0077ff;

  --text-main: #f0f0f5;
  --text-muted: #8b8f9e;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 210, 255, 0.2);

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

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

/* Background Grid & Canvas */
.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  z-index: -2;
  pointer-events: none;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 120px 0;
  position: relative;
}

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

.section-header h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.125rem;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: rgba(10, 10, 12, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  align-items: center;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
}

.logo .axiom {
  color: var(--text-main);
}

.logo .x {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
  margin: 0 1px;
}

.logo .os {
  color: var(--text-muted);
}

.logo.small {
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a:not(.btn) {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:not(.btn):hover {
  color: var(--text-main);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.btn.small {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 119, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 210, 255, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.05);
}

.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

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

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

/* Terminal Typing Cursor */
.typewriter-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background-color: var(--accent-cyan);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Code Showcase Hover Tab Effect */
.code-tab.active {
  background: rgba(0, 210, 255, 0.05) !important;
}

.code-tab:hover:not(.active) {
  color: var(--text-main) !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 160px;
  /* Increased from 80px to prevent overlap with navbar */
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 10;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.hero-title .x {
  color: var(--accent-cyan);
  display: inline-block;
  text-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 24px;
  font-family: var(--font-display);
}

.hero-desc {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 48px auto;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 40px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

/* 3D Tilt Glare elements */
.card-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
  mix-blend-mode: overlay;
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  /* The rest of the transform is handled by JS for 3D tilt */
}

.card:hover .card-glare {
  opacity: 1;
}

.card:hover::before {
  transform: translateX(100%);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  color: var(--accent-cyan);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 12px;
  font-weight: 600;
}

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

/* Architecture Layering */
.architecture-diagram {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.layer {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 24px 32px;
  border-radius: 4px;
  position: relative;
  z-index: 2;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.layer:hover {
  border-color: var(--accent-cyan);
  background: #15151a;
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.05);
}

.layer-app {
  border-top: 2px solid #a855f7;
}

.layer-services {
  border-top: 2px solid #3b82f6;
}

.layer-kernel {
  border-top: 2px solid var(--accent-cyan);
}

.layer-hw {
  border-top: 2px solid #64748b;
}

.layer-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.layer-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.vertical-nodes {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  width: 2px;
  background: var(--border-color);
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

.node {
  width: 8px;
  height: 8px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  position: relative;
  transition: all 0.3s ease;
}

/* Data Flow Pulse Animation on Nodes */
.node.pulse {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan);
  box-shadow: 0 0 15px var(--accent-cyan);
  transform: scale(1.5);
}

/* Timeline/Status */
.timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  width: 120px;
}

.step-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  margin-bottom: 16px;
  transition: all 0.3s;
}

.timeline-step.active .step-marker {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.step-content {
  text-align: center;
}

.step-content h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.timeline-step.active .step-content h4 {
  color: var(--accent-cyan);
}

.timeline-line {
  flex-grow: 1;
  height: 2px;
  background: var(--border-color);
  margin-bottom: 35px;
  /* align with markers */
  min-width: 40px;
}

.timeline-line.active-line {
  background: linear-gradient(90deg, var(--accent-cyan), var(--border-color));
}

/* Ecosystem Vision */
.ecosystem-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.eco-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 200px;
}

.eco-icon {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 1.25rem;
}

.eco-item h4 {
  font-family: var(--font-display);
  font-weight: 500;
}

/* Follow Section */
.follow-section {
  background: linear-gradient(to bottom, transparent, var(--bg-tertiary));
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.follow-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.follow-content h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 16px;
}

.follow-content p {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.subscribe-form {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
}

.input-field {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 12px 16px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1rem;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 210, 255, 0.2);
}

.follow-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 40px;
  width: 100%;
  max-width: 500px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #fff;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.w-full {
  width: 100%;
}

/* Footer */
.footer {
  padding-top: 64px;
  background: var(--bg-primary);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 48px;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

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

.footer-bottom {
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
}

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

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

.monospaced {
  font-family: var(--font-mono);
  color: var(--accent-cyan) !important;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 3.5rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .timeline-line {
    display: none;
  }

  .timeline-step {
    flex-direction: row;
    gap: 16px;
    width: auto;
    text-align: left;
  }

  .step-marker {
    margin-bottom: 0;
  }

  .step-content {
    text-align: left;
  }

  .footer-content {
    flex-direction: column;
    gap: 32px;
  }

  .subscribe-form {
    flex-direction: column;
  }
}