/* =========================
   Dr. Abdul Wahid Baloch — Portfolio
   Full homepage stylesheet
   ========================= */

:root {
    --navy: #16324F;
    --navy-deep: #1e293b;
    --blue: #0088ff;
    --purple: #6610f0;
    --gold: #D6A84F;
    --ink: #34475d;
    --muted: #52657b;
    --hero-bg: #F5F7FA;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #121212;
    color: #F5F7FA;
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-bottom: 2px solid #0055ff;
    background:  #2f304a;
    animation: blueBorderPulse 2s infinite alternate;
}

.nav-links {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 15px;
    list-style: none;
}

.nav-links li a {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #F5F7FA;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.84;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.nav-links li a:hover,
.nav-links li a.active {
    border-color: rgba(0, 136, 255, 0.55);
    background: rgba(0, 136, 255, 0.12);
    box-shadow: 0 0 10px rgba(0, 136, 255, 0.3) inset;
    color: var(--white);
    opacity: 1;
    text-shadow: 0 0 8px var(--blue);
}

/* Hero layout */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(36px, 5vw, 72px);
    min-height: 0;
    padding: 56px max(6%, calc((100% - 1240px) / 2));
    background: var(--hero-bg);
}

.hero-content {
    flex: 1 1 500px;
    width: 100%;
    max-width: 720px;
    min-width: 0;
    padding: 0;
}

.prof-name,
.prof-title,
.prof-dept {
    position: relative;
}

.prof-name {
    margin-bottom: 14px;
    padding-bottom: 13px;
    color: var(--navy);
    font-size: clamp(2.05rem, 3.5vw, 2.85rem);
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 1.1;
    overflow-wrap: break-word;
    text-wrap: balance;
    animation: nameGlowDark 2.5s infinite alternate;
}

.prof-title {
    margin-bottom: 12px;
    padding-bottom: 11px;
    color: var(--navy);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1.25;
}

.prof-dept {
    margin-bottom: 28px;
    padding-bottom: 12px;
    color: var(--navy);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.75;
}

.prof-dept a {
    color: var(--purple);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.25s ease, text-shadow 0.25s ease;
}

.prof-dept a:hover {
    color: var(--navy);
    text-shadow: 0 0 8px rgba(214, 168, 79, 0.55);
}

/* Animated blue underline below the name, position, and department */
.line-glow::after {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60%;
    height: 3px;
    border-radius: 2px;
    background: var(--blue);
    box-shadow: 0 0 12px rgba(0, 136, 255, 0.72);
    content: '';
    animation: textUnderlineGlow 2s infinite alternate ease-in-out;
}

/* Introduction and research cards */
.hero-copy-card {
    max-width: 720px;
    margin-top: 16px;
    padding: 20px 22px;
    border-left: 4px solid var(--gold);
    border-radius: 0 14px 14px 0;
    background: var(--white);
    box-shadow: 0 8px 24px rgba(22, 50, 79, 0.08);
    color: var(--ink);
}

.hero-copy-heading {
    margin-bottom: 10px;
    color: var(--purple);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 1.35px;
    line-height: 1.5;
}

.hero-copy-text {
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.72;
    overflow-wrap: anywhere;
}

/* Typewriter cursor and sequential text reveal */
.typewriter-text {
    white-space: pre-wrap;
    overflow-wrap: inherit;
}

.typewriter-text.typing-active::after {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 3px;
    background: currentColor;
    content: '';
    vertical-align: -0.12em;
    animation: caretBlink 0.72s steps(1, end) infinite;
}

/* Profile photo and CV download */
.hero-image-container {
    display: flex;
    flex: 0 1 310px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.hero-profile {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
}

.hero-photo-frame {
    flex: 0 0 auto;
    width: clamp(230px, 26vw, 290px);
    aspect-ratio: 1;
    overflow: hidden;
    border: 3px solid rgba(0, 136, 255, 0.6);
    border-radius: 50%;
    animation: imageBorderGlow 3s infinite alternate;
}

.hero-img {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 50%;
    object-fit: cover;
}

.cv-download-btn {
    display: inline-flex;
    flex: 0 0 auto;
    align-self: center;
    width: 220px;
    min-width: 0;
    max-width: 100%;
    min-height: 48px;
    height: auto;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 22px;
    border: 2px solid var(--navy);
    border-radius: 999px;
    background: var(--navy);
    box-shadow: 0 8px 20px rgba(22, 50, 79, 0.18);
    color: var(--white);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cv-download-btn:hover,
.cv-download-btn:focus-visible {
    transform: translateY(-2px);
    background: var(--white);
    box-shadow: 0 10px 24px rgba(22, 50, 79, 0.22);
    color: var(--navy);
}

.cv-download-btn:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 4px;
}

.section-divider {
    width: 100%;
    margin-bottom: 50px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    box-shadow: 0 2px 10px rgba(214, 168, 79, 0.5);
}

/* Motion */
@keyframes blueBorderPulse {
    from {
        border-bottom-color: #0033aa;
        box-shadow: 0 4px 10px rgba(0, 51, 170, 0.4);
    }
    to {
        border-bottom-color: var(--blue);
        box-shadow: 0 4px 25px rgba(0, 136, 255, 0.62), 0 4px 15px rgba(0, 136, 255, 0.42);
    }
}

@keyframes textUnderlineGlow {
    from {
        width: 22%;
        opacity: 0.72;
    }
    to {
        width: 64%;
        opacity: 1;
    }
}

@keyframes nameGlowDark {
    from {
        text-shadow: 0 0 5px rgba(0, 136, 255, 0.18);
    }
    to {
        text-shadow: 0 0 15px rgba(0, 136, 255, 0.44), 0 0 20px rgba(0, 136, 255, 0.52);
    }
}

@keyframes imageBorderGlow {
    from {
        border-color: rgba(0, 136, 255, 0.4);
        box-shadow: 0 0 15px rgba(0, 136, 255, 0.2), inset 0 0 15px rgba(0, 136, 255, 0.2);
    }
    to {
        border-color: var(--blue);
        box-shadow: 0 0 36px rgba(0, 136, 255, 0.66), inset 0 0 20px rgba(0, 136, 255, 0.36);
    }
}

@keyframes caretBlink {
    50% { opacity: 0; }
}

/* Tablet and mobile */
@media (max-width: 880px) {
    .hero-section {
        flex-direction: column-reverse;
        gap: 36px;
        padding: 52px 7% 60px;
        text-align: center;
    }

    .hero-content {
        flex: 0 1 auto;
        max-width: 720px;
    }

    .line-glow::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .prof-dept {
        margin-bottom: 28px;
    }

    .hero-copy-card {
        margin-right: auto;
        margin-left: auto;
        text-align: left;
    }

    .hero-image-container {
        flex: 0 1 auto;
    }
}

@media (max-width: 480px) {
    .hero-section {
        gap: 30px;
        padding: 40px 6% 48px;
    }

    .prof-name {
        font-size: clamp(1.85rem, 8vw, 2.25rem);
        letter-spacing: 0.5px;
    }

    .prof-title {
        font-size: 1.12rem;
        letter-spacing: 1.2px;
    }

    .prof-dept {
        font-size: 0.95rem;
    }

    .hero-copy-card {
        padding: 17px 17px;
    }

    .hero-copy-text {
        font-size: 0.96rem;
        line-height: 1.68;
    }

    .hero-photo-frame {
        width: 230px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
