﻿@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

a {
    text-decoration: none;
}

/* ============================================================================
   HEADER
   ============================================================================ */
.header {
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
    display: flex;
    justify-content: right;
    background-color: #0d1117;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-bottom: 2px solid #30363d;
    position: relative;
    z-index: 1000;
}

.nav {
    margin: 5px 5%;
}

.nav .menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav li {
    display: inline;
    margin: 10px;
}

.nav a {
    color: #e2e8f0;
    font-size: 1em;
    display: inline-block;
    transition: color 0.25s ease, transform 0.25s ease;
    text-decoration: none;
}

.nav a:hover {
    color: #0ea5e9;
    transform: translateY(-2px);
}

.nav a.nav-active {
    color: #0ea5e9;
    font-weight: 700;
}

/* Hide checkbox and label by default (desktop) */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
    font-size: 1.8em;
    color: #e2e8f0;
    padding: 10px;
    user-select: none;
}

/* ============================================================================
   FOOTER - UNIFIED MODERN DESIGN
   ============================================================================ */
footer {
    background-color: #0f172a;
    color: #ffffff;
    padding: 3em 2em 1.5em;
    width: 100%;
    margin-top: auto;
}

/* Footer Content Container */
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3em;
    padding-bottom: 2em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Email Section (Get In Touch) */
footer .email,
footer .footer-content .email {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

footer .email h1,
footer .email h3,
footer .footer-content .email h3 {
    font-size: 1.8em;
    margin: 0 0 0.5em 0;
    color: #ffffff;
    font-weight: 600;
}

footer .email p,
footer .footer-content .email p {
    font-size: 1.1em;
    color: #cbd5e1;
    margin: 0.3em 0;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

footer .email p i,
footer .footer-content .email p i {
    color: #0ea5e9;
    font-size: 1.2em;
    width: 24px;
    text-align: center;
}

/* Social Section (Connect With Me) */
footer .social,
footer .footer-content .social {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

footer .social h3,
footer .footer-content .social h3 {
    font-size: 1.8em;
    margin: 0 0 0.5em 0;
    color: #ffffff;
    font-weight: 600;
}

/* Social Links Container */
footer .social-links,
footer .social {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
}

/* Social Icons */
footer .social a,
footer .social-links a,
footer a.fa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: #0ea5e9;
    color: #ffffff;
    border-radius: 50%;
    font-size: 1.4em;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

footer .social a:hover,
footer .social-links a:hover,
footer a.fa:hover {
    background-color: #0284c7;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

/* Ensure icons are centered */
footer .social a i,
footer .social-links a i {
    line-height: 1;
}

/* Credit Section (Copyright) */
footer .credit,
footer > .credit {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 1.5em;
    margin: 0;
}

footer .credit p {
    font-size: 1em;
    color: #94a3b8;
    margin: 0;
}

/* Support for old structure (without footer-content wrapper) */
footer:not(:has(.footer-content)) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    align-items: start;
}

footer:not(:has(.footer-content)) .email {
    grid-column: 1 / 2;
    justify-self: center;
}

footer:not(:has(.footer-content)) .social {
    grid-column: 2 / 3;
    justify-self: start;
}

footer:not(:has(.footer-content)) .credit {
    grid-column: 1 / span 2;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5em;
    margin-top: 1em;
}

/* ============================================================================
   MOBILE STYLES
   ============================================================================ */
@media only screen and (max-width: 768px) {
    /* Header Mobile */
    .header {
        justify-content: space-between;
        padding: 1em 5%;
    }

    .nav-toggle-label {
        display: block;
        position: relative;
        z-index: 1001;
    }

    .nav .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #161b22;
        text-align: center;
        position: absolute;
        top: 100%;
        left: 0;
        padding: 1em 0;
        margin: 0;
        box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);
        border-top: 2px solid #30363d;
    }

    .nav li {
        display: block;
        margin: 15px 0;
    }

    .nav a {
        font-size: 1.2em;
        display: block;
        padding: 10px 20px;
    }

    .nav a:hover {
        background: rgba(14, 165, 233, 0.2);
        color: #0ea5e9;
        transform: none;
    }

    .nav-toggle:checked ~ .menu {
        display: flex;
        animation: fadeIn 0.3s ease-in-out forwards;
    }

    /* Footer Mobile */
    footer,
    footer:not(:has(.footer-content)) {
        padding: 2em 1.5em 1em;
    }

    .footer-content,
    footer:not(:has(.footer-content)) {
        grid-template-columns: 1fr;
        gap: 2em;
    }

    footer .email,
    footer .footer-content .email,
    footer:not(:has(.footer-content)) .email {
        justify-self: start;
        grid-column: 1;
    }

    footer .social,
    footer .footer-content .social,
    footer:not(:has(.footer-content)) .social {
        justify-self: start;
        grid-column: 1;
    }

    footer .credit,
    footer > .credit,
    footer:not(:has(.footer-content)) .credit {
        grid-column: 1;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1.5em;
        margin-top: 1em;
        text-align: center;
    }

    footer .email h1,
    footer .email h3,
    footer .footer-content .email h3 {
        font-size: 1.5em;
    }

    footer .social h3,
    footer .footer-content .social h3 {
        font-size: 1.5em;
    }

    footer .email p,
    footer .footer-content .email p {
        font-size: 1em;
    }

    footer .social a,
    footer .social-links a,
    footer a.fa {
        width: 45px;
        height: 45px;
        font-size: 1.2em;
    }
}

/* Desktop: hide hamburger */
@media (min-width: 769px) {
    .nav-toggle,
    .nav-toggle-label {
        display: none;
    }
}

/* Tablet adjustments */
@media only screen and (max-width: 1024px) and (min-width: 769px) {
    .footer-content {
        gap: 2em;
    }
}

/* Ensure footer stays at bottom */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ============================================================================
   SCROLL REVEAL ANIMATION — applies to any element JS marks with data-animate
   ============================================================================ */
@keyframes reveal-fade-up {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-animate].in-view {
    animation: reveal-fade-up 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94)
               var(--anim-delay, 0ms) both;
}

@media (prefers-reduced-motion: reduce) {
    [data-animate].in-view {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================================================
   SCROLL PROGRESS BAR
   ============================================================================ */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #0ea5e9 0%, #7c3aff 60%, #ec4899 100%);
    z-index: 9999;
    border-radius: 0 2px 2px 0;
    pointer-events: none;
    transition: width 0.08s linear;
}

/* ============================================================================
   BACK TO TOP BUTTON
   ============================================================================ */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 46px;
    height: 46px;
    background: #0ea5e9;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.45);
    opacity: 0;
    transform: translateY(16px) scale(0.85);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease,
                box-shadow 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

#back-to-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#back-to-top:hover {
    background: #0284c7;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.55);
}

/* ============================================================================
   UNIVERSAL HOVER ANIMATIONS
   Applies smooth transitions to all interactive card elements across every page.
   ============================================================================ */

/* Cards that lift on hover */
.role-card,
.capability-category,
.event-card,
.event-type,
.mission-card,
.component-card,
.management-card,
.challenge-card,
.milestone-card,
.pm-card,
.team-card,
.facility-card,
.spec-card,
.leed-card,
.leed-summary-item,
.test-result,
.subsystem-box,
.phase-item,
.goal-item,
.takeaway-item,
.evolution-item,
.achievement-box,
.stat-card,
.achievement-item,
.spec-category,
.cta-stat,
.badge-item,
.certificate-image,
.overview-stats .stat-box,
.pillar {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.role-card:hover,
.event-card:hover,
.mission-card:hover,
.component-card:hover,
.management-card:hover,
.challenge-card:hover,
.pm-card:hover,
.team-card:hover,
.facility-card:hover,
.spec-card:hover,
.leed-card:hover,
.leed-summary-item:hover,
.test-result:hover,
.subsystem-box:hover,
.phase-item:hover,
.goal-item:hover,
.takeaway-item:hover,
.evolution-item:hover,
.achievement-box:hover,
.stat-card:hover,
.achievement-item:hover,
.spec-category:hover,
.cta-stat:hover,
.badge-item:hover,
.certificate-image:hover,
.overview-stats .stat-box:hover,
.pillar:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

/* Gallery items: lift card + zoom image */
.gallery-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.gallery-item img {
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

/* Hero and overview images: subtle zoom */
.hero-image img,
.overview-image img,
.philosophy-image img,
.rover-image img,
.drill-image img {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-image img:hover,
.overview-image img:hover,
.philosophy-image img:hover,
.rover-image img:hover,
.drill-image img:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.55);
}

/* CTA / nav link hover (already has color transition — add scale) */
.cta-link {
    transition: color 0.25s ease, transform 0.25s ease, background 0.25s ease !important;
}

.cta-link:hover {
    transform: translateY(-2px) !important;
}

/* ============================================================================
   MOBILE TOUCH TARGETS — ensure all interactive elements are 44px+ tall
   ============================================================================ */
@media (max-width: 768px) {
    .btn,
    .card-link,
    .nav a,
    .cta-link,
    .card-link,
    footer .social a,
    footer .social-links a {
        min-height: 44px;
    }

    /* Prevent horizontal overflow on all pages */
    body {
        overflow-x: hidden;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    /* Center content on mobile */
    .hero-text,
    .rp-hero-inner,
    .overview-text,
    .about-text {
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* Ensure text scales well on very small screens */
    h1 { font-size: clamp(1.8rem, 7vw, 2.5rem); }
    h2 { font-size: clamp(1.4rem, 6vw, 2rem); }
    h3 { font-size: clamp(1.1rem, 5vw, 1.5rem); }

    /* Stack all flex/grid layouts */
    .stats-grid,
    .cards-grid,
    .skills-categories,
    .expertise-cards,
    .experience-grid,
    .impact-content,
    .role-cards {
        grid-template-columns: 1fr !important;
    }
}
