/* ═══════════════════════════════════════════════════════════════
   PORTFOLIO — Global Styles
   Color Palette: Warm Cream + Deep Navy + Golden Accents
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg: #F5F0E8;
    --bg-card: rgba(255, 255, 255, 0.3);
    --bg-card-hover: rgba(255, 255, 255, 0.7);
    --text: #1A1A2E;
    --text-muted: #4A4A68;
    --accent: #B8860B;
    --accent-hover: #D4A017;
    --accent-light: rgba(184, 134, 11, 0.12);
    --accent-border: rgba(184, 134, 11, 0.4);
    --pill-bg: #1A1A2E;
    --pill-text: #F5E6CA;
    --pill-hover-bg: rgba(26, 26, 46, 0.08);
    --badge-fullstack: #8B5E3C;
    --badge-python: #2D6A9F;
    --badge-rust: #CE422B;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.18);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 30px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-bounce: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", sans-serif;
    background-color: var(--bg);
    color: var(--text);
}


/* ═══════════════════════════════════════════════════════════════
   HEADER & NAVIGATION
   ═══════════════════════════════════════════════════════════════ */

.custom-header {
    position: relative;
    border-bottom: none !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    gap: 1rem;
}

.custom-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-border), transparent);
}

.brand-logo {
    font-family: "Inter", sans-serif;
    transition: color var(--transition-fast);
}

.nav-pills {
    justify-content: center;
    gap: 1rem;
}

.nav-pills .nav-link {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 500;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.nav-pills .nav-link:hover {
    color: var(--text);
    background-color: var(--pill-hover-bg);
}

.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
    background-color: var(--pill-bg) !important;
    color: var(--pill-text) !important;
    box-shadow: var(--shadow-sm);
}


/* ── Mobile Hamburger Toggle ── */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    transition: transform var(--transition-normal);
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2.5px;
    background-color: var(--text);
    border-radius: 2px;
    transition: all var(--transition-normal);
    transform-origin: center;
}

/* Hamburger → X animation */
.nav-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile backdrop */
.nav-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.nav-backdrop.active {
    display: block;
    opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════
   HERO / VIDEO SECTION
   ═══════════════════════════════════════════════════════════════ */

.intro-video-container {
    margin: 2rem 0 2rem auto;
    position: relative;
    width: 35rem;
    max-width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    user-select: none;
    -webkit-user-select: none;
    animation: float 3s ease-in-out infinite;
    transition: transform 0.35s ease;
    /* Poster fallback: always visible even before video loads */
    background-image: url('/images/preview-image.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Set a minimum aspect ratio so the container isn't 0-height before video loads */
    min-height: 300px;
}

.intro-video-container:hover {
    transform: scale(1.02);
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

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

#myVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
    will-change: transform;
    /* Start invisible — fade in once video has data */
    opacity: 0;
    transition: opacity 0.5s ease;
}

#myVideo.video-ready {
    opacity: 1;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: transparent;
}


/* ═══════════════════════════════════════════════════════════════
   ABOUT SECTION
   ═══════════════════════════════════════════════════════════════ */

.about-heading {
    font-size: clamp(2.5rem, 5vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: 2rem;
    color: var(--text);
}

.about-text {
    font-size: 1.12rem;
    line-height: 2;
    color: var(--text-muted);
    text-align: justify;
}

.about-text span {
    position: relative;
    display: inline-block;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    padding: 0 3px;
    border-radius: 4px;
    transition: all 0.25s ease;
}

.about-text span::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0px;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 10px;
    transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.about-text span:hover {
    color: var(--text);
    transform: translateY(-2px);
    background-color: var(--accent-light);
}

.about-text span:hover::after {
    width: 90%;
}


/* ── Special Highlight Badges ── */
.highlight-fullstack {
    color: var(--badge-fullstack) !important;
    background-color: rgba(139, 94, 60, 0.12) !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    border-bottom: 2px solid var(--badge-fullstack) !important;
    font-weight: 800 !important;
}

.highlight-python {
    color: var(--badge-python) !important;
    background-color: rgba(45, 106, 159, 0.12) !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    border-bottom: 2px solid var(--badge-python) !important;
    font-weight: 800 !important;
}

.highlight-fullstack:hover,
.highlight-python:hover {
    transform: translateY(-3px) scale(1.03) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.highlight-name {
    font-weight: 800;
    color: var(--text);
}

.highlight-research,
.highlight-ai {
    font-style: italic;
}


/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

.custom-footer {
    position: relative;
    padding-top: 2rem !important;
}

.custom-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-border), transparent);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.footer-icon {
    color: var(--text-muted) !important;
    display: inline-block;
    transition: transform var(--transition-bounce), color var(--transition-normal);
}

.footer-icon:hover {
    color: var(--text) !important;
    transform: translateY(-4px) scale(1.15);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}


/* ═══════════════════════════════════════════════════════════════
   CONTACT PAGE
   ═══════════════════════════════════════════════════════════════ */

.contact-card {
    border: 1px solid rgba(184, 134, 11, 0.2);
    transition: all var(--transition-bounce);
    background: var(--bg-card);
    cursor: pointer;
}

.glass-effect {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.contact-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(184, 134, 11, 0.15);
    background: var(--bg-card-hover);
    border-color: rgba(184, 134, 11, 0.5);
}


/* ═══════════════════════════════════════════════════════════════
   404 PAGE
   ═══════════════════════════════════════════════════════════════ */

.astronaut-float {
    animation: float 4s ease-in-out infinite;
}

.eyebrow-404 {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.heading-404 {
    font-family: "Inter", sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: -1px;
}

.subtext-404 {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 520px;
    margin-bottom: 32px;
    line-height: 1.7;
}

.btn-404-primary {
    display: inline-block;
    font-size: 15px;
    padding: 12px 28px;
    border: 2px solid var(--text);
    border-radius: var(--radius-sm);
    color: var(--pill-text);
    background-color: var(--pill-bg);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.btn-404-primary:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-404-secondary {
    display: inline-block;
    font-size: 15px;
    padding: 12px 28px;
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--accent);
    background-color: transparent;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.btn-404-secondary:hover {
    background-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}


/* ═══════════════════════════════════════════════════════════════
   SCROLL ANIMATIONS (fade-in on viewport entry)
   ═══════════════════════════════════════════════════════════════ */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-delay {
    transition-delay: 0.2s;
}


/* ═══════════════════════════════════════════════════════════════
   POPUP (kept from original)
   ═══════════════════════════════════════════════════════════════ */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.popup-content {
    background-color: #4fbd98;
    font-family: "Inter", sans-serif;
    color: black;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent);
}

.hidden {
    opacity: 0;
    pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 992px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 992px) {
    .intro-video-container {
        width: 100%;
        max-width: 28rem;
        margin: 1rem auto;
    }
}


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 768px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* Mobile header: brand left, hamburger right */
    .custom-header {
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .custom-header > a {
        margin-bottom: 0 !important;
        flex-shrink: 1;
        min-width: 0;
    }

    .brand-logo {
        font-size: 1.3rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Show hamburger, hide nav pills */
    .nav-toggle {
        display: flex;
        flex-shrink: 0;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 260px;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        padding: 80px 24px 24px;
        gap: 0.5rem;
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform var(--transition-normal);
    }

    .nav-menu.active {
        display: flex;
        transform: translateX(0);
    }

    .nav-pills .nav-link {
        font-size: 1.1rem;
        padding: 12px 16px;
        text-align: left;
    }

    /* Hero section */
    .about-heading {
        font-size: clamp(2rem, 8vw, 2.8rem);
        letter-spacing: -1px;
        margin-bottom: 1.5rem;
    }

    .about-text {
        font-size: 1rem;
        line-height: 1.8;
        text-align: left;
        /* Justified text looks broken on mobile */
    }

    .highlight-fullstack,
    .highlight-python {
        padding: 1px 6px !important;
    }

    /* Video */
    .intro-video-container {
        width: 100%;
        max-width: 100%;
        border-radius: 20px;
    }

    /* Footer */
    .custom-footer {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .custom-footer .nav {
        justify-content: center !important;
    }

    /* 404 page */
    .heading-404 {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
    }

    .subtext-404 {
        font-size: 14px;
        padding: 0 16px;
    }
}


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — SMALL PHONES (≤ 480px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .about-heading {
        font-size: 1.8rem;
    }

    .intro-video-container {
        border-radius: 16px;
        box-shadow: var(--shadow-md);
    }

    .btn-404-primary,
    .btn-404-secondary {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLL TO TOP BUTTON
   ═══════════════════════════════════════════════════════════════ */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-bounce);
    z-index: 1050;
}

.scroll-to-top:hover {
    background-color: var(--accent-hover);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}
