:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #06101d;
  --surface: #0b1726;
  --surface-2: #102135;
  --border: #203852;
  --text: #eef6ff;
  --muted: #95a9bf;
  --accent: #67e8f9;
  --accent-2: #38bdf8;
  --good: #34d399;
  --bad: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(14, 116, 144, .22), transparent 32rem),
    radial-gradient(circle at 90% 8%, rgba(37, 99, 235, .14), transparent 28rem),
    linear-gradient(180deg, #07111f, #050b14);
  color: var(--text);
}

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

.demo-banner {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: #082f49;
  border-bottom: 1px solid #155e75;
  color: #cffafe;
  font-size: .9rem;
}

.hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 48px;
  display: grid;
  grid-template-columns: 1.45fr .75fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .15em;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  line-height: .95;
  letter-spacing: -.055em;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  letter-spacing: -.03em;
}

h3 { margin-bottom: 6px; }

.hero-text,
.panel p,
.engineering-section p,
.proof-grid p,
footer {
  color: var(--muted);
}

.hero-text {
  max-width: 780px;
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button,
button,
select {
  border-radius: 11px;
  border: 1px solid var(--border);
  font: inherit;
}

.button {
  padding: 12px 16px;
  font-weight: 800;
}

.button.primary {
  background: linear-gradient(135deg, #0e7490, #0369a1);
  border-color: #0891b2;
}

.button.ghost { background: rgba(11, 23, 38, .75); }

.architecture-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(11, 23, 38, .88);
  box-shadow: var(--shadow);
}

.arch-node {
  padding: 13px;
  border-radius: 11px;
  background: #10243a;
  border: 1px solid #28445f;
  text-align: center;
  font-weight: 750;
}

.arch-node.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.arch-node.split span {
  padding: 8px;
  background: #0a1a2a;
  border-radius: 8px;
}

.arch-arrow {
  text-align: center;
  color: var(--accent);
  font-size: 1.2rem;
  padding: 5px 0;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 70px;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.proof-grid article {
  padding: 20px;
  border-radius: 18px;
  background: rgba(11, 23, 38, .82);
  border: 1px solid var(--border);
}

.proof-number {
  display: inline-block;
  margin-bottom: 24px;
  color: #67e8f9;
  font-weight: 900;
  font-size: .8rem;
}

.demo-shell {
  border: 1px solid #27445f;
  border-radius: 24px;
  padding: 26px;
  background: rgba(7, 17, 31, .86);
  box-shadow: var(--shadow);
}

.section-title,
.panel-head,
.engineering-section {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.mode-badge {
  white-space: nowrap;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid #155e75;
  background: #083344;
  color: #a5f3fc;
  font-size: .74rem;
  font-weight: 850;
  letter-spacing: .08em;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 14px;
  align-items: end;
}

.controls label {
  display: grid;
  gap: 6px;
  min-width: 240px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

button,
select {
  padding: 11px 14px;
  color: var(--text);
  background: var(--surface-2);
}

button {
  cursor: pointer;
  font-weight: 800;
}

button:hover { filter: brightness(1.12); }

button.danger { background: #6e2134; border-color: #a73a53; }
button.success { background: #174f3d; border-color: #2a8063; }
button.secondary { background: #253448; }

.instruction-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0b1c2f;
  border: 1px solid #203a55;
  color: #c4d7e9;
  font-size: .9rem;
}

.message {
  min-height: 26px;
  padding-top: 10px;
  color: var(--accent);
  font-weight: 750;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 8px 0 18px;
}

.metric {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.metric-label {
  color: var(--muted);
  font-size: .85rem;
}

.metric-value {
  margin-top: 4px;
  font-size: 2rem;
  font-weight: 900;
}

.panel {
  margin-top: 16px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(11, 23, 38, .9);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.service-card {
  padding: 15px;
  border-radius: 14px;
  background: #0d1b2d;
  border: 1px solid #2a4663;
}

.service-card.offline {
  background: #26121a;
  border-color: #9f3850;
}

.state {
  display: inline-flex;
  margin-bottom: 8px;
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.state.online { color: var(--good); }
.state.offline { color: var(--bad); }

.service-meta {
  margin-top: 12px;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: .82rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.chart-panel {
  min-height: 350px;
}

.table-wrap { overflow-x: auto; }

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

th, td {
  padding: 11px 9px;
  text-align: left;
  border-bottom: 1px solid #1b3149;
}

th {
  color: #8fa8c0;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 900;
}

.badge.online,
.badge.resolved { background: #143c32; color: #a7f3d0; }

.badge.offline,
.badge.active { background: #572131; color: #fecdd3; }

.engineering-section {
  margin-top: 28px;
  padding: 28px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(11, 23, 38, .94), rgba(8, 47, 73, .46));
}

.engineering-section > div:first-child { max-width: 760px; }

.stack-list {
  max-width: 340px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-list span {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #31516f;
  background: #0c2034;
  color: #d7e9f8;
  font-size: .82rem;
  font-weight: 750;
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 40px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: .85rem;
}

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .engineering-section { flex-direction: column; }
}

@media (max-width: 620px) {
  .hero { padding-top: 48px; }
  .proof-grid,
  .summary-grid,
  .service-grid { grid-template-columns: 1fr; }
  .controls > * { width: 100%; }
  .controls label { min-width: 0; }
  .section-title { flex-direction: column; }
  footer { flex-direction: column; }
}


/* Mobile containment: keep charts and wide tables inside the viewport. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

main,
.hero,
.demo-shell,
.panel,
.chart-grid,
.chart-panel,
.table-wrap,
.engineering-section {
  min-width: 0;
  max-width: 100%;
}

.chart-grid > *,
.summary-grid > *,
.service-grid > *,
.proof-grid > * {
  min-width: 0;
}

.chart-panel {
  overflow: hidden;
}

.chart-panel canvas {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 260px !important;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  min-width: 680px;
}

@media (max-width: 620px) {
  .demo-shell {
    padding: 16px;
    border-radius: 18px;
  }

  .panel {
    padding: 15px;
  }

  .chart-panel {
    min-height: 0;
  }

  .chart-panel canvas {
    height: 230px !important;
  }

  .table-wrap {
    margin-inline: 0;
  }
}
