:root {
  --sys-bg: #16130e;
  --sys-panel: #211c14;
  --sys-panel-2: #17130e;
  --sys-border: #3a3226;
  --sys-ink: #e8e0d2;
  --sys-muted: #a89a82;
  --sys-gold: #f79321;
  --sys-blue: #5aa9e6;
  --sys-green: #48d6a5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: clamp(10px, 3vw, 16px);
  background:
    linear-gradient(90deg, rgba(90, 169, 230, 0.08), transparent 34%),
    linear-gradient(180deg, #211c14 0%, var(--sys-bg) 42%, #100e0a 100%);
  color: var(--sys-ink);
  font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

.system-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 12px 0 62px;
}

.system-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 24px 0 18px;
  border-bottom: 1px solid rgba(232, 224, 210, 0.16);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--sys-gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 820px;
  margin: 0;
  color: #fff8ea;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 0.98;
  letter-spacing: 0;
}

.system-hero p {
  max-width: 760px;
  margin: 12px 0 0;
  color: #cfbea1;
  font-size: 15px;
  line-height: 1.55;
}

.status-chip {
  display: grid;
  min-width: 178px;
  padding: 12px;
  border: 1px solid rgba(72, 214, 165, 0.32);
  border-radius: 8px;
  background: rgba(72, 214, 165, 0.08);
}

.status-chip span {
  color: var(--sys-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-chip b {
  color: var(--sys-green);
  font-size: 24px;
  line-height: 1.15;
}

.system-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 4px;
}

.system-tabs a {
  color: #d8c9ab;
  border: 1px solid rgba(58, 50, 38, 0.9);
  border-radius: 6px;
  background: rgba(33, 28, 20, 0.82);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.system-tabs a:hover,
.system-tabs a.active {
  color: #16130e;
  border-color: var(--sys-gold);
  background: var(--sys-gold);
}

.subarena-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 2px;
}

.subarena-tabs a {
  color: #bfe7ff;
  border: 1px solid rgba(90, 169, 230, 0.38);
  border-radius: 6px;
  background: rgba(18, 31, 40, 0.64);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.subarena-tabs a:hover,
.subarena-tabs a.active {
  color: #07131b;
  border-color: var(--sys-blue);
  background: var(--sys-blue);
}

.section-band {
  padding: 22px 0;
  border-bottom: 1px solid rgba(58, 50, 38, 0.72);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 12px;
}

h2 {
  margin: 0;
  color: #fff2d7;
  font-size: 22px;
  line-height: 1.1;
}

.section-head p,
.section-band > p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--sys-muted);
  line-height: 1.55;
}

.component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.component-card,
.flow-step,
.proof-row {
  border: 1px solid var(--sys-border);
  border-radius: 8px;
  background: var(--sys-panel);
}

.component-card {
  display: grid;
  gap: 8px;
  min-height: 174px;
  padding: 14px;
}

.component-card .tag,
.flow-step .tag {
  color: var(--sys-blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.component-card h3,
.flow-step h3 {
  margin: 0;
  color: #fff8ea;
  font-size: 17px;
}

.component-card p,
.flow-step p,
.proof-row p {
  margin: 0;
  color: #c9b99c;
  font-size: 13px;
  line-height: 1.5;
}

.component-card a {
  align-self: end;
  color: var(--sys-gold);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.arena-scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.arena-metric {
  min-height: 104px;
  padding: 12px;
  border: 1px solid var(--sys-border);
  border-radius: 8px;
  background: var(--sys-panel);
}

.arena-metric span {
  display: block;
  color: var(--sys-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.arena-metric b {
  display: block;
  margin-top: 6px;
  color: var(--sys-gold);
  font-size: 24px;
  line-height: 1.1;
}

.arena-metric p {
  margin: 6px 0 0;
  color: #c9b99c;
  font-size: 12px;
  line-height: 1.45;
}

.arena-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 12px;
}

.arena-panel {
  border: 1px solid var(--sys-border);
  border-radius: 8px;
  background: var(--sys-panel);
  padding: 14px;
}

.arena-panel h3 {
  margin: 0 0 8px;
  color: #fff8ea;
  font-size: 18px;
}

.arena-panel p,
.arena-panel li {
  color: #c9b99c;
  font-size: 13px;
  line-height: 1.55;
}

.arena-panel ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.flow {
  display: grid;
  gap: 10px;
  counter-reset: flow;
}

.flow-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.flow-step::before {
  counter-increment: flow;
  content: counter(flow);
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #16130e;
  border-radius: 999px;
  background: var(--sys-gold);
  font-weight: 900;
}

.matrix {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  border: 1px solid var(--sys-border);
  border-radius: 8px;
  overflow: hidden;
}

.matrix div {
  padding: 10px;
  border-right: 1px solid var(--sys-border);
  border-bottom: 1px solid var(--sys-border);
  background: rgba(33, 28, 20, 0.82);
  color: #d8c9ab;
  font-size: 13px;
}

.matrix div:nth-child(3n) {
  border-right: 0;
}

.matrix .head {
  color: var(--sys-gold);
  background: #17130e;
  font-weight: 800;
  text-transform: uppercase;
}

code {
  color: #f0d19f;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.proof-list {
  display: grid;
  gap: 8px;
}

.proof-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 12px;
}

.proof-row b {
  color: var(--sys-green);
}

@media (max-width: 820px) {
  .system-shell {
    width: 100%;
    padding-bottom: 74px;
  }

  .system-hero,
  .section-head,
  .proof-row,
  .flow-step,
  .matrix,
  .arena-layout {
    grid-template-columns: 1fr;
  }

  .system-hero {
    align-items: stretch;
    gap: 14px;
    padding: 18px 0 14px;
  }

  .status-chip {
    min-width: 0;
  }

  .system-tabs,
  .subarena-tabs {
    flex-wrap: nowrap;
    padding-bottom: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .system-tabs a,
  .subarena-tabs a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .section-head {
    align-items: start;
  }

  .component-card {
    min-height: 0;
  }

  .matrix div,
  .matrix div:nth-child(3n) {
    border-right: 0;
  }

  .matrix div {
    overflow-wrap: anywhere;
  }

  .proof-row {
    gap: 5px;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: clamp(27px, 10vw, 38px);
    line-height: 1.02;
  }

  .system-hero p {
    font-size: 14px;
  }

  .section-band {
    padding: 18px 0;
  }

  .component-grid,
  .arena-scoreboard {
    grid-template-columns: 1fr;
  }

  .flow-step::before {
    width: 28px;
    height: 28px;
  }

  .matrix {
    display: block;
  }

  .matrix div {
    border-right: 0;
  }

  .matrix .head {
    position: sticky;
    top: 48px;
    z-index: 1;
  }
}
