/* ============================================
   RICHARD IBAMBASI - PORTFOLIO STYLE
============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Light theme (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fc;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #555770;
    --text-muted: #8e8ea0;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.08);
    --accent-glow: rgba(37, 99, 235, 0.25);
    --border-color: #e5e7eb;
    --border-light: #f0f0f5;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.08), 0 12px 32px rgba(0,0,0,0.1);
    --nav-bg: rgba(255, 255, 255, 0.85);
    --nav-shadow: 0 1px 3px rgba(0,0,0,0.06);
    --code-bg: #f1f5f9;
    --tag-bg: #f0f4ff;
    --tag-color: #2563eb;
    --timeline-line: #e5e7eb;
    --progress-bg: #e5e7eb;
    --footer-bg: #1a1a2e;
    --footer-text: #c0c0d0;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #161625;
    --bg-card: #1c1c30;
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b8;
    --text-muted: #6e6e88;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: rgba(59, 130, 246, 0.1);
    --accent-glow: rgba(59, 130, 246, 0.3);
    --border-color: #2a2a40;
    --border-light: #222238;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.3);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.3), 0 12px 32px rgba(0,0,0,0.4);
    --nav-bg: rgba(15, 15, 26, 0.9);
    --nav-shadow: 0 1px 3px rgba(0,0,0,0.3);
    --code-bg: #1c1c30;
    --tag-bg: rgba(59, 130, 246, 0.12);
    --tag-color: #60a5fa;
    --timeline-line: #2a2a40;
    --progress-bg: #2a2a40;
    --footer-bg: #0a0a14;
    --footer-text: #6e6e88;
}

/* ---------- Base & Reset ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background-color var(--transition), color var(--transition);
    overflow-x: hidden;
}

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

a:hover {
    color: var(--accent-hover);
}

::selection {
    background: var(--accent);
    color: #fff;
}

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

.fw-500 { font-weight: 500; }
.fw-800 { font-weight: 800; }
.text-accent { color: var(--accent) !important; }
.bg-section-alt { background-color: var(--bg-secondary); }

.section-padding {
    padding: 100px 0;
}

/* ---------- Navbar ---------- */
#mainNav {
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--nav-shadow);
    padding: 12px 0;
    transition: all var(--transition);
    z-index: 1050;
}

#mainNav.scrolled {
    padding: 8px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary) !important;
    letter-spacing: -1px;
}

.brand-accent {
    color: var(--accent);
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: all var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent) !important;
    background: var(--accent-light);
}

.navbar-toggler {
    color: var(--text-primary);
}

.navbar-toggler-icon {
    filter: var(--toggler-filter, none);
}

[data-theme="dark"] .navbar-toggler-icon {
    filter: invert(1);
}

.theme-toggle {
    background: var(--accent-light);
    border: 1px solid var(--border-color);
    color: var(--accent);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--accent);
    color: #fff;
    transform: rotate(20deg);
}

/* ---------- Hero Section ---------- */
#hero {
    padding-top: 100px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.4;
    pointer-events: none;
}

.hero-greeting {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-title {
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: 0.3em;
}

.hero-jobtitle {
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.hero-subtitle-wrap {
    display: flex;
    align-items: center;
    min-height: 40px;
}

.hero-subtitle {
    color: var(--text-secondary);
}

.typed-cursor {
    color: var(--accent);
    font-weight: 300;
    font-size: 1.5rem;
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-desc {
    color: var(--text-secondary);
    max-width: 540px;
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    border: 2px solid var(--accent);
    font-weight: 600;
    border-radius: 10px;
    transition: all var(--transition);
}

.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-glow);
}

.btn-outline-secondary {
    color: var(--text-primary);
    border-color: var(--border-color);
    font-weight: 600;
    border-radius: 10px;
    border-width: 2px;
}

.btn-outline-secondary:hover {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

/* Social Links */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all var(--transition);
}

.social-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

/* Hero Avatar */
.hero-avatar-wrapper {
    position: relative;
    display: inline-block;
}

.hero-avatar {
    position: relative;
    z-index: 2;
    width: 280px;
    height: 280px;
    margin: 0 auto;
}

.hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 4px solid var(--accent);
    box-shadow: 0 12px 40px var(--accent-glow);
}

.avatar-decoration {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 100%;
    height: 100%;
    border: 2px dashed var(--accent);
    border-radius: 50%;
    opacity: 0.3;
    z-index: 1;
    animation: spin-slow 20s linear infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---------- Section Headers ---------- */
.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 12px auto 0;
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* ---------- About Section ---------- */
.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--accent);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.about-content h3 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.about-content p {
    color: var(--text-secondary);
}

.about-details p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* ---------- Skills Section ---------- */
.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
}

.skill-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--accent);
}

.skill-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 1.4rem;
    color: var(--accent);
}

.skill-card-title {
    font-weight: 700;
    margin-bottom: 16px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-color);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition);
}

.skill-tag:hover {
    background: var(--accent);
    color: #fff;
    transform: scale(1.05);
}

/* ---------- Resume / Timeline ---------- */
.resume-column-title {
    font-weight: 700;
    font-size: 1.4rem;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--timeline-line);
}

.timeline-item {
    position: relative;
    margin-bottom: 36px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-badge {
    position: absolute;
    left: -30px;
    top: 4px;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 2px var(--accent);
    z-index: 2;
    font-size: 0;
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
}

.timeline-content:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: var(--accent);
}

.timeline-content h5 {
    font-weight: 700;
    margin-bottom: 4px;
}

.timeline-place {
    color: var(--accent);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.timeline-content p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.timeline-tags span {
    background: var(--tag-bg);
    color: var(--tag-color);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
}

/* Language Bars */
.lang-item {
    margin-bottom: 16px;
}

.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--progress-bg);
    overflow: hidden;
}

.progress-bar.bg-accent {
    background-color: var(--accent) !important;
    transition: width 1.5s ease-out;
    border-radius: 4px;
}

/* ---------- Projects Section ---------- */
.project-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 22px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--accent);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.project-icon {
    font-size: 1.8rem;
    color: var(--accent);
}

.project-links a {
    color: var(--text-muted);
    font-size: 1.3rem;
    transition: color var(--transition);
}

.project-links a:hover {
    color: var(--accent);
}

.project-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.project-tech span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--code-bg);
    padding: 3px 10px;
    border-radius: 6px;
}

/* Project Filter Animation */
.project-item {
    transition: all 0.4s ease;
}

.project-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.project-item.visible {
    opacity: 1;
    transform: scale(1);
}

/* ---------- Contact Section ---------- */
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 36px 24px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--accent);
}

.contact-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: 50%;
    margin: 0 auto 16px;
    font-size: 1.5rem;
    color: var(--accent);
}

.contact-card h5 {
    font-weight: 700;
    margin-bottom: 6px;
}

.contact-card a,
.contact-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.contact-card a:hover {
    color: var(--accent);
}

/* Contact Form */
.contact-form .form-control {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.contact-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-card);
    color: var(--text-primary);
}

.contact-form .form-control::placeholder {
    color: var(--text-muted);
}

.contact-form .form-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
}

.site-footer p {
    font-size: 0.9rem;
}

.footer-socials {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
}

.footer-socials a {
    color: var(--footer-text);
    font-size: 1.2rem;
    transition: color var(--transition);
}

.footer-socials a:hover {
    color: var(--accent);
}

/* ---------- Back to Top ---------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition);
    box-shadow: 0 4px 14px var(--accent-glow);
    z-index: 1000;
}

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

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

/* ---------- Scroll Reveal Animations ---------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .section-padding {
        padding: 70px 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-avatar {
        width: 200px;
        height: 200px;
    }

    .navbar-collapse {
        background: var(--bg-card);
        border-radius: 16px;
        padding: 16px;
        margin-top: 10px;
        border: 1px solid var(--border-color);
        box-shadow: var(--card-shadow);
    }

    .theme-toggle {
        margin: 10px auto 0;
    }

    .footer-socials {
        justify-content: center;
        margin-top: 10px;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .about-stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-card {
        padding: 20px 14px;
    }

    .contact-form {
        padding: 0 10px;
    }
}

@media (max-width: 575.98px) {
    .hero-avatar {
        width: 160px;
        height: 160px;
    }

    .hero-title {
        font-size: 1.7rem;
    }

    .btn-lg {
        font-size: 0.95rem;
        padding: 10px 20px !important;
    }

    .section-padding {
        padding: 50px 0;
    }
}

/* ---------- Utility Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* ---------- Print Styles ---------- */
@media print {
    #mainNav,
    .back-to-top,
    .theme-toggle,
    .hero-socials,
    .project-filters,
    .contact-form,
    .footer-socials {
        display: none !important;
    }

    .section-padding {
        padding: 30px 0;
    }

    body {
        color: #000;
        background: #fff;
    }
}
