/* Animated text height fix (keep OUTSIDE sidebar rules) */

#animatedText {
    min-height: 2.75rem;
    /* ~44px */
}

@media (min-width:768px) {
    #animatedText {
        min-height: 2rem;
    }
}


/* Sticky animated top nav */

#topHeader {
    position: sticky;
    /* stays visible while scrolling */
    top: 0;
    z-index: 9999;
    transition: transform 280ms ease, box-shadow 280ms ease, background-color 280ms ease;
    will-change: transform;
}


/* When scrolling down: compact + shadow */

#topHeader.is-scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}


/* Hide on scroll down */

#topHeader.nav-hide {
    transform: translateY(-110%);
}


/* Show on scroll up */

#topHeader.nav-show {
    transform: translateY(0);
}


/* ===== Scroll reveal ===== */

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 1.05s cubic-bezier(.22, 1, .36, 1), transform .5s cubic-bezier(.22, 1, .36, 1);
}

.reveal.show {
    opacity: 1;
    transform: translateY(0);
}


/* ===== Photo card hover ===== */

.photo-card {
    transition: transform 320ms cubic-bezier(.22, 1, .36, 1), box-shadow 320ms cubic-bezier(.22, 1, .36, 1);
}

.photo-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 18px 40px rgba(2, 8, 23, .12);
}


/* Hide ABOUT heading on mobile */

@media (max-width: 767px) {
    .about-heading {
        display: none;
        margin: 0;
        padding: 0;
    }

    #about {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}


/* Projects: stagger reveal */

.proj-card {
    opacity: 0;
    transform: translateX(18px) scale(.985);
    transition: opacity .9s ease, transform .9s ease;
    will-change: opacity, transform;
}

.proj-card.in {
    opacity: 1;
    transform: translateX(0) scale(1);
}


/* Nice hover (professional) */

.proj-card:hover {
    transform: translateX(0) translateY(-4px) scale(1.01);
    box-shadow: 0 18px 40px rgba(2, 8, 23, .12);
}


/* Achievements: pop-in */

.ach-card {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .95s ease, transform .95s ease;
    will-change: opacity, transform;
}

.ach-card.in {
    opacity: 1;
    transform: translateY(0);
}


/* Badge micro-pulse on appear */

.ach-card.in .ach-badge {
    animation: badgePop .6s ease-out;
}

@keyframes badgePop {
    0% {
        transform: scale(.92);
    }

    60% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}


/* Media (image/iframe) slight float on hover */

.ach-media {
    transition: transform .45s ease;
}

.ach-card:hover .ach-media {
    transform: translateY(-3px);
}

#backToTop {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}


/* === Profile card: make footer same width as image and align together === */

.profile-card {
    width: 300px;
    margin: 0 auto;
    justify-content: right;
    /* mobile center */
}

@media (min-width: 768px) {
    .profile-card {
        margin: 0;
        /* let md:flex md:justify-end control position */
    }
}


/* footer aligned with image width */

.profile-footer {
    width: 100%;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #d1d5db;
    text-align: center;
    font-weight: 400;
    color: #111827;
}


/* === Profile rows: icon left, text right === */

.profile-item {
    display: grid;
    grid-template-columns: 20px 1fr;
    /* icon | text */
    align-items: end;
    column-gap: 12px;
    text-align: right;
    /* text aligns right */
    font-size: 0.95rem;
    color: #1f2937;
    margin: 10px 0;
}


/* === Profile name (centered, standalone) === */

.profile-name {
    margin: 0px 0 12px;
    padding-bottom: 10px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    /* subtle divider */
}


/* === Profile info rows === */


/* icon left | text right */

.profile-item {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: start;
    column-gap: 12px;
    margin: 10px 0;
    font-size: 0.95rem;
    color: #1f2937;
}


/* icon column */

.profile-item i {
    justify-self: start;
    color: #06142A;
    margin-top: 2px;
}


/* text column */

.profile-item a,
.profile-item span {
    justify-self: end;
    text-align: right;
    line-height: 1.45;
}


/* horizontal divider between profile rows */

.profile-item+.profile-item {
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
}


/* === Profile icons (centered with top & bottom lines) === */

.profile-icons {
    margin-top: 14px;
    padding: 12px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
}


/* icon links */

.profile-icons a {
    display: flex;
    align-items: center;
    padding: 0 10px;
}


/* separators */

.profile-icons a:not(:last-child) {
    border-right: 1px solid #d1d5db;
}


/* icons */

.profile-icons img {
    width: 24px !important;
    height: 24px !important;
    opacity: 0.85;
    transition: all 0.2s ease;
}

.profile-icons img:hover {
    opacity: 1;
    transform: translateY(-2px);
}


/* === Academic Status Line (Professional – Blue) === */

.status-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-top: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    line-height: 1.45;
    animation: fadeUp 0.4s ease-out both;
}


/* subtle academic badge */

.status-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}


/* main text */

.status-text {
    font-size: 14px;
    color: #1f2937;
    opacity: 0.98;
    flex: 1;
}


/* CV button (low emphasis, academic) */

.status-cta {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 10px;
    color: #1e40af;
    background: #f8fafc;
    border: 1px solid #c7d2fe;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-cta:hover {
    background: #eef2ff;
}


/* live dot — calm, non-alert */

.status-badge .live-dot {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #2563eb;
    position: relative;
}

.status-badge .live-dot::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 9999px;
    border: 5px solid rgba(37, 99, 235, 0.35);
    animation: badgePing 2s ease-out infinite;
}

.status-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
}

.status-cta {
    width: fit-content;
    /* or 100% if you want full width */
}

@keyframes badgePing {
    0% {
        transform: scale(0.6);
        opacity: 0.9;
    }

    70% {
        transform: scale(1.6);
        opacity: 0;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}


/* respect reduced motion */

@media (prefers-reduced-motion: reduce) {
    .status-badge .live-dot::after {
        animation: none;
    }
}


/* === Section header (modern academic) === */

.section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 0 2px;
}

.section-ic {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #0f172a;
    flex-shrink: 0;
}


/* icon container (modern, subtle) */

.section-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #0f172a;
    flex-shrink: 0;
}


/* section title */

.section-title {
    font-family: "Montserrat", sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: #0A3D91;
    margin: 0;
    white-space: nowrap;
}


/* horizontal rule */

.section-rule {
    height: 0.5px;
    flex: 1;
    background: #d5daee;
    transform: translateY(2px);
}


/* Modifier: compact top spacing */

.section-header--compact {
    margin-top: -10px !important;
    /* Increased reduction of top spacing */
}


/* Academic highlights carousel */

.act__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}


/* Controls */

.act__controls {
    display: flex;
    gap: 0.5rem;
}


/* more academic button style */

.act__btn {
    width: 28px;
    height: 28px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #808080;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.act__btn:hover {
    background: #f8fafc;
    border-color: #dbeafe;
    /* subtle blue-ish academic hint */
    transform: translateY(-1px);
}

.act__btn:active {
    transform: translateY(0);
}


/* Hide on mobile */

@media (max-width: 768px) {
    .act__controls {
        display: none;
    }
}


/* Track */

.act__track {
    display: flex;
    gap: 0.95rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable both-edges;
}

.act__track::-webkit-scrollbar {
    display: none;
}


/* Card */

.act__card {
    flex: 0 0 88%;
    scroll-snap-align: start;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.act__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.10);
    border-color: #dbeafe;
}

@media (min-width: 768px) {
    .act__card {
        flex-basis: 46%;
    }
}

@media (min-width: 1100px) {
    .act__card {
        flex-basis: 32%;
    }
}


/* Media */

.act__media {
    aspect-ratio: 16 / 10;
    background: #f1f5f9;
    overflow: hidden;
}

.act__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Mobile: start centered (keep your good snap behavior) */

@media (max-width: 640px) {
    .act__track {
        padding-left: 6%;
        padding-right: 6%;
        scroll-padding-left: 6%;
        scroll-padding-right: 6%;
    }

    .act__card {
        scroll-snap-align: center;
    }
}


/* Body */

.act__body {
    padding: 1rem 1.1rem 1.15rem;
}

.act__h3 {
    margin: 0 0 .35rem;
    font-size: 1rem;
    /* title should be bigger */
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
}

.act__meta {
    margin: 0;
    font-size: 0.875rem;
    /* meta should be smaller */
    color: #475569;
}


/* === Recent publications (professional) === */

.rp-ico {
    font-size: 18px;
    color: #111827;
    opacity: 0.85;
}

.rp-list {
    display: flex;
    flex-direction: column;
    text-align: justify;
    gap: 12px;
}

.rp-item {
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.rp-item p {
    margin: 0;
    line-height: 1.65;
    color: #374151;
    font-size: 15.5px;
}

.rp-item a {
    color: dodgerblue;
    text-decoration: none;
}

.rp-item a:hover {
    text-decoration: underline;
}

.rp-link {
    margin-left: 8px;
    color: #1d4ed8;
    text-decoration: none;
}

.rp-link i {
    font-size: 14px;
    transform: translateY(1px);
}


/* Mobile only */

@media (max-width: 640px) {
    .edu-line {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .edu-cgpa {
        width: 100%;
        margin-left: 22px;
        /* aligns under text, not icon */
    }
}


/* ===== Stable typewriter container (NO layout shift) ===== */

.tw-slot {
    position: relative;
    display: inline-block;
    vertical-align: baseline;
}


/* Reserves space in layout, but invisible */

.tw-reserve {
    visibility: hidden;
    display: inline-block;
    white-space: normal;
    /* wraps like real text */
}


/* Animated text overlays the reserved space, doesn't affect layout */

.tw-anim {
    position: absolute;
    inset: 0;
    display: inline-block;
    white-space: normal;
    pointer-events: none;
}


/* Mobile safety against subpixel reflow */

@media (max-width: 1980px) {
    .tw-slot {
        max-width: 100%;
    }

    .tw-reserve,
    .tw-anim {
        word-break: break-word;
    }
}


/* Desktop: keep the animated phrase on the same line */

@media (min-width: 1024px) {

    .tw-slot,
    .tw-reserve,
    .tw-anim {
        white-space: nowrap !important;
        word-break: normal !important;
    }
}


/* Mobile layout ONLY for the status card */

@media (max-width: 640px) {
    .status-card {
        display: grid;
        /* override your flex on mobile */
        grid-template-columns: 1fr;
        /* single column */
        gap: 10px;
        align-items: start;
    }

    /* Seeking badge goes to the TOP */
    .status-card .status-badge {
        justify-self: start;
        order: 1;
    }

    /* Text stays in the MIDDLE */
    .status-card .status-text {
        order: 2;
        line-height: 1.35;
    }

    .status-card .status-text p {
        margin: 0 0 2px 0;
    }

    /* CV button goes to BOTTOM-LEFT */
    .status-card .status-cta {
        justify-self: start;
        order: 3;
    }
}


/* Mobile-only spacing fix so image doesn't stick to top */

@media (max-width: 640px) {
    #about {
        padding-top: 1.25rem;
        /* space below mobile navbar */
    }
}