:root {
    --bg:             #ffffff;
    --bg-alt:         #f5f5f7;
    --surface:        #ffffff;
    --surface-2:      #f5f5f7;
    --text:           #1d1d1f;
    --text-muted:     #6e6e73;
    --heading:        #1d1d1f;
    --primary:        #0066cc;
    --primary-hover:  #004499;
    --border:         #d2d2d7;
    --shadow:         0 2px 16px rgba(0,0,0,.07);
    --shadow-hover:   0 8px 32px rgba(0,0,0,.12);
    --icon-bg:        #f5f5f7;
    --tag-bg:         #f5f5f7;
    --tag-text:       #1d1d1f;
    --tag-border:     #d2d2d7;
    --nav-bg:         rgba(255,255,255,.85);
    --nav-text:       #1d1d1f;
    --nav-brand:      #0066cc;
    --footer-bg:      #1d1d1f;
    --footer-text:    #86868b;
    --cert-bg:        #1d1d1f;
    --cert-surface:   #2c2c2e;
    --cert-border:    #3a3a3c;
    --radius:         12px;
    --transition:     .2s ease;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg:            #000000;
        --bg-alt:        #1d1d1f;
        --surface:       #1c1c1e;
        --surface-2:     #2c2c2e;
        --text:          #f5f5f7;
        --text-muted:    #86868b;
        --heading:       #f5f5f7;
        --primary:       #2997ff;
        --primary-hover: #0077ed;
        --border:        #3a3a3c;
        --shadow:        0 2px 16px rgba(0,0,0,.5);
        --shadow-hover:  0 8px 32px rgba(0,0,0,.7);
        --icon-bg:       #2c2c2e;
        --tag-bg:        #2c2c2e;
        --tag-text:      #f5f5f7;
        --tag-border:    #3a3a3c;
        --nav-bg:        rgba(0,0,0,.85);
        --nav-text:      #f5f5f7;
        --nav-brand:     #2997ff;
        --footer-bg:     #000000;
        --footer-text:   #6e6e73;
        --cert-bg:       #000000;
        --cert-surface:  #1c1c1e;
        --cert-border:   #3a3a3c;
    }
}
*, *::before, *::after { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}

figure { margin: 0; }

body {
    overflow-x: hidden;
    max-width: 100%;
    font-family: -apple-system, 'SF Pro Text', 'Inter', 'Helvetica Neue', sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
    word-break: break-word;
    overflow-wrap: break-word;
}

h1,h2,h3,h4,h5,h6 {
    font-family: -apple-system, 'SF Pro Display', 'Inter', 'Helvetica Neue', sans-serif;
    color: var(--heading);
    line-height: 1.2;
    font-weight: 700;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }
section { overflow-x: hidden; }
.section-padding { padding: 96px 0; }

.section-label {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: .6rem;
}
.section-label.light { color: #6e9ef0; }

.section-title {
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    color: var(--heading);
    letter-spacing: -.5px;
    margin-bottom: 0;
}

.bg-light { background-color: var(--bg-alt) !important; }
#mainNav {
    padding: 1.1rem 0;
    background: transparent;
    transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
    z-index: 1030;
    width: 100%;
    left: 0;
}

#mainNav.nav-scrolled {
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 1px 0 var(--border);
    padding: .7rem 0;
}

#mainNav .navbar-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 1px;
}
#mainNav.nav-scrolled .navbar-brand { color: var(--nav-brand); }

#mainNav .nav-link {
    font-size: .85rem;
    font-weight: 500;
    color: rgba(255,255,255,.9);
    padding: .35rem .85rem;
    transition: color var(--transition);
}
#mainNav.nav-scrolled .nav-link { color: var(--nav-text); opacity: .8; }
#mainNav .nav-link:hover,
#mainNav .nav-link.active { color: var(--primary) !important; opacity: 1; }

#mainNav .navbar-toggler { border-color: rgba(255,255,255,.4); }
#mainNav.nav-scrolled .navbar-toggler { border-color: var(--border); }
#mainNav .navbar-toggler-icon { filter: invert(1); }
#mainNav.nav-scrolled .navbar-toggler-icon { filter: none; }

@media (prefers-color-scheme: dark) {
    #mainNav.nav-scrolled .navbar-toggler-icon { filter: invert(1); }
}

.navbar-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: rgba(255,255,255,.8);
    font-size: .85rem;
    margin-left: .3rem;
    transition: background var(--transition), color var(--transition);
}
#mainNav.nav-scrolled .navbar-social a { color: var(--text-muted); }
.navbar-social a:hover { background: var(--primary); color: #fff !important; }

@media (max-width: 991px) {
    #mainNav .navbar-collapse {
        background: var(--surface);
        border-radius: var(--radius);
        padding: 1rem 1.25rem;
        box-shadow: var(--shadow-hover);
        margin-top: .5rem;
        border: 1px solid var(--border);
    }
    #mainNav .nav-link { color: var(--nav-text) !important; opacity: .85; }
    .navbar-social a { color: var(--text-muted) !important; }
}
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../img/main-header.jpg') center center / cover no-repeat;
    text-align: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(0,0,0,.82) 0%, rgba(0,30,100,.7) 100%);
}

@media (prefers-color-scheme: dark) {
    .hero-overlay {
        background: linear-gradient(160deg, rgba(0,0,0,.92) 0%, rgba(0,10,40,.85) 100%);
    }
}

.hero-section .container { position: relative; z-index: 2; padding: 120px 20px 80px; }

.hero-greeting {
    font-size: .95rem;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255,255,255,.6);
    margin-bottom: .75rem;
}

.hero-name {
    font-size: clamp(2.8rem, 8vw, 5rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -2px;
    margin-bottom: .5rem;
}

.hero-section h2 {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 300;
    color: rgba(255,255,255,.75);
    margin-bottom: 1rem;
    letter-spacing: 0;
}

#typed { color: #60aaff; font-weight: 600; }

.hero-location {
    font-size: .88rem;
    color: rgba(255,255,255,.5);
    margin-bottom: 0;
}
.hero-location i { color: #ff6b6b; margin-right: .35rem; }

.hero-cta { margin-top: 2.5rem; }
.hero-cta .btn-primary {
    background: var(--primary);
    border: none;
    padding: .8rem 2.2rem;
    font-weight: 600;
    font-size: .95rem;
    border-radius: 980px;
    transition: background var(--transition), transform var(--transition);
}
.hero-cta .btn-primary:hover { background: var(--primary-hover); transform: scale(1.02); }
.hero-cta .btn-outline-light {
    padding: .8rem 2.2rem;
    font-weight: 600;
    font-size: .95rem;
    border-radius: 980px;
    border-width: 1.5px;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}
.hero-cta .btn-outline-light:hover { transform: scale(1.02); }

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: bounce 2s infinite;
}
.hero-scroll a { color: rgba(255,255,255,.45); font-size: 1.3rem; }
.hero-scroll a:hover { color: rgba(255,255,255,.8); }

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(8px); }
}
.profile-img-wrap {
    display: inline-block;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--primary), #6e40c9);
}
.profile-img {
    width: 220px;
    height: 220px;
    max-width: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg);
    display: block;
}
.about-text { color: var(--text-muted); font-size: 1rem; margin-bottom: 1rem; }

.contact-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem 1.5rem;
}
@media (max-width: 576px) { .contact-info-grid { grid-template-columns: 1fr; } }

.contact-info-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .9rem;
}
.contact-info-item i {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: var(--icon-bg);
    color: var(--primary);
    border-radius: 8px;
    flex-shrink: 0;
    font-size: .85rem;
}
.contact-info-item a { color: var(--text-muted); }
.contact-info-item a:hover { color: var(--primary); }
.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
    height: 100%;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}
.service-icon {
    width: 52px; height: 52px;
    background: var(--icon-bg);
    color: var(--primary);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
    transition: background var(--transition), color var(--transition);
}
.service-card:hover .service-icon { background: var(--primary); color: #ffffff; }
.service-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .6rem; color: var(--heading); }
.service-card p  { font-size: .9rem; color: var(--text-muted); margin: 0; line-height: 1.7; }
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 7px; top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-marker {
    position: absolute;
    left: -2rem; top: .4rem;
    width: 14px; height: 14px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 2px var(--primary);
}
.timeline-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
}
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}
.timeline-role    { font-size: 1.05rem; font-weight: 700; color: var(--heading); margin: 0 0 .25rem; }
.timeline-company { font-size: .88rem; color: var(--primary); font-weight: 600; margin: 0; }
.timeline-period  {
    font-size: .78rem; font-weight: 600;
    color: var(--primary);
    background: var(--icon-bg);
    border: 1px solid var(--border);
    padding: .3rem .9rem;
    border-radius: 980px;
    white-space: nowrap;
    flex-shrink: 0;
}
.timeline-list { padding-left: 1.25rem; margin: 0; font-size: .9rem; color: var(--text-muted); }
.timeline-list li { margin-bottom: .5rem; }
.timeline-list strong { color: var(--heading); }
.project-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    height: 100%;
    transition: transform var(--transition), box-shadow var(--transition);
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.project-icon { font-size: 1.8rem; color: var(--primary); margin-bottom: 1rem; }
.project-badge {
    position: absolute; top: 1.25rem; right: 1.25rem;
    font-size: .68rem; font-weight: 700; letter-spacing: .5px;
    text-transform: uppercase; padding: .25rem .7rem;
    border-radius: 980px;
    background: #d1fae5; color: #065f46;
}
.project-badge.in-progress { background: #fef9c3; color: #854d0e; }
@media (prefers-color-scheme: dark) {
    .project-badge               { background: #064e3b; color: #6ee7b7; }
    .project-badge.in-progress   { background: #422006; color: #fde68a; }
}
.project-card h3 { font-size: .98rem; font-weight: 700; margin: 0 0 .75rem; padding-right: 80px; color: var(--heading); }
.project-card p  { font-size: .88rem; color: var(--text-muted); margin-bottom: 1rem; }

.project-tags, .skill-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.project-tags span, .skill-tags span {
    font-size: .73rem; font-weight: 600;
    padding: .22rem .65rem;
    border-radius: 980px;
    background: var(--tag-bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.skill-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    height: 100%;
}
.skill-group h4 { font-size: .9rem; font-weight: 700; color: var(--heading); margin-bottom: 1rem; }
.skill-group h4 i { color: var(--primary); }
#certifications { background: var(--cert-bg); }
#certifications .section-title,
#certifications h3 { color: #f5f5f7; }
#certifications .section-label { color: #6e9ef0; }

.cert-card {
    background: var(--cert-surface);
    border: 1px solid var(--cert-border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    height: 100%;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.cert-card:hover { border-color: #2997ff; transform: translateY(-3px); }
.cert-icon { font-size: 2.4rem; color: #f97316; margin-bottom: 1rem; }
.cert-card h3 { font-size: .95rem; font-weight: 700; color: #f5f5f7; margin-bottom: .3rem; }
.cert-sub  { font-size: .83rem; color: #86868b; margin-bottom: .5rem; }
.cert-year { font-size: .9rem; font-weight: 700; color: #2997ff; margin-bottom: .2rem; }
.cert-reg  { font-size: .76rem; color: #6e6e73; margin: 0; }

.edu-item {
    padding: 1.75rem;
    border: 1px solid var(--cert-border);
    border-radius: var(--radius);
    background: var(--cert-surface);
}
.edu-item h4 { color: #f5f5f7; font-size: 1.1rem; margin-bottom: .5rem; }
.edu-item p  { color: #86868b; margin: 0; font-size: .9rem; }
.consulting-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
    height: 100%;
    transition: transform var(--transition), box-shadow var(--transition);
}
.consulting-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.consulting-icon { font-size: 1.8rem; color: var(--primary); margin-bottom: 1rem; }
.consulting-card h3 { font-size: .98rem; font-weight: 700; margin-bottom: .3rem; color: var(--heading); }
.consulting-client { font-size: .82rem; font-weight: 600; color: var(--primary); margin-bottom: .75rem; }
.consulting-card p  { font-size: .88rem; color: var(--text-muted); margin-bottom: 1rem; }
.testimonial-card { max-width: 680px; margin: 0 auto 3.5rem; text-align: center; padding: 0 1rem; }
.testimonial-quote { font-size: 2rem; color: var(--primary); margin-bottom: 1.25rem; opacity: .5; }
.testimonial-card p { font-size: 1.05rem; color: var(--text-muted); font-style: italic; line-height: 1.85; }
.testimonial-author { margin-top: 1.5rem; }
.testimonial-author strong { font-size: .95rem; color: var(--heading); display: block; }

.testi-indicators { bottom: 0; }
.testi-indicators [data-bs-target] {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    transition: background var(--transition);
}
.testi-indicators .active { background: var(--primary); }
.carousel-control-prev,
.carousel-control-next { width: 40px; top: 50%; transform: translateY(-50%); bottom: auto; height: 40px; }
.carousel-control-prev-icon,
.carousel-control-next-icon { filter: invert(0); opacity: .4; }
@media (prefers-color-scheme: dark) {
    .carousel-control-prev-icon,
    .carousel-control-next-icon { filter: invert(1); }
}
.contact-detail {
    display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem;
}
.contact-detail i {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--icon-bg);
    color: var(--primary);
    border-radius: 10px;
    font-size: .95rem;
    flex-shrink: 0;
}
.contact-detail strong { display: block; font-size: .78rem; color: var(--text-muted); font-weight: 600; margin-bottom: .1rem; letter-spacing: .5px; text-transform: uppercase; }
.contact-detail a, .contact-detail span { font-size: .9rem; color: var(--heading); }
.contact-detail a:hover { color: var(--primary); }

.form-control {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: .75rem 1rem;
    font-size: .9rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.form-control:focus {
    background: var(--surface);
    color: var(--text);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,102,204,.15);
    outline: none;
}
@media (prefers-color-scheme: dark) {
    .form-control:focus { box-shadow: 0 0 0 3px rgba(41,151,255,.2); }
}
.form-control::placeholder { color: var(--text-muted); opacity: .6; }
.form-label { font-size: .82rem; font-weight: 600; color: var(--heading); margin-bottom: .4rem; letter-spacing: .2px; }

.btn-primary {
    background: var(--primary);
    border: none;
    font-weight: 600;
    border-radius: 980px;
    padding: .75rem 1.75rem;
    font-size: .9rem;
    transition: background var(--transition), transform var(--transition);
}
.btn-primary:hover,
.btn-primary:focus { background: var(--primary-hover); border: none; transform: scale(1.01); }

/* reCAPTCHA badge position */
.grecaptcha-badge { visibility: hidden; }
.main-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem 0;
    position: relative;
    border-top: 1px solid var(--cert-border);
}
.main-footer p { font-size: .84rem; margin: 0; }
.main-footer strong { color: #f5f5f7; }

.footer-social {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    color: var(--footer-text);
    font-size: .85rem;
    margin-left: .5rem;
    transition: background var(--transition), color var(--transition);
}
.footer-social:hover { background: var(--primary); color: #fff; }
.back-to-top {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    width: 44px; height: 44px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 14px rgba(0,102,204,.4);
    opacity: 0; pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
    z-index: 999;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { color: #fff; transform: translateY(-3px); }
@media (max-width: 991px) {
    .row.g-5 {
        --bs-gutter-x: 1.5rem;
        --bs-gutter-y: 1.5rem;
    }
}
@media (max-width: 767px) {
    .section-padding { padding: 64px 0; }
    .timeline { padding-left: 1.5rem; }
    .timeline-marker { left: -1.5rem; }
    .timeline-header { flex-direction: column; }
    .profile-img { width: 160px; height: 160px; }
    .hero-cta .btn { width: 100%; margin-bottom: .6rem; }
    .form-control { font-size: 1rem; }
    .navbar-social a { width: 44px; height: 44px; }
}
@media (max-width: 575px) {
    .contact-info-grid { grid-template-columns: 1fr; }
    .timeline-content { padding: 1.25rem; }
}

.text-muted-light { color: #86868b; }

/* FA icon pre-sizing stub — prevents CLS while fa.min.css loads deferred */
.fas, .far, .fab, .fa, .fa-solid, .fa-regular, .fa-brands {
    display: inline-block;
    width: 1.25em;
    text-align: center;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
}