/* Shared, responsive footer for the academic portfolio */
html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* Avoid an oversized gap where a short page ends with a divider. */
body > .section-divider:last-of-type {
    margin-bottom: 0;
}

.site-footer {
    position: relative;
    isolation: isolate;
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
    padding: 1rem clamp(1rem, 4vw, 2.5rem) 0.75rem;
    overflow: hidden;
    color: #e8eef8;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(0, 136, 255, 0.13), transparent 58%),
        linear-gradient(135deg, #111c2d, #0b1220 58%, #111827);
    border-top: 1px solid rgba(0, 136, 255, 0.65);
    box-shadow: 0 -8px 28px rgba(0, 70, 160, 0.18);
}

.site-footer::before {
    position: absolute;
    z-index: -1;
    top: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 2%, #d6a84f 20%, #0088ff 50%, #d6a84f 80%, transparent 98%);
    background-size: 200% 100%;
    content: "";
    animation: footerGlow 5s ease-in-out infinite alternate;
}

.footer-content {
    display: grid;
    justify-items: center;
    gap: 0.65rem;
    width: min(1100px, 100%);
    margin: 0 auto;
    text-align: center;
}

.footer-title {
    color: #f0d38e;
    font-size: clamp(0.95rem, 1.5vw, 1.08rem);
    font-weight: 750;
    line-height: 1.5;
    letter-spacing: 0.035em;
}

.footer-contact-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
}

.footer-contact-links > span,
.footer-contact-links > .whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-width: 0;
    min-height: 42px;
    box-sizing: border-box;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(164, 184, 214, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    color: #dbe6f5;
    font-size: 0.84rem;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;
}

.footer-contact-links a {
    color: #dbe6f5;
    text-decoration: none;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.footer-contact-links > span a:hover,
.footer-contact-links > span a:focus-visible {
    color: #f0d38e;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-contact-links > .whatsapp-btn {
    border-color: rgba(37, 211, 102, 0.34);
    background: rgba(37, 211, 102, 0.1);
    color: #d9f7e4;
    font-weight: 700;
}

.footer-contact-links > .whatsapp-btn:hover,
.footer-contact-links > .whatsapp-btn:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(37, 211, 102, 0.7);
    background: rgba(37, 211, 102, 0.17);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.12);
}

.footer-contact-links a:focus-visible {
    outline: 2px solid #f0d38e;
    outline-offset: 3px;
}

.footer-copyright {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.1rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aab6c8;
    font-size: 0.76rem;
    line-height: 1.5;
}

.developer-credit {
    width: min(1100px, 100%);
    box-sizing: border-box;
    margin: 0.45rem auto 0;
    color: #9aa8bb;
    font-size: 0.78rem;
    line-height: 1.6;
    text-align: center;
}

.developer-credit span {
    color: #f0d38e;
    font-weight: 700;
}

@keyframes footerGlow {
    from {
        background-position: 0% 50%;
        opacity: 0.65;
    }
    to {
        background-position: 100% 50%;
        opacity: 1;
    }
}

@media (max-width: 600px) {
    .site-footer {
        padding: 0.9rem 1rem 0.7rem;
    }

    .footer-content {
        gap: 0.65rem;
    }

    .footer-contact-links {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.6rem;
    }

    .footer-contact-links > span,
    .footer-contact-links > .whatsapp-btn {
        min-height: 40px;
        padding: 0.45rem 0.7rem;
        font-size: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-footer::before {
        animation: none;
    }

    .footer-contact-links a {
        transition: none;
    }
}

/* Shared tablet layout: preserve the single-row navigation and allow swiping. */
@media (max-width: 900px) {
    .navbar {
        box-sizing: border-box;
        justify-content: flex-start;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        touch-action: pan-x;
    }

    .navbar::-webkit-scrollbar {
        display: none;
    }

    .nav-links {
        flex: 0 0 auto;
        width: max-content;
        min-width: max-content;
        justify-content: flex-start;
        gap: clamp(6px, 1.4vw, 12px);
        margin-inline: 0;
    }

    .nav-links li {
        flex: 0 0 auto;
    }

    .nav-links li a {
        white-space: nowrap;
    }

    .academic-section,
    .awards-section,
    .exp-section,
    .pub-section,
    .teach-section {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        padding-right: clamp(16px, 4vw, 32px);
        padding-left: clamp(16px, 4vw, 32px);
    }

    .academic-container,
    .awards-grid,
    .pub-grid {
        width: 100%;
        max-width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .academic-box,
    .award-box,
    .exp-card,
    .pub-box,
    .sup-table-card,
    .teach-card {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .academic-header,
    .awards-header,
    .exp-header-info,
    .pub-header-wrapper {
        max-width: 100%;
        flex-wrap: wrap;
    }
}

/* Phone layout: stack page cards and keep long controls inside the viewport. */
@media (max-width: 600px) {
    .navbar {
        padding-right: 7px;
        padding-left: 7px;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-links li a {
        padding: 7px 8px;
        font-size: 10px;
        letter-spacing: 0.45px;
    }

    .academic-section,
    .awards-section,
    .exp-section,
    .pub-section,
    .teach-section {
        padding: 30px 16px 40px;
    }

    .academic-container,
    .awards-grid,
    .pub-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .academic-box,
    .award-box,
    .exp-card,
    .pub-box,
    .sup-table-card,
    .teach-card {
        width: 100%;
    }

    .academic-header,
    .awards-header,
    .exp-header-info,
    .pub-header-wrapper {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }

    .tab-container {
        max-width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tab-container::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        flex: 0 0 auto;
    }

    .filter-pagination-bar {
        max-width: 100%;
        flex-wrap: wrap;
    }

    .search-box,
    .search-box input {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .pagination-nav {
        max-width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .section-divider {
        margin-bottom: 24px;
    }

    .footer-copyright,
    .developer-credit {
        overflow-wrap: anywhere;
    }
}

/* Final phone overrides: keep the page-specific desktop grids from leaking into mobile. */
@media only screen and (max-width: 600px) {
    html,
    body {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body > * {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
    }

    body > .navbar,
    body > .academic-section,
    body > .awards-section,
    body > .exp-section,
    body > .pub-section,
    body > .teach-section,
    body > .section-divider,
    body > .site-footer {
        align-self: stretch;
        width: 100%;
        max-width: 100%;
    }

    .navbar {
        display: flex;
        min-width: 0;
        justify-content: flex-start !important;
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
    }

    .nav-links {
        flex: 0 0 auto !important;
        width: max-content !important;
        min-width: max-content !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
    }

    .nav-links li,
    .nav-links li a {
        flex: 0 0 auto !important;
        white-space: nowrap;
    }

    .academic-section .academic-container,
    .awards-section .awards-grid,
    .pub-section .pub-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100%;
        max-width: 100%;
    }

    .academic-section .academic-box,
    .awards-section .award-box,
    .exp-section .exp-card,
    .pub-section .pub-box,
    .pub-section .sup-table-card,
    .teach-section .teach-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow-wrap: anywhere;
    }

    .academic-section .section-title,
    .awards-section .section-title,
    .exp-section .section-title,
    .pub-section .section-title,
    .teach-section .section-title {
        max-width: 100%;
        font-size: clamp(1.2rem, 5vw, 1.8rem);
        line-height: 1.25;
        letter-spacing: 0.04em;
        overflow-wrap: anywhere;
    }
}

/* Keep the academic cap icons on either side of the title on small screens. */
@media (max-width: 900px) {
    .academic-section .section-title {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        gap: clamp(6px, 1.4vw, 12px);
        font-size: clamp(1.25rem, 4vw, 2rem);
        white-space: nowrap;
    }

    .academic-section .section-title .cap-icon {
        flex: 0 0 auto;
        font-size: clamp(1.4rem, 4.6vw, 2rem);
    }
}

@media (max-width: 600px) {
    .academic-section .section-title {
        gap: clamp(4px, 1.2vw, 8px);
        font-size: clamp(0.68rem, 3.7vw, 1.2rem);
        line-height: 1.15;
        letter-spacing: 0.02em;
    }

    .academic-section .section-title .cap-icon {
        font-size: clamp(0.9rem, 4.4vw, 1.35rem);
    }
}

/* Keep the Teaching page badges beside its title on phones and tablets. */
@media (max-width: 900px) {
    .teach-section .pub-header-wrapper {
        display: grid;
        grid-template-columns: clamp(52px, 10vw, 88px) minmax(0, 1fr) clamp(52px, 10vw, 88px);
        align-items: center;
        gap: clamp(5px, 1.4vw, 12px);
    }

    .teach-section .glow-circle {
        width: clamp(52px, 10vw, 88px);
        height: clamp(52px, 10vw, 88px);
        min-width: 0;
    }

    .teach-section .pub-header {
        min-width: 0;
        padding: clamp(6px, 1.5vw, 16px);
    }

    .teach-section .section-title {
        font-size: clamp(0.58rem, 2.4vw, 1.1rem);
        line-height: 1.2;
        letter-spacing: 0;
        overflow-wrap: normal;
    }

    .teach-section .section-title .icon {
        margin: 0 clamp(1px, 0.35vw, 4px);
    }

    .teach-section .count-num {
        font-size: clamp(0.78rem, 1.8vw, 1.1rem);
    }

    .teach-section .count-label {
        font-size: clamp(0.4rem, 1.1vw, 0.58rem);
        line-height: 1.15;
        letter-spacing: 0;
    }
}

@media (max-width: 420px) {
    .teach-section .pub-header-wrapper {
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        gap: 4px;
    }

    .teach-section .glow-circle {
        width: 48px;
        height: 48px;
        border-width: 2px;
    }

    .teach-section .pub-header {
        padding: 6px 3px;
    }

    .teach-section .section-title {
        font-size: clamp(0.5rem, 2.65vw, 0.7rem);
        letter-spacing: -0.01em;
    }

    .teach-section .count-num {
        font-size: 0.75rem;
    }

    .teach-section .count-label {
        font-size: 0.38rem;
    }
}

/* Home page: hero background ko footer tak extend kare */
body > #home.hero-section {
  flex: 1 0 auto;
}
.navbar {
    border-bottom: none !important;
    animation: none !important;
    box-shadow: none !important;
}
/* Normal state: koi permanent blue highlight nahi */
.navbar .nav-links li a,
.navbar .nav-links li a.active {
    color: #F5F7FA !important;
    opacity: 0.8 !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Blue effect sirf cursor link par ho tab */
.navbar .nav-links li a:hover {
    color: #ffffff !important;
    opacity: 1 !important;
    border: 1px solid rgba(0, 136, 255, 0.65) !important;
    background: rgba(0, 136, 255, 0.1) !important;
    box-shadow: 0 0 8px rgba(0, 136, 255, 0.25) inset,
                0 0 10px rgba(0, 136, 255, 0.18) !important;
    text-shadow: 0 0 6px rgba(0, 136, 255, 0.55) !important;
}
footer {
    border-top: none !important;
    margin-top: 0 !important;
}

footer::before {
    content: none !important;
    display: none !important;
}
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: page-out 120ms ease-out both;
}

::view-transition-new(root) {
    animation: page-in 220ms ease-out both;
}

@keyframes page-out {
    to { opacity: 0; }
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}