:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #111622;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-card-hover: rgba(26, 35, 54, 0.8);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-sub: #6b7280;

  --accent-primary: #6366f1;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --accent-glow: rgba(99, 102, 241, 0.25);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

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

/* Background Effects */
.bg-glow {
  position: fixed;
  top: -20%;
  left: 30%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  filter: blur(80px);
  z-index: -2;
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  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;
  z-index: -1;
  pointer-events: none;
}

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

/* Header */
.header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(16px);
  background: rgba(10, 13, 20, 0.75);
  border-bottom: 1px solid var(--bg-card-border);
  z-index: 100;
  padding: 16px 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  background: var(--accent-gradient);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.logo-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

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

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.live {
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.status-text {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Hero */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 100px;
  font-size: 13px;
  color: #a5b4fc;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

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

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

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

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.metric-card {
  background: rgba(18, 24, 38, 0.6);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: left;
}

.metric-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.metric-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* Section */
.section {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

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

/* Kong Pipeline Diagram */
.pipeline-container {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  overflow-x: auto;
  padding: 28px 20px;
  margin-bottom: 32px;
}

.pipeline-step {
  flex: 1;
  min-width: 150px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.pipeline-step.highlight {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.06);
}

.phase-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.phase-tag.active-tag {
  color: #a5b4fc;
}

.phase-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text-main);
}

.phase-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  flex-grow: 1;
}

.phase-detail {
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #d1d5db;
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  color: var(--text-sub);
  font-size: 16px;
  padding: 0 4px;
}

/* Entities Grid */
.entities-grid {
  margin-top: 24px;
}

.entity-card {
  text-align: left;
}

.entity-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.entity-badge {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.entity-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.entity-list {
  list-style: none;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entity-list code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-secondary);
}

/* Execution Phase Trace Box */
.trace-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.trace-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trace-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trace-pill {
  font-size: 11.5px;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.trace-pill.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.trace-pill.blocked {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: #f87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.trace-arrow {
  color: var(--text-sub);
  font-size: 12px;
}

/* Technical Comparison Table */
.table-card {
  overflow-x: auto;
  padding: 0;
}

.tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.tech-table th, .tech-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-card-border);
}

.tech-table th {
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
}

.tech-table td {
  color: var(--text-muted);
}

.tech-table tr:last-child td {
  border-bottom: none;
}

.tech-table code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-secondary);
}

  color: var(--text-sub);
  font-size: 20px;
  font-weight: 700;
}

/* Lab Controls */
.control-panel .card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.card-desc code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-secondary);
}

.rate-limit-meter {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 24px;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}

.meter-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
}

.meter-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  transition: width 0.3s ease, background 0.3s ease;
}

.meter-bar-fill.warning {
  background: var(--warning);
}

.meter-bar-fill.danger {
  background: var(--danger);
}

.control-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background: #4f46e5;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

.btn-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  background: rgba(245, 158, 11, 0.25);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  text-decoration: none;
}

.btn-ghost:hover {
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.test-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.text-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--bg-card-border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Console Panel */
.console-panel {
  display: flex;
  flex-direction: column;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bg-card-border);
  margin-bottom: 16px;
}

.console-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.console-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
}

.console-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.console-meta span {
  color: var(--text-main);
}

.console-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-box {
  background: #06090e;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a5b4fc;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 16px;
}

/* Curriculum Cards */
.curriculum-grid {
  margin-top: 20px;
}

.spec-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.spec-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-secondary);
  font-weight: 700;
  margin-bottom: 6px;
}

.spec-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.spec-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

.spec-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.spec-badge.verified {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Footer */
.footer {
  border-top: 1px solid var(--bg-card-border);
  padding: 32px 0;
  margin-top: 60px;
  color: var(--text-muted);
  font-size: 13px;
}

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

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

.footer-tag {
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }
  .arch-diagram {
    flex-direction: column;
  }
  .arch-arrow {
    transform: rotate(90deg);
  }
}
