/* ============================================================================
   main.css — tokens, reset, layout primitives, navbar, hero, footer
   Load order is load-bearing: main -> components -> responsive
   ========================================================================= */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --deep-blue: #0C498A;
  --light-cyan: #B2EEFA;
  --light-green: #9DC384;
  --forest-green: #669348;
  --sky-blue: #69B5FA;
  --white: #FFFFFF;
  --dark-text: #1a2a3a;
  --body-text: #2c3e50;
  --light-bg: #f0fafe;
  --shadow-sm: 0 2px 8px rgba(12, 73, 138, 0.08);
  --shadow-md: 0 4px 20px rgba(12, 73, 138, 0.12);
  --shadow-lg: 0 8px 40px rgba(12, 73, 138, 0.16);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Spacing scale */
  --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;

  /* Z-index scale — modals, maps, dropdowns and tooltips all stack */
  --z-base: 1; --z-sticky: 100; --z-nav: 1000; --z-dropdown: 1010;
  --z-drawer: 1020; --z-modal: 1100; --z-tooltip: 1200;

  /* Semantic status — map pins, risk matrix, RACI, project state */
  --status-ok: var(--forest-green);
  --status-warn: #E8A33D;
  --status-alert: #D9534F;
  --status-planned: var(--sky-blue);
  --status-neutral: #94a3b8;

  /* Curriculum phase colors (4 phases x 12 modules) */
  --phase-1: var(--deep-blue);
  --phase-2: var(--sky-blue);
  --phase-3: var(--forest-green);
  --phase-4: var(--light-green);

  --nav-h: 72px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Open Sans', 'PT Sans', sans-serif;
  color: var(--body-text);
  line-height: 1.7;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  /* The navbar is position:fixed. Without this every page hides its first
     72px underneath it. .page-hero subtracts it back out so full-bleed
     heroes still run under the nav. */
  padding-top: var(--nav-h);
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Anchor targets must clear the fixed navbar */
:target { scroll-margin-top: calc(var(--nav-h) + var(--sp-4)); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-tooltip);
  background: var(--deep-blue);
  color: var(--white);
  padding: var(--sp-3) var(--sp-5);
  border-radius: 0 0 var(--radius) 0;
  font-weight: 700;
}

.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--sky-blue);
  outline-offset: 2px;
}

/* ===== TYPOGRAPHY ===== */
.prose h2 { font-size: 1.9rem; font-weight: 800; color: var(--deep-blue); margin: var(--sp-7) 0 var(--sp-4); letter-spacing: -0.5px; }
.prose h3 { font-size: 1.25rem; font-weight: 700; color: var(--deep-blue); margin: var(--sp-6) 0 var(--sp-3); }
.prose h4 { font-size: 1.05rem; font-weight: 700; color: var(--forest-green); margin: var(--sp-5) 0 var(--sp-2); }
.prose p { margin-bottom: var(--sp-4); }
.prose ul, .prose ol { margin: 0 0 var(--sp-4) var(--sp-5); }
.prose ul li { list-style: disc; padding: var(--sp-1) 0; }
.prose ol li { list-style: decimal; padding: var(--sp-1) 0; }
.prose a { color: var(--sky-blue); font-weight: 600; }
.prose a:hover { color: var(--deep-blue); text-decoration: underline; }
.prose strong { color: var(--deep-blue); }

.callout {
  background: var(--light-bg);
  border-left: 4px solid var(--sky-blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--sp-5);
  margin: var(--sp-5) 0;
}
.callout--green  { border-left-color: var(--forest-green); background: rgba(157, 195, 132, 0.10); }
.callout--warn   { border-left-color: var(--status-warn);  background: rgba(232, 163, 61, 0.08); }
.callout--alert  { border-left-color: var(--status-alert); background: rgba(217, 83, 79, 0.07); }
.callout__title  { font-weight: 700; color: var(--deep-blue); margin-bottom: var(--sp-2); }

.pull-quote {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--deep-blue);
  border-left: 4px solid var(--light-green);
  padding-left: var(--sp-5);
  margin: var(--sp-6) 0;
  line-height: 1.6;
}
.pull-quote cite { display: block; font-size: 0.85rem; font-style: normal; opacity: 0.7; margin-top: var(--sp-2); }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--light-cyan);
  color: var(--deep-blue);
}
.badge--green { background: rgba(157, 195, 132, 0.3); color: var(--forest-green); }
.badge--warn  { background: rgba(232, 163, 61, 0.18); color: #96631a; }
.badge--alert { background: rgba(217, 83, 79, 0.14); color: #a3302c; }

/* ===== LAYOUT PRIMITIVES ===== */
.section { padding: 100px 0; }
.section--tight { padding: 64px 0; }
.section--bg    { background: var(--light-bg); }
.section--white { background: var(--white); }

.card-grid { display: grid; gap: 24px; }
.card-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-7); align-items: center; }
.split--sidebar { grid-template-columns: 2fr 1fr; align-items: start; }

.stack > * + * { margin-top: var(--sp-4); }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(12, 73, 138, 0.08);
  transition: box-shadow var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

.navbar-brand {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.navbar-brand .brand-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--deep-blue);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.navbar-brand .brand-sub {
  font-size: 0.65rem;
  color: var(--forest-green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.navbar-item { position: relative; }

.navbar-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--deep-blue);
  transition: color var(--transition);
  position: relative;
  padding: 4px 0;
}

.navbar-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--sky-blue);
  transition: width var(--transition);
}

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

.navbar-link:hover { color: var(--sky-blue); }
.navbar-link.is-active { color: var(--sky-blue); }

.navbar-caret {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition);
}

.navbar-item--has-children:hover .navbar-caret,
.navbar-item--has-children.is-open .navbar-caret { transform: rotate(180deg); }

/* ===== NAVBAR DROPDOWN ===== */
.navbar-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: -16px;
  min-width: 250px;
  background: var(--white);
  border: 1px solid rgba(12, 73, 138, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

/* Bridges the 14px gap so the dropdown survives the mouse crossing it */
.navbar-item--has-children::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
}

.navbar-item--has-children:hover .navbar-dropdown,
.navbar-item--has-children.is-open .navbar-dropdown,
.navbar-dropdown:focus-within {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.navbar-dropdown li a {
  display: block;
  padding: 9px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--deep-blue);
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}

.navbar-dropdown li a:hover {
  background: var(--light-bg);
  color: var(--sky-blue);
}

.navbar-dropdown__foot {
  border-top: 1px solid rgba(12, 73, 138, 0.08);
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
}

.navbar-dropdown__foot a { color: var(--forest-green) !important; font-weight: 700 !important; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 50px;
  font-family: 'Open Sans', 'PT Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--deep-blue);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--sky-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(105, 181, 250, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

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

/* Outline variant for use on light backgrounds */
.btn-outline-blue {
  background: transparent;
  color: var(--deep-blue);
  border: 2px solid var(--deep-blue);
}

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

.btn-green {
  background: var(--forest-green);
  color: var(--white);
}

.btn-green:hover {
  background: var(--light-green);
  color: var(--deep-blue);
  transform: translateY(-2px);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--deep-blue);
  margin: 6px 0;
  transition: all var(--transition);
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
  background: var(--light-bg);
  border-bottom: 1px solid rgba(12, 73, 138, 0.06);
  font-size: 0.8rem;
  padding: var(--sp-3) 0;
}
.breadcrumbs a { color: var(--sky-blue); font-weight: 600; }
.breadcrumbs a:hover { color: var(--deep-blue); text-decoration: underline; }
.breadcrumbs__sep { opacity: 0.4; margin: 0 var(--sp-1); }
.breadcrumbs [aria-current="page"] { opacity: 0.7; }

/* ===== HERO ===== */
/* body has padding-top:var(--nav-h) so ordinary pages clear the fixed navbar.
   Heroes are full-bleed and must run UNDER it, so the negative margin cancels
   that padding — which leaves the original 140px top padding untouched. */
.hero,
.page-hero {
  margin-top: calc(-1 * var(--nav-h));
  background: linear-gradient(135deg, var(--deep-blue) 0%, #0a3d75 40%, var(--sky-blue) 100%);
  position: relative;
  overflow: hidden;
}

.hero { padding: 140px 0 80px; }

/* Interior pages get a shorter hero than the landing page */
.page-hero { padding: 118px 0 56px; }

.page-hero--forest { background: linear-gradient(135deg, var(--forest-green) 0%, #4d7235 50%, var(--light-green) 100%); }
.page-hero--green  { background: linear-gradient(135deg, var(--light-green) 0%, var(--forest-green) 100%); }
.page-hero--sky    { background: linear-gradient(135deg, var(--sky-blue) 0%, var(--deep-blue) 100%); }

.hero::before,
.page-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(178, 238, 250, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(157, 195, 132, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero .container,
.page-hero .container {
  position: relative;
  z-index: var(--z-base);
  text-align: center;
}

.page-hero--left .container { text-align: left; }

.hero-tagline,
.page-hero__label {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--light-cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.page-hero h1 {
  font-size: 2.7rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero h1 span {
  display: block;
  background: linear-gradient(90deg, var(--light-cyan), var(--light-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle,
.page-hero__sub {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 700px;
  margin: 0 auto 40px;
  font-weight: 400;
  line-height: 1.7;
}

.page-hero__sub { margin-bottom: 0; font-size: 1.08rem; }
.page-hero--left .page-hero__sub { margin-left: 0; }

/* Search bar */
.hero-search {
  max-width: 600px;
  margin: 0 auto 48px;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 18px 60px 18px 24px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 60px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: var(--white);
  font-size: 1rem;
  font-family: 'Open Sans', 'PT Sans', sans-serif;
  outline: none;
  transition: all var(--transition);
}

.hero-search input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.hero-search input:focus {
  border-color: var(--light-cyan);
  background: rgba(255, 255, 255, 0.18);
}

.hero-search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
}

/* Stats row */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat .stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--white);
  display: block;
}

.hero-stat .stat-label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  max-width: 200px;
}

/* ===== SECTION HEADER ===== */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--forest-green);
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--deep-blue);
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--body-text);
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.8;
}

/* Legacy landing-page section wrappers */
.stakeholders  { padding: 100px 0; background: var(--light-bg); }
.how-it-works  { padding: 100px 0; background: var(--white); }
.calculators   { padding: 100px 0; background: var(--light-bg); }
.knowledge     { padding: 100px 0; background: var(--white); }
.backed-by     { padding: 80px 0;  background: var(--light-bg); }

.backed-by .section-header { margin-bottom: 40px; }

/* ===== CTA SECTION ===== */
.cta-section {
  padding: 100px 0;
  background: linear-gradient(135deg, var(--deep-blue) 0%, #0a3d75 50%, var(--sky-blue) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: rgba(157, 195, 132, 0.08);
  border-radius: 50%;
}

.cta-section h2 {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.cta-section p {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 40px;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: var(--z-base);
}

/* ===== PARTNERS ===== */
.partners-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 56px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.partner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.partner-logo {
  width: 72px;
  height: 72px;
  background: var(--white);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--deep-blue);
}

.partner-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--deep-blue);
}

.partner-country {
  font-size: 0.72rem;
  color: var(--body-text);
  opacity: 0.6;
}

.backed-by .backed-text {
  text-align: center;
  font-size: 0.95rem;
  color: var(--body-text);
  max-width: 700px;
  margin: 0 auto;
  font-style: italic;
  opacity: 0.8;
}

/* ===== FOOTER ===== */
.footer {
  padding: 48px 0 0;
  background: #071e36;
  color: rgba(255, 255, 255, 0.7);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 36px;
}

.footer-brand .brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 4px;
}

.footer-brand .brand-sub {
  font-size: 0.7rem;
  color: var(--sky-blue);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.82rem;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: var(--sp-3);
}

.footer-col ul { display: flex; flex-direction: column; gap: var(--sp-2); }

.footer-col a,
.footer-links a {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition);
}

.footer-col a:hover,
.footer-links a:hover {
  color: var(--light-cyan);
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-bar {
  height: 8px;
  display: flex;
}

.footer-bar span {
  flex: 1;
}

.footer-bar span:nth-child(1) { background: var(--deep-blue); }
.footer-bar span:nth-child(2) { background: var(--forest-green); }
.footer-bar span:nth-child(3) { background: var(--light-green); }
.footer-bar span:nth-child(4) { background: var(--sky-blue); }
.footer-bar span:nth-child(5) { background: var(--light-cyan); }

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

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

/* AOS ships [data-aos^="fade"]{opacity:0} unconditionally. If aos.js fails to
   load, every animated element on the site stays permanently invisible.
   Default to visible; only hide once main.js has confirmed AOS exists. */
[data-aos^="fade"] { opacity: 1; }
body.aos-ready [data-aos^="fade"] { opacity: 0; }
