/* ========================================
   Dibongo Ngoh - Personal Site
   Clean minimal design, Inter font
   ======================================== */

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

:root {
    --black: #0a0a0a;
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 1120px;
    --nav-h: 64px;
    --transition: 0.2s ease;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--gray-900);
    background: var(--white);
    font-size: 16px;
    line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---- NAV ---- */
.site-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: box-shadow var(--transition);
}
.site-nav.scrolled { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

.nav-inner {
    max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
    height: var(--nav-h);
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; color: var(--black); white-space: nowrap; }

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--gray-600); transition: color var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--black); }

.nav-links a.nav-cta {
    background: var(--black); color: var(--white);
    padding: 8px 18px; border-radius: 6px;
    font-size: 13px; font-weight: 600;
    transition: background var(--transition);
}
.nav-links a.nav-cta:hover { background: var(--gray-800); color: var(--white); }

.nav-toggle {
    display: none; background: none; border: none; cursor: pointer;
    width: 28px; height: 20px; position: relative;
    flex-direction: column; justify-content: space-between;
}
.nav-toggle span { display: block; width: 100%; height: 2px; background: var(--black); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---- HERO ---- */
.hero { padding: 120px 24px 56px; max-width: var(--max-width); margin: 0 auto; }
.hero-content { display: flex; align-items: center; gap: 64px; }
.hero-text { flex: 1; min-width: 0; }

.hero-label {
    font-size: 13px; font-weight: 600; color: var(--gray-500);
    text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 16px;
}
.hero h1 {
    font-size: clamp(28px, 4vw, 42px); font-weight: 800; line-height: 1.15;
    letter-spacing: -1px; color: var(--black); margin-bottom: 20px;
}
.hero-bio { font-size: 16px; color: var(--gray-600); line-height: 1.7; margin-bottom: 32px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; margin-bottom: 40px; }

.btn {
    display: inline-flex; align-items: center;
    padding: 12px 24px; border-radius: 6px;
    font-size: 14px; font-weight: 600;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    cursor: pointer; border: none;
}
.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: var(--gray-800); }
.btn-ghost { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-ghost:hover { border-color: var(--gray-400); color: var(--black); }

.hero-social { display: flex; gap: 16px; align-items: center; }
.hero-social a { display: flex; align-items: center; }
.hero-social svg { fill: var(--gray-400); transition: fill var(--transition); }
.hero-social a:hover svg { fill: var(--black); }

.hero-image { flex-shrink: 0; width: 360px; }
.hero-image img {
    border-radius: var(--radius-lg); width: 100%;
    aspect-ratio: 4 / 4.6; object-fit: cover; object-position: 50% 30%;
}

/* ---- IMPACT STRIP ---- */
.impact-strip { border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); padding: 40px 0; }
.impact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.impact-number { display: block; font-size: 36px; font-weight: 800; letter-spacing: -1px; color: var(--black); line-height: 1.2; margin-bottom: 6px; }
.impact-item p { font-size: 14px; color: var(--gray-600); line-height: 1.5; }

/* ---- PHOTO BANNER (optional) ---- */
.photo-banner { position: relative; width: 100%; overflow: hidden; }
.photo-banner img { width: 100%; height: 520px; object-fit: cover; }
.photo-banner-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 32px 48px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); }
.photo-banner-overlay p { color: var(--white); font-size: 18px; font-weight: 600; max-width: var(--max-width); margin: 0 auto; }

/* ---- SECTIONS ---- */
.section { padding: 72px 0; }
.section-alt { background: var(--gray-50); }
.section-dark { background: var(--gray-900); color: var(--white); }

.section-title { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 32px; color: var(--black); }
.section-title.center { text-align: center; }
.section-subtitle { text-align: center; color: var(--gray-500); font-size: 17px; margin: -20px auto 36px; max-width: 640px; }
.lead { font-size: 17px; color: var(--gray-500); margin: -20px 0 36px; max-width: 640px; }

/* ---- EXPERTISE ---- */
.expertise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.expertise-card {
    display: flex; flex-direction: column;
    padding: 32px; background: var(--white);
    border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.expertise-card:hover { border-color: var(--gray-400); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04); }
.expertise-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 12px; color: var(--black); }
.expertise-card > p { font-size: 15px; color: var(--gray-600); line-height: 1.6; }
.expertise-card .card-now {
    margin-top: auto; padding-top: 16px; border-top: 1px solid var(--gray-200);
    font-size: 13px; color: var(--gray-800); line-height: 1.5;
}
.expertise-card > p:first-of-type { margin-bottom: 20px; }
.card-now a { color: var(--accent); }
.card-now a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---- TIMELINE ---- */
.timeline { position: relative; padding-left: 36px; max-width: 860px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--gray-200); }
.timeline-item { position: relative; padding-bottom: 36px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
    position: absolute; left: -36px; top: 4px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--white); border: 3px solid var(--gray-400); z-index: 1;
}
.timeline-item:first-child .timeline-marker { border-color: var(--black); background: var(--black); }
.timeline-date { font-size: 13px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; }
.timeline-details h3 { font-size: 20px; font-weight: 700; margin: 4px 0 2px; color: var(--black); }
.timeline-org { font-size: 15px; color: var(--gray-500); }
.timeline-org + p { font-size: 15px; color: var(--gray-600); line-height: 1.65; margin-top: 8px; }

/* ---- CARDS (projects, teaching) ---- */
.publications-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pub-card {
    display: flex; flex-direction: column;
    border-radius: var(--radius-lg); overflow: hidden;
    background: var(--white); border: 1px solid var(--gray-200);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
a.pub-card:hover { border-color: var(--gray-400); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06); transform: translateY(-2px); }
.pub-info { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.pub-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); margin-bottom: 8px; }
.pub-info h3 { font-size: 17px; font-weight: 700; line-height: 1.35; margin-bottom: 8px; color: var(--black); }
.pub-desc { font-size: 14px; color: var(--gray-600); line-height: 1.6; margin-bottom: 16px; }
.pub-venue { font-size: 13px; color: var(--gray-500); margin-top: auto; }
.pub-card-more { background: var(--gray-900); border-color: var(--gray-900); }
.pub-card-more h3 { color: var(--white); }
.pub-card-more .pub-desc { color: var(--gray-400); }
.pub-card-more .pub-type { color: #93b4f8; }
.pub-card-more .pub-venue { color: var(--white); font-weight: 600; }
a.pub-card-more:hover { border-color: var(--gray-700); }


/* ---- SPEAKING ---- */
.speaking-header { margin-bottom: 32px; max-width: 760px; }
.speaking-header .section-title { margin-bottom: 12px; }
.speaking-header-sub { font-size: 17px; color: var(--gray-500); line-height: 1.6; }

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 300px 300px;
    gap: 16px;
    margin-bottom: 40px;
}
.gallery-item { position: relative; margin: 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--gray-900); }
.gallery-item img, .gallery-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item video { background: #000; }
.gallery-tall { grid-row: span 2; }
.gallery-tall img { object-position: 50% 20%; }
.gallery-wide { grid-column: span 2; }
.gallery-wide img { object-position: 50% 35%; }
.gallery-item figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 28px 16px 12px;
    font-size: 13px; font-weight: 600; color: var(--white);
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    pointer-events: none;
}
.gallery-item:has(video) figcaption { padding-bottom: 60px; }
.speaking-cards .pub-card { background: var(--white); }

/* ---- MORE BUILDS ---- */
.more-builds-label { margin-top: 40px; }
.more-builds { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 32px; }
.more-builds li { font-size: 14px; color: var(--gray-600); line-height: 1.55; padding-left: 14px; position: relative; }
.more-builds li::before { content: ''; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--gray-400); }
.more-builds strong { color: var(--gray-900); font-weight: 600; }

/* ---- CREDENTIALS ---- */
.cred-label { font-size: 13px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.certs-grid + .cred-label { margin-top: 40px; }
.certs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cert-item {
    position: relative;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 24px 16px; background: var(--white);
    border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.cert-item:hover { border-color: var(--gray-400); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04); }
.cert-item img { width: 80px; height: 80px; object-fit: contain; margin-bottom: 12px; }
.cert-logo-text {
    width: 80px; height: 80px; margin-bottom: 12px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--gray-100); border: 1px solid var(--gray-200);
    font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--gray-600);
    padding: 0 8px; line-height: 1.2;
}
.cert-name { font-size: 13px; font-weight: 600; color: var(--gray-700); line-height: 1.4; }
.cert-progress { background: var(--gray-50); border-style: dashed; }
.cert-progress .cert-logo-text { background: var(--white); }
.cert-tag {
    position: absolute; top: 12px; right: 12px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
    color: var(--accent); background: #eaf0fe; border-radius: 999px; padding: 4px 9px;
}

.education-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.edu-card { display: flex; align-items: center; gap: 20px; padding: 24px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); }
.edu-logo { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; border-radius: 6px; }
.edu-logo-wide { width: 120px; height: 44px; border-radius: 4px; }
.edu-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: var(--black); }
.edu-school { font-size: 14px; color: var(--gray-500); margin-bottom: 2px; }
.edu-year { font-size: 13px; color: var(--gray-400); font-weight: 600; }

/* ---- CONTACT ---- */
.contact-container { text-align: center; max-width: 600px; }
.section-dark .section-title { color: var(--white); margin-bottom: 12px; }
.contact-sub { color: var(--gray-400); margin-bottom: 24px; }
.contact-email { margin-bottom: 32px; }
.contact-email a { font-size: clamp(20px, 4vw, 28px); font-weight: 700; color: var(--white); transition: opacity var(--transition); overflow-wrap: anywhere; }
.contact-email a:hover { opacity: 0.7; }
.contact-actions { display: flex; gap: 12px; justify-content: center; }
.section-dark .btn-primary { background: var(--white); color: var(--black); }
.section-dark .btn-primary:hover { background: var(--gray-200); }
.section-dark .btn-ghost { border-color: var(--gray-600); color: var(--gray-400); }
.section-dark .btn-ghost:hover { border-color: var(--gray-400); color: var(--white); }

/* ---- FOOTER ---- */
.site-footer { border-top: 1px solid var(--gray-200); padding: 24px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 13px; color: var(--gray-500); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--gray-500); transition: color var(--transition); }
.footer-links a:hover { color: var(--black); }

/* ---- RESPONSIVE ---- */
@media (max-width: 960px) {
    .impact-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery { grid-template-columns: repeat(2, 1fr); grid-template-rows: 260px 260px 260px; }
    .gallery-tall { grid-row: span 2; }
    .gallery-wide { grid-column: span 2; }
    .expertise-grid, .publications-grid, .certs-grid { grid-template-columns: repeat(2, 1fr); }
    .education-grid { grid-template-columns: 1fr 1fr; }
    .hero-image { width: 300px; }
    .hero-content { gap: 40px; }
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-links {
        display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
        background: var(--white); flex-direction: column; align-items: stretch;
        padding: 8px 24px 24px; gap: 0;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 0; font-size: 15px; border-bottom: 1px solid var(--gray-100); }
    .nav-links a.nav-cta { margin-top: 12px; text-align: center; border-bottom: none; padding: 12px 18px; }

    .hero { padding: 96px 16px 48px; }
    .hero-content { flex-direction: column; align-items: flex-start; gap: 32px; }
    .hero-image { width: 100%; max-width: 320px; }
    .hero-actions { flex-direction: column; align-self: stretch; }
    .btn { justify-content: center; }

    .container { padding: 0 16px; }
    .section { padding: 56px 0; }
    .section-title { font-size: 28px; }
    .impact-number { font-size: 30px; }
    .impact-grid { gap: 24px 20px; }
    .expertise-grid, .publications-grid, .certs-grid, .education-grid { grid-template-columns: 1fr; }
    .expertise-card { padding: 24px; }
    .timeline { padding-left: 30px; }
    .timeline-marker { left: -30px; }
    .contact-actions { flex-direction: column; }
    .gallery { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: 260px; }
    .gallery-tall { grid-row: auto; height: 420px; }
    .gallery-wide { grid-column: auto; }
    .more-builds { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; text-align: center; }
    .photo-banner img { height: 320px; }
    .photo-banner-overlay { padding: 24px 16px; }
}
