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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --dark: #0f172a;
  --dark-light: #1e293b;
  --gray: #64748b;
  --light: #f1f5f9;
  --white: #ffffff;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background: var(--white);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: var(--white);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

nav {
  padding: 1rem 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.logo-img {
  width: 40px;
  height: 40px;
}

.pin-emoji {
  font-size: 2rem;
}

.pin-text {
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
  transition: color 0.3s;
}

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

.github-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--dark);
  color: var(--white) !important;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: background 0.3s;
}

.github-btn:hover {
  background: var(--primary);
}

/* Hero */
.hero {
  padding: 4rem 0;
  background: linear-gradient(135deg, #f1f5f9 0%, #e0e7ff 100%);
}

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

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

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

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--gray);
  max-width: 700px;
  margin: 0 auto 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.btn {
  padding: 0.875rem 2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-block;
}

.btn-primary {
  background: var(--gradient);
  color: var(--white);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: var(--white);
}

.hero-animation {
  max-width: 900px;
  margin: 0 auto;
  background: #0f0f23;
  border: 3px solid #00ff41;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.2);
}

.daemon-diagram {
  width: 100%;
  height: auto;
}

.pulse-line {
  animation: pulse-opacity 2s ease-in-out infinite;
}

.pulse-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes pulse-dot {
  0% { 
    opacity: 0;
    transform: translateX(0);
  }
  50% {
    opacity: 1;
  }
  100% { 
    opacity: 0;
    transform: translateX(60px);
  }
}

.cursor-blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.connect-line {
  animation: dash 2s linear infinite;
}

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

.event-log {
  opacity: 0;
}

.code-preview {
  background: var(--dark);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 700px;
  margin: 0 auto;
  text-align: left;
}

.code-preview pre {
  overflow-x: auto;
}

.code-preview code {
  color: #e2e8f0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Features */
.features {
  padding: 5rem 0;
}

.features h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

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

.feature-card {
  padding: 2rem;
  background: var(--white);
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  transition: all 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--dark);
}

.feature-card p {
  color: var(--gray);
}

/* Daemon Section */
.daemon-section {
  padding: 5rem 0;
  background: var(--light);
}

.daemon-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-subtitle {
  text-align: center;
  color: var(--gray);
  font-size: 1.2rem;
  margin-bottom: 3rem;
}

.daemon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.daemon-card {
  background: var(--white);
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
}

.daemon-card h3 {
  margin-bottom: 1.5rem;
  color: var(--primary);
}

.endpoint-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--light);
  border-radius: 0.5rem;
}

.method {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
}

.method.get {
  background: #10b981;
}

.method.post {
  background: #f59e0b;
}

.path {
  font-family: monospace;
  font-weight: 600;
}

.desc {
  color: var(--gray);
  font-size: 0.9rem;
}

.event-list {
  list-style: none;
}

.event-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.event-list code {
  background: var(--light);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-family: monospace;
  color: var(--primary);
}

.code-example {
  background: var(--dark);
  padding: 2rem;
  border-radius: 1rem;
  overflow-x: auto;
}

.code-example h4 {
  color: var(--white);
  margin-bottom: 1rem;
}

.code-example pre {
  overflow-x: auto;
}

.code-example code {
  color: #e2e8f0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre;
}

/* Quick Start */
.quickstart {
  padding: 5rem 0;
}

.quickstart h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.step-number {
  width: 3rem;
  height: 3rem;
  background: var(--gradient);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h3 {
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.step-content p {
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.step-content code {
  background: var(--dark);
  color: #e2e8f0;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  display: inline-block;
  font-family: monospace;
  word-break: break-all;
}

.download-link {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  margin-top: 0.5rem;
  transition: background 0.3s;
}

.download-link:hover {
  background: var(--primary-dark);
}

.step-content pre {
  background: var(--dark);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-top: 0.5rem;
}

.step-content pre code {
  padding: 0;
  white-space: pre;
}

/* Examples Section */
.examples-section {
  padding: 5rem 0;
  background: var(--light);
}

.examples-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.example-card {
  background: var(--white);
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.example-card h3 {
  margin-bottom: 0.75rem;
  color: var(--dark);
}

.example-card > p {
  color: var(--gray);
  margin-bottom: 1rem;
}

.example-card pre {
  background: var(--dark);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-top: 1rem;
}

.example-card code {
  color: #e2e8f0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
}

.example-usage {
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: var(--light);
  border-radius: 0.5rem;
}

.example-usage code {
  background: transparent;
  color: var(--primary);
  font-weight: 600;
}

.example-note {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--gray);
  font-style: italic;
}

/* Animation Preview Styles */
.animation-preview {
  background: #0f0f23;
  border: 2px solid #00ff41;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mini-animation {
  width: 100%;
  max-width: 100%;
  height: 200px;
}

.node {
  fill: #1a1a2e;
  stroke: #00ff41;
  stroke-width: 3;
}

.node.parallel {
  fill: #1a1a2e;
  stroke: #00d9ff;
}

.node.active {
  fill: #00ff41;
  stroke: #00ff41;
  animation: blink 0.8s ease-in-out infinite;
}

.node.completed {
  fill: #1a1a2e;
  stroke: #00ff41;
}

.arrow {
  stroke: #00ff41;
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.arrow.animate {
  animation: drawArrow 0.8s ease-out forwards;
}

.label {
  fill: #00ff41;
  font-size: 13px;
  font-weight: normal;
  text-anchor: middle;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
}

.label.active {
  fill: #1a1a2e;
}

.status-text {
  fill: #00ff41;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.4; }
}

@keyframes drawArrow {
  to { stroke-dashoffset: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Docs Section */
.docs-section {
  padding: 5rem 0;
  background: var(--light);
}

.docs-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.doc-card {
  background: var(--white);
  padding: 2rem;
  border-radius: 1rem;
  text-decoration: none;
  color: var(--dark);
  border: 1px solid #e2e8f0;
  transition: all 0.3s;
}

.doc-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.doc-card h3 {
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.doc-card p {
  color: var(--gray);
}

/* Footer */
footer {
  background: var(--dark);
  color: var(--white);
  padding: 2rem 0;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s;
}

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

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .nav-links a:not(.github-btn) {
    display: none;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-animation {
    padding: 1rem;
    overflow-x: auto;
  }

  .daemon-diagram {
    min-width: 700px;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .daemon-grid {
    grid-template-columns: 1fr;
  }

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