/* Start Variables */

:root {
    --primary: #4A90E2;
    --primary-light: #7FBFFF;
    --dark: #1A202C;
    --darker: #0F111A;
    --light: #F0F4F8;
    --gray: #9AAABF;
    --gradient: linear-gradient(135deg, #4A90E2 0%, #306ABF 100%);
}

/* Start Global Rules */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    scroll-behavior: smooth;
    background-color: var(--darker);
    color: var(--light);
    position: relative;
    line-height: 1.6;
    overflow-x: hidden;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
}

header,
section {
    padding: 8rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

section {
    margin-bottom: 4rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--light);
    font-size: 1.5rem;
    cursor: pointer;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 4px;
    bottom: -10px;
    left: 0;
    background: var(--primary);
    border-radius: 2px;
}

::selection {
    background-color: var(--primary);
    color: var(--dark);
}

/* NavBar */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(26, 32, 44, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    z-index: 1000;
    border-bottom: 1px solid rgba(240, 244, 248, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-50px);
    animation: fadeInDown 1s forwards;
    animation-delay: 0.3s;
}

@keyframes fadeInDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-logo {
    font-weight: 700;
    font-size: 1.5rem;
    background: #4A90E2;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--light);
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
}

nav a:hover {
    color: var(--primary-light);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: var(--primary);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
    height: 3px;
}

.github-btn i {
    font-size: 1.5rem;
}

/* Header - (Hero) */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-content {
    max-width: 600px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.2rem;
    line-height: 1.2;
}

.hero h1 span {
    background: var(--primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--gray);
    margin-bottom: 2rem;
    max-width: 500px;
}

.typewriter {
    font-size: 1.25rem;
    color: var(--primary-light);
    margin-bottom: 2ch;
    height: 1.5em;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.4);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.6);
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    margin-left: 1rem;
}

.btn-outline:hover {
    background: rgba(74, 144, 226, 0.1);
}

.profile-pic {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 20px;
    border: 5px solid rgba(74, 144, 226, 0.5);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    transition: all 0.5s ease;
    position: absolute;
    right: 5%;
    top: 30%;
    transform: translateY(-50%);
}

.profile-pic:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.5);
}

/* About Us */

.about-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--gray);
}

.about-illustration {
    flex: 1;
    text-align: center;
}

.about-illustration img {
    max-width: 100%;
    height: auto;
}

/* Skills */

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.skill-box {
    background: rgba(26, 32, 44, 0.7);
    border: 1px solid rgba(240, 244, 248, 0.2);
    padding: 2rem 1rem;
    text-align: center;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.skill-box:hover {
    transform: translateY(-10px);
    background: rgba(74, 144, 226, 0.15);
    border-color: var(--primary-light);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.skill-box i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.skill-box h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Portfolio */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: rgba(26, 32, 44, 0.7);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(240, 244, 248, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-light);
}

/* Image wrapper: preserves natural aspect ratio */
.project-image-wrapper {
    width: 100%;
    overflow: hidden;
    background: rgba(15, 17, 26, 0.6);
    border-bottom: 1px solid rgba(240, 244, 248, 0.1);
}

.project-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.project-card:hover .project-image {
    transform: scale(1.03);
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.project-info p {
    color: var(--gray);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: rgba(74, 144, 226, 0.2);
    color: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    color: var(--light);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.3s ease;
}

.project-links a:hover {
    color: var(--primary-light);
}

/* Portfolio Badge */
.project-card {
    position: relative;
}

.project-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 100px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

.hidden-project {
    display: none;
    opacity: 0;
}

/* Keyframe: card flies in from below with a spring feel */
@keyframes cardReveal {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.88) rotateX(8deg);
        filter: blur(4px);
    }

    60% {
        opacity: 1;
        transform: translateY(-6px) scale(1.02) rotateX(0deg);
        filter: blur(0px);
    }

    80% {
        transform: translateY(3px) scale(0.99);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

/* Keyframe: card slides out smoothly */
@keyframes cardHide {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }

    100% {
        opacity: 0;
        transform: translateY(30px) scale(0.92);
        filter: blur(3px);
    }
}

.hidden-project.show-animate {
    display: block;
    animation: cardReveal 0.65s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.hidden-project.hide-animate {
    animation: cardHide 0.38s ease-in both;
}

.project-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.6s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Portfolio Toggle */
.portfolio-toggle {
    text-align: center;
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.btn-toggle-projects {
    background: transparent;
    color: var(--primary-light);
    border: 2px solid var(--primary);
    padding: 0.75rem 2.2rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    font-family: 'Poppins', sans-serif;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn-toggle-projects::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 0;
    border-radius: 50px;
}

.btn-toggle-projects:hover::before {
    opacity: 1;
}

.btn-toggle-projects span,
.btn-toggle-projects i {
    position: relative;
    z-index: 1;
}

.btn-toggle-projects:hover {
    color: #fff;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(74, 144, 226, 0.45);
}

.btn-toggle-projects:active {
    transform: translateY(-1px);
}

.btn-toggle-projects i {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 0.85rem;
}

.btn-toggle-projects.expanded i {
    transform: rotate(180deg);
}

.projects-counter {
    color: var(--gray);
    font-size: 0.85rem;
}

/* Quote-card */

.quote-card {
    background: rgba(26, 32, 44, 0.7);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    border: 1px solid rgba(74, 144, 226, 0.5);
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.quote-card::before {
    content: '"';
    position: absolute;
    font-size: 10rem;
    color: rgba(74, 144, 226, 0.1);
    top: -3rem;
    left: -1rem;
    line-height: 1;
    z-index: 0;
}

.quote-card p {
    font-size: 1.25rem;
    font-style: italic;
    position: relative;
    z-index: 1;
}

.quote-card .author {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--primary-light);
}

/* My Services */

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: rgba(26, 32, 44, 0.7);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid rgba(240, 244, 248, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.testimonial-text {
    color: var(--gray);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-card {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
}

.author-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.author-info p {
    color: var(--gray);
    font-size: 0.8rem;
}

/* Contact */

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(74, 144, 226, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-light);
}

.contact-text h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.contact-text a,
.contact-text p {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-text a:hover {
    color: var(--primary-light);
}

.contact-form {
    background: rgba(26, 32, 44, 0.7);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid rgba(240, 244, 248, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 1.5rem;
    resize: none;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(240, 244, 248, 0.1);
    background: rgba(240, 244, 248, 0.05);
    color: var(--light);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(74, 144, 226, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* Footer */

footer {
    background: rgba(26, 32, 44, 0.8);
    padding: 1rem 5%;
    text-align: center;
    border-top: 1px solid rgba(240, 244, 248, 0.1);
    position: relative;
    z-index: 10;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 11;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(240, 244, 248, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light);
    transition: all 0.3s ease;
    position: relative;
    z-index: 13;
    text-decoration: none;
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.copyright {
    color: var(--gray);
    font-size: 0.9rem;
}

.copyright a {
    color: inherit;
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding-bottom: 0.05em;
}

.copyright a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0em;
    width: 0;
    height: 3px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.copyright a:hover::after {
    width: 100%;
}

#SendError {
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
}

/* Responsive */
@media (max-width: 992px) {

    body,
    html {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }

    header,
    section {
        padding: 2rem 3%;
        margin: 0 auto;
    }

    .about-content {
        flex-direction: column;
    }

    .profile-pic {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin: 2rem auto;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }

    .hero {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: 2rem 3%;
        padding-top: 80px;
    }

    .profile-pic {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin: 2rem auto 0 auto;
        width: 250px;
        height: 250px;
    }

    .hero-content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--dark);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3rem;
        transition: all 0.5s ease;
    }

    .nav-links.active {
        left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    header,
    section {
        padding: 6rem 5%;
    }

    .hero {
        margin-top: 20px;
    }
}

@media (max-width: 576px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .btn-outline {
        margin-left: 0;
    }

    /* Portfolio mobile */
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-info {
        padding: 1rem;
    }

    .project-info h3 {
        font-size: 1.1rem;
    }

    .tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }

    .project-links {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .project-links a {
        font-size: 0.85rem;
    }

    .btn-toggle-projects {
        width: 100%;
        justify-content: center;
        font-size: 0.9rem;
    }
}

@media (min-width: 577px) and (max-width: 992px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* ---------- Background Wrapper ---------- */
.bg-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--darker) 0%, #1a202c 50%, var(--darker) 100%);
    opacity: 0.8;
    opacity: 0.8;
}

.bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(127, 191, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    background-size: 100px 100px;
    animation: float 20s ease-in-out infinite;
}

.bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.bg-shape {
    position: absolute;
    background: var(--primary-light);
    opacity: 0.1;
    border-radius: 50%;
    animation: drift 15s linear infinite;
}

.bg-shape-1 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.bg-shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 20%;
    animation-delay: 5s;
    background: var(--light);
}

.bg-shape-3 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 30%;
    animation-delay: 10s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

@keyframes drift {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(100px, -100px) rotate(360deg);
    }
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 32, 44, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.dots {
    display: flex;
    gap: 10px;
}

.dots span {
    width: 15px;
    height: 15px;
    background: #4A90E2;
    border-radius: 50%;
    animation: bounce 0.6s infinite alternate;
}

.dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-20px);
    }
}