/* ===== Uganda palette ===== */
:root {
  --ug-black: #000000;
  --ug-yellow: #FCDC04;
  --ug-red: #D90000;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
  --max: 1160px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-2: #121214;
  --surface: #17171a;
  --line: #2a2a2e;
  --text: #f4f2ec;
  --muted: #a3a09a;
  --accent: var(--ug-yellow);
  --on-accent: #0a0a0b;
  --ph: #1c1c20;
  --ribbon-edge: rgba(255, 255, 255, .28);   /* keeps the black stripe visible on black */
}

[data-theme="light"] {
  --bg: #faf8f3;
  --bg-2: #f1ede4;
  --surface: #ffffff;
  --line: #e2ddd1;
  --text: #121212;
  --muted: #5d5a54;
  --accent: var(--ug-red);
  --on-accent: #ffffff;
  --ph: #ece7dc;
  --ribbon-edge: rgba(0, 0, 0, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .4s var(--ease);
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

/* ===== progress bar ===== */
.progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 60; }
.progress span {
  display: block; height: 100%; width: 100%;
  transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--ug-black) 0 33.3%, var(--ug-yellow) 33.3% 66.6%, var(--ug-red) 66.6%);
  box-shadow: 0 0 0 1px var(--ribbon-edge);
}

/* ===== nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.brand-mark { display: inline-flex; flex-direction: column; width: 22px; height: 18px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px var(--ribbon-edge); }
.brand-mark i { flex: 1; }
.brand-mark i:nth-child(1) { background: var(--ug-black); }
.brand-mark i:nth-child(2) { background: var(--ug-yellow); }
.brand-mark i:nth-child(3) { background: var(--ug-red); }
.nav-links { display: flex; gap: 1.6rem; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: .95rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  display: grid; place-items: center; cursor: pointer; transition: transform .3s var(--ease);
}
.theme-toggle:hover { transform: rotate(20deg); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; grid-area: 1/1; transition: opacity .3s, transform .4s var(--ease); }
[data-theme="dark"] .i-sun, [data-theme="light"] .i-moon { opacity: 0; transform: scale(.5) rotate(-60deg); }

/* ===== layout ===== */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(4.5rem, 10vw, 8rem) clamp(1.25rem, 4vw, 3rem); }
.section-head { margin-bottom: 3rem; }
.section-head.center { text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }

/* ===== hero ===== */
.hero {
  max-width: var(--max); margin: 0 auto;
  min-height: calc(100vh - 74px);
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 6vw, 5rem); align-items: center;
  padding: 3rem clamp(1.25rem, 4vw, 3rem);
}
.hero h1 { font-size: clamp(3rem, 8vw, 6.2rem); font-weight: 700; letter-spacing: -.025em; margin-bottom: 1.4rem; }
.accent { color: var(--accent); font-style: italic; font-weight: 600; }
.role { font-size: 1.12rem; font-weight: 500; color: var(--text); border-left: 3px solid var(--ug-red); padding-left: 1rem; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 34ch; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 2rem; }
.btn { display: inline-block; padding: .85rem 1.5rem; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .95rem; transition: transform .2s var(--ease), background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface); }

.hero-portrait { position: relative; margin: 0; }
.ph-portrait { aspect-ratio: 4/5; border-radius: var(--radius); position: relative; z-index: 1; }
.portrait-stripes {
  position: absolute; z-index: 0; inset: 1.4rem -1.4rem -1.4rem 1.4rem;
  display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 0 1px var(--ribbon-edge);
}
.portrait-stripes i, .flag-bar i { flex: 1; }
.portrait-stripes i:nth-child(3n+1), .flag-bar i:nth-child(3n+1) { background: var(--ug-black); }
.portrait-stripes i:nth-child(3n+2), .flag-bar i:nth-child(3n+2) { background: var(--ug-yellow); }
.portrait-stripes i:nth-child(3n+3), .flag-bar i:nth-child(3n+3) { background: var(--ug-red); }

/* ===== image placeholders ===== */
.ph {
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, color-mix(in srgb, var(--text) 4%, transparent) 14px 15px),
    var(--ph);
  border: 1px dashed color-mix(in srgb, var(--text) 22%, transparent);
  border-radius: var(--radius);
  display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: .9rem; font-weight: 500;
  min-height: 140px;
}
.ph small { opacity: .7; font-weight: 400; }
.ph img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* ===== about ===== */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 4rem; align-items: start; }
.big { font-family: var(--font-display); font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.4; }
.about-copy p:not(.big) { color: var(--muted); }
.stats { margin: 0; display: grid; gap: 1rem; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; }
.stats dt { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--accent); }
.stats dd { margin: .4rem 0 0; color: var(--muted); font-size: .92rem; }

/* ===== portfolio cards ===== */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2rem; transition: transform .35s var(--ease), border-color .35s;
}
.card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.card h3 { margin: 1.3rem 0 .8rem; }
.card p { color: var(--muted); font-size: .96rem; margin: 0; }
.card-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; }
.card-icon svg { width: 24px; height: 24px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.c-black { background: var(--ug-black); box-shadow: 0 0 0 1px var(--ribbon-edge); }
.c-black svg { stroke: var(--ug-yellow); }
.c-yellow { background: var(--ug-yellow); }
.c-yellow svg { stroke: var(--ug-black); }
.c-red { background: var(--ug-red); }
.c-red svg { stroke: #fff; }

/* ===== journey / ribbon ===== */
.timeline { position: relative; display: flex; flex-direction: column; gap: 5.5rem; padding: 2rem 0 4rem; }
.ribbon { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.ribbon .edge { fill: none; stroke: var(--ribbon-edge); stroke-width: 1; }

.milestone {
  position: relative; z-index: 1;
  width: min(42%, 440px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem 2rem;
  opacity: .25; transform: translateY(30px) scale(.98);
  transition: opacity .7s var(--ease), transform .7s var(--ease), border-color .5s, box-shadow .5s;
}
.milestone:nth-of-type(odd) { align-self: flex-start; }
.milestone:nth-of-type(even) { align-self: flex-end; }
.milestone.lit {
  opacity: 1; transform: none;
  border-color: color-mix(in srgb, var(--ug-yellow) 55%, var(--line));
  box-shadow: 0 20px 50px -25px color-mix(in srgb, var(--ug-yellow) 45%, transparent);
}
.year {
  display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  padding: .2rem .75rem; border-radius: 999px; margin-bottom: .9rem;
  background: var(--ug-red); color: #fff;
}
.milestone h3 { margin-bottom: .6rem; }
.milestone p { color: var(--muted); margin: 0; font-size: .96rem; }
.ph-small { aspect-ratio: 16/9; min-height: 0; margin-top: 1.2rem; }

/* ===== real photos ===== */
.photo { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--ph); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph-portrait img { object-position: 50% 30%; }
.about-grid { grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.about-photo { aspect-ratio: 3/4; }
.about-photo img { object-position: 50% 25%; }
.about-copy .pillars { margin-top: 2rem; }

/* ===== hero titles ===== */
.titles { list-style: none; margin: 0 0 1.4rem; padding: 0 0 0 1rem; border-left: 3px solid var(--ug-red); display: grid; gap: .25rem; }
.titles li { font-size: 1.05rem; font-weight: 500; }
.titles li:first-child { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--accent); margin-bottom: .15rem; }

/* ===== about pillars ===== */
.about-copy p:not(.big) { margin-bottom: 1.1em; }
.pillars { display: grid; gap: 1rem; }
.pillar { display: flex; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.5rem; }
.pillar strong { display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.pillar small { color: var(--muted); font-size: .88rem; }
.dot { flex: none; width: 14px; height: 14px; border-radius: 50%; }
.d-black { background: var(--ug-black); box-shadow: 0 0 0 1px var(--ribbon-edge); }
.d-yellow { background: var(--ug-yellow); }
.d-red { background: var(--ug-red); }

/* ===== expertise: 7 cards in a 4-col grid, first one wide ===== */
.cards.expertise { grid-template-columns: repeat(4, 1fr); }
.cards.expertise .card:first-child { grid-column: span 2; }
.cards.expertise h3 { font-size: 1.15rem; }

/* ===== journey extras ===== */
.milestone .org { color: var(--accent); font-size: .9rem; font-weight: 500; margin-bottom: .6rem; }

/* ===== community ===== */
.community-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.feature-img { aspect-ratio: 16/9; border-radius: 0; border-width: 0 0 1px 0; }
.feature-body { padding: 2rem; }
.feature-body h3 { font-size: 1.8rem; margin-bottom: .9rem; }
.feature-body p { color: var(--muted); }
.tag { color: var(--accent) !important; font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .5rem; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.ticks li { font-size: .85rem; font-weight: 500; padding: .35rem .85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); }

/* ===== mission ===== */
.mission {
  max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem);
  display: grid; grid-template-columns: .75fr 1.25fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.mission-photo { aspect-ratio: 4/5; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.mission-photo img { object-position: 35% 40%; }
.mission .flag-bar { max-width: 120px; height: 8px; border-radius: 4px; overflow: hidden; margin: 0 0 2rem; }
.mission blockquote { margin: 0; font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.6rem); line-height: 1.3; font-weight: 400; }
.mission em { color: var(--accent); font-style: italic; font-weight: 500; }

/* ===== gallery ===== */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 220px; gap: 1rem; }
.gallery .g-wide { grid-column: span 2; }
.gallery .g-tall { grid-row: span 2; }

/* ===== contact ===== */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.contact-card { font-style: normal; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; }
.contact-card h3 { margin-bottom: 1rem; }
.contact-card p { color: var(--muted); }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.contact-list li { display: grid; }
.contact-list span { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.contact-list a, .map-link { text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.contact-list a:hover, .map-link:hover { color: var(--accent); }
.map-link { color: var(--accent); }

/* ===== footer ===== */
.footer { text-align: center; padding: 0 1.5rem 3rem; color: var(--muted); font-size: .9rem; }
.flag-bar { display: flex; height: 6px; margin: 0 auto 2.5rem; max-width: 100%; box-shadow: 0 0 0 1px var(--ribbon-edge); }
.footer p { margin: .3rem 0; }
.motto { font-family: var(--font-display); font-style: italic; color: var(--accent); }

/* ===== reveal ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===== responsive ===== */
@media (max-width: 1100px) {
  .cards.expertise { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .theme-toggle { margin-left: auto; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 2.5rem; }
  .hero-portrait { max-width: 380px; margin-right: 1.4rem; }
  .about-grid, .cards, .cards.expertise, .contact-grid, .community-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .cards.expertise .card:first-child { grid-column: auto; }
  .mission { grid-template-columns: 1fr; }
  .about-photo, .mission-photo { max-width: 420px; }
  .milestone { width: auto; margin-left: 3.2rem; align-self: stretch !important; }
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .milestone { opacity: 1; transform: none; transition: none; }
}
