/* ==========================================================================
   FinAssure Use Case Showcase Stylesheet
   Theme: High-Performance Dark Fintech & Observability (Compact Desktop Scale)
   Fonts: Inter & JetBrains Mono
   ========================================================================== */

:root {
  --bg-primary: #070a12;
  --bg-secondary: #0d121f;
  --bg-card: rgba(15, 23, 42, 0.78);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-code: #0b1120;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);
  --border-focus: #6366f1;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  --shadow-glow-cyan: 0 0 16px rgba(56, 189, 248, 0.18);
  --shadow-glow-emerald: 0 0 16px rgba(16, 185, 129, 0.18);
  --shadow-glow-rose: 0 0 18px rgba(244, 63, 94, 0.2);
  --shadow-glow-indigo: 0 0 20px rgba(99, 102, 241, 0.2);
  
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 13px; /* Compact base scale for high-density overview */
  color-scheme: dark;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; /* STRICT: No horizontal scroll */
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; /* STRICT: No horizontal scroll */
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.1) 0%, transparent 35%),
    radial-gradient(circle at 85% 25%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 70%, rgba(16, 185, 129, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* Reading Progress Bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo), var(--accent-emerald));
  z-index: 1000;
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Header & Navigation Bar */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(7, 10, 18, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.55rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-badge {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  text-decoration: none;
}

/* Quick Zoom Control Bar */
.zoom-controls {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px 4px;
  gap: 2px;
}

.zoom-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.zoom-btn:hover {
  color: #fff;
}

.zoom-btn.active {
  background: var(--accent-indigo);
  color: #fff;
}

.nav-cta-btn {
  background: linear-gradient(135deg, var(--accent-indigo), #4f46e5);
  color: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.5);
  text-decoration: none;
}

/* Page Container: strict minmax(0, 1fr) eliminates any grid blowout */
.page-container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1rem 3.5rem;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 1.25rem;
  box-sizing: border-box;
}

/* Sticky Sidebar Table of Contents */
.sidebar-toc {
  position: sticky;
  top: 4.2rem;
  height: calc(100vh - 5rem);
  overflow-y: auto;
  padding-right: 0.35rem;
  scrollbar-width: thin;
}

.toc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  backdrop-filter: blur(12px);
}

.toc-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.65rem;
  font-weight: 700;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.toc-item a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-num {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  font-size: 0.66rem;
  color: var(--accent-cyan);
  font-weight: 700;
  flex-shrink: 0;
}

.toc-item a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  text-decoration: none;
  transform: translateX(2px);
}

.toc-item.active a {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-cyan);
  border-left: 2px solid var(--accent-cyan);
}

/* Content Area */
.content-area {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* Compact section spacing */
}

/* Standard Section Card */
.usecase-section {
  scroll-margin-top: 4.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  backdrop-filter: blur(16px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.usecase-section:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.section-title {
  font-size: 1.25rem;
  color: var(--text-main);
}

/* Section 1: Hero & Hosted Project Link Slot */
.hero-title-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  font-size: 0.74rem;
  font-weight: 600;
  width: fit-content;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.main-hero-title {
  font-size: 1.75rem;
  line-height: 1.22;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-hero-summary {
  font-size: 0.95rem;
  color: #e2e8f0;
  line-height: 1.5;
  padding: 0.65rem 0.95rem;
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--accent-indigo);
  border-radius: var(--radius-sm);
}

/* HOSTED PROJECT LINK HERO CARD */
.hosted-project-card {
  margin-top: 1.15rem;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.7), rgba(15, 23, 42, 0.9));
  border: 1.5px solid rgba(99, 102, 241, 0.5);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-glow-indigo);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.hosted-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.hosted-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hosted-slot-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #ffffff;
}

.hosted-slot-desc {
  color: var(--text-muted);
  font-size: 0.84rem;
  margin-bottom: 0.85rem;
}

.hosted-url-group {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.hosted-input-wrapper {
  flex: 1;
  min-width: 220px;
  position: relative;
  display: flex;
  align-items: center;
}

.hosted-url-input {
  width: 100%;
  background: rgba(11, 17, 32, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem 0.5rem 2.2rem;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}

.hosted-url-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.hosted-input-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--accent-cyan);
  pointer-events: none;
}

.launch-btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
  white-space: nowrap;
}

.launch-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5);
  text-decoration: none;
  color: #ffffff;
}

.save-url-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
  white-space: nowrap;
}

.save-url-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.hosted-hint-bar {
  margin-top: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Section 2: At a Glance Cards */
.glance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}

.glance-card {
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: var(--transition);
}

.glance-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.8);
}

.glance-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
}

.glance-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.glance-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge-stable {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-difficulty {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
}

/* Section 3: The Problem */
.problem-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.85rem;
}

.problem-col {
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
}

.problem-col.traditional {
  background: rgba(225, 29, 72, 0.06);
  border: 1px solid rgba(225, 29, 72, 0.25);
}

.problem-col.finassure {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.col-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.col-header.bad { color: var(--accent-rose); }
.col-header.good { color: var(--accent-emerald); }

.problem-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.problem-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.problem-list li strong {
  color: #fff;
}

.icon-x { color: var(--accent-rose); flex-shrink: 0; }
.icon-check { color: var(--accent-emerald); flex-shrink: 0; }

/* Section 4: Architecture & Flow */
.diagram-container {
  margin: 1rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #090d16;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  max-width: 100%;
}

.diagram-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.diagram-tabs {
  display: flex;
  gap: 0.35rem;
}

.diagram-tab-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.diagram-tab-btn.active, .diagram-tab-btn:hover {
  background: var(--accent-indigo);
  color: #ffffff;
  border-color: var(--accent-indigo);
}

.diagram-img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
  background: #090d16;
}

/* Interactive Simulator HUD */
.interactive-simulator-card {
  margin-top: 1rem;
  background: rgba(13, 18, 31, 0.8);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
}

.sim-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.sim-btn {
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.sim-btn.active {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.sim-btn.chaos {
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.sim-btn.chaos.active {
  background: var(--accent-rose);
  border-color: var(--accent-rose);
  color: #ffffff;
  box-shadow: var(--shadow-glow-rose);
}

.sim-nodes-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.sim-node {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.35rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  min-width: 0;
}

.sim-node:hover, .sim-node.selected {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-1px);
}

.sim-node.faulted {
  border-color: var(--accent-rose) !important;
  background: rgba(244, 63, 94, 0.15) !important;
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.sim-node-num {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

.sim-node-name {
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0.15rem 0;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-node-status {
  font-size: 0.66rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

.sim-node-inspector {
  margin-top: 0.75rem;
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.78rem;
  color: #cbd5e1;
}

/* Section 5: Prerequisites */
.prereq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
}

.prereq-card {
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.prereq-icon {
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.prereq-card h4 {
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: #ffffff;
}

.prereq-card p, .prereq-card ul {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.prereq-card ul {
  list-style-position: inside;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* Section 6: Step-by-Step Walkthrough */
.walkthrough-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.walkthrough-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 0.85rem;
  position: relative;
  min-width: 0;
}

.step-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-indigo), #3730a3);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.step-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.step-title {
  font-size: 0.98rem;
  color: #ffffff;
}

.step-desc {
  color: #cbd5e1;
  font-size: 0.82rem;
  line-height: 1.4;
}

.code-snippet-box {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 0.25rem;
  min-width: 0;
  max-width: 100%;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.code-lang-label {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.45rem;
  font-size: 0.68rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

pre {
  padding: 0.55rem 0.75rem;
  overflow-x: auto;
  font-size: 0.78rem;
  color: #e2e8f0;
  line-height: 1.45;
  white-space: pre;
  max-width: 100%;
}

/* Section 7: Expected Output */
.output-tab-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.output-nav-tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.4rem;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
}

.output-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.output-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.output-tab-btn.active {
  background: var(--accent-indigo);
  color: #ffffff;
}

.output-pane {
  display: none;
  min-width: 0;
}

.output-pane.active {
  display: block;
}

.terminal-box {
  background: #050811;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.76rem;
  color: #94a3b8;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: auto;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
  min-width: 0;
}

.term-line-err { color: #f87171; font-weight: 600; }
.term-line-pass { color: #34d399; font-weight: 600; }
.term-line-warn { color: #fbbf24; }
.term-line-dim { color: #475569; }
.term-line-highlight { color: #38bdf8; font-weight: 600; }

/* Metrics Comparison KPI Cards */
.metrics-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.metric-hud-card {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.metric-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}

.metric-val-split {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.metric-v1 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-rose);
}

.metric-v2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.metric-delta {
  font-size: 0.68rem;
  color: #38bdf8;
  font-weight: 600;
}

/* Section 8: Verify it Worked */
.verify-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.verify-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: rgba(11, 17, 32, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.95rem;
}

.verify-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.74rem;
  flex-shrink: 0;
}

.verify-content h4 {
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
  color: #ffffff;
}

.verify-content p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Section 9: Clean Up */
.cleanup-box {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
}

.cleanup-box h4 {
  color: #fbbf24;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
}

.cleanup-box p {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-bottom: 0.65rem;
}

/* Section 10: Variations & Next Steps */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.pack-card {
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition);
}

.pack-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent-indigo);
}

.pack-tag {
  align-self: flex-start;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.66rem;
  font-weight: 700;
}

.pack-tag.kyc { background: rgba(2, 132, 199, 0.2); color: #38bdf8; }
.pack-tag.aml { background: rgba(13, 148, 136, 0.2); color: #2dd4bf; }
.pack-tag.custom { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.pack-card h4 {
  font-size: 0.92rem;
  color: #ffffff;
}

.pack-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pack-link {
  margin-top: auto;
  font-size: 0.76rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Section 11: Tested With Table */
.test-env-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.test-env-table th, .test-env-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.test-env-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.test-env-table td {
  color: #cbd5e1;
}

.test-env-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* Responsive Breakpoints */
@media (max-width: 880px) {
  .page-container {
    grid-template-columns: 1fr;
  }
  .sidebar-toc {
    display: none;
  }
  .problem-comparison-grid {
    grid-template-columns: 1fr;
  }
  .sim-nodes-grid {
    grid-template-columns: 1fr 1fr;
  }
  .nav-links .nav-link {
    display: none;
  }
}

/* ==========================================================================
   ANIMATED INTERACTIVE FLOW & GRAPHS (FINASSURE RELIABILITY)
   ========================================================================== */

/* Animated Pipeline Track & Flow Packet */
.pipeline-track-wrapper {
  position: relative;
  margin-bottom: 1.25rem;
}

.pipeline-flow-line {
  position: absolute;
  top: 50%;
  left: 5%;
  right: 5%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-50%);
  z-index: 1;
  border-radius: 9999px;
  overflow: hidden;
}

.pipeline-flow-packet {
  position: absolute;
  top: 0;
  left: 0;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), #fff, transparent);
  animation: dataPacketFlow 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes dataPacketFlow {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* Chaos Strike Animation on Bureau Node */
.chaos-strike-glow {
  position: absolute;
  inset: -3px;
  border-radius: var(--radius-md);
  border: 2px solid var(--accent-rose);
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.6), inset 0 0 15px rgba(244, 63, 94, 0.3);
  pointer-events: none;
  animation: strikeFlash 1s ease-in-out infinite alternate;
}

@keyframes strikeFlash {
  0% { opacity: 0.4; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1.02); }
}

/* Hardened Shield Animation */
.shield-glow-aura {
  position: absolute;
  inset: -3px;
  border-radius: var(--radius-md);
  border: 2px solid var(--accent-emerald);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.6), inset 0 0 15px rgba(16, 185, 129, 0.3);
  pointer-events: none;
  animation: shieldPulse 1.4s ease-in-out infinite alternate;
}

@keyframes shieldPulse {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Detour Branch Line for Safe Escalation */
.detour-branch-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px dashed var(--accent-emerald);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #6ee7b7;
  font-weight: 700;
  animation: detourFloat 2s ease-in-out infinite alternate;
}

@keyframes detourFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

/* Interactive Animated Graphs (Section 5) */
.graph-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.graph-filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.graph-filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.graph-filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.graph-filter-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.metric-chart-card {
  margin-bottom: 1.25rem;
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.metric-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.metric-chart-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.metric-chart-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.bar-comparison-row {
  display: grid;
  grid-template-columns: 130px 1fr 90px;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
}

.bar-comparison-row:last-child {
  margin-bottom: 0;
}

.bar-label {
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bar-track {
  height: 22px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.bar-fill.danger {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.7), #f43f5e);
  color: #fff;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.4);
}

.bar-fill.success {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.7), #10b981);
  color: #fff;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.bar-fill.neutral {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.7), #6366f1);
  color: #fff;
}

.bar-value {
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: right;
  font-size: 0.8rem;
}

/* Pillar Visual Card Styles */
.pillar-card-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .pillar-card-wrap {
    grid-template-columns: 1fr;
  }
}

.pillar-image-container {
  height: 140px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border-subtle);
  position: relative;
}

.pillar-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.pillar-image-container:hover img {
  transform: scale(1.05);
}

/* Copy Button Styling */
.copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.copy-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: #fff;
}
