.contact-form .btn-primary {
    cursor: pointer;
}
/* Subsection Title Styling */
.subsection-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--light-text);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    letter-spacing: 0.01em;
}
.subsection-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
    
}
:root.light .footer-col.about h3 {
    color: #f1f5f9 !important;
}
:root.light .footer-col.about p {
    color: rgb(203, 213, 225) !important;
}
html {
    box-sizing: border-box;
}
*, *::before, *::after {
    box-sizing: inherit;
}
body {
    margin: 0;
    padding: 0;
}



/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --accent-color: #059669;
    --dark-bg: #0f172a;
    --darker-bg: #1e293b;
    --light-text: #f1f5f9;
    --gray-text: #cbd5e1;
    --card-bg: #1e3240;
    --card-hover: #22344a;
    --border-color: #334155;
    --shadow: 0 2px 12px 0 rgba(0,0,0,0.04);
    --gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --gradient-hover: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
    --footer-link-hover: #ffffff;
}

/* Light theme variable overrides */
:root.light {
    --dark-bg: #ffffff;
    --darker-bg: #f8fafc;
    --light-text: #0f172a;
    --gray-text: #334155;
    --card-bg: #fff;
    --card-hover: #f1f5f9;
    --border-color: #cbd5e1;
    --shadow: 0 4px 20px rgba(2,6,23,0.08);
    --footer-bg: #1e3240;
    --footer-card-bg: transparent;
    --footer-text: #f1f5f9;
    --footer-link-hover: #ffffff;
}

/* Light mode: ensure form inputs are visible */
:root.light .contact-form {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 20px rgba(2,6,23,0.06);
}
:root.light .form-field label {
    color: #0f172a;
}
:root.light .form-field input,
:root.light .form-field textarea {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}
:root.light .form-field input::placeholder,
:root.light .form-field textarea::placeholder {
    color: #94a3b8;
}
:root.light .form-field input:focus,
:root.light .form-field textarea:focus {
    background: #f8fafc;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.13);
}

/* Contact Section Polished */

/* Contact Section Layout (matches reference) */
.contact {
    background: var(--darker-bg);
    padding: 80px 0;
}
.contact-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 4rem;
    align-items: flex-start;
}
.contact-grid { margin-top: 2rem; }
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
    margin-top: 0;
}
.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 1.2rem;
    color: var(--light-text);
}
.contact-info p {
    color: var(--gray-text);
    font-size: 1.13rem;
    margin-bottom: 1.7rem;
    line-height: 1.7;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.13rem;
    margin: 0.4rem 0;
    background: transparent;
    padding: 0.2rem 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
}
.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}
.contact-item h4 { display: none; }
.contact-item a, .contact-item p {
    color: var(--gray-text);
    font-size: 1.08rem;
    margin: 0;
    text-decoration: none;
    font-weight: 600;
}

/* Light mode: ensure contact items are not styled as cards */
:root.light .contact-item {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.contact-social-btns {
    display: flex;
    gap: 1.2rem;
    margin-top: 2.2rem;
}
.contact-social-btns a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    color: #18344a;
    border: 1.5px solid #dbeafe;
    border-radius: 10px;
    padding: 12px 28px;
    font-weight: 500;
    font-size: 1.08rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border 0.2s;
    box-shadow: 0 1px 6px 0 rgba(30,41,59,0.04);
}
.contact-social-btns a:hover {
    background: #eaf1ff;
    color: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 4px 16px rgba(59,130,246,0.10);
}
.contact-form-wrapper { margin-top: 0; }
.contact-form {
    background: var(--card-bg);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 2.7rem 2.2rem 2.2rem 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    border: 1px solid var(--border-color);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    align-items: start;
}
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.form-field label {
    font-weight: 600;
    color: var(--light-text);
    margin-bottom: 0.2rem;
}
.form-field input,
.form-field textarea {
    width: 100%;
    padding: 1.05rem 1.2rem;
    border-radius: 9px;
    border: 1px solid var(--card-hover);
    background: var(--darker-bg);
    color: var(--light-text);
    font-size: 1.12rem;
    transition: border 0.2s, box-shadow 0.2s, background 0.2s;
    resize: none;
    min-height: 48px;
}
.form-field textarea { min-height: 140px; }
.form-field input:focus,
.form-field textarea:focus {
    border: 1.5px solid var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.13);
    outline: none;
    background: var(--card-hover);
}
/* Placeholder visibility (dark/light) */
.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #94a3b8;
}
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
/* Unify form buttons (button and link) */
.contact-form .btn,
.contact-form button {
    height: 48px;
    padding: 0 22px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}
.contact-form .btn-secondary {
    border-width: 2px;
}

/* Contact subtitle and social buttons */
.contact-subtitle {
    text-align: center;    
    cursor: default;
    color: var(--gray-text);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.contact-social {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.social-btn {
    padding: 12px 30px;
    background: var(--card-bg);
    color: var(--light-text);
    text-decoration: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.social-btn:hover {
    background: var(--gradient);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}
@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
        gap: 2.5rem;
    }
    .contact-form {
        padding: 1.5rem 1rem;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .contact-form .btn,
    .contact-form button { width: 100%; }
}

/* Desktop: widen contact form column and reduce gap slightly */
@media (min-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr 1.3fr; /* wider form column */
        gap: 3rem;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
    color: var(--light-text);
    line-height: 1.6;
    overflow-x: hidden;
        margin: 0;
        padding: 0;
}

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        background: var(--card-bg);
        backdrop-filter: blur(10px);
        z-index: 1000;
        padding: 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        border-bottom: 1px solid var(--border-color);
        transition: background 0.3s, box-shadow 0.3s, color 0.3s;
    }


.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 2rem;
}

    .nav-brand {
        flex: 0 0 auto;
        margin-right: 2.5rem;
    }

    .nav-menu {
        display: flex;
        list-style: none;
        gap: 2rem;
        flex: 1 1 auto;
        justify-content: center;
        align-items: center;
        margin: 0;
        padding: 0;
    }

    .nav-actions {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 1rem;
    }

/* Hamburger menu icon (hidden by default, shown on mobile) */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    background: transparent;
    border: none;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--light-text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
    .skills-grid .skill-category,
    .projects-grid .project-card,
    .education-item,
    .cert-card,
    .contact-item,
    .contact-form {
        transition: background 0.3s, box-shadow 0.3s, border 0.3s;
    }
    :root.light .skills-grid .skill-category,
    :root.light .projects-grid .project-card,
    :root.light .education-item,
    :root.light .cert-card,
    :root.light .activity-item,
    :root.light .contact-form {
        background: #fff;
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow);
    }

/* Improve card shadow visibility in light mode: some shadows can be subtle on
   white backgrounds, so provide slightly stronger, specific shadows for
   projects and certifications while preserving existing hover transforms. */
:root.light .project-card,
:root.light .cert-card {
    box-shadow: 0 8px 30px rgba(2,6,23,0.06);
}

:root.light .project-card:hover {
    /* keep existing transform but provide a stronger light-mode shadow */
    box-shadow: 0 15px 40px rgba(2,6,23,0.10);
}

:root.light .cert-card:hover {
    box-shadow: 0 10px 30px rgba(2,6,23,0.10);
}

/* Footer Modern Layout */

/* Footer Modern Layout - improved for light/dark */
.footer {
    background: var(--footer-bg, #1e3240);
    color: var(--footer-text, #dbeafe);
    padding: 3.2rem 0 1.2rem 0;
    margin-top: 3rem;
    border-radius: 1.2rem 1.2rem 0 0;
    box-shadow: 0 -2px 12px 0 rgba(0,0,0,0.04);
    font-size: 1.08rem;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2.5rem;
    padding: 0 2.5rem;
}
.footer-col {
    flex: 1 1 0;
    min-width: 220px;
    background: transparent;
    border-radius: 0;
    padding: 0 1.5rem;
}

.footer-logo {
    height: 80px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}


.footer-col.about h3,
.footer-col.links h3,
.footer-col.connect h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
    color: var(--footer-text, #f1f5f9);
    letter-spacing: 0.02em;
}
.footer-col.about p {
    color: var(--gray-text);
    font-size: 1.08rem;
    line-height: 1.4;
    margin: 0;
}
.footer-col.links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col.links li {
    margin-bottom: 0.5em;
}
.footer-col.links a {
    color: var(--footer-link, #dbeafe);
    text-decoration: none;
    font-size: 1.08rem;
    transition: color 0.2s;
}
.footer-col.links a:hover {
    color: var(--footer-link-hover, #2563eb);
}
.footer-col.connect .footer-icons {
    display: flex;
    gap: 1.1rem;
    margin-bottom: 0.7rem;
}
.footer-col.connect .footer-icons a {
    color: var(--footer-link, #b6d0e2);
    font-size: 1.35rem;
    transition: color 0.2s, transform 0.2s;
}
.footer-col.connect .footer-icons a:hover {
    color: var(--footer-link-hover, #2563eb);

}
.footer-col.connect .footer-email {
    color: rgb(203, 213, 225);
    font-size: 1.05rem;
    margin-top: 0.2rem;
    word-break: break-all;
}
.footer-divider {
    border: none;
    border-top: 1px solid #334155;
    margin: 2.2rem auto 1.2rem auto;
    max-width: 1200px;
    opacity: 0.5;
}
.footer-bottom {
    text-align: center;
    color: var(--footer-text, #f1f5f9);
    font-size: 1.05rem;
    margin-top: 0.5rem;
    letter-spacing: 0.01em;
}

:root.light .footer {
    background: var(--footer-bg, #1e3240);
    color: var(--footer-text, #1e293b);
}
:root.light .footer-col {
    background: var(--footer-card-bg, #fff);
    box-shadow: 0 2px 12px 0 rgba(30,41,59,0.06);
}

@media (max-width: 900px) {
    .footer-content {
        flex-direction: column;
        gap: 2.2rem;
        padding: 0 1.2rem;
    }
    .footer-col {
        min-width: 0;
    }
}

:root.light .navbar .nav-brand {
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    background-clip: initial;
    color: #0f172a;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}



.nav-menu a {
    color: var(--light-text);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Better focus treatment for keyboard users */
:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid rgba(59,130,246,0.6);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Remove default blue tap highlight on mobile/touch devices for interactive controls */
@media (hover: none) and (pointer: coarse) {
    a,
    button,
    .btn,
    .theme-toggle,
    .hamburger,
    .nav-menu a,
    .cert-toggle-icon,
    .social-links a,
    .footer-col.connect .footer-icons a,
    .project-card,
    .skill-tag,
    .contact-social-btns a {
        -webkit-tap-highlight-color: transparent;
        outline: none;
    }
    /* Prevent sticky hover look for chevron toggle on touch devices */
    .cert-toggle-icon:hover {
        transform: none !important;
        color: inherit !important;
        background: inherit !important;
        box-shadow: inherit !important;
    }
    .cert-toggle-icon:focus {
        outline: none;
    }
}


.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo {
    height: 90px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}

:root.light .nav-logo {
    filter: none;
}



@media (max-width: 768px) {
    .nav-logo { height: 60px; }
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--light-text);
    border: 1px solid var(--card-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.25rem;
    padding: 0;
    position: relative;
    overflow: hidden;
}
.theme-toggle i {
    font-size: 1.35em;
    display: block;
    width: 1em;
    height: 1em;
    margin: 0 auto;
    line-height: 1em;
    transition: color 0.2s, transform 0.2s;
    pointer-events: none;
}
.theme-toggle:hover {
    transform: scale(1.25);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 60px;
    background: var(--dark-bg);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    z-index: 0;
}

.hero-content {
    text-align: center;
    z-index: 1;
    position: relative;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.highlight {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 2rem;
    color: var(--gray-text);
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--gray-text);
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn {
    padding: 12px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

/* Small button variant for subtle CTAs */
.btn-sm {
    padding: 8px 14px;
    font-size: 0.92rem;
    border-radius: 6px;
}

/* Optional: spacing helper for certification CTA */
.cert-cta {
    margin-bottom: 2rem;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--gradient-hover);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

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

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* In contact form: disable hover movement/scaling on buttons */
.contact-form .btn-primary:hover,
.contact-form .btn-secondary:hover,
.contact-form button:hover,
.contact-form a.btn:hover {
    transform: none !important;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.social-links a {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-text);
    font-size: 1.5rem;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.5);
}

/* Section Styles */
section {
    padding: 80px 20px;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    position: fixed;
    left: 16px;
    top: 16px;
    width: auto;
    height: auto;
    padding: 8px 12px;
    background: var(--gradient);
    color: #fff;
    border-radius: 6px;
    z-index: 1100;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

/* About Section */

.about-content {
    max-width: 1100px;
    margin: 0 auto;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: flex-start;
}

.about-col {
    background: none;
    padding: 0;
}

/* Photo column styling */
.about-photo-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.about-photo-wrapper {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #cbd5e1;
    box-shadow: 0 10px 40px rgba(203, 213, 225, 0.3);
    transition: all 0.3s ease;
}

.about-photo-wrapper:hover {
    box-shadow: 0 15px 50px rgba(203, 213, 225, 0.4);
}

.about-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-name {
    font-size: 2rem;
    font-weight: 400;
    font-family: 'Brush Script MT', 'Lucida Handwriting', 'Apple Chancery', cursive;
    font-style: italic;
    color: #cbd5e1;
    text-align: center;
    letter-spacing: 1px;
    margin: 0;
    text-shadow: 0 2px 10px rgba(203, 213, 225, 0.3);
    position: relative;
}

.about-name::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: #cbd5e1;
    border-radius: 2px;
    opacity: 0.6;
}

.about-heading {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--light-text);
}
.about-heading i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.about-col p {
    font-size: 1.13rem;
    color: var(--gray-text);
    line-height: 1.8;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--gray-text);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}


/* Skills Section */
.skills {
    background: var(--dark-bg);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.skill-category:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.skill-category h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--light-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category h3 i {
    color: var(--primary-color);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    background: var(--darker-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--light-text);
    border: 1px solid var(--card-hover);
    transition: all 0.3s;
}

.skill-tag:hover {
    border-color: var(--primary-color);
    cursor: default;
}

/* Projects Section */
.projects {
    background: var(--darker-bg);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    padding: 1.95rem;
    border-radius: 15px;
    transition: all 0.3s;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.2);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.project-card h3 {
    font-size: 1.5rem;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    color: var(--light-text);
    display: flex;
    align-items: center;
}

.project-status {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.project-card p {
    color: var(--gray-text);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tags span {
    background: var(--darker-bg);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}
.project-tags span:hover {
    cursor: default;
}

/* Education Section */
.education {
    background: var(--dark-bg);
}

.education-content {
    max-width: 800px;
    margin: 0 auto 4rem;
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    opacity: 0.6;
}

.education-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    transition: all 0.3s;
    position: relative;
}

.education-item:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.education-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 1rem;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--dark-bg);
}

.edu-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.edu-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.edu-header h3 {
    font-size: 1.4rem;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    color: var(--light-text);
    display: flex;
    align-items: center;
}

.edu-details h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--light-text);
}

.edu-institution {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.edu-date {
    color: var(--gray-text);
    font-size: 0.95rem;
}



.certifications-grid {
    padding: .3rem;
    cursor: default;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    /* allow smooth expand/collapse when JS adjusts max-height */
    transition: max-height 300ms ease;
}

/* Allow grid items to shrink within the grid to avoid subtle horizontal overflow */
.certifications-grid > * {
    min-width: 0;
}

/* Collapsed state: limit grid height to approx 3 rows and hide overflow */
.certifications-grid.collapsed {
    /* height will be set inline by JS to exactly 3 rows; keep overflow hidden */
    overflow: hidden;
}

/* Small ellipsis indicator shown when collapsed */
.cert-ellipsis {
    display: block;
    font-size: 1.5rem;
    color: var(--gray-text);
    margin-top: 0.5rem;
}

/* Compact toggle that replaces the dots: looks like a subtle link, not a button */
.cert-compact-toggle {
    display: inline-block;
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    margin-top: 0.5rem;
    cursor: pointer;
    text-decoration: underline;
    border-radius: 6px;
}
.cert-compact-toggle:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

/* Icon-style toggle placed where the dots were. Small circular icon that
   looks like a subtle control rather than a full button. */
.cert-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: #fff;
    box-shadow: 0 6px 18px rgba(2,6,23,0.06);
    cursor: pointer;
    margin: 1.4rem auto 0; /* unified top spacing for both chevrons */
    font-size: 1rem;
    transition: .4s ease;
}
.cert-toggle-icon i {
    font-size: 1rem;
    line-height: 1;

}

.cert-toggle-icon:hover {
    transform: translateY(-3px);
    color: var(--primary-color);
    box-shadow: 0 7px 7px rgba(37, 99, 235, 0.1);
    background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(124,58,237,0.04));
}

:root.light .cert-toggle-icon {
    color: var(--primary-color);
    
}
:root.light .cert-toggle-icon:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Projects grid collapsed behavior mirrors certifications grid but ensures
   the parent container can still expand when the grid is uncollapsed. */
.projects-grid.collapsed {
    overflow: hidden;
}

/* Ensure the icon toggle sits above the grid content on small screens */
.cert-toggle-icon {
    z-index: 50;
}

/* Ensure the old text-based wrapper is unobtrusive when JS moves the button */
.cert-toggle-wrap { text-align: center; }
.cert-toggle-wrap #cert-toggle { display: none; }

/* Make the toggle button visible and slightly different style */
.cert-toggle-wrap .btn {
    display: inline-block;
    padding: 8px 16px;
    cursor: pointer;
}

.cert-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.cert-card.featured {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.cert-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.2);
}

.cert-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.cert-card.featured i {
    color: var(--accent-color);
}

.cert-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--light-text);
}

.cert-card p {
    color: var(--gray-text);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere; /* wrap long words/URLs to avoid overflow */
}

/* Cert header: icon + title side-by-side */
.cert-card .cert-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}
.cert-card .cert-header i {
    display: inline-flex;
    margin-bottom: 0;
}
/* Ensure the smaller badge size overrides the more general .cert-card i rule (higher specificity) */
.cert-card .cert-header i.cert-badge {
    font-size: 1.65rem; /* smaller than the main cert icon */
    line-height: 1;
    color: var(--primary-color);
    margin-right: 0rem;
    display: inline-flex;
    vertical-align: middle;
}
.cert-card .cert-header h4 {
    margin: 0;
    flex: 1 1 auto;      /* let the title take remaining space and shrink */
    min-width: 0;        /* allow flex child to shrink instead of overflowing */
    white-space: normal; /* enable wrapping */
    overflow-wrap: anywhere; /* wrap at slashes/long tokens if needed */
}

.cert-description {
    font-size: 0.85rem !important;
    line-height: 1.5;
}

.activities {
    display: grid;    
    gap: 1.5rem;
    cursor: default;
    max-width: 800px;
    margin: 0 auto;
}

.activity-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.3s;
}

.activity-item:hover {
    background: var(--card-hover);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

/* Ensure hover effect also applies in light mode (higher specificity override) */
:root.light .activity-item:hover {
    background: var(--card-hover);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.activity-item i {
    font-size: 1.5rem;
    color: var(--accent-color);
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.activity-item p {
    color: var(--gray-text);
    line-height: 1.6;
}

/* Activity header: icon + title in one row */
.activity-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
.activity-header i {
    margin-top: 0;
}
.activity-title {
    margin: 0;
    font-size: 1.05rem;
    color: var(--light-text);
}

/* Contact Section */

/* (Removed duplicate minimal footer styles that overrode the modern footer above) */

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

/* Back to top */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--card-hover);
    background: var(--card-bg);
    color: var(--light-text);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: all 0.3s;
    opacity: 0;
    pointer-events: none;
}

.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--gradient);
    color: white;
    transform: translateY(-3px);
}

/* Responsive Design */
@media (max-width: 900px) {
    .navbar .container {
        padding: 0 12px;
        gap: 1rem;
    }
    .nav-brand {
        margin-right: 1rem;
    }
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    /* Reorder: show photo first, then professional summary on mobile */
    .about-photo-col {
        order: -1;
    }
    .hamburger {
        display: flex;
    }

    .navbar .container {
        flex-wrap: wrap;
        min-height: 56px;
    }

    /* Mobile navigation: overlay below the navbar, hidden by default and
       revealed via the .active class. Use visibility + opacity to avoid
       interaction when hidden and ensure it sits above other content. */
    .nav-menu {
        position: fixed;
        left: 0;
        top: 72px; /* align immediately below navbar (navbar min-height = 72px) */
        right: 0;
        height: calc(100vh - 72px);
        display: flex;
        flex-direction: column;
        background: rgba(15, 23, 42, 0.98);
        width: 100%;
        text-align: center;
        padding: 1.25rem 0;
        gap: 1rem;
        justify-content: flex-start;
        align-items: center;
        z-index: 1200;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity 180ms ease, transform 200ms ease, visibility 0ms linear 180ms;
    }

    /* When active, make it visible and interactive */
    .nav-menu.active {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        transition: opacity 200ms ease, transform 200ms ease;
    }

    /* Ensure hamburger sits above the nav when opened */
    .hamburger {
        z-index: 1300;
    }

    /* Make mobile nav links more tappable */
    .nav-menu a {
        display: block;
        padding: 0.85rem 1.25rem;
        font-size: 1.05rem;
        color: var(--light-text);
        width: 100%;
    }

    /* Light mode: ensure the mobile nav overlay matches light theme so
       links remain readable when :root.light is active (fixes invisible links) */
    :root.light .nav-menu {
        background: #ffffff; /* match navbar in light theme */
        color: #0f172a;
    }
    /* Force high-specificity link color for mobile nav in light mode */
    :root.light .nav-menu a {
        color: #0f172a !important;
        background: none !important;
    }

    /* Ensure the active state is visible in light mode even if transitions
       or other rules delay visibility changes in some environments */
    :root.light .nav-menu.active {
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: opacity 200ms ease, transform 200ms ease !important;
    }

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

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }

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

    .skills-grid,
    .projects-grid,
    .certifications-grid {
        grid-template-columns: 1fr;
    }

    /* Ensure certifications grid never overflows: allow content to shrink */
    .certifications-grid {
        grid-template-columns: minmax(0, 1fr);
        padding-right: 0; /* avoid fractional rounding adding a pixel on the right */
    }

    .education-item {
        flex-direction: column;
        gap: 1rem;
    }

    .contact-social {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

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

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .about-highlights {
        grid-template-columns: 1fr;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
