/* Health Informatics Africa - Premium Styles */
:root {
  --primary: #41686c;
  --primary-dark: #2d4a4e;
  --primary-light: #5a8a8f;
  --primary-soft: #e8f0f1;
  --primary-muted: #a8c4c7;
  --white: #ffffff;
  --off-white: #f8fafb;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --text: #1a2b2d;
  --text-muted: #5a6b6e;
  --shadow-sm: 0 1px 2px rgba(65, 104, 108, 0.05);
  --shadow: 0 4px 6px -1px rgba(65, 104, 108, 0.08), 0 2px 4px -1px rgba(65, 104, 108, 0.04);
  --shadow-md: 0 10px 15px -3px rgba(65, 104, 108, 0.1), 0 4px 6px -2px rgba(65, 104, 108, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(65, 104, 108, 0.1), 0 10px 10px -5px rgba(65, 104, 108, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(65, 104, 108, 0.2);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-heading: 'Be Vietnam Pro', system-ui, sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
  --container: 1200px;
  --header-height: 80px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

ul, ol { list-style: none; }

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -0.015em; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { margin-bottom: 1rem; color: var(--text-muted); }

.lead {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 50px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(65, 104, 108, 0.35);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(65, 104, 108, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-white {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-md);
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1rem;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  transition: var(--transition);
  background: transparent;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  height: 48px;
}

.logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

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

.nav-link {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--white);
  position: relative;
  padding: 0.25rem 0;
}

.header.scrolled .nav-link {
  color: var(--gray-700);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-light);
  transition: width 0.3s ease;
}

.header.scrolled .nav-link::after {
  background: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-light);
}

.header.scrolled .nav-link:hover,
.header.scrolled .nav-link.active {
  color: var(--primary);
}

.header .btn-cta {
  background: var(--white);
  color: var(--primary);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header.scrolled .btn-cta {
  background: var(--primary);
  color: var(--white);
}

.header .btn-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(65, 104, 108, 0.3);
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: var(--transition);
  border-radius: 2px;
}

.header.scrolled .menu-toggle span {
  background: var(--primary);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
  .menu-toggle { display: flex; }
  
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem 2rem 2rem;
    gap: 1.5rem;
    box-shadow: var(--shadow-xl);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .nav.open {
    right: 0;
  }
  
  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    width: 100%;
  }
  
  .nav-link {
    color: var(--gray-700) !important;
    font-size: 1.125rem;
  }
  
  .nav-link::after {
    background: var(--primary) !important;
  }
  
  .header .btn-cta {
    background: var(--primary) !important;
    color: var(--white) !important;
    width: 100%;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #2d4a4e 0%, #41686c 40%, #5a8a8f 100%);
  overflow: hidden;
  padding-top: var(--header-height);
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-bg canvas {
  width: 100%;
  height: 100%;
  opacity: 0.4;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  padding: 4rem 0;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.hero .lead {
  color: rgba(255,255,255,0.9);
  margin-bottom: 2.5rem;
  font-size: 1.1875rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-visual {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 45%;
  max-width: 560px;
  height: 70%;
  opacity: 0.9;
  z-index: 1;
}

@media (max-width: 1000px) {
  .hero-visual { display: none; }
  .hero-content { max-width: 100%; text-align: center; }
  .hero-ctas { justify-content: center; }
}

/* Section Common */
.section {
  padding: 5.5rem 0;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3.5rem;
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

/* Impact Cards */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

.impact-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.impact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
  transform-origin: top;
}

.impact-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-muted);
}

.impact-card:hover::before {
  transform: scaleY(1);
}

.impact-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--primary);
  transition: var(--transition);
}

.impact-card:hover .impact-icon {
  background: var(--primary);
  color: var(--white);
  transform: scale(1.05);
}

.impact-card h3 {
  margin-bottom: 0.75rem;
  color: var(--gray-900);
}

.impact-card p {
  margin: 0;
  font-size: 0.9375rem;
}

/* About Preview */
.about-preview {
  background: var(--off-white);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.split-image {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: linear-gradient(145deg, var(--primary-dark), var(--primary-light));
  box-shadow: var(--shadow-xl);
}

.split-image-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.split-content h2 {
  margin-bottom: 1.25rem;
}

.split-content p {
  margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .split-image { order: -1; max-height: 320px; }
}

/* Services Preview */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-soft), #d4e8ea);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
}

.service-card h3 {
  margin-bottom: 0.625rem;
  font-size: 1.125rem;
}

.service-card p {
  font-size: 0.9375rem;
  margin: 0;
  flex-grow: 1;
}

/* Why Matters */
.why-matters {
  background: var(--primary);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.why-matters h2,
.why-matters p {
  color: var(--white);
}

.why-matters .lead {
  color: rgba(255,255,255,0.85);
}

.process-flow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.process-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  min-width: 130px;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(20px);
}

.process-step.visible {
  opacity: 1;
  transform: translateY(0);
}

.process-step:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-4px);
}

.process-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--white);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.875rem;
}

.process-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  text-align: center;
}

.process-arrow {
  color: rgba(255,255,255,0.5);
  font-size: 1.25rem;
  display: none;
}

@media (min-width: 700px) {
  .process-arrow { display: block; }
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--off-white) 100%);
  text-align: center;
}

.cta-section h2 {
  margin-bottom: 1rem;
}

.cta-section .lead {
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* Footer */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 4rem 0 2rem;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 40%);
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  position: relative;
}

.footer-brand .logo {
  height: 42px;
  margin-bottom: 1rem;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  color: rgba(255,255,255,0.7);
  font-size: 0.9375rem;
  max-width: 280px;
}

.footer h4 {
  color: var(--white);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.footer-links a {
  display: block;
  color: rgba(255,255,255,0.7);
  font-size: 0.9375rem;
  margin-bottom: 0.625rem;
}

.footer-links a:hover {
  color: var(--white);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  position: relative;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Page Hero (inner pages) */
.page-hero {
  background: linear-gradient(135deg, #2d4a4e 0%, #41686c 50%, #5a8a8f 100%);
  padding: calc(var(--header-height) + 4rem) 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero h1 {
  color: var(--white);
  margin-bottom: 1rem;
}

.page-hero .lead {
  color: rgba(255,255,255,0.9);
  max-width: 600px;
  margin: 0 auto;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.3;
}

/* About Page */
.vision-mission {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.vm-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.vm-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.vm-card h3 {
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.principle-card {
  background: var(--off-white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

.principle-card:hover {
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.principle-card h4 {
  margin-bottom: 0.625rem;
  color: var(--primary);
}

/* Services Detail */
.service-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  padding: 4rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.service-detail:last-child {
  border-bottom: none;
}

.service-detail.reverse {
  direction: rtl;
}

.service-detail.reverse > * {
  direction: ltr;
}

.service-detail-content h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.service-benefits {
  margin: 1.5rem 0;
}

.service-benefits li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.service-benefits li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.service-visual {
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 16/11;
  background: linear-gradient(145deg, var(--primary-dark), var(--primary));
  position: relative;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 900px) {
  .service-detail,
  .service-detail.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 2rem;
  }
  .service-visual { max-height: 280px; }
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
}

.contact-form {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
  color: var(--gray-700);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-50);
  transition: var(--transition);
  color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(65, 104, 108, 0.15);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-card {
  background: var(--primary-soft);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.info-card h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

.info-card p, .info-card a {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.info-card a:hover {
  color: var(--primary);
}

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

/* Animations */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-up.delay-1 { transition-delay: 0.1s; }
.fade-up.delay-2 { transition-delay: 0.2s; }
.fade-up.delay-3 { transition-delay: 0.3s; }
.fade-up.delay-4 { transition-delay: 0.4s; }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }

/* Abstract visual patterns for image placeholders */
.abstract-data {
  width: 100%;
  height: 100%;
  position: relative;
  background: 
    radial-gradient(circle at 30% 40%, rgba(255,255,255,0.15) 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.1) 0%, transparent 35%),
    linear-gradient(145deg, var(--primary-dark), var(--primary));
}

.abstract-data svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

/* Form success */
.form-success {
  display: none;
  text-align: center;
  padding: 2rem;
}

.form-success.show {
  display: block;
}

.form-success svg {
  width: 64px;
  height: 64px;
  color: var(--primary);
  margin: 0 auto 1rem;
}

/* Logo switch */
.logo img.logo-white { display: block; }
.logo img.logo-dark { display: none; }
.header.scrolled .logo img.logo-white { display: none; }
.header.scrolled .logo img.logo-dark { display: block; }

/* Footer logo - use dark inverted or white */
.footer .logo img {
  filter: none;
  height: 42px;
}
.footer .logo .logo-white { display: block; }
.footer .logo .logo-dark { display: none; }

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: var(--transition);
  z-index: 900;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.back-to-top svg {
  width: 22px;
  height: 22px;
}

/* Team section */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.team-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.team-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-muted);
}

.team-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 1.25rem;
  background: linear-gradient(145deg, var(--primary-soft), #d0e4e6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  border: 3px solid var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.team-avatar svg {
  width: 56px;
  height: 56px;
  opacity: 0.7;
}

.team-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.35rem;
  color: var(--gray-900);
}

.team-card .team-role {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 600;
  font-family: var(--font-heading);
  margin-bottom: 0.75rem;
}

.team-card p {
  font-size: 0.875rem;
  margin: 0;
  color: var(--text-muted);
}

/* Medical icon enhancements */
.medical-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-soft), #d4e8ea);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--primary);
}

/* Hero medical visual improvements */
.hero-medical-visual {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  width: min(480px, 42%);
  height: auto;
  z-index: 1;
  opacity: 0.85;
  pointer-events: none;
}

@media (max-width: 1000px) {
  .hero-medical-visual { display: none; }
}

/* ============================================
   IMIGONGO PATTERNS — African geometric motifs
   Inspired by traditional Rwandan Imigongo art
   ============================================ */

:root {
  --imigongo: #2d4a4e;
  --imigongo-soft: rgba(65, 104, 108, 0.12);
  --imigongo-mid: rgba(65, 104, 108, 0.22);
}

/* Horizontal separator bar */
.imigongo-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 auto 2.5rem;
  max-width: 420px;
  color: var(--primary);
  opacity: 0.55;
}

.imigongo-sep::before,
.imigongo-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-muted));
}

.imigongo-sep svg {
  width: 180px;
  height: 18px;
  flex-shrink: 0;
}

/* Compact diamond-only separator */
.imigongo-sep-sm {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 1.5rem 0;
  color: var(--primary);
  opacity: 0.4;
}

.imigongo-sep-sm span {
  display: block;
  width: 10px;
  height: 10px;
  background: currentColor;
  transform: rotate(45deg);
}

.imigongo-sep-sm span:nth-child(even) {
  width: 6px;
  height: 6px;
  opacity: 0.6;
  margin-top: 2px;
}

/* Vertical side border decoration (subtle) */
.imigongo-border-l,
.imigongo-border-r {
  position: relative;
}

.imigongo-border-l::before,
.imigongo-border-r::after {
  content: '';
  position: absolute;
  top: 10%;
  bottom: 10%;
  width: 14px;
  opacity: 0.08;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='80' viewBox='0 0 14 80'%3E%3Cg fill='%2341686c'%3E%3Cpolygon points='7,2 13,12 1,12'/%3E%3Cpolygon points='1,14 13,14 7,24'/%3E%3Cpolygon points='7,26 13,36 1,36'/%3E%3Cpolygon points='1,38 13,38 7,48'/%3E%3Cpolygon points='7,50 13,60 1,60'/%3E%3Cpolygon points='1,62 13,62 7,72'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-size: 14px 80px;
}

.imigongo-border-l::before { left: 0; }
.imigongo-border-r::after { right: 0; }

@media (max-width: 900px) {
  .imigongo-border-l::before,
  .imigongo-border-r::after { display: none; }
}

/* Card corner accents */
.imigongo-card {
  position: relative;
  overflow: hidden;
}

.imigongo-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='%2341686c'%3E%3Cpolygon points='48,0 48,18 30,0'/%3E%3Cpolygon points='48,20 48,36 32,20'/%3E%3Cpolygon points='28,0 20,0 28,8'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  pointer-events: none;
}

/* Section top/bottom geometric border */
.imigongo-section-border {
  position: relative;
}

.imigongo-section-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='8' viewBox='0 0 80 8'%3E%3Cg fill='%2341686c'%3E%3Cpolygon points='0,0 8,0 4,8'/%3E%3Cpolygon points='10,8 18,8 14,0'/%3E%3Cpolygon points='20,0 28,0 24,8'/%3E%3Cpolygon points='30,8 38,8 34,0'/%3E%3Cpolygon points='40,0 48,0 44,8'/%3E%3Cpolygon points='50,8 58,8 54,0'/%3E%3Cpolygon points='60,0 68,0 64,8'/%3E%3Cpolygon points='70,8 78,8 74,0'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 80px 8px;
}

/* Footer Imigongo strip */
.footer-imigongo {
  height: 12px;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='12' viewBox='0 0 100 12'%3E%3Cg fill='%23ffffff'%3E%3Cpolygon points='6,1 12,6 6,11 0,6'/%3E%3Cpolygon points='22,1 28,6 22,11 16,6'/%3E%3Cpolygon points='38,1 44,6 38,11 32,6'/%3E%3Cpolygon points='50,2 56,2 53,7'/%3E%3Cpolygon points='50,10 56,10 53,5'/%3E%3Cpolygon points='62,1 68,6 62,11 56,6'/%3E%3Cpolygon points='78,1 84,6 78,11 72,6'/%3E%3Cpolygon points='90,2 96,2 93,7'/%3E%3Cpolygon points='90,10 96,10 93,5'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 100px 12px;
  margin-bottom: 1.5rem;
}

/* Inline decorative motif next to headings */
.imigongo-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 0.5rem;
  vertical-align: middle;
  color: var(--primary);
  opacity: 0.7;
}

.imigongo-mark span {
  display: block;
  width: 8px;
  height: 8px;
  background: currentColor;
  transform: rotate(45deg);
}

.imigongo-mark span:nth-child(2) {
  width: 5px;
  height: 5px;
  opacity: 0.5;
}

/* Why-matters section variant (on dark bg) */
.why-matters .imigongo-sep {
  color: rgba(255,255,255,0.7);
  opacity: 0.5;
}

.why-matters .imigongo-sep::before,
.why-matters .imigongo-sep::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
}

/* Page hero bottom edge */
.page-hero .imigongo-edge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 10px;
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='10' viewBox='0 0 64 10'%3E%3Cg fill='%23ffffff'%3E%3Cpolygon points='4,1 10,5 4,9 0-2'/%3E%3Cpolygon points='16,1 22,5 16,9 10,5'/%3E%3Cpolygon points='28,1 34,5 28,9 22,5'/%3E%3Cpolygon points='40,2 46,2 43,7'/%3E%3Cpolygon points='40,8 46,8 43,3'/%3E%3Cpolygon points='52,1 58,5 52,9 46,5'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 64px 10px;
}

/* Team / card accent line using triangles */
.imigongo-accent-line {
  height: 4px;
  width: 48px;
  margin: 0.75rem auto 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='4' viewBox='0 0 48 4'%3E%3Cg fill='%2341686c'%3E%3Cpolygon points='0,0 6,0 3,4'/%3E%3Cpolygon points='8,4 14,4 11,0'/%3E%3Cpolygon points='16,0 22,0 19,4'/%3E%3Cpolygon points='24,4 30,4 27,0'/%3E%3Cpolygon points='32,0 38,0 35,4'/%3E%3Cpolygon points='40,4 46,4 43,0'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 48px 4px;
}

/* Africa Impact Map in Hero */
.hero {
  display: flex;
  align-items: center;
  position: relative;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero-map {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  animation: mapFloat 6s ease-in-out infinite;
}

.map-glow {
  position: absolute;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(127, 212, 197, 0.35) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(30px);
  z-index: 0;
  animation: glowPulse 4s ease-in-out infinite;
}

.africa-map-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.25));
}

.map-land {
  transition: all 0.3s ease;
}

.node-pulse {
  transform-origin: center;
  transform-box: fill-box;
  animation: nodePulse 3s ease-out infinite;
}

.conn {
  animation: dashMove 20s linear infinite;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7fd4c5;
  box-shadow: 0 0 10px #7fd4c5;
  animation: legendBlink 2s ease-in-out infinite;
}

@keyframes nodePulse {
  0% {
    opacity: 0.9;
    transform: scale(0.6);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.3);
  }
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes mapFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes dashMove {
  to { stroke-dashoffset: -100; }
}

@keyframes legendBlink {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px #7fd4c5; }
  50% { opacity: 0.5; box-shadow: 0 0 4px #7fd4c5; }
}

/* Ensure hero content and map sit side by side */
.hero .container {
  display: grid !important;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 1rem;
  width: 100%;
  position: relative;
  z-index: 2;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 100%;
  padding: 2rem 0;
}

.hero-map {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@media (max-width: 1000px) {
  .hero .container {
    grid-template-columns: 1fr !important;
    text-align: center;
  }
  .hero-content {
    text-align: center;
  }
  .hero-ctas {
    justify-content: center;
  }
  .hero-map {
    min-height: 280px;
    max-width: 320px;
    margin: 0 auto;
  }
  .africa-map-svg {
    max-width: 280px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-map,
  .node-pulse,
  .map-glow,
  .conn,
  .legend-dot {
    animation: none !important;
  }
}

/* Force hero map visibility */
.hero .hero-map {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}
.hero .hero-map {
  animation: mapFloat 6s ease-in-out infinite;
}
@media (max-width: 1000px) {
  .hero .hero-map {
    max-width: 300px;
    min-height: 260px;
  }
}

/* Africa map image */
.africa-map-img {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.35));
  animation: mapFloat 6s ease-in-out infinite;
}

.hero-map .map-glow {
  background: radial-gradient(circle, rgba(0, 200, 220, 0.25) 0%, transparent 65%);
}

@media (max-width: 1000px) {
  .africa-map-img {
    max-width: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .africa-map-img {
    animation: none !important;
  }
}
