:root {
  --bg: #070A12;
  --surface: #0F1422;
  --surface-2: #151C2F;
  --surface-3: #1B243B;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --border-cyan: rgba(56, 189, 248, 0.42);
  --border-emerald: rgba(52, 211, 153, 0.42);
  --cyan: #38BDF8;
  --cyan-dim: rgba(56, 189, 248, 0.14);
  --emerald: #34D399;
  --emerald-dim: rgba(52, 211, 153, 0.14);
  --amber: #FBBF24;
  --text: #F1F5F9;
  --text-soft: #CBD5E1;
  --muted: #94A3B8;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

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

code, pre {
  font-family: var(--font-mono);
}

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

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(60% 42% at 50% -6%, rgba(56, 189, 248, 0.16), transparent 70%),
    radial-gradient(40% 35% at 85% 18%, rgba(52, 211, 153, 0.10), transparent 72%),
    linear-gradient(to right, rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
}

.container {
  width: min(1140px, calc(100% - 2rem));
  margin-inline: auto;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  padding: 0.24rem 0.52rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
}

.brand-name {
  font-size: 1.05rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

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

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.68rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.btn:hover {
  border-color: var(--border-cyan);
  background: var(--surface-3);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.btn-sm {
  padding: 0.46rem 0.88rem;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  border-color: transparent;
  color: #04101B;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5CCCFB, #52E0AC);
  border-color: transparent;
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.34);
}

.btn-outline {
  background: rgba(15, 20, 34, 0.8);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--cyan);
}

.btn-ghost:hover {
  background: var(--cyan-dim);
  border-color: var(--border-cyan);
}

.btn-copy {
  padding: 0.5rem 0.95rem;
  background: var(--cyan-dim);
  border-color: var(--border-cyan);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: nowrap;
}

.btn-copy.copied {
  background: var(--emerald-dim);
  border-color: var(--border-emerald);
  color: var(--emerald);
}

.btn-block {
  width: 100%;
}

/* Hero */
.hero {
  padding: 4.5rem 0 2.75rem;
  text-align: center;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-cyan);
  background: rgba(56, 189, 248, 0.08);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

.hero-title {
  margin: 1.35rem auto 1rem;
  max-width: 18ch;
  font-size: clamp(2.15rem, 5vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.gradient-text {
  background: linear-gradient(120deg, var(--cyan), var(--emerald));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 auto 2rem;
  max-width: 68ch;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}

.hero-subtitle code,
.section-head code,
.tier-list code,
.proof-label code {
  padding: 0.12rem 0.38rem;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.18);
  color: var(--cyan);
  font-size: 0.9em;
}

.install-card {
  max-width: 780px;
  margin: 0 auto;
  padding: 1.15rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-cyan);
  box-shadow: var(--shadow), 0 0 40px rgba(56, 189, 248, 0.09);
}

.install-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  text-align: left;
}

.install-prompt {
  color: var(--emerald);
  font-family: var(--font-mono);
  font-weight: 700;
  user-select: none;
}

.install-cmd {
  flex: 1;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.94rem;
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.95rem;
}

/* Proof Strip */
.proof-section {
  padding: 1rem 0 2.5rem;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.95rem;
}

.proof-item {
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.16s ease;
}

.proof-item:hover {
  border-color: var(--border-cyan);
}

.proof-value {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.proof-label {
  margin-top: 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
}

/* Sections */
.section {
  padding: 3.25rem 0;
}

.section-head {
  margin-bottom: 1.85rem;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-bottom: 0.45rem;
}

.section-head h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  letter-spacing: -0.025em;
}

.section-head p {
  margin: 0;
  max-width: 72ch;
  color: var(--muted);
}

.pull-model-quote {
  color: var(--text-soft) !important;
  font-style: italic;
  border-left: 3px solid var(--emerald);
  padding-left: 0.9rem;
}

/* Calculator Component */
b8g-savings-calc,
b8g-rack-viewer {
  display: block;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr);
  gap: 1.5rem;
  align-items: start;
}

.calc-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
}

.field-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyan);
}

.field-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.num-input,
.select-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

.num-input {
  width: 132px;
  flex-shrink: 0;
}

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

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid var(--bg);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid var(--bg);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
  cursor: pointer;
}

.stack-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.stack-pill {
  padding: 0.58rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.stack-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.stack-pill.active {
  border-color: var(--border-cyan);
  background: var(--cyan-dim);
  color: var(--cyan);
}

.calc-outputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.kpi-box {
  padding: 1rem 1.05rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.kpi-box-highlight {
  border-color: var(--border-emerald);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.11), rgba(7, 10, 18, 0.95));
}

.kpi-box-wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-color: var(--border-cyan);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.11), rgba(52, 211, 153, 0.08));
}

.kpi-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.kpi-value {
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-sub {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.split-bar {
  grid-column: 1 / -1;
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--border);
}

.split-seg-rack { background: var(--muted); }
.split-seg-customer { background: var(--emerald); }
.split-seg-b8g { background: var(--cyan); }

/* Telemetry Viewer Component */
.viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.mode-toggle {
  display: inline-flex;
  padding: 0.24rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  gap: 0.24rem;
}

.mode-btn {
  padding: 0.44rem 0.85rem;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.mode-btn.active {
  background: var(--surface-2);
  border-color: var(--border-cyan);
  color: var(--cyan);
}

.viewer-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--emerald-dim);
  border: 1px solid var(--border-emerald);
  color: var(--emerald);
}

.status-badge.sim {
  background: var(--cyan-dim);
  border-color: var(--border-cyan);
  color: var(--cyan);
}

.sparkline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.chart-card {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.chart-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chart-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
}

.spark-canvas {
  display: block;
  width: 100%;
  height: 112px;
}

.telemetry-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.stat-tile {
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.stat-tile-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stat-tile-val {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.tenant-bar-wrap {
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 1.15rem;
}

.tenant-bar-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-bottom: 0.55rem;
}

.tenant-track {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
}

.tenant-active {
  background: linear-gradient(90deg, var(--emerald), #10B981);
  transition: width 0.35s ease;
}

.tenant-frozen {
  background: linear-gradient(90deg, var(--cyan), #0284C7);
  transition: width 0.35s ease;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.report-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.report-output {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: #04070D;
  border: 1px solid var(--border-emerald);
  color: var(--emerald);
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 320px;
}

.report-output[hidden] {
  display: none;
}

.extract-panel {
  margin-top: 1.15rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.extract-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.extract-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.extract-sub {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--emerald);
}

.extract-form {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.text-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

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

.extract-output {
  margin: 0.85rem 0 0;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: #04070D;
  border: 1px solid var(--border-cyan);
  color: var(--cyan);
  font-size: 0.8rem;
  line-height: 1.48;
  overflow-x: auto;
  max-height: 240px;
}

.extract-output[hidden] {
  display: none;
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.pricing-card-featured {
  border-color: var(--border-emerald);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.08), var(--surface) 45%);
  box-shadow: var(--shadow), 0 0 36px rgba(52, 211, 153, 0.10);
}

.tier-badge {
  align-self: flex-start;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--surface-3);
  color: var(--text-soft);
  margin-bottom: 0.9rem;
}

.tier-badge-emerald {
  background: var(--emerald-dim);
  color: var(--emerald);
  border: 1px solid var(--border-emerald);
}

.tier-badge-cyan {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--border-cyan);
}

.pricing-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
}

.tier-price {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.55rem;
}

.tier-period {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.tier-desc {
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.tier-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.tier-list li {
  position: relative;
  padding-left: 1.25rem;
}

.tier-list li::before {
  content: "+";
  position: absolute;
  left: 0;
  color: var(--emerald);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  padding: 1.75rem 0 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}

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

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

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

/* Responsive */
@media (max-width: 960px) {
  .proof-strip,
  .telemetry-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-grid,
  .sparkline-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-nav {
    display: none;
  }

  .hero {
    padding-top: 3rem;
  }

  .proof-strip,
  .calc-outputs,
  .telemetry-stats {
    grid-template-columns: 1fr;
  }

  .stack-pills,
  .extract-form {
    grid-template-columns: 1fr;
  }

  .kpi-box-wide {
    flex-direction: column;
    align-items: flex-start;
  }
}
