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

/* Variables */
:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #222535;
  --border: #2a2d3e;
  --accent: #6c63ff;
  --accent-hover: #8b85ff;
  --text-primary: #e8e9f0;
  --text-secondary: #8b8fa8;
  --text-muted: #5c5f74;
  --nav-height: 60px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0;
}

.nav-divider {
  color: var(--border);
  font-size: 1.2rem;
  line-height: 1;
}

.nav-section {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-back {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: color 0.15s, border-color 0.15s;
}

.nav-back:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.nav-back svg {
  flex-shrink: 0;
}

/* Hero */
.hero {
  padding: 5rem 2rem 4rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

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

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
}

/* Section */
.section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--border);
}

.card {
  background: var(--surface);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  transition: background 0.15s;
  position: relative;
}

.card:hover {
  background: var(--surface-hover);
}

.card:hover .card-arrow {
  transform: translate(2px, -2px);
  color: var(--accent);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(108, 99, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-arrow {
  color: var(--text-muted);
  transition: transform 0.15s, color 0.15s;
  flex-shrink: 0;
  margin-top: 2px;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(108, 99, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(108, 99, 255, 0.2);
}

.card-tag.green {
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.2);
}

.card-tag.blue {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.2);
}

.card-tag.orange {
  background: rgba(251, 146, 60, 0.1);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.2);
}

.card-tag.pink {
  background: rgba(244, 114, 182, 0.1);
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.2);
}

/* Info bar */
.info-bar {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.info-item strong {
  color: var(--text-secondary);
}

/* Redoc host page */
.redoc-nav {
  position: relative;
  z-index: 200;
}

body.redoc-page {
  background: #fff;
  color: #333;
}

body.redoc-page .redoc-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* Footer */
.footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

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

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

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

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

/* Responsive */
@media (max-width: 640px) {
  .hero {
    padding: 3rem 1.25rem 2.5rem;
  }

  .section {
    padding: 0 1.25rem 3rem;
  }

  .info-bar {
    padding: 0 1.25rem 2rem;
  }

  .footer {
    padding: 1.5rem 1.25rem 2rem;
    flex-direction: column;
    align-items: flex-start;
  }

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

  .nav {
    padding: 0 1.25rem;
  }
}
