/* Custom properties and theme settings */
:root {
    --bg-gradient: radial-gradient(circle at top, #0a0f1e 0%, #03050b 100%);
    --bg-dark: #03050b;
    --text-primary: #eef5ff;
    --text-secondary: #a0aec0;
    --accent: #0ff;
    --accent-glow: rgba(0, 255, 255, 0.4);
    --glass-bg: rgba(15, 25, 45, 0.55);
    --glass-border: 1px solid rgba(0, 255, 255, 0.15);
    --glass-border-hover: 1px solid rgba(0, 255, 255, 0.4);
    --font-stack: 'Inter', sans-serif;
}

/* Base Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background: var(--bg-dark);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-stack);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #03050b;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Helper Layout Classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px;
}

/* Typography styles */
h1, h2, h3, h4 {
    font-weight: 700;
}

/* Glassmorphism base layout styling */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass:hover {
    border: var(--glass-border-hover);
    box-shadow: 0 8px 32px 0 rgba(0, 255, 255, 0.15);
    transform: translateY(-5px);
}

/* Utility buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
}

.btn-primary:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    color: #fff;
}

/* Sections Global Header layout */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header .subtitle {
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.section-header .title {
    font-size: 2.25rem;
    margin-top: 8px;
}

/* Navigation Menu */
.navbar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(3, 5, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.nav-logo .accent {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    color: var(--accent);
}

.resume-btn {
    border: 1px solid var(--accent);
    padding: 8px 18px;
    border-radius: 20px;
    color: var(--accent);
    transition: all 0.3s ease;
}

.resume-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Mobile Menu Button (Hamburger) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
}

/* Hero Section design */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px 24px;
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 900px;
    width: 100%;
    overflow: hidden;
}

.hero-greeting {
    font-size: 1.1rem;
    color: var(--accent);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 12px;
}

/* Responsive Single-line Hero Title Styling - Now featuring a single solid color */
.hero-title {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    font-size: clamp(1.4rem, 5.2vw, 4.5rem); 
    gap: 0 clamp(4px, 1.2vw, 16px);
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-primary);
    width: 100%;
}

/* Name Parts - Styled with a single solid color (#ffffff) and a smooth hover state */
.name-part {
    display: inline-block;
    color: #ffffff;
    transition: color 0.3s ease;
}

.name-part:hover {
    color: var(--accent); /* Smoothly transitions to cyan on hover */
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.75rem);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 24px;
    min-height: 2.2rem;
}

.typing-text {
    color: var(--accent);
    font-weight: 600;
}

.typed-cursor {
    color: var(--accent);
    margin-left: 2px;
    animation: blink 0.7s infinite;
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 36px auto;
}

/* Social link buttons - ensuring styles override default anchor properties */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.social-links a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: var(--glass-border);
    background: var(--glass-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary) !important;
    font-size: 1.25rem;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.social-links a:hover {
    border-color: var(--accent);
    color: var(--accent) !important;
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

/* About Section */
.about-card {
    padding: 48px;
    max-width: 900px;
    margin: 0 auto;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* Skills Section Grid layout */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.skills-card {
    padding: 32px;
}

.skills-category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.category-icon {
    font-size: 1.5rem;
    color: var(--accent);
}

.skills-category-header h3 {
    font-size: 1.25rem;
}

.skills-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.skill-badge i {
    color: var(--accent);
}

.skills-card:hover .skill-badge {
    border-color: rgba(0, 255, 255, 0.2);
}

.skill-badge:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: rgba(0, 255, 255, 0.05);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
}

/* Projects Section Styling - Multi-Column Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    padding: 40px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.project-icon {
    font-size: 1.75rem;
    color: var(--accent);
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    flex-grow: 1; /* Aligns card heights by pushing tech stack to the bottom */
}

.project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.tech-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(0, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 255, 0.1);
}

.project-links {
    display: flex;
    gap: 16px;
}

.proj-link {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.proj-link.primary {
    background: var(--accent);
    color: var(--bg-dark);
}

.proj-link.primary:hover {
    background: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.proj-link.secondary {
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.proj-link.secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Education Section Styling */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 32px;
}

.education-card {
    padding: 36px;
}

.edu-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.edu-icon {
    font-size: 1.75rem;
    color: var(--accent);
    background: rgba(0, 255, 255, 0.05);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.1);
}

.edu-duration {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 1px;
}

.edu-degree {
    font-size: 1.25rem;
    margin-top: 4px;
}

.edu-institution {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.edu-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Certifications Grid layout */
.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.cert-card {
    padding: 28px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cert-icon-wrapper {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.cert-title {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.cert-provider {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
    flex-grow: 1;
}

.cert-footer {
    display: flex;
    justify-content: flex-start;
}

.cert-verify {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.cert-verify:hover {
    border-bottom: 1px solid var(--accent);
}

/* Footer & Contact setup */
.footer {
    background: #030508;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 80px 24px 40px 24px;
}

.footer-title {
    font-size: 2rem;
    margin-bottom: 12px;
}

.footer-desc {
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 32px;
}

.footer-social-links {
    display: flex;
    gap: 20px;
    margin-bottom: 48px;
}

.footer-social-links a {
    font-size: 1.35rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.footer-social-links a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.footer-divider {
    width: 100%;
    max-width: 600px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin-bottom: 32px;
}

.copyright {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

/* Back to Top floating layout */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 25, 45, 0.8);
    border: var(--glass-border);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    transform: translateY(-3px);
}

/* Keyframe animations */
@keyframes blink {
    50% { opacity: 0; }
}

/* Media Queries for responsive systems */
@media (max-width: 992px) {
    .education-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    /* Mobile Navigation Slide-Down setup - Completely updated to avoid fixed heights and cutoff bugs */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        max-height: 0; /* Changed from height: 0 to allow fluid max-height transition */
        overflow: hidden;
        flex-direction: column;
        background: rgba(3, 5, 11, 0.98); /* Solid overlay to completely block underlying content */
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        gap: 0;
        transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.4s ease;
        border-bottom: 0px solid rgba(0, 255, 255, 0.1);
        padding: 0; /* Explicitly reset to 0 in inactive state */
    }

    .nav-links.active {
        max-height: 480px; /* Safe expanded limit to comfortably hold all 7 menu items */
        padding: 16px 0 24px 0; /* Safe vertical padding to contain the bottom of the resume button */
        border-bottom: 1px solid rgba(0, 255, 255, 0.15);
        overflow-y: auto; /* Fallback vertical scroll for extremely small viewports */
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-item {
        display: block;
        padding: 12px 0; /* Compacted height to safely fit smaller phone viewports */
        width: 100%;
    }

    .resume-btn {
        margin: 12px auto 0 auto; /* Balanced top margin to prevent overlapping elements, removed bottom margin */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 10px 24px;
        width: auto;
    }

    /* Toggle Hamburger Animation */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Containers spacing on smaller viewports */
    .container {
        padding: 60px 20px;
    }

    .section-header {
        margin-bottom: 35px;
    }

    .about-card {
        padding: 28px 20px;
    }

    .project-card {
        padding: 28px 20px;
    }
}

/* Defensive fallback for extremely small screens (under 380px wide) */
@media (max-width: 380px) {
    .hero-title {
        font-size: clamp(1.1rem, 6.2vw, 1.5rem);
        gap: 0 4px;
    }
}