/* ============================================================
   IRD — Innovation for Rehabilitation and Development
   Custom design system: glassmorphism, gradients, animations,
   accessibility controls, dark-mode refinements.
   ============================================================ */

:root {
  --primary: #0077C8;
  --deep: #005B9A;
  --light: #2EA8E6;
  --green: #4CAF50;
  --lgreen: #8BC34A;
  --gold: #F2C94C;
  --soft: #F5F7FA;
  --ink: #3B3B3B;
  --bg: #ffffff;
  --card: #ffffff;
  --text: #3B3B3B;
  --muted: #5c6b78;
  --border: #e4ebf1;
  --header-bg: rgba(255, 255, 255, 0.85);
  --hero-veil: linear-gradient(105deg, rgba(0, 90, 154, 0.88) 0%, rgba(0, 119, 200, 0.55) 48%, rgba(76, 175, 80, 0.35) 100%);
}

.dark {
  --bg: #0a1a28;
  --card: #0f2438;
  --text: #e8f0f6;
  --muted: #9fb3c4;
  --border: #1c3a52;
  --header-bg: rgba(10, 26, 40, 0.85);
  --hero-veil: linear-gradient(105deg, rgba(4, 40, 70, 0.92) 0%, rgba(0, 90, 154, 0.6) 50%, rgba(47, 110, 52, 0.45) 100%);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Noto Sans Ethiopic', ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { font-family: 'Poppins', 'Noto Sans Ethiopic', ui-sans-serif, system-ui, sans-serif; }

::selection { background: rgba(0, 119, 200, 0.25); }
.dark ::selection { background: rgba(46, 168, 230, 0.35); }

/* Skip link for keyboard users */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--primary); color: #fff; padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.75rem 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Focus visibility */
:focus-visible {
  outline: 3px solid rgba(46, 168, 230, 0.9);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Reusable components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 600; border-radius: 9999px; padding: 0.8rem 1.6rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none; line-height: 1.2; cursor: pointer; border: 2px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, #0077C8, #4CAF50); color: #fff; box-shadow: 0 12px 28px -10px rgba(0, 119, 200, 0.55); }
.btn-primary:hover { box-shadow: 0 16px 34px -10px rgba(0, 119, 200, 0.65); }
.btn-gold { background: var(--gold); color: #3b3b3b; box-shadow: 0 12px 28px -12px rgba(242, 201, 76, 0.7); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: rgba(0, 119, 200, 0.08); }
.btn-white { background: #fff; color: var(--deep); box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.35); }
.btn-ghost { color: var(--text); background: transparent; }
.btn-ghost:hover { background: rgba(0, 119, 200, 0.08); }
.dark .btn-outline { border-color: var(--light); color: var(--light); }

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 18px 45px -22px rgba(0, 90, 154, 0.35);
}
.dark .glass {
  background: rgba(15, 36, 56, 0.72);
  border-color: rgba(46, 168, 230, 0.18);
  box-shadow: 0 18px 45px -22px rgba(0, 0, 0, 0.6);
}

/* Gradient text */
.grad-text {
  background: linear-gradient(120deg, #0077C8 10%, #2EA8E6 45%, #4CAF50 90%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.gold-grad { background: linear-gradient(120deg, #F2C94C, #f5b301); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Section helpers */
.section-title { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; font-weight: 700; color: var(--primary); }
.dark .eyebrow { color: var(--light); }

/* Card hover lift */
.card-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card-lift:hover { transform: translateY(-6px); box-shadow: 0 24px 48px -20px rgba(0, 90, 154, 0.28); }
.card-img { overflow: hidden; }
.card-img img { transition: transform 0.6s ease; }
.card-lift:hover .card-img img { transform: scale(1.06); }

/* Chips / badges */
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.85rem; border-radius: 9999px; font-size: 0.78rem; font-weight: 600;
  background: rgba(0, 119, 200, 0.1); color: var(--deep); border: 1px solid rgba(0, 119, 200, 0.2);
}
.dark .chip { background: rgba(46, 168, 230, 0.14); color: var(--light); border-color: rgba(46, 168, 230, 0.3); }
.chip-green { background: rgba(76, 175, 80, 0.12); color: #2e7d32; border-color: rgba(76, 175, 80, 0.28); }
.dark .chip-green { background: rgba(76, 175, 80, 0.16); color: #8fd48f; border-color: rgba(76, 175, 80, 0.35); }
.chip-gold { background: rgba(242, 201, 76, 0.16); color: #8a6d00; border-color: rgba(242, 201, 76, 0.4); }
.dark .chip-gold { background: rgba(242, 201, 76, 0.14); color: #f2c94c; border-color: rgba(242, 201, 76, 0.35); }

/* Forms */
.field-label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text); }
.input, textarea.input, select.input {
  width: 100%; padding: 0.7rem 0.95rem; border-radius: 0.8rem;
  border: 1.5px solid var(--border); background: var(--card); color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease; font-size: 0.95rem;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0, 119, 200, 0.14); outline: none; }
.input::placeholder { color: #98a6b3; }

/* Progress bar */
.progress { height: 10px; border-radius: 9999px; background: rgba(0, 119, 200, 0.12); overflow: hidden; }
.progress > span {
  display: block; height: 100%; border-radius: 9999px;
  background: linear-gradient(90deg, #0077C8, #4CAF50);
  transition: width 1.2s cubic-bezier(0.25, 0.8, 0.3, 1);
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Divider */
.divider-grad { height: 4px; width: 84px; border-radius: 9999px; background: linear-gradient(90deg, #0077C8, #4CAF50); }

/* Hero veil */
.hero-veil { background: var(--hero-veil); }

/* Nav link */
.nav-link { position: relative; font-weight: 500; color: var(--text); transition: color 0.2s; }
.nav-link:hover { color: var(--primary); }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2.5px; width: 0;
  background: linear-gradient(90deg, #0077C8, #4CAF50); border-radius: 2px; transition: width 0.25s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--primary); font-weight: 600; }

/* Social buttons */
.social-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff; transition: background 0.2s ease, transform 0.2s ease;
}
.social-btn:hover { background: var(--primary); transform: translateY(-3px); }

/* Soft dots / decorative */
.dot-grid {
  background-image: radial-gradient(rgba(0, 119, 200, 0.22) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
}
.dark .dot-grid { background-image: radial-gradient(rgba(46, 168, 230, 0.28) 1.4px, transparent 1.4px); }

/* Timeline */
.timeline-item { position: relative; padding-left: 1.8rem; }
.timeline-item::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 9999px;
  background: linear-gradient(135deg, #0077C8, #4CAF50);
  box-shadow: 0 0 0 4px rgba(0, 119, 200, 0.15);
}
.timeline-item::after {
  content: ""; position: absolute; left: 5px; top: 24px; bottom: -14px; width: 2px;
  background: linear-gradient(180deg, rgba(0, 119, 200, 0.35), rgba(76, 175, 80, 0.2));
}
.timeline-item:last-child::after { display: none; }

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tbl th { text-align: left; padding: 0.7rem 0.9rem; background: rgba(0, 119, 200, 0.08); font-weight: 600; color: var(--deep); }
.dark .tbl th { color: var(--light); }
.tbl td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}
.site-header.scrolled { box-shadow: 0 10px 30px -18px rgba(0, 60, 110, 0.35); }

/* Logo chip */
.logo-chip {
  background: #fff; border-radius: 0.9rem; padding: 0.3rem;
  box-shadow: 0 4px 14px -6px rgba(0, 90, 154, 0.35);
  border: 1px solid rgba(0, 119, 200, 0.18);
  display: inline-flex; align-items: center; justify-content: center;
}
.logo-chip img { display: block; width: 3.1rem; height: 3.1rem; border-radius: 0.6rem; object-fit: cover; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #0077C8, #4CAF50); border-radius: 8px; }

/* Dark-mode image treatment */
.dark img.dark-safe { filter: brightness(0.92) saturate(1.05); }

/* Print */
@media print {
  .site-header, .site-footer, .cookie-banner, .back-top, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}

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