/* ============================================================
   LOTHAL — Complete Stylesheet
   Inspired by the Indus Valley Civilization · Built in C++
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&family=Lora:ital,wght@0,400;0,500;1,400;1,500&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─────────────────────────────────────────────
   1. CSS CUSTOM PROPERTIES — DESIGN TOKENS
───────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:        #141413;
  --bg-surface:     #1a1917;
  --bg-raised:      #211f1d;
  --bg-high:        #2a2824;
  --bg-border:      #3a3730;
  --bg-border-soft: #2e2c29;

  /* Text */
  --text-primary:   #faf9f5;
  --text-body:      #d4d2cc;
  --text-muted:     #b0aea5;
  --text-faint:     #6b6962;
  --text-ghost:     #4a4844;

  /* Accent — Terracotta (primary) */
  --terracotta:       #c4724a;
  --terracotta-deep:  #9a4f30;
  --terracotta-light: #d98c6a;
  --terracotta-muted: rgba(196, 114, 74, 0.15);
  --terracotta-glow:  rgba(196, 114, 74, 0.08);

  /* Accent — Copper */
  --copper:       #b08850;
  --copper-deep:  #8a6030;
  --copper-light: #caa870;
  --copper-muted: rgba(176, 136, 80, 0.15);

  /* Accent — Sand / Ochre */
  --sand:        #c9b47a;
  --sand-deep:   #a89050;
  --sand-light:  #e0ceA0;
  --ochre:       #d4a82a;
  --ochre-deep:  #a07a18;
  --ochre-muted: rgba(212, 168, 42, 0.12);

  /* Accent — Olive */
  --olive:        #7d8c5a;
  --olive-deep:   #5a6a38;
  --olive-light:  #a0b070;
  --olive-muted:  rgba(125, 140, 90, 0.15);

  /* Accent — Sage */
  --sage:       #5a8060;
  --sage-light: #7aaa80;
  --sage-muted: rgba(90, 128, 96, 0.15);

  /* Accent — River Blue */
  --river:        #4a8a9c;
  --river-deep:   #2d6070;
  --river-light:  #7ab4c4;
  --river-muted:  rgba(74, 138, 156, 0.15);
  --river-glow:   rgba(74, 138, 156, 0.08);

  /* Accent — Teal */
  --teal:       #3a7a72;
  --teal-light: #5aa09a;
  --teal-muted: rgba(58, 122, 114, 0.15);

  /* Accent — Burgundy (danger/error) */
  --burgundy:       #8a3a3a;
  --burgundy-light: #b05a5a;
  --burgundy-muted: rgba(138, 58, 58, 0.15);

  /* Accent — Umber / Stone */
  --umber:  #8a4a2a;
  --stone:  #8a8070;

  /* Semantic */
  --success: var(--olive);
  --warning: var(--ochre);
  --error:   var(--burgundy-light);
  --info:    var(--river);

  /* Spacing (8px base grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  /* Layout */
  --sidebar-w: 230px;
  --content-max: 860px;

  /* Radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Borders */
  --border: 1px solid var(--bg-border);
  --border-soft: 1px solid var(--bg-border-soft);

  /* Transitions */
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --t-fast:   150ms;
  --t-mid:    300ms;
  --t-slow:   600ms;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
}

/* ─────────────────────────────────────────────
   2. RESET & BASE
───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-base);
  color: var(--text-body);
  font-family: 'Lora', Georgia, serif;
  font-size: 17px;
  line-height: 1.8;
  overflow-x: hidden;
  /* Subtle grain texture */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
}

::selection {
  background: var(--terracotta-muted);
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

a {
  color: var(--terracotta-light);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--sand-light); }

img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
code { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

/* ─────────────────────────────────────────────
   3. TYPOGRAPHY
───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.25;
}

.display {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(32px, 4vw, 48px); }
h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 500; }
h3 { font-size: clamp(18px, 2.5vw, 24px); font-weight: 500; }
h4 { font-size: 18px; font-weight: 500; }

.label {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lead {
  font-size: 19px;
  line-height: 1.85;
  color: var(--text-body);
}

.caption {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

/* Pull quote */
.pullquote {
  font-family: 'Lora', serif;
  font-size: clamp(20px, 2.5vw, 28px);
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
  padding: var(--sp-6) var(--sp-7);
  border-left: 3px solid var(--terracotta);
  background: var(--terracotta-glow);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  position: relative;
}
.pullquote::before {
  content: '❝';
  font-family: 'Poppins', sans-serif;
  font-style: normal;
  font-size: 48px;
  color: var(--terracotta);
  opacity: 0.4;
  position: absolute;
  top: -12px;
  left: 20px;
  line-height: 1;
}

/* ─────────────────────────────────────────────
   4. SCROLL PROGRESS BAR
───────────────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--terracotta), var(--copper), var(--sand));
  z-index: 1000;
  transition: width 0.1s linear;
}

/* ─────────────────────────────────────────────
   5. LAYOUT
───────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─────────────────────────────────────────────
   6. SIDEBAR NAVIGATION
───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--bg-surface);
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: var(--sp-6) var(--sp-5);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.sidebar-logo .seal-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}
.sidebar-logo .logo-sub {
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.sidebar-nav {
  flex: 1;
  padding: var(--sp-4) 0;
}

.nav-group-label {
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-ghost);
  padding: var(--sp-4) var(--sp-5) var(--sp-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-5);
  color: var(--text-muted);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
  border-left: 2px solid transparent;
  position: relative;
}

.nav-item .nav-symbol {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--t-fast);
}

.nav-item:hover {
  color: var(--text-body);
  background: var(--bg-raised);
}
.nav-item:hover .nav-symbol { opacity: 1; }

.nav-item.active {
  color: var(--text-primary);
  border-left-color: var(--terracotta);
  background: var(--terracotta-glow);
}
.nav-item.active .nav-symbol {
  opacity: 1;
  color: var(--terracotta);
}

.sidebar-bottom {
  padding: var(--sp-5);
  border-top: var(--border);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  transition: color var(--t-fast);
}
.sidebar-link:hover { color: var(--text-primary); }

/* ─────────────────────────────────────────────
   7. MAIN CONTENT AREA
───────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

section {
  padding: var(--sp-10) var(--sp-8);
  max-width: calc(var(--content-max) + var(--sp-8) * 2);
}

section + section {
  border-top: var(--border);
}

/* ─────────────────────────────────────────────
   8. HARAPPAN DESIGN ELEMENTS
───────────────────────────────────────────── */

/* Section header with seal */
.section-header {
  margin-bottom: var(--sp-8);
}

.section-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.section-eyebrow .harappan-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--terracotta);
}

/* Channel divider — Harappan water channel cross-section */
.channel-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin: var(--sp-8) 0;
  color: var(--text-ghost);
}
.channel-divider::before,
.channel-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--bg-border), transparent);
}
.channel-divider .channel-mark {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-ghost);
  white-space: nowrap;
}

/* Harappan brick-row separator */
.brick-row {
  display: flex;
  gap: 3px;
  margin: var(--sp-6) 0;
  height: 8px;
}
.brick-row span {
  flex: 1;
  height: 100%;
  background: var(--bg-raised);
  border-radius: 1px;
}
.brick-row span:nth-child(2n) {
  background: var(--bg-border);
}

/* Seal badge */
.seal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: var(--r-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.seal-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--terracotta);
}
.seal-badge.live .dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Indus measurement ticks */
.measure-strip {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: var(--sp-2) 0;
  margin-bottom: var(--sp-5);
}
.measure-strip .tick {
  width: 1px;
  background: var(--bg-border);
}
.measure-strip .tick:nth-child(5n) {
  background: var(--terracotta);
  opacity: 0.5;
}
.measure-strip .tick:nth-child(1)  { height: 16px; }
.measure-strip .tick:nth-child(2)  { height: 8px; }
.measure-strip .tick:nth-child(3)  { height: 8px; }
.measure-strip .tick:nth-child(4)  { height: 8px; }
.measure-strip .tick:nth-child(5)  { height: 16px; }
.measure-strip .tick:nth-child(6)  { height: 8px; }
.measure-strip .tick:nth-child(7)  { height: 8px; }
.measure-strip .tick:nth-child(8)  { height: 8px; }
.measure-strip .tick:nth-child(9)  { height: 8px; }
.measure-strip .tick:nth-child(10) { height: 20px; }

/* Ancient symbol row */
.symbol-strip {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  color: var(--text-ghost);
  font-size: 16px;
  margin: var(--sp-5) 0;
  flex-wrap: wrap;
}
.symbol-strip .sym {
  opacity: 0.4;
  transition: opacity var(--t-fast);
  cursor: default;
  user-select: none;
}
.symbol-strip .sym:hover { opacity: 0.8; }

/* ─────────────────────────────────────────────
   9. HERO SECTION
───────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-10) var(--sp-8);
  position: relative;
  overflow: hidden;
  border-top: none;
}

/* Harappan grid background */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent calc(var(--sp-7) - 1px),
      var(--bg-border-soft) calc(var(--sp-7) - 1px),
      var(--bg-border-soft) var(--sp-7)
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent calc(var(--sp-7) - 1px),
      var(--bg-border-soft) calc(var(--sp-7) - 1px),
      var(--bg-border-soft) var(--sp-7)
    );
  opacity: 0.35;
  pointer-events: none;
}

/* Bottom fade */
#hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(transparent, var(--bg-base));
  pointer-events: none;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-7);
  position: relative;
  z-index: 1;
}

.hero-seal {
  width: 48px;
  height: 48px;
}

.hero-tag {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.hero-title {
  position: relative;
  z-index: 1;
  margin-bottom: var(--sp-6);
}

.hero-title .display {
  display: block;
  margin-bottom: var(--sp-3);
}

.hero-title .display em {
  font-style: normal;
  color: var(--terracotta-light);
}

.hero-subtitle {
  font-family: 'Lora', serif;
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 540px;
  position: relative;
  z-index: 1;
  margin-bottom: var(--sp-8);
}

.hero-cta {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* TCP visualization canvas */
#hero-viz {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 45%;
  opacity: 0.3;
  pointer-events: none;
}

/* Stats strip */
.hero-stats {
  display: flex;
  gap: var(--sp-6);
  flex-wrap: wrap;
  margin-top: var(--sp-9);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--bg-border-soft);
  position: relative;
  z-index: 1;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-stat .stat-value {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.hero-stat .stat-label {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-ghost);
}

/* Colour each stat differently */
.hero-stat:nth-child(1) .stat-value { color: var(--terracotta-light); }
.hero-stat:nth-child(2) .stat-value { color: var(--copper-light); }
.hero-stat:nth-child(3) .stat-value { color: var(--sand); }
.hero-stat:nth-child(4) .stat-value { color: var(--olive-light); }
.hero-stat:nth-child(5) .stat-value { color: var(--river-light); }
.hero-stat:nth-child(6) .stat-value { color: var(--teal-light); }

/* ─────────────────────────────────────────────
   10. BUTTONS
───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 11px 24px;
  border-radius: var(--r-md);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--terracotta);
  color: var(--bg-base);
}
.btn-primary:hover {
  background: var(--terracotta-light);
  color: var(--bg-base);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(196,114,74,0.35);
}

.btn-outline {
  background: transparent;
  color: var(--text-body);
  border: 1px solid var(--bg-border);
}
.btn-outline:hover {
  background: var(--bg-raised);
  border-color: var(--bg-border);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 8px 16px;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-raised);
}

.btn-sm {
  padding: 7px 16px;
  font-size: 12px;
}

.btn-copper {
  background: var(--copper);
  color: var(--bg-base);
}
.btn-copper:hover {
  background: var(--copper-light);
  color: var(--bg-base);
  box-shadow: 0 4px 20px rgba(176,136,80,0.3);
}

.btn-river {
  background: var(--river);
  color: var(--bg-base);
}
.btn-river:hover {
  background: var(--river-light);
  color: var(--bg-base);
}

.btn-olive {
  background: var(--olive);
  color: var(--bg-base);
}
.btn-olive:hover { background: var(--olive-light); }

.btn-danger {
  background: var(--burgundy);
  color: var(--text-primary);
}
.btn-danger:hover { background: var(--burgundy-light); }

/* ─────────────────────────────────────────────
   11. CODE BLOCKS
───────────────────────────────────────────── */
.code-block {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: var(--sp-5) 0;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--sp-5);
  border-bottom: var(--border);
  background: var(--bg-raised);
}

.code-block-title {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.code-block-lang {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-ghost);
  background: var(--bg-high);
  padding: 2px 8px;
  border-radius: var(--r-sm);
}

.code-block pre {
  padding: var(--sp-5);
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-body);
}

.code-block pre .kw  { color: var(--copper-light); }
.code-block pre .str { color: var(--olive-light); }
.code-block pre .num { color: var(--sand); }
.code-block pre .cm  { color: var(--text-ghost); font-style: italic; }
.code-block pre .fn  { color: var(--river-light); }
.code-block pre .ty  { color: var(--terracotta-light); }
.code-block pre .hdr { color: var(--teal-light); }
.code-block pre .val { color: var(--sand-light); }

/* HTTP request/response */
.http-block {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.http-block-method {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
}

/* ─────────────────────────────────────────────
   12. FEATURE CARDS & GRIDS
───────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-6) 0;
}

.feature-card {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  transition: all var(--t-mid) var(--ease);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--card-accent, var(--terracotta));
  transform: scaleX(0);
  transition: transform var(--t-mid) var(--ease);
  transform-origin: left;
}

.feature-card:hover {
  border-color: var(--bg-border);
  background: var(--bg-raised);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card-icon {
  font-size: 22px;
  margin-bottom: var(--sp-3);
  display: block;
}

.feature-card h4 {
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.feature-card p {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Status color variants */
.card-terracotta { --card-accent: var(--terracotta); }
.card-copper     { --card-accent: var(--copper); }
.card-sand       { --card-accent: var(--sand); }
.card-olive      { --card-accent: var(--olive); }
.card-river      { --card-accent: var(--river); }
.card-teal       { --card-accent: var(--teal); }
.card-ochre      { --card-accent: var(--ochre); }
.card-sage       { --card-accent: var(--sage); }
.card-burgundy   { --card-accent: var(--burgundy-light); }

/* ─────────────────────────────────────────────
   13. REQUEST FLOW VISUALIZATION
───────────────────────────────────────────── */
.flow-container {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin: var(--sp-6) 0;
  overflow-x: auto;
}

.flow-nodes {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 360px;
}

.flow-node {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: var(--sp-4);
  padding: 12px var(--sp-5);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: all var(--t-mid) var(--ease);
  cursor: pointer;
  position: relative;
}

.flow-node:hover,
.flow-node.active {
  background: var(--bg-raised);
  border-color: var(--bg-border);
}

.flow-node.active .flow-node-icon {
  color: var(--node-color, var(--terracotta));
  filter: drop-shadow(0 0 6px var(--node-color, var(--terracotta)));
}

.flow-node-icon {
  font-size: 20px;
  text-align: center;
  transition: all var(--t-mid) var(--ease);
  color: var(--text-ghost);
}

.flow-node-text h4 {
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--t-fast);
}

.flow-node.active .flow-node-text h4 {
  color: var(--text-primary);
}

.flow-node-text p {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--text-ghost);
  margin-top: 2px;
}

.flow-connector {
  display: flex;
  align-items: center;
  padding-left: 17px;
  height: 20px;
}

.flow-connector::before {
  content: '';
  display: block;
  width: 1px;
  height: 100%;
  background: var(--bg-border);
  transition: background var(--t-mid);
}

.flow-connector.active::before {
  background: linear-gradient(
    var(--node-color, var(--terracotta)),
    var(--next-color, var(--copper))
  );
}

.flow-time-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-ghost);
  background: var(--bg-high);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  transition: all var(--t-mid);
}

.flow-node.active .flow-time-badge {
  color: var(--node-color, var(--terracotta));
  background: var(--bg-raised);
}

/* ─────────────────────────────────────────────
   14. MIDDLEWARE PIPELINE
───────────────────────────────────────────── */
.pipeline-visual {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: var(--sp-5) 0;
  margin: var(--sp-5) 0;
}

.pipeline-stage {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.pipeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--r-md);
  min-width: 100px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-mid) var(--ease);
  position: relative;
}

.pipeline-node:hover,
.pipeline-node.selected {
  background: var(--bg-raised);
  border-color: var(--pipe-color, var(--terracotta));
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.pipeline-node .pipe-icon {
  font-size: 24px;
  color: var(--pipe-color, var(--terracotta));
}

.pipeline-node .pipe-name {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  padding: 0 var(--sp-2);
  color: var(--text-ghost);
  font-size: 18px;
}

/* ─────────────────────────────────────────────
   15. HTTP METHOD PLAYGROUND
───────────────────────────────────────────── */
.playground-shell {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.playground-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-raised);
  border-bottom: var(--border);
  flex-wrap: wrap;
}

.method-select {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.method-btn {
  padding: 5px 12px;
  border-radius: var(--r-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--bg-border);
  background: var(--bg-high);
  color: var(--text-muted);
  transition: all var(--t-fast) var(--ease);
  cursor: pointer;
}

.method-btn:hover { color: var(--text-body); background: var(--bg-border); }

.method-btn.active { color: var(--bg-base); border-color: transparent; }
.method-btn[data-method="GET"].active    { background: var(--olive); }
.method-btn[data-method="POST"].active   { background: var(--terracotta); }
.method-btn[data-method="PUT"].active    { background: var(--copper); }
.method-btn[data-method="PATCH"].active  { background: var(--ochre); }
.method-btn[data-method="DELETE"].active { background: var(--burgundy-light); }
.method-btn[data-method="HEAD"].active   { background: var(--river); }
.method-btn[data-method="OPTIONS"].active{ background: var(--teal); }
.method-btn[data-method="QUERY"].active  { background: var(--sand-deep); }

.url-bar {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: var(--border);
  align-items: center;
}

.url-input {
  flex: 1;
  background: var(--bg-high);
  border: 1px solid var(--bg-border);
  border-radius: var(--r-md);
  padding: 9px var(--sp-4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color var(--t-fast);
}
.url-input:focus {
  outline: none;
  border-color: var(--terracotta);
}

.playground-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
  .playground-body { grid-template-columns: 1fr; }
}

.playground-panel {
  padding: var(--sp-5);
  min-height: 200px;
}

.playground-panel + .playground-panel {
  border-left: var(--border);
}

.panel-label {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-ghost);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.textarea-input {
  width: 100%;
  background: var(--bg-high);
  border: 1px solid var(--bg-border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-body);
  resize: vertical;
  min-height: 120px;
  transition: border-color var(--t-fast);
}
.textarea-input:focus {
  outline: none;
  border-color: var(--river);
}

/* Response panel */
.response-area {
  padding: var(--sp-5);
  border-top: var(--border);
  min-height: 160px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: var(--r-sm);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: var(--sp-4);
}

.status-2xx { background: var(--olive-muted); color: var(--olive-light); border: 1px solid var(--olive); }
.status-3xx { background: var(--river-muted); color: var(--river-light); border: 1px solid var(--river); }
.status-4xx { background: var(--terracotta-muted); color: var(--terracotta-light); border: 1px solid var(--terracotta); }
.status-5xx { background: var(--burgundy-muted); color: var(--burgundy-light); border: 1px solid var(--burgundy-light); }

.response-meta {
  display: flex;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.response-meta span {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--text-ghost);
}

.response-meta strong {
  font-weight: 600;
  color: var(--text-muted);
}

.response-headers-table {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sp-4);
}

.response-headers-table tr:not(:last-child) td {
  border-bottom: 1px solid var(--bg-border-soft);
}

.response-headers-table td {
  padding: 5px 0;
  vertical-align: top;
}

.response-headers-table td:first-child {
  color: var(--teal-light);
  padding-right: var(--sp-4);
  white-space: nowrap;
}

.response-headers-table td:last-child {
  color: var(--sand);
  word-break: break-all;
}

.response-body-area {
  background: var(--bg-high);
  border: var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-body);
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ─────────────────────────────────────────────
   16. TABS
───────────────────────────────────────────── */
.tabs {
  border-bottom: var(--border);
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-body); }
.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--terracotta);
}

.tab-content { display: none; padding: var(--sp-5) 0; }
.tab-content.active { display: block; }

/* ─────────────────────────────────────────────
   17. DEMO PANELS (Cache, Compression, etc.)
───────────────────────────────────────────── */
.demo-card {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin: var(--sp-5) 0;
}

.demo-card-header {
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-raised);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.demo-card-body {
  padding: var(--sp-6);
}

/* Comparison columns */
.compare-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  margin: var(--sp-4) 0;
}

@media (max-width: 640px) {
  .compare-cols { grid-template-columns: 1fr; }
}

.compare-col {
  background: var(--bg-raised);
  border: var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
}

.compare-col h5 {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}

/* Bar charts */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
}

.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 60px;
  align-items: center;
  gap: var(--sp-3);
}

.bar-label {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

.bar-track {
  background: var(--bg-high);
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s var(--ease);
}

.bar-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

/* Stream terminal */
.stream-terminal {
  background: #0d0c0b;
  border: 1px solid var(--bg-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  min-height: 160px;
  max-height: 240px;
  overflow-y: auto;
  color: var(--olive-light);
  line-height: 1.6;
}

.stream-terminal .stream-line {
  animation: fadeInLine 0.15s ease forwards;
}

@keyframes fadeInLine {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─────────────────────────────────────────────
   18. LOG STREAM
───────────────────────────────────────────── */
.log-feed {
  background: #0d0c0b;
  border: 1px solid var(--bg-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.log-feed-header {
  padding: 8px var(--sp-4);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--bg-border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-ghost);
}

.log-entries {
  padding: var(--sp-3) var(--sp-4);
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  display: grid;
  grid-template-columns: 80px 60px 1fr 50px;
  gap: var(--sp-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  animation: slideInLog 0.2s ease forwards;
}

@keyframes slideInLog {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.log-entry .log-time  { color: var(--text-ghost); }
.log-entry .log-method { font-weight: 600; }
.log-entry .log-path  { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-entry .log-status { text-align: right; }

.log-method-get     { color: var(--olive-light); }
.log-method-post    { color: var(--terracotta-light); }
.log-method-put     { color: var(--copper-light); }
.log-method-patch   { color: var(--ochre); }
.log-method-delete  { color: var(--burgundy-light); }
.log-method-head    { color: var(--river-light); }
.log-method-options { color: var(--teal-light); }

.log-status-2xx { color: var(--olive-light); }
.log-status-3xx { color: var(--river-light); }
.log-status-4xx { color: var(--terracotta-light); }
.log-status-5xx { color: var(--burgundy-light); }

/* ─────────────────────────────────────────────
   19. ROUTE TESTER
───────────────────────────────────────────── */
.route-tester {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.route-input-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: var(--border);
}

.route-path-input {
  flex: 1;
  background: var(--bg-high);
  border: 1px solid var(--bg-border);
  border-radius: var(--r-md);
  padding: 9px var(--sp-4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-primary);
}
.route-path-input:focus {
  outline: none;
  border-color: var(--copper);
}

.route-result {
  padding: var(--sp-5);
}

.route-match-card {
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-left: 3px solid var(--olive);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.route-no-match {
  border-left-color: var(--burgundy-light);
}

.route-params {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-3);
}

.param-pill {
  background: var(--copper-muted);
  border: 1px solid var(--copper);
  color: var(--copper-light);
  padding: 2px 10px;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* ─────────────────────────────────────────────
   20. THREAD POOL VISUALIZATION
───────────────────────────────────────────── */
.thread-pool-viz {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
}

.thread-node {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-ghost);
  transition: all 0.3s var(--ease);
}

.thread-node.busy {
  background: var(--olive-muted);
  border-color: var(--olive);
  color: var(--olive-light);
  animation: thread-pulse 1.2s ease-in-out infinite;
}

.thread-node .thread-icon {
  font-size: 18px;
}

@keyframes thread-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(125,140,90,0); }
  50% { box-shadow: 0 0 0 6px rgba(125,140,90,0.15); }
}

/* ─────────────────────────────────────────────
   21. ARCHITECTURE / BLUEPRINT SECTION
───────────────────────────────────────────── */
.arch-diagram {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-7);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  overflow-x: auto;
  line-height: 1.8;
  color: var(--text-muted);
}

.arch-diagram .arch-title {
  color: var(--copper-light);
  font-weight: 600;
}

.arch-diagram .arch-arrow {
  color: var(--text-ghost);
}

.arch-diagram .arch-label {
  color: var(--sand-light);
}

.source-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
}

.source-file-card {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  transition: all var(--t-fast) var(--ease);
}

.source-file-card:hover {
  background: var(--bg-raised);
  border-color: var(--bg-border);
}

.source-file-card .file-ext {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: var(--r-sm);
  background: var(--bg-high);
  color: var(--copper-light);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.source-file-card h5 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.source-file-card p {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─────────────────────────────────────────────
   22. FOOTER / SEAL SECTION
───────────────────────────────────────────── */
#seal {
  padding: var(--sp-10) var(--sp-8);
  border-top: var(--border);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.seal-centerpiece {
  width: 120px;
  height: 120px;
  margin: 0 auto var(--sp-7);
  animation: seal-rotate 30s linear infinite;
}

@keyframes seal-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.seal-centerpiece:hover {
  animation-play-state: paused;
}

.seal-footer-text {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-ghost);
}

/* ─────────────────────────────────────────────
   23. SECTION-SPECIFIC ACCENT COLORS
───────────────────────────────────────────── */
#city       { --section-color: var(--sand); }
#dockyard   { --section-color: var(--river); }
#channels   { --section-color: var(--teal); }
#routes     { --section-color: var(--copper); }
#workshops  { --section-color: var(--terracotta); }
#granary    { --section-color: var(--ochre); }
#engineers  { --section-color: var(--olive); }
#watchtower { --section-color: var(--burgundy-light); }
#blueprint  { --section-color: var(--stone); }

.section-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--section-color, var(--terracotta));
  letter-spacing: 0.12em;
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.section-number::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--section-color, var(--terracotta));
  opacity: 0.6;
}

/* Section title underline */
.section-title {
  position: relative;
  display: inline-block;
  margin-bottom: var(--sp-3);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--section-color, var(--terracotta));
  border-radius: 2px;
}

/* ─────────────────────────────────────────────
   24. HARAPPAN SYMBOL LEGEND / FLOATING MARKS
───────────────────────────────────────────── */
.harappan-legend {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
  padding: var(--sp-4);
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-lg);
  margin: var(--sp-5) 0;
}

.harappan-legend .hl-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
}

.harappan-legend .hl-sym {
  font-size: 18px;
  color: var(--terracotta);
}

/* Decorative Indus-script inspired character strip */
.indus-strip {
  display: flex;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  color: var(--text-ghost);
  font-size: 22px;
  letter-spacing: 0.1em;
  overflow: hidden;
  flex-wrap: wrap;
}

.indus-strip span {
  opacity: 0.25;
  transition: opacity 0.3s;
  cursor: default;
  user-select: none;
}
.indus-strip span:hover { opacity: 0.7; }

/* Seal stamp background watermark */
.seal-watermark {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  height: 300px;
  opacity: 0.02;
  pointer-events: none;
}

/* ─────────────────────────────────────────────
   25. INTERSECTION OBSERVER ANIMATIONS
───────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow) var(--ease),
              transform var(--t-slow) var(--ease);
}

.fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

.fade-left {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity var(--t-slow) var(--ease),
              transform var(--t-slow) var(--ease);
}

.fade-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-slow) var(--ease),
              transform var(--t-slow) var(--ease);
}

.stagger-children.in-view > *:nth-child(1) { transition-delay: 0ms;    opacity: 1; transform: none; }
.stagger-children.in-view > *:nth-child(2) { transition-delay: 80ms;   opacity: 1; transform: none; }
.stagger-children.in-view > *:nth-child(3) { transition-delay: 160ms;  opacity: 1; transform: none; }
.stagger-children.in-view > *:nth-child(4) { transition-delay: 240ms;  opacity: 1; transform: none; }
.stagger-children.in-view > *:nth-child(5) { transition-delay: 320ms;  opacity: 1; transform: none; }
.stagger-children.in-view > *:nth-child(6) { transition-delay: 400ms;  opacity: 1; transform: none; }
.stagger-children.in-view > *:nth-child(7) { transition-delay: 480ms;  opacity: 1; transform: none; }
.stagger-children.in-view > *:nth-child(8) { transition-delay: 560ms;  opacity: 1; transform: none; }
.stagger-children.in-view > *:nth-child(9) { transition-delay: 640ms;  opacity: 1; transform: none; }

/* ─────────────────────────────────────────────
   26. RANGE SLIDER (Byte Range Demo)
───────────────────────────────────────────── */
.range-bar-container {
  margin: var(--sp-5) 0;
  background: var(--bg-raised);
  border: var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}

.file-bar-track {
  position: relative;
  height: 40px;
  background: var(--bg-high);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: var(--sp-4);
}

.file-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--river-muted), var(--river));
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--river-light);
  transition: left 0.3s var(--ease), right 0.3s var(--ease);
}

/* ─────────────────────────────────────────────
   27. HARAPPAN SEAL ANIMATIONS
───────────────────────────────────────────── */
@keyframes seal-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(196,114,74,0.3)); }
  50%       { filter: drop-shadow(0 0 12px rgba(196,114,74,0.6)); }
}

.seal-animated {
  animation: seal-glow 3s ease-in-out infinite;
}

@keyframes brick-march {
  from { background-position: 0 0; }
  to   { background-position: 32px 0; }
}

/* Keep-alive line animation */
@keyframes flow-packet {
  0%   { transform: translateX(-100%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateX(500px); opacity: 0; }
}

.packet-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terracotta);
  animation: flow-packet 2s ease-in-out infinite;
}

.packet-dot:nth-child(2) { animation-delay: 0.5s; background: var(--copper); }
.packet-dot:nth-child(3) { animation-delay: 1s;   background: var(--sand); }

/* ─────────────────────────────────────────────
   28. RESPONSIVE MOBILE
───────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--t-mid) var(--ease);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  section {
    padding: var(--sp-8) var(--sp-5);
  }

  #hero {
    padding: var(--sp-8) var(--sp-5);
    min-height: 90vh;
  }

  #hero-viz {
    display: none;
  }
}

/* Mobile top bar */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-surface);
  border-bottom: var(--border);
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-5);
}

@media (max-width: 900px) {
  .mobile-topbar { display: flex; }
  .main-content { padding-top: 56px; }
}

.hamburger {
  background: none;
  border: none;
  color: var(--text-body);
  font-size: 22px;
  cursor: pointer;
  padding: var(--sp-2);
  border-radius: var(--r-sm);
}
.hamburger:hover { background: var(--bg-raised); }

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
}

.sidebar-overlay.open { display: block; }

/* ─────────────────────────────────────────────
   29. UTILITY CLASSES
───────────────────────────────────────────── */
.text-primary  { color: var(--text-primary); }
.text-muted    { color: var(--text-muted); }
.text-faint    { color: var(--text-faint); }
.text-terra    { color: var(--terracotta); }
.text-copper   { color: var(--copper-light); }
.text-sand     { color: var(--sand); }
.text-olive    { color: var(--olive-light); }
.text-river    { color: var(--river-light); }
.text-teal     { color: var(--teal-light); }
.text-ochre    { color: var(--ochre); }

.bg-surface { background: var(--bg-surface); }
.bg-raised  { background: var(--bg-raised); }

.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.gap-2        { gap: var(--sp-2); }
.gap-3        { gap: var(--sp-3); }
.gap-4        { gap: var(--sp-4); }

.rounded    { border-radius: var(--r-md); }
.rounded-lg { border-radius: var(--r-lg); }

.border     { border: var(--border); }

.w-full { width: 100%; }

/* Loading spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--bg-border);
  border-top-color: var(--terracotta);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────
   30. REQUEST FLOW VISUALIZATION
───────────────────────────────────────────── */
#flow-nodes {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.flow-node {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--bg-border);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all var(--t-mid) var(--ease);
  position: relative;
  overflow: hidden;
}

.flow-node::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--node-color, var(--terracotta));
  opacity: 0;
  transition: opacity var(--t-mid) var(--ease);
}

.flow-node.active {
  background: var(--bg-raised);
  border-color: var(--node-color, var(--terracotta));
  transform: translateX(4px);
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.flow-node.active::before { opacity: 1; }

.flow-node-icon {
  font-size: 20px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
  transition: transform var(--t-mid) var(--ease);
}

.flow-node.active .flow-node-icon {
  transform: scale(1.3);
}

.flow-node-text h4 {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.flow-node-text p {
  font-size: 11px;
  color: var(--text-faint);
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.04em;
}

.flow-time-badge {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-ghost);
  background: var(--bg-high);
  padding: 2px 8px;
  border-radius: 99px;
}

.flow-connector {
  width: 2px;
  height: 18px;
  background: var(--bg-border);
  margin-left: 34px;
  transition: background var(--t-mid) var(--ease);
  position: relative;
}

.flow-connector.active {
  background: var(--node-color, var(--terracotta));
}

/* Live request/response panes */
.flow-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 700px) {
  .flow-panes { grid-template-columns: 1fr; }
}

.flow-pane {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.flow-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: var(--border);
  background: var(--bg-raised);
}

.flow-pane-title {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

#live-request-display,
#live-response-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.8;
  padding: 16px;
  min-height: 160px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-body);
}

/* ─────────────────────────────────────────────
   31. MIDDLEWARE PIPELINE
───────────────────────────────────────────── */
#pipeline-visual {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 24px;
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-lg);
  overflow-x: auto;
}

.pipeline-stage {
  display: flex;
  align-items: center;
  gap: 0;
}

.pipeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border: 1px solid var(--bg-border);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  cursor: pointer;
  transition: all var(--t-mid) var(--ease);
  min-width: 90px;
  text-align: center;
  position: relative;
}

.pipeline-node::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-md);
  background: var(--pipe-color, var(--terracotta));
  opacity: 0;
  transition: opacity var(--t-mid) var(--ease);
}

.pipeline-node:hover {
  border-color: var(--pipe-color, var(--terracotta));
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.pipeline-node.selected {
  border-color: var(--pipe-color, var(--terracotta));
  background: color-mix(in srgb, var(--pipe-color, var(--terracotta)) 12%, var(--bg-raised));
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.pipe-icon {
  font-size: 22px;
  line-height: 1;
}

.pipe-name {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pipeline-arrow {
  padding: 0 6px;
  color: var(--text-ghost);
  font-size: 18px;
  font-weight: 300;
}

/* Detail panel */
#middleware-detail {
  display: none;
  margin-top: 20px;
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.middleware-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: var(--border);
  background: var(--bg-raised);
}

.middleware-detail-body {
  padding: 20px;
}

/* ─────────────────────────────────────────────
   32. ROUTE TESTER
───────────────────────────────────────────── */
.route-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

#route-test-input {
  flex: 1;
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease);
}

#route-test-input:focus {
  border-color: var(--terracotta);
}

.route-match-card {
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--olive-muted);
  border-radius: var(--r-md);
  margin-top: 16px;
}

.route-no-match {
  border-color: var(--burgundy-muted);
  background: color-mix(in srgb, var(--burgundy) 5%, var(--bg-surface));
}

.route-params {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.param-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--river-muted);
  color: var(--river-light);
  border: 1px solid var(--river);
  padding: 3px 10px;
  border-radius: 99px;
}

/* Known routes table */
.routes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.routes-table thead tr {
  border-bottom: 2px solid var(--bg-border);
}

.routes-table th {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 8px 12px;
  text-align: left;
}

.routes-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-border-soft);
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-body);
  vertical-align: middle;
}

.routes-table tr:last-child td { border-bottom: none; }

.routes-table tr:hover td { background: var(--bg-raised); }

/* ─────────────────────────────────────────────
   33. HTTP METHODS PLAYGROUND
───────────────────────────────────────────── */
.method-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.method-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--bg-border);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  letter-spacing: 0.04em;
}

.method-btn:hover {
  border-color: var(--text-faint);
  color: var(--text-body);
}

/* Method-specific active colours */
.method-btn[data-method="GET"].active    { background:var(--olive-muted);     color:var(--olive-light);     border-color:var(--olive); }
.method-btn[data-method="POST"].active   { background:var(--terracotta-muted); color:var(--terracotta-light); border-color:var(--terracotta); }
.method-btn[data-method="PUT"].active    { background:var(--river-muted);      color:var(--river-light);      border-color:var(--river); }
.method-btn[data-method="PATCH"].active  { background:var(--teal-muted);       color:var(--teal-light);       border-color:var(--teal); }
.method-btn[data-method="DELETE"].active { background:var(--burgundy-muted);   color:var(--burgundy-light);   border-color:var(--burgundy); }
.method-btn[data-method="HEAD"].active   { background:var(--copper-muted);     color:var(--copper-light);     border-color:var(--copper); }
.method-btn[data-method="OPTIONS"].active{ background:var(--sand-deep);        color:var(--sand-light);       border-color:var(--sand); opacity:0.7 }
.method-btn[data-method="QUERY"].active  { background:var(--ochre-muted);      color:var(--ochre);            border-color:var(--ochre); }

/* Playground form */
.pg-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pg-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.pg-row label {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  min-width: 60px;
  padding-top: 11px;
  flex-shrink: 0;
}

.pg-input {
  flex: 1;
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease);
  resize: vertical;
}

.pg-input:focus { border-color: var(--terracotta); }

/* Response display */
#pg-response {
  display: none;
  margin-top: 24px;
  border: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.pg-response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-raised);
  border-bottom: var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

#pg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--text-faint);
}

.response-tabs {
  display: flex;
  border-bottom: var(--border);
}

.response-tab-btn {
  padding: 10px 18px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}

.response-tab-btn:hover { color: var(--text-body); }
.response-tab-btn.active {
  color: var(--terracotta-light);
  border-bottom-color: var(--terracotta);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.response-headers-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.response-headers-table td {
  padding: 8px 16px;
  border-bottom: 1px solid var(--bg-border-soft);
  color: var(--text-muted);
  word-break: break-all;
}

.response-headers-table td:first-child {
  color: var(--teal-light);
  font-weight: 500;
  white-space: nowrap;
  width: 40%;
}

.response-body-area {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  padding: 16px;
  color: var(--text-body);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
  max-height: 300px;
}

/* ─────────────────────────────────────────────
   34. STATUS BADGES
───────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 99px;
}

.status-badge.status-2xx {
  background: var(--olive-muted);
  color: var(--olive-light);
  border: 1px solid var(--olive);
}

.status-badge.status-3xx {
  background: var(--river-muted);
  color: var(--river-light);
  border: 1px solid var(--river);
}

.status-badge.status-4xx {
  background: var(--ochre-muted);
  color: var(--ochre);
  border: 1px solid var(--ochre-deep);
}

.status-badge.status-5xx {
  background: var(--burgundy-muted);
  color: var(--burgundy-light);
  border: 1px solid var(--burgundy);
}

/* ─────────────────────────────────────────────
   35. SESSION LOG FEED
───────────────────────────────────────────── */
.log-feed {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

#log-entries,
.log-entries {
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 0;
}

#log-entries::-webkit-scrollbar,
.log-entries::-webkit-scrollbar { width: 4px; }
#log-entries::-webkit-scrollbar-thumb,
.log-entries::-webkit-scrollbar-thumb { background: var(--bg-border); border-radius: 2px; }

.log-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  transition: background var(--t-fast) var(--ease);
}

.log-entry:hover { background: var(--bg-raised); }

.log-time {
  color: var(--text-ghost);
  min-width: 60px;
  flex-shrink: 0;
}

.log-method {
  font-weight: 600;
  min-width: 52px;
  flex-shrink: 0;
}

.log-method-get     { color: var(--olive-light); }
.log-method-post    { color: var(--terracotta-light); }
.log-method-put     { color: var(--river-light); }
.log-method-patch   { color: var(--teal-light); }
.log-method-delete  { color: var(--burgundy-light); }
.log-method-head    { color: var(--copper-light); }
.log-method-options { color: var(--sand); }
.log-method-query   { color: var(--ochre); }
.log-method-err     { color: var(--burgundy-light); }

.log-path {
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-status {
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

.log-status-2xx { color: var(--olive-light); }
.log-status-3xx { color: var(--river-light); }
.log-status-4xx { color: var(--ochre); }
.log-status-5xx { color: var(--burgundy-light); }
.log-status-err { color: var(--burgundy-light); }

/* ─────────────────────────────────────────────
   36. THREAD POOL VISUALIZATION
───────────────────────────────────────────── */
#thread-viz {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  padding: 20px;
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-lg);
}

.thread-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  border: 1px solid var(--bg-border);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  transition: all var(--t-mid) var(--ease);
  text-transform: uppercase;
}

.thread-node.busy {
  border-color: var(--terracotta);
  background: var(--terracotta-muted);
  color: var(--terracotta-light);
  animation: thread-pulse 1.2s ease-in-out infinite;
}

@keyframes thread-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 114, 74, 0.3); }
  50%       { box-shadow: 0 0 0 6px rgba(196, 114, 74, 0); }
}

.thread-icon {
  font-size: 20px;
  line-height: 1;
}

/* ─────────────────────────────────────────────
   37. STREAM OUTPUT
───────────────────────────────────────────── */
#stream-output {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.7;
  padding: 16px;
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-md);
  min-height: 120px;
  max-height: 260px;
  overflow-y: auto;
}

#stream-output::-webkit-scrollbar { width: 4px; }
#stream-output::-webkit-scrollbar-thumb { background: var(--bg-border); border-radius: 2px; }

.stream-line {
  padding: 2px 0;
  animation: stream-fade-in 0.15s ease;
}

@keyframes stream-fade-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ─────────────────────────────────────────────
   38. CACHE / COMPRESSION BAR CHART
───────────────────────────────────────────── */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-md);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  min-width: 80px;
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 10px;
  background: var(--bg-high);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 99px;
  width: 0%;
  transition: width 0.8s var(--ease);
}

.bar-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  min-width: 60px;
}

/* ─────────────────────────────────────────────
   39. COMPARE COLUMNS
───────────────────────────────────────────── */
.compare-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compare-col {
  padding: 16px;
  background: var(--bg-raised);
  border: var(--border);
  border-radius: var(--r-md);
}

.compare-col h5 {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

@media (max-width: 600px) {
  .compare-cols { grid-template-columns: 1fr; }
}


/* ─────────────────────────────────────────────
   41. FLOW CONTROLS BAR
───────────────────────────────────────────── */
.flow-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.flow-live-badge {
  display: none;
  align-items: center;
  gap: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--olive-light);
  background: var(--olive-muted);
  border: 1px solid var(--olive);
  padding: 4px 10px;
  border-radius: 99px;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--olive-light);
  border-radius: 50%;
  animation: live-blink 1.2s ease-in-out infinite;
}

@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* ─────────────────────────────────────────────
   42. RANGE DEMO INPUTS
───────────────────────────────────────────── */
.range-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.range-inputs label {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
}

.range-inputs input[type="number"] {
  width: 80px;
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease);
  -moz-appearance: textfield;
}

.range-inputs input[type="number"]:focus {
  border-color: var(--river);
}

/* ─────────────────────────────────────────────
   43. KEEP-ALIVE BAR ROWS
───────────────────────────────────────────── */
#keepalive-result {
  margin-top: 16px;
}

/* ─────────────────────────────────────────────
   44. RATE LIMITER COUNTER
───────────────────────────────────────────── */
.rate-counter-display {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--text-ghost);
  margin-top: 8px;
}

/* ─────────────────────────────────────────────
   45. SECTION LIVE BADGE (generic)
───────────────────────────────────────────── */
.section-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta-light);
  background: var(--terracotta-muted);
  border: 1px solid var(--terracotta);
  padding: 3px 8px;
  border-radius: 99px;
}

/* ─────────────────────────────────────────────
   46. WHY LOTHAL ACCORDION
───────────────────────────────────────────── */
.why-lothal-wrap {
  border: 1px solid var(--bg-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-surface);
}

.why-lothal-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 20px 24px;
  background: var(--bg-raised);
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
  text-align: left;
}

.why-lothal-trigger:hover {
  background: var(--bg-high);
}

.why-lothal-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.why-lothal-heading {
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.why-lothal-chevron {
  font-size: 18px;
  color: var(--text-faint);
  transition: transform var(--t-mid) var(--ease);
  flex-shrink: 0;
}

.why-lothal-trigger[aria-expanded="true"] .why-lothal-chevron,
#why-lothal-chevron.open {
  transform: rotate(180deg);
}

.why-lothal-body {
  padding: 0 24px 24px;
  border-top: var(--border);
}

.why-lothal-body[hidden] {
  display: none;
}

/* Image frame */
.lothal-image-frame {
  width: 100%;
  aspect-ratio: 16 / 7;
  border: 1px solid var(--bg-border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-raised);
  margin: 24px 0 20px;
  position: relative;
}

.lothal-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lothal-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: repeating-linear-gradient(
    45deg,
    var(--bg-raised),
    var(--bg-raised) 10px,
    var(--bg-high) 10px,
    var(--bg-high) 20px
  );
  opacity: 0.7;
}

/* Text layout */
.why-lothal-text {
  padding-top: 4px;
}

/* ─────────────────────────────────────────────
   47. CREATED BY BLOCK
───────────────────────────────────────────── */
.created-by-block {
  display: flex;
  justify-content: center;
  margin: 0 auto 48px;
}

.created-by-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 32px;
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--r-xl);
  transition: border-color var(--t-mid) var(--ease),
              box-shadow var(--t-mid) var(--ease);
}

.created-by-inner:hover {
  border-color: var(--terracotta);
  box-shadow: 0 4px 24px rgba(196, 114, 74, 0.1);
}

.creator-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--terracotta-muted);
  border: 1.5px solid var(--terracotta);
  color: var(--terracotta-light);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.creator-text {
  text-align: left;
}

.creator-label {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-ghost);
  margin-bottom: 4px;
}

.creator-name {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 6px;
  transition: color var(--t-fast) var(--ease);
}

.creator-name:hover {
  color: var(--terracotta-light);
}

.creator-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
}

.creator-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.creator-links a:hover {
  color: var(--terracotta-light);
}
