:root {
  --bg: #070c17;
  --bg-elev: #0e1628;
  --bg-card: #121c33;
  --bg-card-hover: #172442;
  --border: rgba(148, 163, 184, 0.16);
  --border-bright: rgba(56, 189, 248, 0.4);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #0ea5e9;
  --primary-bright: #38bdf8;
  --primary-glow: rgba(14, 165, 233, 0.25);
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.22);
  --amber: #f59e0b;
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.22);
  --mono: 'Cascadia Code', Consolas, 'Courier New', monospace;
  --sans: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: radial-gradient(circle at 20% 0%, #0f1f3d 0%, var(--bg) 52%);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

/* Header */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 12, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

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

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-bright), #0369a1);
  border: 2px solid #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 0 20px var(--primary-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 500;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #0284c7);
  color: #fff;
  box-shadow: 0 8px 28px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-bright), var(--primary));
  box-shadow: 0 10px 32px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--border-bright);
  background: rgba(56, 189, 248, 0.08);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.88rem;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--primary-bright);
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 22px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.65; }
}

.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.45rem);
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: -0.025em;
  max-width: 900px;
  margin: 0 auto 20px;
}

.gradient-text {
  background: linear-gradient(90deg, #38bdf8, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.12rem;
  max-width: 740px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 28px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.pill {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 0.83rem;
  color: var(--text-muted);
}

/* Sections */
section {
  padding: 68px 0;
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 42px;
}

.section-head .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-bright);
  margin-bottom: 8px;
}

.section-head h2 {
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-head p {
  color: var(--text-muted);
}

/* Interactive Simulator */
.sim-shell {
  background: var(--bg-elev);
  border: 1px solid var(--border-bright);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.sim-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.mode-tab:hover {
  color: var(--text);
  border-color: var(--border-bright);
}

.mode-tab.active {
  background: rgba(14, 165, 233, 0.18);
  border-color: var(--primary-bright);
  color: #fff;
}

.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-intruder {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-intruder.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 0 20px var(--red-glow);
}

/* Step progress bar */
.sim-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.sim-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.sim-step .step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.76rem;
  flex-shrink: 0;
}

.sim-step.active {
  border-color: var(--primary-bright);
  color: #fff;
  background: rgba(14, 165, 233, 0.14);
}

.sim-step.active .step-num {
  background: var(--primary);
  color: #fff;
}

.sim-step.done {
  border-color: rgba(16, 185, 129, 0.45);
  color: #a7f3d0;
}

.sim-step.done .step-num {
  background: var(--green);
  color: #fff;
}

.sim-step.blocked {
  border-color: var(--red);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.15);
}

.sim-step.blocked .step-num {
  background: var(--red);
  color: #fff;
}

/* Stage grid */
.sim-stage {
  display: grid;
  grid-template-columns: 1fr 120px 1.05fr 120px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.stage-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  min-height: 255px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.stage-col.glow-blue {
  border-color: var(--primary-bright);
  box-shadow: 0 0 26px var(--primary-glow);
}

.stage-col.glow-green {
  border-color: var(--green);
  box-shadow: 0 0 26px var(--green-glow);
}

.stage-col.glow-red {
  border-color: var(--red);
  box-shadow: 0 0 26px var(--red-glow);
}

.stage-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 10px;
}

.source-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 0.83rem;
  transition: all 0.25s ease;
}

.source-item.sending {
  border-color: var(--primary-bright);
  background: rgba(14, 165, 233, 0.14);
}

.source-item code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #e2e8f0;
  display: block;
}

.source-item span {
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* Flow pipes */
.pipe-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pipe-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--primary-bright);
  text-align: center;
}

.pipe-svg {
  width: 100%;
  height: 44px;
  overflow: visible;
}

.pipe-track {
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 3;
  fill: none;
}

.pipe-flow {
  stroke: var(--primary-bright);
  stroke-width: 3;
  stroke-dasharray: 8 10;
  fill: none;
  opacity: 0.25;
}

.pipe-flow.flowing {
  opacity: 1;
  animation: dashMove 0.75s linear infinite;
}

.pipe-flow.blocked {
  stroke: var(--red);
  opacity: 0.9;
  stroke-dasharray: 4 6;
  animation: none;
}

@keyframes dashMove {
  from { stroke-dashoffset: 36; }
  to { stroke-dashoffset: 0; }
}

.packet-dot {
  fill: #34d399;
  opacity: 0;
}

.packet-dot.flowing {
  opacity: 1;
  animation: packetTravel 1.1s linear infinite;
}

@keyframes packetTravel {
  0% { transform: translateX(0px); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateX(100px); opacity: 0; }
}

/* Engine center */
.tray-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 12, 23, 0.75);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  margin-bottom: 10px;
}

.tray-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.tray-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.82rem;
  color: #fff;
  background: #106ebe;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.tray-circle.syncing {
  background: #109b41;
  box-shadow: 0 0 14px rgba(16, 155, 65, 0.75);
}

.tray-circle.error {
  background: #d97706;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.75);
}

.tray-status-text {
  font-size: 0.77rem;
  font-weight: 600;
}

.engine-metrics {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 9px;
  padding: 10px;
  border: 1px solid var(--border);
}

.metric-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.79rem;
  margin-bottom: 6px;
}

.metric-line code {
  font-family: var(--mono);
  color: var(--primary-bright);
}

.progress-bar-wrap {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--green));
  transition: width 0.3s ease, background 0.2s ease;
}

.progress-bar-fill.blocked {
  background: var(--red);
}

/* Destination Box */
.hwid-card {
  background: rgba(7, 12, 23, 0.75);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 0.74rem;
}

.hwid-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.hwid-badge.ok {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.hwid-badge.wait {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.hwid-badge.fail {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

/* Toast + Console */
.sim-bottom {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
}

.sim-console {
  background: #050912;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 0.76rem;
  height: 118px;
  overflow-y: auto;
  color: #cbd5e1;
}

.log-line {
  margin-bottom: 4px;
}

.log-ok { color: #34d399; }
.log-err { color: #f87171; }
.log-info { color: #38bdf8; }

.sim-toast {
  background: #14203b;
  border: 1px solid var(--border-bright);
  border-left: 4px solid var(--primary-bright);
  border-radius: 11px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: border-color 0.25s ease;
}

.sim-toast.toast-ok {
  border-left-color: var(--green);
}

.sim-toast.toast-err {
  border-left-color: var(--red);
}

.toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

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

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  margin-bottom: 14px;
}

.feature-card h3 {
  font-size: 1.06rem;
  font-weight: 700;
  margin-bottom: 8px;
}

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

/* How-to Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.how-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
}

.how-num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-bright);
  background: rgba(14, 165, 233, 0.14);
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.how-card h3 {
  font-size: 1.02rem;
  margin-bottom: 8px;
}

.how-card p {
  font-size: 0.89rem;
  color: var(--text-muted);
}

/* CLI / Download Panels */
.split-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
}

.panel-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.panel-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.code-block {
  background: #050912;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 0.81rem;
  color: #bae6fd;
  overflow-x: auto;
  margin-bottom: 14px;
  position: relative;
}

.flags-list {
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 0.87rem;
  color: var(--text-muted);
}

.flags-list code {
  font-family: var(--mono);
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: 5px;
}

.download-box {
  background: linear-gradient(155deg, rgba(14, 165, 233, 0.14), rgba(16, 185, 129, 0.08));
  border: 1px solid var(--border-bright);
}

.meta-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 0.85rem;
}

.meta-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.meta-table td:first-child {
  color: var(--text-muted);
  width: 130px;
}

.hash-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(5, 9, 18, 0.7);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  word-break: break-all;
  margin-bottom: 18px;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.76rem;
  cursor: pointer;
  flex-shrink: 0;
}

.copy-btn:hover {
  border-color: var(--primary-bright);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 34px 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
  .sim-stage {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .pipe-box {
    transform: rotate(90deg);
    height: 44px;
    margin: 4px 0;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .nav-links {
    display: none;
  }
  .sim-steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .sim-bottom {
    grid-template-columns: 1fr;
  }
  .features-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }
}
