/* Event Horizon Interactive Playground — Paper-Ink & Forest Green */

.pg-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

.pg-hero {
  max-width: 860px;
  margin-bottom: 24px;
}
.pg-kicker {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.pg-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--ink);
}
.pg-lead {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-muted);
  margin: 0;
}
.pg-lead code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--ink);
}

/* 4-Scene Switcher */
.pg-scene-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.pg-scene-btn {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  text-align: left;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.pg-scene-btn:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.pg-scene-btn.active {
  background: var(--forest);
  border-color: var(--forest);
  color: #f4f7f4;
  box-shadow: 0 10px 26px rgba(31, 43, 40, 0.14);
}
.pg-scene-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--primary);
  flex-shrink: 0;
}
.pg-scene-btn.active .pg-scene-num {
  background: rgba(219, 232, 201, 0.16);
  color: var(--accent-bg);
}
.pg-scene-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.pg-scene-meta strong {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.3;
}
.pg-scene-meta small {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.35;
}
.pg-scene-btn.active .pg-scene-meta small {
  color: #bdd0c6;
}

/* Split Workspace */
.pg-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.18fr);
  gap: 20px;
  align-items: start;
}

/* Left Pane: Browser Stage */
.pg-stage-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pg-browser-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(24, 34, 30, 0.06);
}
.pg-browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #edf1ec;
  border-bottom: 1px solid var(--line);
}
.pg-dots {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.pg-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c6d0c9;
}
.pg-url-pill {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 10px;
}
.pg-open-lab {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.pg-open-lab:hover {
  text-decoration: underline;
}
.pg-shot-wrap {
  position: relative;
  background: #f8faf8;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.pg-shot-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.pg-mode-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(25, 38, 33, 0.88);
  color: #e6f2d8;
  border: 1px solid rgba(219, 232, 201, 0.35);
  backdrop-filter: blur(4px);
}
.pg-mode-badge.is-delta {
  background: rgba(20, 83, 45, 0.92);
  color: #dcfce7;
}
.pg-mode-badge.is-blocked {
  background: rgba(153, 27, 27, 0.94);
  color: #fee2e2;
  border-color: rgba(254, 202, 202, 0.45);
}

.pg-step-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.pg-step-pills {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}
.pg-step-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.pg-step-btn.active {
  background: var(--forest);
  color: #f3f7f4;
}
.pg-action-btn {
  white-space: nowrap;
}

.pg-takeaway {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
  padding: 14px 16px;
}
.pg-takeaway-head {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 5px;
}
.pg-takeaway-body {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}

/* Right Pane: KPIs & Inspector */
.pg-inspector-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.pg-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.pg-kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.pg-kpi-eh {
  background: #f1f6ee;
  border-color: #c5d9be;
}
.pg-kpi-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.pg-kpi-val {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.pg-kpi-eh .pg-kpi-val {
  color: var(--primary);
}
.pg-kpi-sub {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.pg-panel {
  background: #17211e;
  border: 1px solid #263530;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(20, 30, 27, 0.12);
}
.pg-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #111917;
  border-bottom: 1px solid #25342f;
  flex-wrap: wrap;
}
.pg-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pg-tab {
  border: 1px solid transparent;
  background: transparent;
  color: #9db0a7;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 7px;
  cursor: pointer;
}
.pg-tab:hover {
  color: #e6efe9;
  background: rgba(255, 255, 255, 0.05);
}
.pg-tab.active {
  background: #274136;
  border-color: #3f6856;
  color: #edf7ea;
}
.pg-copy-btn {
  border: 1px solid #354c43;
  background: #1d2b26;
  color: #d6e4dc;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.pg-copy-btn:hover {
  background: #283c35;
}

.pg-view {
  padding: 14px;
}
.pg-gate-banner {
  margin-bottom: 12px;
  padding: 11px 13px;
  border-radius: 9px;
  background: rgba(153, 27, 27, 0.24);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
}
.pg-code {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.58;
  color: #dce7e1;
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.pg-code-raw {
  max-height: 290px;
  color: #b7c4be;
  font-size: 11.5px;
}
.pg-code-json {
  max-height: 235px;
  background: #111816;
  border: 1px solid #24332e;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  color: #d6ebe0;
}
.pg-code-json:last-child {
  margin-bottom: 0;
}

/* Syntax highlights inside contract viewer */
.tok-hdr { color: #8fd19e; font-weight: 600; }
.tok-card { color: #dbe8c9; font-weight: 650; }
.tok-id { color: #7dd3fc; font-weight: 700; }
.tok-grid { color: #94a3b8; }
.tok-act { color: #fde68a; font-weight: 600; }
.tok-warn { color: #fca5a5; font-weight: 650; }
.tok-ev { color: #a7f3d0; background: rgba(16, 185, 129, 0.14); padding: 1px 4px; border-radius: 4px; }

/* Comparison Bars */
.pg-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  background: #111816;
  border: 1px solid #24332e;
  border-radius: 10px;
}
.pg-bar-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #c4d3cb;
  margin-bottom: 5px;
}
.pg-bar-top strong {
  font-family: var(--mono);
  color: #f0f6f2;
}
.pg-bar-track {
  height: 10px;
  background: #1e2c27;
  border-radius: 999px;
  overflow: hidden;
}
.pg-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}
.pg-bar-warn { background: #d97706; }
.pg-bar-muted { background: #64748b; }
.pg-bar-pri { background: #4ade80; min-width: 8px; }

.pg-contrast-note {
  font-size: 12.5px;
  line-height: 1.55;
  color: #c2d4ca;
  margin-bottom: 12px;
}
.pg-sub-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8ea59a;
  margin-bottom: 7px;
}

/* Bottom Conversion Card */
.pg-cta-card {
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.pg-cta-kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 6px;
}
.pg-cta-title {
  font-family: var(--serif);
  font-size: clamp(21px, 2.4vw, 28px);
  margin: 0 0 8px;
  color: var(--ink);
}
.pg-cta-desc {
  margin: 0 0 14px;
  max-width: 680px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-muted);
}
.pg-cmd-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #17211e;
  border-radius: 9px;
  padding: 9px 12px;
  max-width: 720px;
  overflow-x: auto;
}
.pg-cmd-box code {
  font-family: var(--mono);
  font-size: 12px;
  color: #dbe8c9;
  white-space: nowrap;
}
.pg-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 210px;
}

@media (max-width: 1040px) {
  .pg-scene-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg-workspace { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pg-scene-bar { grid-template-columns: 1fr; }
  .pg-kpi-row { grid-template-columns: 1fr; }
  .pg-cta-actions { width: 100%; }
}
