/* Navigation Overlay */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 5%;
    background: rgba(10, 15, 29, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.hero-location {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 12px 0 18px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.hero-location i {
    color: #38bdf8;
    font-size: 1rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.1rem;
}

.logo-mark {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.logo-text {
    letter-spacing: 0.03em;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.25rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.15rem;
}

.nav-toggle:focus-visible,
.nav-links a:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

/* Base Layout Config */
.section-container {
    padding: 7rem 5% 4rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 3.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 50px;
    height: 3px;
    background: var(--primary);
}

/* Updated Hero Section with explicit margins & expanded icons */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 5rem;
    align-items: center;
    width: 100%;
}

.hero-text h1 {
    font-size: clamp(2.75rem, 6vw, 4.25rem);
    line-height: 1.15;
    margin-bottom: 2rem; /* Enhanced spacing */
}

/* Enlarged & spaced out social link elements */
.social-links {
    display: flex;
    gap: 2rem; 
    margin-bottom: 3rem; 
}

.social-links a {
    font-size: 2.2rem; /* Significantly bigger sizing */
    color: var(--text-muted);
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary);
    transform: translateY(-3px);
}

.hero-cta {
    margin-top: 1rem;
}

/* Vector SVG Container Adjustments */
.hero-graphic {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-svg {
    width: 100%;
    max-width: 440px;
    height: auto;
}

/* SVG Keyframe Animation Routines */
.rotator {
    transform-origin: center;
    animation: rotateSVG 25s linear infinite;
}

.pulse {
    transform-origin: center;
    animation: pulseSVG 4s ease-in-out infinite alternate;
}

@keyframes rotateSVG {
    to { transform: rotate(360deg); }
}

@keyframes pulseSVG {
    0% { opacity: 0.3; transform: scale(0.95); }
    100% { opacity: 0.8; transform: scale(1.02); }
}

/* Nested Sub-Role Timeline Adjustments */
.sub-role-block {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed rgba(46, 61, 96, 0.4);
}

.sub-role-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sub-role-block h5 {
    font-size: 1.15rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.sub-date {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 400;
    margin-left: 0.5rem;
}

/* Layout Separations */
.skills-grid, .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.blogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

/* Give every project card one shared height on desktop, even across rows. */
@media (min-width: 901px) {
    .projects-grid,
    .certifications-grid,
    .blogs-grid {
        grid-auto-rows: 1fr;
    }
}

.soft-skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        margin-top: 8rem;
    }
    .hero-location { justify-content: center; }
    .hero-graphic { order: -1; }
    .social-links { justify-content: center; }
}

@media (max-width: 1100px) {
    .navbar {
        padding: 0.9rem 5%;
        gap: 0.75rem;
    }

    .nav-toggle {
        display: inline-flex;
        order: 2;
    }

    .theme-toggle {
        order: 1;
        margin-left: auto;
    }

    .navbar nav {
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        width: 100%;
        padding: 0 5%;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-0.75rem);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .navbar nav.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        padding: 0.75rem 0;
    }

    .nav-links a {
        display: block;
        padding: 0.8rem 0.5rem;
    }
}

@media (max-width: 700px) {
    .section-container {
        padding: 5rem 1.25rem 2.5rem;
    }

    .section-title {
        font-size: 1.9rem;
        margin-bottom: 2.75rem;
    }

    .hero-section {
        min-height: auto;
        padding: 7rem 1.25rem 3rem;
    }

    .hero-container {
        gap: 2.5rem;
    }

    .hero-text h1 {
        font-size: clamp(2.4rem, 11vw, 3.4rem);
        margin-bottom: 1.5rem;
    }

    .social-links {
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .social-links a {
        font-size: 1.8rem;
    }

    .hero-cta {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-cta .btn,
    .publication-link {
        width: 100%;
        margin-left: 0;
        text-align: center;
    }

    .sub-role-block h5 {
        font-size: 1rem;
    }

    .sub-date {
        display: block;
        margin: 0.35rem 0 0;
    }

    .nav-links {
        grid-template-columns: 1fr;
    }

    .skills-grid,
    .projects-grid,
    .certifications-grid,
    .blogs-grid,
    .soft-skills-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .education-cards,
    .subsections-container {
        gap: 1.25rem;
    }

    .sub-block {
        padding: 1.5rem;
    }

    .contact-wrapper {
        width: 100%;
    }
}

.education-cards, .subsections-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sub-block {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 14px;
}

.sub-block h3 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-wrapper {
    max-width: 650px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        margin-top: 8rem;
    }
    .hero-graphic { order: -1; }
    .social-links { justify-content: center; }
}

/* --- Education Aesthetic Timeline --- */
.edu-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.edu-timeline::before {
    content: '';
    position: absolute;
    left: 31px;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary) 0%, var(--border-color) 100%);
}

.edu-timeline-item {
    position: relative;
    padding-left: 70px;
    margin-bottom: 3rem;
}

.edu-timeline-item::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 24px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 4px solid var(--primary);
    z-index: 2;
    transition: background 0.3s ease;
}

/* Scroll POP-IN Animation Hook */
.edu-timeline-item.scrolled-in .education-card {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.edu-timeline-item .education-card {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease-out;
}

.edu-timeline-item:hover::before {
    background: var(--primary);
}

/* --- Responsive Slider Blog Framework --- */
.blog-carousel {
    position: relative;
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
}

.blogs-viewport {
    overflow: hidden;
    width: 100%;
    border-radius: 14px;
}

.blogs-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
    gap: 1.5rem;
    width: 100%;
}

/* Ensure uniformity inside blog cards and force them to take exactly half the space */
.blog-slide {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 calc(50% - 0.75rem); /* 50% width minus half of the 1.5rem (24px) gap */
    width: calc(50% - 0.75rem);    /* Forces the width boundary on desktop viewports */
    min-width: calc(50% - 0.75rem);
}

.blog-card-link {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%; /* Keeps heights perfectly uniform across rows */
    text-decoration: none;
}

/* Enforce uniform layout content height inside the link element */
.blog-card-link p {
    flex-grow: 1; /* Pushes the card footer to the bottom identically */
}

/* Mobile responsive layout to break the track into a vertical stack */
@media (max-width: 767px) {
    .blogs-viewport {
        overflow: visible; 
    }

    .blogs-track {
        flex-direction: column; 
        transform: none !important; /* Overrides JS styling translations on mobile */
        gap: 1.5rem;
    }

    .blog-slide {
        flex: 0 0 auto;
        width: 100%; /* Allow cards to stretch full-width on mobile views */
        min-width: 100%;
    }

    .carousel-controls {
        display: none !important; 
    }
}
.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.carousel-button {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, border-color 0.3s, transform 0.2s;
}

.carousel-button:hover {
    background: var(--primary-glow);
    border-color: var(--primary);
    transform: scale(1.05);
}

@media (max-width: 767px) {
    .edu-timeline::before {
        left: 15px;
    }
    .edu-timeline-item {
        padding-left: 45px;
    }
    .edu-timeline-item::before {
        left: 6px;
    }
}
