:root {
  color-scheme: dark;
  --bg: #06100e;
  --panel: #0c1716;
  --panel-2: #101f1d;
  --ink: #f4f7f6;
  --muted: #9aa8a6;
  --line: rgba(230, 238, 235, 0.14);
  --brand: #2d88f5;
  --green: #26b978;
  --amber: #c69b49;
  --red: #e25558;
  --blue-soft: rgba(45, 136, 245, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(115deg, rgba(45, 136, 245, 0.14), transparent 34rem),
    linear-gradient(180deg, #07110f 0%, #0a1412 46%, #06100e 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  font: inherit;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.demo-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(6, 16, 14, 0.9);
  backdrop-filter: blur(18px);
}

.brand img {
  display: block;
  width: 154px;
}

.demo-header nav {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 2.6vw, 30px);
  color: #cbd5d2;
  font-size: 14px;
}

.demo-header nav a:hover {
  color: #fff;
}

.header-cta,
.scenario-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  font-weight: 800;
}

.header-cta {
  padding: 0 18px;
  background: var(--brand);
  color: #fff;
}

main {
  padding-bottom: 72px;
}

.demo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.66fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
  padding: clamp(48px, 7vw, 92px) clamp(18px, 5vw, 72px) 28px;
}

.eyebrow,
.kicker {
  color: #d1ad62;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 16px;
  border: 1px solid rgba(198, 155, 73, 0.44);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(198, 155, 73, 0.09);
}

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

h1 {
  max-width: 1000px;
  margin-bottom: 18px;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.99;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.66;
}

.demo-hero p {
  max-width: 790px;
  font-size: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.summary-grid article,
.panel,
.integration-strip article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 31, 29, 0.96), rgba(7, 17, 15, 0.96));
  box-shadow: var(--shadow);
}

.summary-grid article {
  min-height: 108px;
  padding: 18px;
}

.summary-grid span,
.market-meta,
.source-row span,
.monitor-item span,
.sync-grid span,
.feed-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-grid strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(21px, 2.4vw, 28px);
  line-height: 1.1;
}

.integration-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 16px clamp(18px, 5vw, 72px) 18px;
}

.integration-strip article {
  min-height: 190px;
  padding: 18px;
}

.integration-strip article > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid rgba(45, 136, 245, 0.42);
  border-radius: 8px;
  color: #8fc2ff;
  background: var(--blue-soft);
  font-weight: 900;
}

.integration-strip h2 {
  margin-bottom: 10px;
}

.integration-strip p {
  margin-bottom: 0;
}

.integration-strip code {
  color: #d9ebe7;
}

.terminal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
  gap: 18px;
  padding: 18px clamp(18px, 5vw, 72px);
}

.left-stack,
.right-stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel {
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-title.compact {
  margin-bottom: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 11px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.live {
  color: #00170c;
  background: var(--green);
}

.status-pill.neutral {
  color: #d9ebe7;
  background: rgba(244, 247, 246, 0.08);
}

.status-pill.fallback {
  color: #111;
  background: var(--amber);
}

.status-pill.risk {
  color: #fff;
  background: var(--red);
}

.feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.feed-meta span,
.checklist span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(244, 247, 246, 0.04);
}

.feed-meta b {
  color: #fff;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.market-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(244, 247, 246, 0.035);
}

.market-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.market-head strong {
  display: block;
  margin-bottom: 4px;
}

.bookmaker-row {
  display: grid;
  grid-template-columns: 70px repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.bookmaker {
  color: #d9ebe7;
  font-size: 12px;
  font-weight: 900;
}

.backup-flag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 6px;
  border: 1px solid rgba(230, 238, 235, 0.14);
  border-radius: 999px;
  padding: 0 8px;
  color: #8fa09d;
  background: rgba(244, 247, 246, 0.04);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.backup-flag.active {
  border-color: rgba(198, 155, 73, 0.54);
  color: #ffe0a0;
  background: rgba(198, 155, 73, 0.14);
}

.odd-box {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.035);
}

.odd-box span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.odd-box strong {
  display: block;
  margin-top: 8px;
  font-size: 23px;
}

.odd-box.flash-up {
  border-color: rgba(226, 85, 88, 0.72);
}

.odd-box.flash-down {
  border-color: rgba(45, 136, 245, 0.72);
}

.odd-box.suspended {
  opacity: 0.58;
  border-color: rgba(230, 238, 235, 0.12);
  background: rgba(130, 139, 136, 0.1);
}

.chart-wrap {
  height: 250px;
}

#latency-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.grid-lines path {
  stroke: rgba(230, 238, 235, 0.1);
}

.chart-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.primary {
  stroke: var(--brand);
}

.chart-line.consensus {
  stroke: var(--green);
}

.chart-legend {
  fill: #9aa8a6;
  font-size: 12px;
}

.chart-legend circle {
  fill: var(--brand);
}

.chart-legend .green {
  fill: var(--green);
}

.sync-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.sync-grid div {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: rgba(244, 247, 246, 0.035);
}

.sync-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 21px;
}

.monitor-list,
.source-list {
  display: grid;
  gap: 10px;
}

.monitor-item,
.source-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: rgba(244, 247, 246, 0.035);
}

.monitor-item strong,
.source-row strong {
  display: block;
}

.monitor-code {
  min-width: 54px;
  border-radius: 999px;
  padding: 6px 9px;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
}

.monitor-code.grey {
  color: #101817;
  background: #aebbb7;
}

.monitor-code.red {
  color: #fff;
  background: var(--red);
}

.monitor-code.blue {
  color: #fff;
  background: var(--brand);
}

.monitor-code.green {
  color: #00170c;
  background: var(--green);
}

.scenario-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.scenario-actions button {
  border: 1px solid var(--line);
  color: #edf3f1;
  background: rgba(244, 247, 246, 0.055);
  cursor: pointer;
}

.scenario-actions button:hover,
.scenario-actions button.active {
  border-color: rgba(45, 136, 245, 0.58);
  background: rgba(45, 136, 245, 0.18);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.dot.warning {
  background: var(--amber);
}

.dot.danger {
  background: var(--red);
}

.audit-log {
  display: grid;
  gap: 8px;
  max-height: 315px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.audit-log li {
  border-left: 3px solid var(--brand);
  padding: 8px 10px;
  color: #dce5e2;
  background: rgba(244, 247, 246, 0.035);
  font-size: 13px;
}

.audit-log time {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.api-section {
  display: grid;
  grid-template-columns: 0.56fr 1fr;
  gap: 34px;
  align-items: start;
  margin: 18px clamp(18px, 5vw, 72px) 0;
  border: 1px solid #dfe7e4;
  border-radius: 8px;
  padding: 30px;
  background: #fff;
  color: #14201e;
  box-shadow: var(--shadow);
}

.api-section p {
  color: #66736f;
}

.api-section pre {
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  padding: 22px;
  color: #d9ebe7;
  background: #07110f;
  font-size: 14px;
  line-height: 1.68;
}

.checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.checklist span {
  color: #2d3b38;
  background: #f5f7f6;
  border-color: #dfe7e4;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .integration-strip,
  .sync-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-hero,
  .terminal-layout,
  .api-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .demo-header {
    grid-template-columns: 1fr auto;
  }

  .demo-header nav {
    display: none;
  }

  .brand img {
    width: 132px;
  }

  .demo-hero {
    padding-top: 42px;
  }

  h1 {
    font-size: 39px;
  }

  .summary-grid,
  .integration-strip,
  .market-grid,
  .scenario-actions,
  .sync-grid {
    grid-template-columns: 1fr;
  }

  .bookmaker-row {
    grid-template-columns: 1fr;
  }

  .odd-box {
    min-height: 62px;
  }

  .panel-title {
    flex-direction: column;
  }
}
