/* A pre-set font from google APIs  */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
    --primary-color: #3a6cf4;
    --secondary-color: #4e9eff;
    --accent-color: #601cfc;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --glass-border: rgba(58, 108, 244, 0.1);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.05);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

/* ----------------- Header & Nav ----------------- */
header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    width: 100%;
    position: fixed;
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10%;
    top: 0;
    transition: var(--transition);
}

.dark-mode header {
    background: rgba(15, 23, 42, 0.6);
}

.logo {
    text-decoration: none;
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: 2px;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links li a {
    color: inherit;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links li a:hover::after {
    width: 100%;
}

#theme-toggle {
    background: rgba(58, 108, 244, 0.1);
    border: 1px solid var(--glass-border);
    padding: 8px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle:hover {
    background: rgba(58, 108, 244, 0.2);
    transform: scale(1.1);
}

.hamburger {
    display: none;
    /* Hidden on PC */
}

/* ----------------- Hero Section ----------------- */
.main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 100px 10%;
    position: relative;
    background: linear-gradient(135deg, rgba(58, 108, 244, 0.05) 0%, rgba(96, 28, 252, 0.05) 100%);
}

.hero-content {
    flex: 1 1 500px;
    max-width: 650px;
    z-index: 1;
}

.hero-image {
    flex: 1 1 350px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.profile-frame {
    position: relative;
    width: 350px;
    height: 350px;
    max-width: 85vw;
    max-height: 85vw;
    border-radius: 50%;
    padding: 6px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    box-shadow: 0 20px 50px rgba(58, 108, 244, 0.35);
    animation: floatProfile 6s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    overflow: hidden;
}

@keyframes floatProfile {
    0%, 100% {
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -12px, 0);
        -webkit-transform: translate3d(0, -12px, 0);
    }
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 46%;
    background: var(--card-bg);
    border: 4px solid var(--bg-color);
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: var(--transition);
}

.profile-frame:hover {
    box-shadow: 0 25px 60px rgba(96, 28, 252, 0.5);
    transform: translate3d(0, -6px, 0) scale(1.02);
}

.main::before {
    content: '';
    position: absolute;
    top: 20%;
    right: 10%;
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    filter: blur(150px);
    opacity: 0.15;
    z-index: -1;
}

.main h2 {
    font-size: 2rem;
    font-weight: 500;
}

.main h2 span {
    display: inline;
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 800;
}

.main h3 {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 20px 0 40px;
    max-width: 600px;
}

.main-btn {
    color: #fff;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 15px 35px;
    border-radius: 50px;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(58, 108, 244, 0.2);
    border: none;
}

.main-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(58, 108, 244, 0.3);
    color: #fff;
}

.social-icons {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.social-icons a {
    color: inherit;
    font-size: 1.6rem;
    transition: var(--transition);
    opacity: 0.7;
}

.social-icons a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
    opacity: 1;
}

/* ----------------- Sections General ----------------- */
section {
    padding: 100px 10%;
}

.title {
    text-align: center;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 60px;
    color: var(--primary-color);
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ----------------- About Section ----------------- */
.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.highlight {
    color: var(--primary-color);
    font-weight: 700;
}

/* ----------------- Cards & Skills ----------------- */
.content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px 30px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card .icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.card p {
    color: var(--text-secondary);
}

/* ----------------- Projects Section ----------------- */
.projects .card {
    padding: 0;
    overflow: hidden;
    align-items: flex-start;
    text-align: left;
}

.projects .image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.projects .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.projects .card:hover .image img {
    transform: scale(1.1);
}

.projects .info {
    padding: 25px;
    width: 100%;
}

.projects .info p {
    color: var(--text-secondary);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.cards .tags {
    justify-content: center;
}

.tags span {
    background: rgba(58, 108, 244, 0.1);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-links {
    padding: 0 25px 25px;
}

/* ----------------- Contact Form ----------------- */
.form {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.form-h2 {
    text-align: center;
    margin-bottom: 10px;
}

.form-subtitle {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.03);
    border: 2px solid transparent;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1rem;
    color: inherit;
    transition: var(--transition);
}

.dark-mode .form-control {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Focused, active, and typing text in text boxes */
.form-control:focus,
.form-control:active,
.form-control:focus-visible,
.search-input:focus,
.search-input:active,
input:focus,
input:active,
input:focus-visible,
textarea:focus,
textarea:active,
textarea:focus-visible,
select:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    background-color: #1e293b !important;
    box-shadow: 0 0 0 3px rgba(58, 108, 244, 0.25) !important;
}

.dark-mode .form-control:focus,
.dark-mode .search-input:focus,
.dark-mode input:focus,
.dark-mode textarea:focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.submitbtn {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.submitbtn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(58, 108, 244, 0.3);
}

/* ----------------- Back to Top ----------------- */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#back-to-top:hover {
    background: var(--accent-color);
    transform: translateY(-5px);
}

/* ----------------- Responsive ----------------- */
@media (max-width: 1024px) {
    header {
        padding: 15px 5%;
    }

    section {
        padding: 80px 5%;
    }

    .main h2 span {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
        font-size: 1.8rem;
        cursor: pointer;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        transition: 0.5s;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .nav-links.show {
        right: 0;
    }

    .main {
        flex-direction: column-reverse;
        text-align: center;
        justify-content: center;
        padding-top: 130px;
        gap: 30px;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-image {
        margin-bottom: 10px;
    }

    .profile-frame {
        width: 260px;
        height: 260px;
        max-width: 75vw;
        max-height: 75vw;
        border-radius: 50%;
        box-shadow: 0 10px 30px rgba(58, 108, 244, 0.3);
    }

    .profile-img {
        border-radius: 50%;
    }

    .main h2 span {
        font-size: 2.5rem;
    }

    .social-icons {
        justify-content: center;
    }

    .form {
        padding: 30px 20px;
    }
}