:root {
  --bg-root: #080a0f;
  --bg-panel: #0f131c;
  --bg-panel-alt: #141a26;
  --bg-elevated: #1a2232;
  --border-subtle: #1f293d;
  --border-highlight: #2e3d59;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #38bdf8;
  --accent-cyan-dim: rgba(56, 189, 248, 0.14);
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.14);
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-indigo: #6366f1;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-root);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  background-color: var(--bg-root);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(56, 189, 248, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 82% 18%, rgba(245, 158, 11, 0.05) 0%, transparent 45%);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

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

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 10, 15, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: #34d399;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.16s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #041019;
  box-shadow: 0 2px 14px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-panel-alt);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-cyan);
}

/* Hero Section */
.hero {
  padding: 64px 0 36px;
}

.hero-top {
  max-width: 820px;
  margin: 0 auto 42px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid var(--border-highlight);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.35rem);
  line-height: 1.13;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
  font-weight: 800;
}

.hero h1 span {
  background: linear-gradient(90deg, #38bdf8 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.telemetry-strip {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  padding: 9px 18px;
  border-radius: 8px;
  background: rgba(15, 19, 28, 0.85);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.telemetry-strip strong {
  color: var(--text-primary);
}

/* NLE Studio Workspace Mockup */
.nle-frame {
  background: var(--bg-panel);
  border: 1px solid var(--border-highlight);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.65);
  margin-bottom: 72px;
}

.nle-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #0b0e15;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  gap: 12px;
  flex-wrap: wrap;
}

.nle-window-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.nle-window-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #334155;
}

.nle-window-dots span:nth-child(1) { background: #ef4444; }
.nle-window-dots span:nth-child(2) { background: #f59e0b; }
.nle-window-dots span:nth-child(3) { background: #10b981; }

.nle-project-title {
  color: var(--text-primary);
  font-weight: 600;
}

.nle-stream-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
}

.badge-amber {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-cyan {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.nle-upper {
  display: grid;
  grid-template-columns: 260px 1fr 270px;
  border-bottom: 1px solid var(--border-subtle);
  min-height: 310px;
}

.nle-pane {
  padding: 14px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.nle-pane:last-child {
  border-right: none;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.bin-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.bin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bg-panel-alt);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.14s ease;
}

.bin-item:hover,
.bin-item.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.bin-item-name {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bin-item-meta {
  color: var(--text-muted);
  font-size: 0.68rem;
  flex-shrink: 0;
  margin-left: 8px;
}

/* Program Monitor Center */
.monitor-pane {
  background: #07090e;
  justify-content: space-between;
}

.monitor-viewport {
  position: relative;
  flex: 1;
  background:
    linear-gradient(135deg, #0d1522 0%, #111c2d 48%, #1d1626 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 210px;
}

.monitor-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.monitor-overlay-top {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  pointer-events: none;
}

.monitor-overlay-bottom {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  pointer-events: none;
}

.tc-readout {
  background: rgba(8, 10, 15, 0.85);
  border: 1px solid var(--border-highlight);
  padding: 3px 9px;
  border-radius: 4px;
  color: var(--accent-amber);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.monitor-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.transport-btns {
  display: flex;
  gap: 8px;
}

.transport-btn {
  background: var(--bg-panel-alt);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  padding: 4px 11px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
}

.transport-btn:hover,
.transport-btn.active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Right Inspector / Scopes */
.scope-box {
  background: #06080c;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  height: 108px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.inspector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.inspector-cell {
  background: var(--bg-panel-alt);
  border: 1px solid var(--border-subtle);
  padding: 7px 9px;
  border-radius: 5px;
}

.inspector-label {
  color: var(--text-muted);
  font-size: 0.66rem;
  display: block;
}

.inspector-val {
  color: var(--text-primary);
  font-weight: 600;
}

/* Timeline Lower Section */
.nle-timeline {
  background: #0a0d14;
  padding: 12px 16px 16px;
  position: relative;
}

.timeline-ruler {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 0 0 8px 110px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}

.timeline-tracks {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.track-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 10px;
  height: 30px;
}

.track-header {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--text-secondary);
  background: var(--bg-panel-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
}

.track-lane {
  position: relative;
  height: 100%;
  background: #0f141f;
  border-radius: 4px;
  border: 1px solid #182030;
  overflow: hidden;
}

.clip {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 3px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  color: #041019;
  font-weight: 600;
}

.clip-v1 {
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
}

.clip-v2 {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.clip-v3 {
  background: linear-gradient(90deg, #818cf8, #6366f1);
  color: #fff;
}

.clip-a1 {
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid #10b981;
  color: #6ee7b7;
}

.playhead-line {
  position: absolute;
  top: -22px;
  bottom: 0;
  left: 42%;
  width: 2px;
  background: var(--accent-rose);
  pointer-events: none;
  z-index: 10;
  transition: left 0.08s linear;
}

.playhead-cap {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 12px;
  height: 12px;
  background: var(--accent-rose);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* Sections */
.section {
  padding: 64px 0;
  border-top: 1px solid var(--border-subtle);
}

.section-header {
  max-width: 720px;
  margin-bottom: 42px;
}

.section-header h2 {
  font-size: 1.95rem;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

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

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 22px;
}

.feature-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 24px;
  transition: border-color 0.16s ease;
}

.feature-card:hover {
  border-color: var(--border-highlight);
}

.feature-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1.12rem;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* Codec & Bandwidth Table */
.table-wrap {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow-x: auto;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.spec-table th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #0b0e15;
}

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

.spec-table code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
}

/* Login Page */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-panel);
  border: 1px solid var(--border-highlight);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.auth-card h1 {
  font-size: 1.45rem;
  margin-bottom: 6px;
}

.auth-card .auth-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  padding: 10px 13px;
  border-radius: 7px;
  background: #080b11;
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.form-check input {
  margin-top: 4px;
}

.auth-alert {
  display: none;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 7px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
}

.auth-alert.visible {
  display: block;
}

.auth-footer-meta {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Docs Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 40px;
  padding: 48px 0 80px;
}

.docs-sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 18px;
}

.docs-nav-group {
  margin-bottom: 18px;
}

.docs-nav-group:last-child {
  margin-bottom: 0;
}

.docs-nav-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.docs-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}

.docs-nav-list a {
  color: var(--text-secondary);
  display: block;
  padding: 4px 8px;
  border-radius: 5px;
}

.docs-nav-list a:hover {
  color: var(--text-primary);
  background: var(--bg-panel-alt);
}

.docs-content h1 {
  font-size: 2.1rem;
  margin-bottom: 12px;
}

.docs-content h2 {
  font-size: 1.4rem;
  margin: 36px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.docs-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.code-block {
  background: #07090e;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.81rem;
  color: #e2e8f0;
  overflow-x: auto;
  margin-bottom: 20px;
  line-height: 1.55;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: #06080c;
  padding: 32px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

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

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

@media (max-width: 960px) {
  .nle-upper {
    grid-template-columns: 1fr;
  }
  .nle-pane {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    position: static;
  }
  .nav-links {
    display: none;
  }
}
