/* ─────────────────────────────────────────────
   Slytherin · Live Demo Dashboard
   The 5-industry persona-switching showcase
   ───────────────────────────────────────────── */

.demo {
  background: var(--cream);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.demo::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 40% at 80% 0%, rgba(200,150,90,0.08), transparent 60%),
    radial-gradient(40% 50% at 10% 100%, rgba(26,61,46,0.06), transparent 60%);
  pointer-events: none;
}
.demo .container { position: relative; }

.demo-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--s-7);
}
.demo-head h2 { margin-top: 14px; margin-bottom: 14px; }
.demo-head p { color: var(--ink-2); }

.industry-switch {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 auto var(--s-7);
  max-width: 980px;
  padding: 0 16px;
  align-items: center;
}
.industry-switch .pill-label {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--gold-3);
  margin-right: 12px;
}
.industry-switch button {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: all var(--d-fast) var(--ease-out);
  position: relative;
}
.industry-switch button:hover {
  border-color: var(--gold);
  color: var(--ink);
  transform: translateY(-1px);
}
.industry-switch button.active {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
  box-shadow: 0 8px 20px rgba(15, 31, 26, 0.18);
}

@media (max-width: 680px) {
  .industry-switch .pill-label { flex-basis: 100%; text-align: center; margin: 0 0 8px; }
}

/* Browser frame */
.demo-frame {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  overflow: hidden;
  position: relative;
  transition: transform var(--d-mid) var(--ease-out);
}
.demo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(229, 188, 133, 0.05);
}

.demo-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--cream-2);
  border-bottom: 1px solid var(--line);
}
.demo-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--cream-3); }
.demo-dot:nth-child(1) { background: #E5C8B2; }
.demo-dot:nth-child(2) { background: #E5DCB2; }
.demo-dot:nth-child(3) { background: #C7DCC2; }
.demo-url {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.78rem;
  color: var(--ink-2);
  font-family: 'Inter', monospace;
  text-align: center;
  font-feature-settings: "tnum";
}

.demo-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 580px;
}
@media (max-width: 780px) { .demo-body { grid-template-columns: 1fr; } }

.demo-side {
  background: var(--cream);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
}
@media (max-width: 780px) { .demo-side { display: none; } }

.demo-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  padding: 0 6px;
  color: var(--ink);
}
.demo-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--emerald);
  color: var(--gold);
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: 'Fraunces', serif;
}

.demo-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.demo-nav button {
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink-2);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--d-fast) var(--ease-out),
              color var(--d-fast) var(--ease-out);
}
.demo-nav button:hover {
  background: rgba(26, 61, 46, 0.06);
  color: var(--ink);
}
.demo-nav button.active {
  background: var(--emerald);
  color: var(--cream);
}
.demo-nav button.active:hover {
  background: var(--emerald-2);
  color: var(--cream);
}
.demo-nav .ico { width: 16px; height: 16px; flex-shrink: 0; }

.demo-main { padding: 28px 32px; }
@media (max-width: 540px) { .demo-main { padding: 22px 20px; } }

.demo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.demo-topbar h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
}
.demo-topbar .subtle { color: var(--ink-2); font-size: 0.85rem; }
.demo-tag {
  background: rgba(26, 61, 46, 0.08);
  color: var(--emerald);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 680px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }

.kpi {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  transition: transform var(--d-fast) var(--ease-out);
}
.kpi:hover { transform: translateY(-2px); }
.kpi-label {
  color: var(--ink-2);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.kpi-value {
  font-family: 'Fraunces', serif;
  font-size: 1.55rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.kpi-value .big-sub {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-2);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  margin-top: 4px;
  letter-spacing: 0;
}
.kpi-delta {
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kpi-delta.up { color: var(--emerald); }
.kpi-delta.down { color: #9C4628; }

.demo-panels {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
@media (max-width: 780px) { .demo-panels { grid-template-columns: 1fr; } }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
.panel h4 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  font-family: 'Inter', sans-serif;
}

.chart {
  height: 180px;
  display: flex;
  align-items: stretch;
  gap: 7px;
  padding: 0 4px;
}
.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  min-width: 0;
  height: 100%;
  justify-content: flex-start;
}
.bar {
  border-radius: 3px 3px 0 0;
  width: 100%;
  flex-shrink: 0;
  transition: opacity var(--d-fast) var(--ease-out),
              height var(--d-slow) cubic-bezier(.5, 1.6, .5, 1);
  transform-origin: bottom;
}
.bar.r { background: var(--emerald); }
.bar.w { background: var(--gold); }
.bar.b { background: var(--ink-2); }
.bar:hover { opacity: 0.82; }

.chart-x {
  display: flex;
  gap: 7px;
  padding: 8px 4px 0;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.chart-x span {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  color: var(--ink-3);
  min-width: 0;
}

.legend {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--ink-2);
  margin-top: 10px;
  flex-wrap: wrap;
}
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: var(--cream);
  border: 1px solid var(--line);
}
.alert-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
}
.alert.crit .alert-icon { background: #FCE9E2; color: #9C4628; }
.alert.warn .alert-icon { background: #FBF1D9; color: #A77822; }
.alert.ok .alert-icon { background: #E8F0EB; color: var(--emerald); }
.alert-body { flex: 1; min-width: 0; }
.alert-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alert-meta {
  font-size: 0.76rem;
  color: var(--ink-2);
  margin-top: 2px;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.mini-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line);
  font-family: 'Inter', sans-serif;
}
.mini-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.mini-table tr:last-child td { border-bottom: none; }

.pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  display: inline-block;
  letter-spacing: 0.02em;
}
.pill.green { background: #E8F0EB; color: var(--emerald); }
.pill.gold { background: #FBF1D9; color: #A77822; }
.pill.red { background: #FCE9E2; color: #9C4628; }

.tab-content { display: none; }
.tab-content.active {
  display: block;
  animation: fadeUp var(--d-mid) var(--ease-out);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.demo-foot {
  text-align: center;
  color: var(--ink-3);
  font-size: 0.84rem;
  margin-top: var(--s-5);
  font-style: italic;
  font-family: 'Fraunces', serif;
}
