/* --------------------------
   Global Body
--------------------------- */
body {
    margin: 0;
    font-family: "Space Mono", monospace;
    background: #fff;
    color: #111;
}

/* --------------------------
   Navigation
--------------------------- */
header {
    position: absolute;
    top: 20px;
    right: 40px;
    z-index: 10;
}
nav a {
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #111;
    position: relative;
}
nav a::after {
    content: "";
    display: block;
    height: 2px;
    width: 0;
    background: currentColor;
    transition: width 0.3s ease;
    position: absolute;
    bottom: -4px;
    left: 0;
}
nav a:hover::after {
    width: 100%;
}

/* --------------------------
   Hero Section Base
--------------------------- */
.hero,
.hero-404,
.hero-contact,
.hero-portfolio,
.hero-blog,
.hero-blogs,
.hero-hire {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    position: relative;
    overflow: hidden;

    background: linear-gradient(
        135deg,
        #ffffff,
        #e6e9ff,
        #ffe6f9,
        #e6fff9,
        #f9e6ff,
        #fff9e6
    );
    background-size: 600% 600%;
    animation: gradientShift 15s ease infinite;
}

.hero h1,
.hero-404 h1,
.hero-contact h1,
.hero-portfolio h1,
.hero-blog h1,
.hero-blogs h1,
.hero-hire h1 {
    font-weight: 800;
    letter-spacing: 3px;
    color: #111;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    margin: 0 0 1rem;
    position: relative;
    z-index: 2;
}

.hero p,
.hero-404 p,
.hero-contact p,
.hero-portfolio p,
.hero-blog p,
.hero-blogs p,
.hero-hire p {
    font-weight: 300;
    color: rgba(17, 17, 17, 0.8);
    margin: 0;
    position: relative;
    z-index: 2;
}

/* --------------------------
   Pearlescent shimmer overlay
--------------------------- */
.hero::before,
.hero-404::before,
.hero-contact::before,
.hero-portfolio::before,
.hero-blog::before,
.hero-blogs::before,
.hero-hire::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
            circle at 20% 30%,
            rgba(255, 255, 255, 0.4),
            transparent 60%
        ),
        radial-gradient(
            circle at 80% 50%,
            rgba(255, 255, 255, 0.3),
            transparent 70%
        ),
        radial-gradient(
            circle at 50% 80%,
            rgba(255, 255, 255, 0.35),
            transparent 65%
        );
    background-size: 200% 200%;
    animation: shimmer 20s ease-in-out infinite;
    mix-blend-mode: screen;
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

/* --------------------------
   Printstream overlay
--------------------------- */
.hero .stream-overlay,
.hero-404 .stream-overlay,
.hero-contact .stream-overlay,
.hero-portfolio .stream-overlay,
.hero-blog .stream-overlay,
.hero-blogs .stream-overlay,
.hero-hire .stream-overlay{
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(
            45deg,
            rgba(0, 0, 0, 0.05) 0,
            rgba(0, 0, 0, 0.05) 1px,
            transparent 1px,
            transparent 20px
        ),
        radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.07), transparent 70%),
        radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.05), transparent 70%);
    background-size: auto, 50% 50%, 60% 60%;
    z-index: 1;
}

/* --------------------------
   Moving stream line
--------------------------- */
.hero::after,
.hero-404::after,
.hero-contact::after,
.hero-portfolio::after,
.hero-blog::after,
.hero-blogs::after,
.hero-hire::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -50%;
    width: 200%;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(2deg);
    animation: movingStream 15s linear infinite;
    z-index: 1;
}

/* --------------------------
   Scroll hint (shared)
--------------------------- */
.scroll-hint {
    position: absolute;
    bottom: 20px;
    font-size: 1.5rem;
    opacity: 0.6;
    animation: bounce 2s infinite;
    z-index: 2;
}

/* --------------------------
   Hero Cross Trail
--------------------------- */
.hero-cross {
    position: absolute;
    font-size: 2rem;
    pointer-events: none;
    z-index: 2;
    user-select: none;
    font-weight: 900;
    background: linear-gradient(
        45deg,
        #ff7eb9,
        #ffb347,
        #fef65b,
        #8cf178,
        #5edfff,
        #8a85ff,
        #ff8af4
    );
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: crossShimmer 5s ease-in-out infinite;
}

/* --------------------------
   Cards / Services Reusable
--------------------------- */
.card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    background: linear-gradient(45deg, #e6e9ff, #ffe6f9, #e6fff9);
    opacity: 0.08;
    z-index: -1;
    border-radius: 12px;
}

.service-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.card:hover .service-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(0, 200, 255, 0.6));
}

/* --------------------------
   Carousel / Lightbox Reusable
--------------------------- */
.carousel-wrapper {
    overflow: hidden;
    width: 100%;
}

.carousel-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    cursor: pointer;
}

.lightbox img.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0, 200, 255, 0.5);
}

.lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

/* --------------------------
   Footer
--------------------------- */
footer {
    position: relative;
    padding: 2rem;
    text-align: center;
    background: #111;
    color: #fff;
    overflow: hidden;
    border-top: 6px solid;
    border-image-slice: 1;
    border-image-source: linear-gradient(
        270deg,
        #ffb6c1,
        #a8c6ff,
        #90ffe0,
        #fff590,
        #d0a0ff,
        #ffb6c1
    );
    border-image-repeat: stretch;
    animation: pastelRainbowSlide 10s linear infinite;
}

footer p {
    position: relative;
    z-index: 1;
    margin: 0;
}

.footer-pattern img {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2));
}

/* Hover animation */
.footer-pattern img:hover {
    transform: scale(1.2);
    animation: pearlescentGlow 1.5s infinite alternate;
}

.footer-pattern img:nth-child(odd) {
    animation-delay: 0s;
}

.footer-pattern img:nth-child(even) {
    animation-delay: 3s;
}

.hero-text.typing::after {
    content: "|";
    display: inline;
    animation: blink 1s steps(2, start) infinite;
    color: cyan;
}

/* --------------------------
   Global Keyframes
--------------------------- */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes shimmer {
    0%,
    100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
}

@keyframes movingStream {
    0% {
        left: -50%;
        opacity: 0;
    }
    50% {
        left: 50%;
        opacity: 0.6;
    }
    100% {
        left: 150%;
        opacity: 0;
    }
}

@keyframes bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(6px);
    }
}

@keyframes crossShimmer {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

@keyframes scrollCarousel {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes pastelRainbowSlide {
    0% {
        border-image-source: linear-gradient(
            270deg,
            #ffb6c1,
            #a8c6ff,
            #90ffe0,
            #fff590,
            #d0a0ff,
            #ffb6c1
        );
    }
    50% {
        border-image-source: linear-gradient(
            270deg,
            #90ffe0,
            #fff590,
            #d0a0ff,
            #ffb6c1,
            #a8c6ff,
            #90ffe0
        );
    }
    100% {
        border-image-source: linear-gradient(
            270deg,
            #ffb6c1,
            #a8c6ff,
            #90ffe0,
            #fff590,
            #d0a0ff,
            #ffb6c1
        );
    }
}

@keyframes floatFooter {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes blink {
    0%,
    50% {
        opacity: 1;
    }
    50.1%,
    100% {
        opacity: 0;
    }
}

@keyframes glowFloat {
    0% {
        text-shadow: 0 0 4px #fff, 0 0 8px #ff7eb9, 0 0 12px #5edfff;
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        text-shadow: 0 0 8px #fff, 0 0 16px #ffb347, 0 0 24px #8a85ff;
        transform: translate(-50%, -55%) scale(1.1);
    }
    100% {
        text-shadow: 0 0 4px #fff, 0 0 8px #fef65b, 0 0 12px #8cf178;
        transform: translate(-50%, -60%) scale(1);
        opacity: 0;
    }
}

@keyframes pearlescentGlow {
    0% {
        filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2))
            drop-shadow(0 0 1px rgba(255, 200, 255, 0.1))
            drop-shadow(0 0 1px rgba(150, 200, 255, 0.1));
    }
    50% {
        filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3))
            drop-shadow(0 0 2px rgba(255, 200, 255, 0.15))
            drop-shadow(0 0 2px rgba(150, 200, 255, 0.15));
    }
    100% {
        filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2))
            drop-shadow(0 0 1px rgba(255, 200, 255, 0.1))
            drop-shadow(0 0 1px rgba(150, 200, 255, 0.1));
    }
}

@media (max-width: 1200px) {
    nav a {
        margin-left: 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 992px) {
    header {
        right: 20px;
        top: 15px;
    }

    nav a {
        margin-left: 1rem;
        font-size: 0.85rem;
    }

    .hero h1,
    .hero-404 h1,
    .hero-contact h1,
    .hero-portfolio h1,
    .hero-blog h1,
    .hero-blogs h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .hero p,
    .hero-404 p,
    .hero-contact p,
    .hero-portfolio p,
    .hero-blog p,
    .hero-blogs p {
        font-size: 0.9rem;
    }

    .scroll-hint {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    nav a {
        margin-left: 0.8rem;
        font-size: 0.8rem;
    }

    header {
        right: 10px;
        top: 10px;
    }

    .hero h1,
    .hero-404 h1,
    .hero-contact h1,
    .hero-portfolio h1,
    .hero-blog h1,
    .hero-blogs h1 {
        font-size: 1.8rem;
    }

    .hero p,
    .hero-404 p,
    .hero-contact p,
    .hero-portfolio p,
    .hero-blog p,
    .hero-blogs p {
        font-size: 0.85rem;
    }

    .scroll-hint {
        font-size: 1rem;
    }

    .cards,
    .projects-grid,
    .open-source-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card,
    .project-card,
    .open-source-card {
        width: 100%;
    }

    .service-icon {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 576px) {
    nav {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }

    header {
        right: 10px;
        top: 5px;
    }

    .hero h1,
    .hero-404 h1,
    .hero-contact h1,
    .hero-portfolio h1,
    .hero-blog h1,
    .hero-blogs h1 {
        font-size: 1.5rem;
    }

    .hero p,
    .hero-404 p,
    .hero-contact p,
    .hero-portfolio p,
    .hero-blog p,
    .hero-blogs p {
        font-size: 0.8rem;
    }

    .scroll-hint {
        font-size: 0.9rem;
    }

    .hero-cross {
        font-size: 1.5rem;
    }

    .footer-pattern img {
        width: 20px;
        height: 20px;
    }
}
