/* ══════════════════════════════════
   Equate — How It Works Page Styles
   ══════════════════════════════════ */

/* ── SCENARIO TABS ── */
.scenario-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 48px 0 56px;
  flex-wrap: wrap;
}

.scenario-tab {
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border-strong);
  background: transparent;
  color: var(--ink-muted);
  font-family: 'Epilogue', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scenario-tab:hover {
  border-color: var(--salmon);
  color: var(--ink);
}

.scenario-tab.active {
  background: var(--salmon);
  border-color: var(--salmon);
  color: var(--bg);
  box-shadow: 0 2px 8px rgba(232,115,90,0.3);
}

/* ── DEMO PANEL ── */
.demo-panel {
  max-width: 960px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 20px 60px rgba(0,0,0,0.07);
}

.demo-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.demo-col-header {
  padding: 12px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.demo-col-header:first-child {
  border-right: 1px solid var(--border);
}

.demo-column {
  padding: 24px 28px;
}

.demo-column + .demo-column {
  border-left: 1px solid var(--border);
}

/* ── EVENT LOG ── */
.event-log {
  background: var(--ink);
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  color: var(--bg);
  line-height: 1.9;
  min-height: 240px;
  overflow: hidden;
}

.event-log .ev-time { color: var(--ink-soft); }
.event-log .ev-ok   { color: #28c840; }
.event-log .ev-err  { color: #ff5f57; }
.event-log .ev-warn { color: #febc2e; }
.event-log .ev-info { color: var(--salmon); }

.log-entry {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.log-entry.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── SITE ROW HIGHLIGHT ── */
.site-row.affected {
  box-shadow: inset 0 0 0 1.5px var(--salmon);
  background: var(--salmon-light);
}

/* ── EXPLAINER ── */
.scenario-explainer {
  max-width: 640px;
  margin: 56px auto 0;
  text-align: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.scenario-explainer.is-fading {
  opacity: 0;
  transform: translateY(8px);
}

.explainer-heading {
  font-family: 'Epilogue', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 12px;
}

.explainer-body {
  font-size: 0.925rem;
  color: var(--ink-muted);
  line-height: 1.8;
}

@media (max-width: 900px) {
  .demo-panel {
    margin: 0 16px;
  }

  .demo-split {
    grid-template-columns: 1fr;
  }

  .demo-column + .demo-column {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 640px) {
  .scenario-tabs {
    justify-content: flex-start;
  }
}

/* ── MONITORING EXPLAINER ── */
.plane-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 48px 56px;
  align-items: stretch;
}

.plane {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
}

.plane h2 { margin: 8px 0 20px; font-size: 1.25rem; letter-spacing: -.025em; }
.plane-label { font-family: 'JetBrains Mono', monospace; font-size: .65rem; color: var(--salmon); letter-spacing: .08em; text-transform: uppercase; }
.plane-stack { display: grid; gap: 9px; }
.plane-node { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); font-size: .82rem; color: var(--ink-soft); }
.plane-node strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: .82rem; }
.plane-bridge { display: grid; place-items: center; min-width: 105px; color: var(--salmon); font-family: 'JetBrains Mono', monospace; font-size: .66rem; line-height: 1.5; text-align: center; }

.health-model { max-width: 1100px; margin: 0 auto; padding: 0 48px 80px; }
.health-model-header { max-width: 650px; margin-bottom: 28px; }
.health-model-header h2 { margin: 8px 0; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.04em; }
.health-model-header p { color: var(--ink-muted); line-height: 1.7; }
.health-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.health-card { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); }
.health-card h3 { margin: 10px 0 8px; font-size: 1rem; }
.health-card p { color: var(--ink-muted); font-size: .8rem; line-height: 1.65; }
.health-marker { display: block; width: 30px; height: 7px; border-radius: 999px; background: var(--ink-muted); }
.health-card.is-healthy .health-marker { background: #28c840; }
.health-card.is-warning .health-marker { background: #febc2e; }
.health-card.is-critical .health-marker { background: #ff5f57; ; }
.health-card.is-unknown .health-marker { border: 1px dashed var(--ink-muted); background: transparent; }

@media (max-width: 900px) {
  .plane-diagram { grid-template-columns: 1fr; padding: 28px 20px 44px; }
  .plane-bridge { min-width: 0; padding: 2px 0; }
  .health-grid { grid-template-columns: 1fr 1fr; }
  .health-model { padding: 0 20px 60px; }
}

@media (max-width: 540px) { .health-grid { grid-template-columns: 1fr; } }

/* ── TOPOLOGY FLOW ── */
.topology-strip {
  padding: 28px 24px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.topo-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: 100%;
  max-width: 960px;
  flex-wrap: nowrap;
}

.topo-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 110px;
  text-align: center;
}

.topo-node-icon {
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.topo-node-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.topo-node-detail {
  font-size: 0.78rem;
  color: var(--ink);
  line-height: 1.3;
}

.node-pill {
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 4px 10px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.node-pill[hidden] {
  display: none;
}

.node-pill[data-pill-state="active"] {
  color: #28c840;
  border-color: #28c840;
  background: rgba(40, 200, 64, 0.14);
  box-shadow: 0 0 0 1px rgba(40, 200, 64, 0.2);
}

.topo-node[data-active-path="cellular"] .topo-node-icon {
  border-color: #febc2e;
  box-shadow: 0 0 0 4px rgba(254, 188, 46, 0.2);
}

.topo-node[data-active-path="degraded"] .topo-node-icon {
  border-color: #febc2e;
  box-shadow: 0 0 0 4px rgba(254, 188, 46, 0.2);
}

.topo-connector {
  position: relative;
  width: 110px;
  min-width: 110px;
  height: 90px;
}

.connector-line {
  width: 110px;
  height: 3px;
  background: var(--border-strong);
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.connector-line::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid var(--border-strong);
}

.topo-connector[data-state="healthy"] .connector-line {
  background: #28c840;
}

.topo-connector[data-state="healthy"] .connector-line::after {
  border-left-color: #28c840;
}

.topo-connector[data-state="degraded"] .connector-line {
  background: #febc2e;
}

.topo-connector[data-state="degraded"] .connector-line::after {
  border-left-color: #febc2e;
}

.topo-connector[data-state="failed"] .connector-line {
  background: #ff5f57;
}

.topo-connector[data-state="failed"] .connector-line::after {
  border-left-color: #ff5f57;
}

.topo-connector[data-state="standby"] .connector-line {
  background: var(--border-strong);
}

.topo-connector[data-state="standby"] .connector-line::after {
  border-left-color: var(--border-strong);
}

.connector-label {
  position: absolute;
  top: calc(50% + 18px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.topo-connector[data-active="true"] .connector-label {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 640px) {
  .topology-strip {
    padding: 18px 16px;
  }

  .topo-flow {
    gap: 14px;
  }

  .connector-line {
    width: 70px;
  }

  .topo-connector {
    min-width: 70px;
  }

  .topo-node {
    min-width: 80px;
  }
}
