:root {
  --bg-root: #07080a;
  --bg-surface: #0d0f13;
  --bg-panel: #12151b;
  --bg-elevated: #171b22;
  --border-hairline: #1f242d;
  --border-strong: #2e3543;
  --text-primary: #f3f5f8;
  --text-secondary: #9ba3b0;
  --text-dim: #5e6673;
  --emerald: #10b981;
  --emerald-dim: rgba(16, 185, 129, 0.12);
  --amber: #f59e0b;
  --crimson: #ef4444;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-root);
  color: var(--text-primary);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Precision Architectural Grid Background */
.bg-grid-pattern {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 15%, #000 40%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

.hidden {
  display: none !important;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-elevated);
  color: #e2e8f0;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid var(--border-hairline);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 8, 10, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
}

.header-inner {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
}

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

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.version-tag {
  font-size: 0.7rem;
  color: var(--text-dim);
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  padding: 0.1rem 0.38rem;
  border-radius: 3px;
}

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

.nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-item:hover {
  color: var(--text-primary);
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
}

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

.status-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Hero Section: Asymmetric Split */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  gap: 2.75rem;
  align-items: center;
  padding: 3.75rem 0 3.5rem;
  border-bottom: 1px solid var(--border-hairline);
}

.eyebrow-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
  font-size: 0.76rem;
}

.eyebrow-code {
  color: var(--emerald);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.eyebrow-sep {
  color: var(--text-dim);
}

.eyebrow-sub {
  color: var(--text-secondary);
  font-weight: 500;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.3vw, 2.85rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1.15rem;
}

.hero-lead {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2.25rem;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--text-primary);
  color: var(--bg-root);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.72rem 1.25rem;
  border-radius: 5px;
  border: 1px solid var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary-action:hover {
  background: #dce2ec;
}

.btn-ghost-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.72rem 1rem;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-ghost-action:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: var(--bg-panel);
}

/* Spec Strip */
.spec-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  border-radius: 5px;
  overflow: hidden;
}

.spec-cell {
  padding: 0.65rem 0.85rem;
  border-right: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.spec-cell:last-child {
  border-right: none;
}

.spec-k {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.spec-v {
  font-size: 0.75rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Hero Broadcast Monitor */
.hero-monitor {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
}

.monitor-chrome {
  height: 38px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-hairline);
  padding: 0 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.monitor-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.monitor-id {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
}

.monitor-res {
  font-size: 0.68rem;
  color: var(--emerald);
  background: var(--emerald-dim);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.monitor-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chrome-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.68rem;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  cursor: pointer;
}

.chrome-btn:hover,
.chrome-btn.active {
  color: var(--text-primary);
  border-color: var(--emerald);
}

.comparison-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.5;
  background: #040507;
  overflow: hidden;
  user-select: none;
}

#compCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.signal-pill {
  position: absolute;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(7, 8, 10, 0.85);
  border: 1px solid var(--border-strong);
  padding: 0.25rem 0.55rem;
  border-radius: 3px;
  font-size: 0.67rem;
  color: var(--text-primary);
  z-index: 4;
  pointer-events: none;
}

.pill-left {
  left: 10px;
}

.pill-right {
  right: 10px;
}

.pill-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.pill-indicator.bad {
  background: var(--crimson);
}

.pill-indicator.good {
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
}

.comp-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--text-primary);
  z-index: 5;
  pointer-events: none;
}

.comp-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  background: var(--bg-panel);
  border: 1px solid var(--text-primary);
  color: var(--text-primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.comp-range-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 6;
}

.monitor-footer {
  height: 32px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-hairline);
  padding: 0 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* Workspace Section */
.workspace-section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border-hairline);
}

.workspace-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-index {
  display: block;
  font-size: 0.72rem;
  color: var(--emerald);
  margin-bottom: 0.3rem;
}

.section-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.engine-telemetry {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.74rem;
}

.telemetry-key {
  color: var(--text-dim);
  margin-right: 0.35rem;
}

.telemetry-val {
  color: var(--emerald);
}

/* Workbench Shell */
.workbench-shell {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
}

/* Ingest Dropzone */
.ingest-bay {
  padding: 3.75rem 1.5rem;
  text-align: center;
  position: relative;
  background:
    radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.04), transparent 60%),
    var(--bg-surface);
  transition: background 0.15s ease;
}

.ingest-bay.dragover {
  background: rgba(16, 185, 129, 0.07);
}

.ingest-inner {
  max-width: 520px;
  margin: 0 auto;
}

.ingest-crosshair {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.ingest-icon-box {
  width: 54px;
  height: 54px;
  margin: 0 auto 1.1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald);
}

.ingest-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.ingest-caption {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

.ingest-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* Active Inspector Layout */
.inspector-bay {
  padding: 1.25rem;
}

.inspector-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.25rem;
}

.source-column,
.telemetry-column {
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-bar {
  height: 36px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-hairline);
  padding: 0 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.link-reset {
  background: none;
  border: none;
  color: var(--amber);
  font-size: 0.7rem;
  cursor: pointer;
  text-decoration: underline;
}

.player-frame {
  background: #030405;
  padding: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
}

#videoPreview {
  width: 100%;
  max-height: 330px;
  border-radius: 3px;
  background: #000;
}

.atom-strip {
  border-top: 1px solid var(--border-hairline);
  padding: 0.65rem 0.85rem;
  font-size: 0.72rem;
  background: var(--bg-surface);
}

.atom-strip-label {
  display: block;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
  font-size: 0.66rem;
}

.atom-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.atom-node {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  padding: 0.12rem 0.42rem;
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 0.7rem;
}

.atom-node.moov-good {
  border-color: var(--emerald);
  color: var(--emerald);
}

.atom-node.moov-late {
  border-color: var(--amber);
  color: var(--amber);
}

/* Telemetry Table */
.codec-badge {
  background: var(--emerald-dim);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 600;
}

.telemetry-table {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid var(--border-hairline);
}

.t-row {
  padding: 0.7rem 0.9rem;
  border-right: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.t-row:nth-child(2n) {
  border-right: none;
}

.t-key {
  font-size: 0.66rem;
  color: var(--text-dim);
}

.t-val {
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-all;
}

.t-val.accent {
  color: var(--emerald);
}

/* Pipeline Picker */
.pipeline-picker {
  padding: 0.95rem;
  flex: 1;
}

.picker-heading {
  display: block;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-bottom: 0.55rem;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.pipeline-option {
  cursor: pointer;
}

.pipeline-option input {
  display: none;
}

.pipeline-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 4px;
  padding: 0.75rem;
  height: 100%;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pipeline-option input:checked + .pipeline-box {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.04);
}

.pipeline-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.pipeline-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pipeline-tag {
  font-size: 0.65rem;
  color: var(--emerald);
  background: var(--emerald-dim);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.pipeline-desc {
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Execute Button */
.btn-execute {
  margin: 0 0.95rem 0.95rem;
  background: var(--emerald);
  color: #04130d;
  border: none;
  border-radius: 4px;
  padding: 0.85rem 1.15rem;
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.btn-execute:hover {
  filter: brightness(1.08);
}

.btn-execute:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-shortcut {
  font-size: 0.76rem;
  background: rgba(0, 0, 0, 0.18);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}

/* Execution Terminal Drawer */
.execution-drawer {
  margin-top: 1.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: 5px;
  padding: 0.95rem;
}

.exec-bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.exec-progress-rail {
  width: 100%;
  height: 6px;
  background: var(--bg-root);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.exec-progress-fill {
  height: 100%;
  background: var(--emerald);
  transition: width 0.2s ease;
}

.exec-terminal {
  background: #050608;
  border: 1px solid var(--border-hairline);
  border-radius: 4px;
  padding: 0.65rem 0.8rem;
  font-size: 0.74rem;
  color: #a7f3d0;
  max-height: 130px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Output Delivery Drawer */
.delivery-drawer {
  margin-top: 1.25rem;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid var(--emerald);
  border-radius: 5px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.delivery-summary {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.delivery-check {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--emerald);
  color: #03120c;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delivery-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.delivery-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.delivery-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn-download-master {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--emerald);
  color: #03120c;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 0.68rem 1.15rem;
  border-radius: 4px;
  text-decoration: none;
}

.btn-download-master:hover {
  filter: brightness(1.08);
}

/* Delivery Protocol Section (3 Steps) */
.protocol-section {
  padding: 3.5rem 0 4rem;
}

.transport-warning {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--amber);
  border-radius: 5px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
}

.warning-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 0.3rem;
}

.transport-warning p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.transport-warning strong {
  color: var(--text-primary);
}

.protocol-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.protocol-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 5px;
  padding: 1.4rem;
}

.protocol-card.active-protocol {
  border-color: var(--border-strong);
  background: var(--bg-panel);
}

.protocol-num {
  font-size: 0.75rem;
  color: var(--emerald);
  margin-bottom: 0.65rem;
}

.protocol-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

.protocol-note {
  font-size: 0.76rem;
  color: var(--text-primary);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-hairline);
  padding: 1.75rem 0;
  background: var(--bg-surface);
}

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

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-sep,
.footer-sub {
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.footer-right {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Responsive Breakpoints */
@media (max-width: 980px) {
  .hero-section {
    grid-template-columns: 1fr;
  }

  .inspector-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .spec-strip,
  .picker-grid,
  .telemetry-table {
    grid-template-columns: 1fr;
  }

  .main-nav {
    display: none;
  }
}
