/* =============================================
   ID Sentinel Solutions — Scenario Pages
   Shared stylesheet for all scenario detail pages
   ============================================= */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:          #0a0d12;
  --bg-2:        #0f1319;
  --bg-tint:     #111720;
  --surface:     #161c26;
  --surface-2:   #1c2433;
  --border:      #1e2d42;
  --border-2:    #243448;
  --text:        #e2e8f0;
  --text-muted:  #7a8fa8;
  --text-dim:    #4a6075;
  --accent:      #3b82f6;
  --accent-2:    #60a5fa;
  --accent-glow: rgba(59,130,246,0.15);
  --green:       #10b981;
  --amber:       #f59e0b;
  --red:         #ef4444;

  --font-sans: 'Syne', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-body: 'DM Sans', sans-serif;

  --radius:    8px;
  --radius-lg: 14px;
  --nav-h:     64px;
  --max-w:     860px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  background: rgba(10,13,18,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 900;
}
.nav-brand {
  font-family: var(--font-mono); font-weight: 600; font-size: 1rem;
  color: var(--text); text-decoration: none; letter-spacing: 0.05em;
}
.nav-brand-bracket { color: var(--accent); }
.nav-back {
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--text-muted); text-decoration: none;
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color 0.2s, border-color 0.2s;
}
.nav-back:hover { color: var(--accent-2); border-color: var(--accent); }

/* ── HERO ── */
.scenario-hero {
  padding: calc(var(--nav-h) + 3rem) 2rem 3rem;
  max-width: var(--max-w); margin: 0 auto;
  border-bottom: 1px solid var(--border);
}
.scenario-meta {
  display: flex; align-items: center; gap: 0.75rem;
  flex-wrap: wrap; margin-bottom: 1.5rem;
}
.scenario-num-badge {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  color: var(--accent); background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.25);
  padding: 0.25rem 0.65rem; border-radius: 4px;
  letter-spacing: 0.08em;
}
.scenario-tag {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem; border-radius: 4px;
}
.scenario-title {
  font-family: var(--font-sans); font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
  color: #fff; margin-bottom: 1rem;
}
.scenario-summary {
  font-size: 1.05rem; color: var(--text-muted);
  max-width: 680px; line-height: 1.75;
  margin-bottom: 2rem;
}
.skill-chips {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.skill-chip {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--accent-2);
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  padding: 0.3rem 0.7rem; border-radius: 100px;
}

/* ── MAIN CONTENT ── */
.scenario-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  max-width: 1100px; margin: 0 auto;
  padding: 3rem 2rem 6rem;
  align-items: start;
}

/* ── SIDEBAR ── */
.scenario-sidebar {
  position: sticky; top: calc(var(--nav-h) + 2rem);
  order: 2;
}

.scenario-body {
  min-width: 0;
  order: 1;
}
.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.sidebar-card-title {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  color: var(--text-dim); letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 0.9rem;
}
.sidebar-nav-list { list-style: none; }
.sidebar-nav-list li { margin-bottom: 0.2rem; }
.sidebar-nav-list li a {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--text-muted); text-decoration: none;
  display: block; padding: 0.3rem 0.5rem;
  border-radius: 4px; border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.sidebar-nav-list li a:hover,
.sidebar-nav-list li a.active {
  color: var(--accent-2); border-left-color: var(--accent);
  background: var(--accent-glow);
}
.sidebar-stat { display: flex; flex-direction: column; gap: 0.6rem; }
.sidebar-stat-item { display: flex; justify-content: space-between; align-items: baseline; }
.sidebar-stat-label { font-size: 0.78rem; color: var(--text-dim); }
.sidebar-stat-value { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-2); }

.github-link-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--text-muted); text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.6rem 1rem; border-radius: var(--radius);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  width: 100%;
}
.github-link-btn:hover { color: var(--accent-2); border-color: var(--accent); background: var(--accent-glow); }

.nav-scenarios-mini { list-style: none; }
.nav-scenarios-mini li { margin-bottom: 0.15rem; }
.nav-scenarios-mini li a {
  font-size: 0.76rem; color: var(--text-dim); text-decoration: none;
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.4rem; border-radius: 4px;
  transition: color 0.2s;
}
.nav-scenarios-mini li a:hover { color: var(--accent-2); }
.nav-scenarios-mini li a.current { color: var(--accent-2); font-weight: 600; }
.nav-scenarios-mini li a .snum { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-dim); }

/* ── ARTICLE BODY ── */
.scenario-body { min-width: 0; }

.scenario-section {
  margin-bottom: 3rem;
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}

.section-anchor {
  font-family: var(--font-sans); font-size: 1.3rem; font-weight: 700;
  color: var(--text); margin-bottom: 1rem; line-height: 1.2;
  display: flex; align-items: center; gap: 0.5rem;
}
.section-anchor::before {
  content: '';
  display: inline-block; width: 3px; height: 1.1em;
  background: var(--accent); border-radius: 2px; flex-shrink: 0;
}

.scenario-body p {
  color: var(--text-muted); font-size: 0.95rem;
  line-height: 1.8; margin-bottom: 1rem;
}
.scenario-body strong { color: var(--text); font-weight: 600; }

/* Risk / info blocks */
.alert-block {
  border-left: 3px solid var(--red);
  background: rgba(239,68,68,0.06);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1rem;
}
.alert-block.amber { border-left-color: var(--amber); background: rgba(245,158,11,0.06); }
.alert-block.green { border-left-color: var(--green); background: rgba(16,185,129,0.06); }
.alert-block.blue  { border-left-color: var(--accent); background: var(--accent-glow); }

.alert-block ul { list-style: none; padding: 0; }
.alert-block ul li {
  font-size: 0.88rem; color: var(--text-muted);
  padding: 0.25rem 0; padding-left: 1rem; position: relative;
}
.alert-block ul li::before { content: '—'; position: absolute; left: 0; color: var(--text-dim); }

/* Steps */
.step-list { list-style: none; counter-reset: steps; margin-bottom: 1rem; }
.step-item {
  counter-increment: steps;
  display: flex; gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.step-item:last-child { border-bottom: none; }
.step-num {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--accent); background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.step-content h4 { font-size: 0.92rem; font-weight: 700; color: var(--text); margin-bottom: 0.3rem; }
.step-content p  { font-size: 0.86rem; color: var(--text-muted); margin: 0; line-height: 1.6; }

/* Code blocks */
.code-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  overflow-x: auto;
}
.code-block pre {
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--accent-2); line-height: 1.7;
  white-space: pre-wrap; word-break: break-all;
}
.code-label {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
  color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* Tables */
.data-table {
  width: 100%; border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
}
.data-table th {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase;
  text-align: left; padding: 0.6rem 1rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.65rem 1rem; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(59,130,246,0.03); }
.data-table td strong { color: var(--text); }
.data-table td .resolved { color: var(--green); font-family: var(--font-mono); font-size: 0.78rem; }
.data-table td .risk-high { color: var(--red); font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; }
.data-table td .risk-med  { color: var(--amber); font-family: var(--font-mono); font-size: 0.78rem; }
.data-table td .risk-ok   { color: var(--green); font-family: var(--font-mono); font-size: 0.78rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); margin: 1rem 0; }

/* Screenshot placeholder */
.screenshot-placeholder {
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin: 1rem 0;
  color: var(--text-dim);
  font-family: var(--font-mono); font-size: 0.75rem;
}
.screenshot-placeholder i { font-size: 1.5rem; color: var(--border-2); display: block; margin-bottom: 0.5rem; }

/* Outcome grid */
.outcome-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.75rem; margin-bottom: 1.5rem;
}
.outcome-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: flex; align-items: flex-start; gap: 0.6rem;
}
.outcome-item i { color: var(--green); margin-top: 2px; flex-shrink: 0; }
.outcome-item span { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* Files list */
.files-list { list-style: none; }
.files-list li {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.files-list li:last-child { border-bottom: none; }
.files-list li code {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-2);
  background: rgba(59,130,246,0.08); padding: 0.15rem 0.4rem; border-radius: 4px;
  flex-shrink: 0;
}
.files-list li span { color: var(--text-muted); }

/* References */
.refs-list { list-style: none; }
.refs-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.refs-list li:last-child { border-bottom: none; }
.refs-list li a {
  font-size: 0.85rem; color: var(--accent-2); text-decoration: none;
  transition: color 0.2s;
}
.refs-list li a:hover { color: #fff; }

/* Workstream header */
.workstream-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.workstream-badge {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
  color: var(--accent); background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  padding: 0.2rem 0.55rem; border-radius: 4px; flex-shrink: 0;
}
.workstream-header h4 { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.workstream-header p  { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

/* Principle table */
.principle-row { display: flex; gap: 0; margin-bottom: 0.5rem; }

/* Divider */
.section-divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* Footer */
.page-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.5rem;
}
.footer-brand-group { display: flex; align-items: center; gap: 0.6rem; }
.footer-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 4px; }
.footer-brand { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.footer-copy { font-size: 0.75rem; color: var(--text-dim); }

/* Responsive */
@media (max-width: 768px) {
  .scenario-layout { grid-template-columns: 1fr; }
  .scenario-sidebar { position: static; }
  .outcome-grid { grid-template-columns: 1fr; }
  .sidebar-card:nth-child(2) { display: none; }
}