/* Live-demo page — scoped styles.
 *
 * Kept OUT of site.css deliberately: this sheet ships on exactly one route and
 * carries the only dark surface on an otherwise light site. Logical properties
 * throughout (inline-start/end, never left/right) so the Arabic RTL layout
 * mirrors without a single directional override.
 */

.demo-stage {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #0d1230;
  box-shadow: 0 24px 70px rgba(22, 31, 61, .22), 0 2px 0 rgba(255, 255, 255, .5) inset;
  border: 1px solid rgba(155, 139, 240, .22);
}

.demo-map {
  width: 100%;
  height: clamp(320px, 62vh, 620px);
  background: #0d1230;
}

.demo-map .maplibregl-canvas { outline: none; }

/* ── status strip ────────────────────────────────────────────────────────── */
.demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 12px 18px;
  background: rgba(13, 18, 48, .92);
  color: #e7e9f6;
  border-block-start: 1px solid rgba(155, 139, 240, .2);
  font-size: 14px;
}

.demo-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }

.demo-dot {
  inline-size: 9px;
  block-size: 9px;
  border-radius: 50%;
  background: #c9cede;
  flex: 0 0 auto;
}
/* Colour carries the same taxonomy the platform uses: green = fresh,
   amber = real but ageing, neutral = we do not have it. Never red-for-empty —
   an unstarted demo is not an error. */
.demo-dot[data-state="live"] { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }
.demo-dot[data-state="stale"] { background: #f0b429; box-shadow: 0 0 0 4px rgba(240, 180, 41, .18); }
.demo-dot[data-state="warming"],
.demo-dot[data-state="down"] { background: #8d94b5; }

.demo-meta { color: #b9c0da; display: inline-flex; align-items: center; gap: 6px; }
.demo-meta b { color: #fff; font-weight: 700; }
.demo-sep { color: rgba(185, 192, 218, .45); }

.demo-zoom { margin-inline-start: auto; display: inline-flex; gap: 6px; }
.demo-zoom button {
  inline-size: 30px;
  block-size: 30px;
  border-radius: 9px;
  border: 1px solid rgba(155, 139, 240, .35);
  background: rgba(155, 139, 240, .12);
  color: #e7e9f6;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease;
}
.demo-zoom button:hover { background: rgba(155, 139, 240, .26); }
.demo-zoom button:focus-visible { outline: 2px solid #9b8bf0; outline-offset: 2px; }

/* ── the disclosure ──────────────────────────────────────────────────────── */
/* Not a footnote. It sits ABOVE the map, at body-copy size, because the whole
   page is only honest if this line is read before the moving dots are. */
.demo-disclosure {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 16px;
  background: #f4f1ff;
  border: 1px solid rgba(111, 95, 201, .28);
  color: #2a2456;
  margin-block-end: 22px;
  line-height: 1.65;
}
.demo-disclosure .dd-i { flex: 0 0 auto; color: #6f5fc9; margin-block-start: 2px; }
.demo-disclosure b { color: #1d1840; }

/* ── no-WebGL / no-JS fallback ───────────────────────────────────────────── */
.demo-fallback {
  padding: 18px;
  color: #e7e9f6;
  max-block-size: clamp(320px, 62vh, 620px);
  overflow: auto;
}
.demo-fallback p { color: #b9c0da; margin-block-end: 12px; }
.demo-fallback ul { list-style: none; margin: 0; padding: 0; }
.demo-fallback li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-block-end: 1px solid rgba(155, 139, 240, .14);
  font-size: 14px;
}
.demo-fallback li span { color: #9ea6c8; font-variant-numeric: tabular-nums; }
.demo-map[data-nomap="1"] { display: none; }

/* ── the "what you are looking at" strip ─────────────────────────────────── */
.demo-notes { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); margin-block-start: 26px; }
.demo-note { padding: 18px; border-radius: 16px; background: #fff; border: 1px solid rgba(22, 31, 61, .1); }
.demo-note h3 { font-size: 17px; margin: 0 0 6px; }
.demo-note p { margin: 0; color: #4a5273; font-size: 15px; line-height: 1.65; }

@media (max-width: 860px) {
  .demo-notes { grid-template-columns: 1fr; }
  .demo-zoom { margin-inline-start: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-zoom button { transition: none; }
}
