/* ---------- PAGE-SPECIFIC & UTILITY CLASSES FROM HTML ---------- */
/* Page-specific spacing (consolidated below) */

/* Metrics, Data Snapshots, Recommendations, Cards, Tags */
.metrics-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin: 24px 0;
}
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 12px;
}
.metric-item {
  background: white;
  padding: 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.metric-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.metric-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}
.metric-value.danger {
  color: var(--danger);
}
.metric-desc {
  font-size: 12px;
  color: var(--muted);
}

/* Small layout utilities */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.item { margin-bottom: 24px; }
.contact a { display: block; margin-top: 10px; }
.contact-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Breadcrumb and back-link */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 12px 0 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  color: var(--text);
}
.breadcrumb a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb .crumb-sep {
  color: var(--muted);
}
.breadcrumb span {
  font-weight: 600;
}

.back-to-portfolio {
  text-align: center;
  padding: 40px 0 24px;
}
.back-to-portfolio .pill-link {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.hero-cta {
  margin-top: 24px;
  margin-bottom: 28px;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.pill-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

.pill-link.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.pill-link.primary:hover {
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}
.mt-16 { margin-top: 16px; }

.side-index {
  position: fixed;
  top: 120px;
  right: 28px;
  width: 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 14px 10px 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9;
}

.side-index.collapsible {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  width: auto;
  min-width: 0;
}

.side-index-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.side-index-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.side-index.collapsible .side-index-body {
  margin-top: 10px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-index.collapsible:not(.open) .side-index-body {
  display: none;
}

.side-index.collapsible.open .side-index-body {
  display: flex;
}

.side-index-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 2px;
}

.side-index a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.side-index-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.side-index-icon svg {
  width: 18px;
  height: 18px;
}

.side-index-label {
  font-weight: 700;
}

.side-index a:hover {
  background: #eef2ff;
  color: #1e3a8a;
  transform: translateX(2px) scale(1.01);
}

.side-index-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.side-index-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
  line-height: 1;
  padding: 6px;
  border-radius: 8px;
}

.side-index-close:hover {
  background: #eef2ff;
}

.side-index-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-index-parent {
  padding-bottom: 2px;
}

.side-index-children {
  border-left: 2px solid var(--border);
  margin-left: 8px;
  padding-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 768px) {
  .side-index {
    top: auto;
    bottom: 16px;
    right: 16px;
    width: auto;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    z-index: 25;
  }

  .side-index.collapsible .side-index-body {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(82vw, 320px);
    transform: translateX(100%);
    transition: transform 0.2s ease;
    border-radius: 12px 0 0 12px;
    box-shadow: -10px 0 24px rgba(0, 0, 0, 0.14);
    padding: 18px 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
  }

  .side-index.collapsible.open .side-index-body {
    transform: translateX(0);
  }

  .side-index.collapsible:not(.open) .side-index-body {
    display: flex;
    pointer-events: none;
  }

  .side-index-toggle {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
  }

  .side-index-label {
    display: none;
  }

  .side-index a {
    padding: 10px 10px;
  }

  .side-index-header {
    position: sticky;
    top: 0;
    background: var(--card);
    padding-bottom: 8px;
    z-index: 1;
  }
}

.data-snapshot {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}
.snapshot-table {
  font-size: 13px;
  width: 100%;
  border-collapse: collapse;
}
.snapshot-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.snapshot-table tr:last-child td {
  border-bottom: none;
}

/* .recommendation styles consolidated later to ensure consistent precedence */

.findings.notes {
  font-size: 13px;
  color: #888;
}
.bold-row {
  font-weight: bold;
}

/* Approach, Code, and User Cards (from feature-impact) */
.approach {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin: 28px 0;
}
.approach h3 {
  margin-top: 0;
}
.approach-step {
  margin: 16px 0;
  padding-left: 24px;
  border-left: 3px solid var(--accent);
}
.approach-step strong {
  color: var(--text);
}
.code-block {
  background: #1f2937;
  color: #f3f4f6;
  padding: 14px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.4;
  margin: 16px 0;
  display: none;
}
.code-label {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 8px;
  font-weight: 500;
}

/* User cards for feature-impact.html */
.card.user {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.user-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Caption and Figure styles for growth-allocation */
.fig {
  margin: 18px 0;
  text-align: center;
}
.fig img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.caption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

/* Responsive for metrics-row */
@media (max-width: 768px) {
  .metrics-row {
    grid-template-columns: 1fr;
  }

  .side-index {
    display: none;
  }

  .side-index {
    display: none;
  }
}
/* ============================================
   SHARED DESIGN SYSTEM STYLESHEET
   ============================================ */

/* ---------- ROOT VARIABLES & BASE STYLES ---------- */
:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --card: #f9fafb;
  --border: #e5e7eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 200px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
}

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

/* ---------- NAVBAR ---------- */
nav {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.2s ease;
}

nav .left {
  font-weight: 700;
  font-size: 26px;
  display: inline-block;
  transition: transform 0.12s ease;
  letter-spacing: -0.5px;
}

nav .left a {
  display: inline-block;
  transition: transform 0.12s ease;
}

nav .left a:hover {
  transform: translateY(-1px) scale(1.02);
}

nav .right a {
  margin-left: 20px;
  font-size: 14px;
  display: inline-block;
  position: relative;
  transition: transform 0.12s ease, color 0.12s ease;
  padding-bottom: 2px;
}

nav .right a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

nav .right a:hover {
  transform: translateY(-1px);
  color: var(--accent);
}

nav .right a:hover::after {
  width: 100%;
}

nav .right a.active {
  color: var(--accent);
  font-weight: 600;
}

nav .right a.active::after {
  width: 100%;
}
nav .btn {
  padding: 11px 22px 10px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-size: 14px;
  letter-spacing: 0.2px;
  position: relative;
  vertical-align: middle;
  line-height: 1.2;
  height: 40px;
}

.contact-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  line-height: 1;
}

.contact-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  transform: none;
}

.contact-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.nav-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  white-space: nowrap;
}

nav .btn::after {
  display: none !important;
}

nav .btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3);
  background: #1d4ed8;
}

/* Responsive nav */
@media (max-width: 768px) {
  nav {
    padding: 10px 16px;
  }
  nav .left {
    font-size: 22px;
  }
  nav .right {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .contact-icon {
    display: inline-flex;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    position: absolute;
    top: 56px;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 200px;
    display: none;
  }
  nav .right.open .nav-links {
    display: flex;
  }
  nav .right a {
    margin-left: 0;
  }
  nav .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Contact tweaks */
@media (max-width: 768px) {
  .contact {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
  }
  .contact-links {
    flex-direction: column;
  }
  .contact-links .pill-link {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile toast prompt */
.toast-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 30;
}

.toast-overlay.show {
  display: flex;
}

.toast-banner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.16);
  padding: 14px 16px;
  max-width: 360px;
  width: min(440px, 100%);
  display: none;
  flex-direction: column;
  gap: 10px;
}

.toast-banner.show {
  display: flex;
}

.toast-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.toast-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.toast-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toast-buttons .btn-secondary,
.toast-buttons .btn-primary {
  flex: 1;
  min-width: 120px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.toast-buttons .btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.toast-buttons .btn-secondary:hover,
.toast-buttons .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}
/* ---------- SECTIONS & TYPOGRAPHY ---------- */
section {
  padding: 28px 32px;
  max-width: 1100px;
  margin: auto;
  transition: background 0.3s ease;
}

@keyframes sectionHighlight {
  0%, 100% {
    transform: scale(1);
  }
  5% {
    transform: scale(1.015) translateX(-3px);
  }
  10% {
    transform: scale(1.015) translateX(3px);
  }
  15% {
    transform: scale(1.015) translateX(-3px);
  }
  20% {
    transform: scale(1.015) translateX(0);
  }
}

.highlight-flash {
  animation: sectionHighlight 3s ease-out;
  border-radius: 12px;
  transition: none;
}

section#projects {
  padding-top: 0;
}

section#experience {
  padding-top: 0;
}

h1 {
  font-size: 36px;
  margin: 0 0 12px 0;
}

h2 {
  font-size: 26px;
  margin: 20px 0 12px 0;
}

h3 {
  font-size: 20px;
  margin: 18px 0 8px 0;
}

h4 {
  font-size: 16px;
  margin: 16px 0 8px 0;
}

p {
  margin: 0 0 12px 0;
  color: var(--text);
}

/* Lead paragraph style for hero and important intros */
.lead {
  font-size: 18px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 16px;
}

ul {
  margin: 8px 0 16px 20px;
  padding: 0;
  line-height: 1.8;
}

li {
  margin-bottom: 10px;
}

/* ---------- HERO ---------- */
.hero p {
  font-size: 18px;
  max-width: 850px;
}

.hero h1 {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.hero h1 .quote-mark {
  color: var(--accent);
}

.hero .lead {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero .subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 20px;
}

/* Hero questions grid */
.hero-questions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 32px 0 24px 0;
}

.question-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: #f0f9ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.question-item:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

.question-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.question-item p {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
}

.question-sub {
  display: block;
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.hero-joke {
  font-size: 14px;
  color: var(--muted);
  margin-top: 20px;
  margin-bottom: 0;
  font-style: italic;
  line-height: 1.6;
}

/* Hero CTA buttons */
.hero-cta-buttons {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
  background: var(--accent);
  color: white;
  border: 2px solid var(--accent);
}

.cta-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.cta-btn.secondary {
  background: white;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.cta-btn.secondary:hover {
  background: #f0f9ff;
}

/* ---------- CARDS & GRIDS ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 30px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.card a {
  transition: transform 0.12s ease, color 0.12s ease;
  display: inline-block;
}

.card a:hover {
  transform: translateY(-1px) scale(1.02);
}

#projects .card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#projects .card .tag {
  align-self: flex-start;
}

#projects .card h3 {
  margin-top: 6px;
}

#projects .card p {
  flex: 1;
}

#projects .card a {
  margin-top: auto;
  font-weight: 600;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  width: fit-content;
  transition: transform 0.12s ease, color 0.12s ease, background 0.12s ease;
}

#projects .card a:hover {
  background: #eef2ff;
  color: #1e3a8a;
  transform: translateX(2px) scale(1.01);
}

/* Leadership cards (match project card aesthetic but compact) */
.leadership-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.leadership-card {
  padding: 18px;
  border-radius: 10px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.leadership-card h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
}

.leadership-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Research cards: match leadership cards but slightly more reserved */
.research-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .research-cards {
    grid-template-columns: 1fr;
  }
}

.research-card {
  padding: 18px;
  border-radius: 10px;
}

.research-card .research-title {
  margin: 0 0 6px 0;
  font-size: 16px;
}

.research-card .research-title a {
  display: inline-block;
  transition: transform 0.12s ease, color 0.12s ease;
}

.research-card .research-title a:hover {
  transform: translateY(-1px) scale(1.02);
}

.research-card .research-meta {
  margin: 0 0 10px 0;
  font-size: 12px;
  color: var(--muted);
}

.research-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

/* ---------- TAGS ---------- */
.tag {
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #1e3a8a;
  margin-bottom: 4px;
}

.read-time {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
  margin-left: 6px;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 px 0;
}

.tech-tags .tag {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- TABLES ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th {
  background: #f3f4f6;
  font-weight: 600;
  color: var(--text);
}

tr:last-child td {
  border-bottom: none;
}

/* ---------- UTILITIES ---------- */
.highlight {
  background: #fef3c7;
  padding: 2px 6px;
  border-radius: 3px;
}

.positive {
  color: var(--success);
  font-weight: 600;
}

.negative {
  color: var(--danger);
  font-weight: 600;
}

.neutral {
  color: var(--muted);
}

/* ---------- FOOTER ---------- */
footer {
  padding: 40px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- FINDINGS / ALERTS ---------- */
.findings {
  background: #f0fdf4;
  border: 0.5px solid var(--success);
  border-left-width: 4px;
  padding: 16px;
  border-radius: 6px;
  margin: 20px 0;
}

.findings.warning {
  background: #fef3c7;
  border-color: var(--warning);
  border-left-width: 4px;
}

.findings.danger {
  background: #fee2e2;
  border-color: var(--danger);
  border-left-width: 4px;
}

.findings strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

/* ---------- TL;DR / DECISION PROMINENCE ---------- */
.tldr {
  background: #fbfdff;
  border: 0.5px solid var(--accent);
  border-left-width: 4px;
  padding: 16px;
  border-radius: 6px;
  margin: 20px 0;
}
.tldr h2 {
  font-size: 30px;
  margin-top: 0;
  color: var(--text);
}
.tldr p, .tldr ul, .tldr li {
  color: var(--text);
  font-weight: 500;
}

/* make recommendation sections visually prominent when used */
.recommendation {
  background: #fee2e2;
  border: 0.5px solid var(--danger);
  border-left-width: 2px;
  border-radius: 6px;
  padding: 16px;
  margin: 20px 0;
}
.recommendation.positive {
  background: #f0fdf4;
  border-color: var(--success);
  border-left-width: 2px;
}
.recommendation.positive h3 {
  color: var(--success);
}
.recommendation h3 {
  color: var(--danger);
  margin-top: 0;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  section {
    padding: 36px 20px;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 24px;
    margin-top: 36px;
  }

  .metrics-row {
    grid-template-columns: 1fr;
  }
}

/* Vertical rhythm helper */
/* keep zero-bottom-margin for most last-child elements, but allow explicit spacing for TL;DR and recommendation blocks */
section > *:last-child:not(.tldr):not(.recommendation) {
  margin-bottom: 0;
}

/* reduce space between hero and immediate TL;DR */
.hero + .tldr {
  margin-top: 12px;
  padding-top: 16px;
}

/* ---------- EXPERIENCE CARDS & VISUAL HIERARCHY ---------- */
.experience-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.experience-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04);
}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 20px;
}

.experience-header > div {
  flex: 1;
}

.experience-header h4 {
  margin: 0 0 4px 0;
}

.role {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.company {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  font-weight: 500;
}

.dates {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 500;
}

.impact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.impact-item {
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #1e40af;
  font-weight: 500;
  white-space: nowrap;
}

.experience-card ul {
  margin: 0 0 0 20px;
  padding: 0;
}

.experience-card li {
  margin-bottom: 10px;
  line-height: 1.6;
  font-size: 14px;
}

.education-courses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 6px 18px;
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}

.education-courses li {
  margin: 0;
  padding-left: 0;
}

/* Metric pill styling (visual highlight for bold metrics via CSS) */
.experience-card strong {
  color: var(--text);
  font-weight: 600;
  background: #fef3c7;
  padding: 2px 5px;
  border-radius: 4px;
}

.experience-card strong.course-label {
  background: none !important;
  padding: 0 !important;
  font-weight: 700 !important;
}
}

/* ---------- RESEARCH PUBLICATIONS REDESIGN ---------- */
.research-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 24px;
}

.research-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s ease;
}

.research-item:last-child {
  border-bottom: none;
}

.research-item:hover {
  opacity: 0.9;
}

.research-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px 0;
}

.research-meta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.research-item > p:last-child {
  font-size: 14px;
  color: var(--text);
  margin: 0;
  line-height: 1.6;
}

/* ---------- RESPONSIVE EXPERIENCE SECTION ---------- */
@media (max-width: 768px) {
  .experience-card {
    padding: 18px;
  }

  .experience-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .dates {
    white-space: normal;
  }

  .role {
    font-size: 16px;
  }

  .impact-strip {
    margin-bottom: 14px;
  }

  .impact-item {
    font-size: 11px;
    padding: 3px 8px;
  }

  .experience-card li {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .research-title {
    font-size: 15px;
  }

  .research-item > p:last-child {
    font-size: 13px;
  }
}

/* ---------- LAYOUT ENHANCEMENTS FOR CASE STUDIES ---------- */

/* Two-column layout: metrics left, figure right */
.split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  align-items: start;
  margin-top: 24px;
}

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

/* Compact cards for metric-style summaries */
.card.compact {
  padding: 16px;
}

.card.compact h4 {
  margin-top: 0;
  font-size: 15px;
}

/* Force 2-column grid when 3 causes orphaning */
.cards.two-col {
  grid-template-columns: repeat(2, 1fr);
}

/* Reduce visual noise for figure-only cards */
.card.figure-only {
  padding: 12px;
}

/* Light section divider without lines */
.section-note {
  font-size: 14px;
  color: var(--muted);
  margin-top: -8px;
  margin-bottom: 16px;
}

/* ---------- COMPARISON BLOCK ---------- */

.comparison-card {
  padding: 20px;
}

.comparison-card h4 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 16px;
}

.comparison-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 15px;
}

.comparison-row strong {
  font-weight: 600;
}

.comparison-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.comparison-row.result {
  font-size: 16px;
}

.comparison-row.result strong {
  color: var(--danger);
}

/* Stack helper for left column */
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Metric rows */
.metric-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
}
.highlight-row {
  margin-top: 6px;
}

/* Subtle explanatory card */
.card.subtle {
  background: #ffffff;
  border: 1px dashed var(--border);
}

/* Quiet chart container */
.card.figure-only {
  padding: 12px;
}

/* Neutral emphasis for corrected result */
.neutral {
  color: var(--muted);
  font-weight: 600;
}

/* Positive interpretation block */
.card.subtle.positive {
  border: 1px dashed var(--success);
  background: #f0fdf4;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

/* Emphasized decision card */
.card.emphasis {
  background: #f8fafc;
  border: 1px solid var(--border);
}

/* Large metric text */
.metric-big {
  font-size: 22px;
  font-weight: 600;
  margin: 6px 0;
}

/* Clean list */
.clean-list {
  list-style: none;
  padding-left: 0;
  margin: 8px 0 0 0;
}

.clean-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.clean-list li:last-child {
  border-bottom: none;
}
.metrics-contrast {
  margin-top: 24px;
}

/* Labels above metric blocks */
.metric-label {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}

/* Primary metric emphasis */
.metric-primary {
  border: 2px solid var(--accent);
  background: #f8faff;
}

/* Secondary metric de-emphasis */
.metric-secondary {
  background: var(--card);
  opacity: 0.9;
}

/* Data sources */
.data-sources {
  margin-top: 24px;
}

/* --- Mobile contact icon in navbar --- */
.nav-contact-icon {
  display: none !important;
}

@media (max-width: 768px) {
  .nav-contact-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 84px;
    line-height: 2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
  }

  .nav-contact-icon:hover {
    transform: scale(1.1);
    opacity: 0.8;
  }
}
