@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
}

:root {
    --text-color: #fff;
    --bg-color: #030316;
    --second-bg-color: #0a0e27;
    --main-color: #13bbff;
    --other-color: #04142c;

    --h1-font: 5rem;
    --h2-font: 4rem;
    --h3-font: 3.5rem;
    --p-font: 1.4rem;
    
    /* Additional consistent font sizes */
    --stat-number-font: 3.5rem;
    --stat-label-font: 1.45rem;
    --skill-title-font: 2rem;
    --skill-icon-size: 60px;
}

html {
    font-size: 72.5%;
    max-width: 100%;
}

body {
    width: 100%;
    height: 100vh;
    overflow-x: hidden;
    background-color: var(--bg-color);
    color: var(--text-color);
    max-width: 100vw;
}

body::-webkit-scrollbar {
    display: none;
}

/* Fix scrollbar appearing with SweetAlert */
body.swal2-shown {
    overflow: hidden !important;
    padding-right: 0 !important;
}

html.swal2-html-shown {
    overflow: hidden !important;
}

.swal2-container {
    padding: 0 !important;
}

span {
    color: var(--main-color);
}

/* Navbar */

header {
    position: fixed;
    height: 100px;
    width: 100%;
    padding: 0 9%;
    background: transparent;
    backdrop-filter: blur(10px);
    display: flex;
    z-index: 100;
}

header .container {
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

header .container .logo {
    font-size: 28px;
    color: var(--text-color);
    font-weight: 800;
    cursor: pointer;
    transition: 0.5s ease;
}

header .container .logo:hover {
    transform: scale(1.1);
}

nav a {
    font-size: 17px;
    color: var(--text-color);
    margin-left: 40px;
    font-weight: 500;
    transition: 0.3s ease;
    position: relative;
    padding-bottom: 5px;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--main-color);
    transition: width 0.3s ease;
}

nav a.active {
    color: var(--main-color);
}

nav a.active::after {
    width: 100%;
}

/* Mobile menu toggle (hidden by default) */

.menu-toggle {
    display: none;
    background: transparent;
    color: var(--text-color);
    font-size: 2.2rem;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    z-index: 300;
    position: relative;
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.06);
    transform: scale(1.05);
}

section {
    min-height: 100vh;
    padding: 5rem 9% 5rem;
}

.c-btn {
    display: inline-block;
    padding: 11px 26px;
    background: var(--main-color);
    color: var(--bg-color);
    border: 2px solid var(--main-color);
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    transition: all .3s ease;
}

.c-btn:hover {
    background: transparent;
    color: var(--main-color);
    box-shadow: 0 0 20px var(--main-color);
    transform: scale(1.1);
}

/* Home */

.home {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5rem;
}

.home-img {
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 1s ease, transform 1s ease;
}

.home-img.visible {
    opacity: 1;
    transform: translateX(0);
}

.home-content {
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 1s ease, transform 1s ease;
    transition-delay: 0.3s;
}

.home-content.visible {
    opacity: 1;
    transform: translateX(0);
}

.home-content h1 {
    font-size: var(--h1-font);
    font-weight: 700;
    line-height: 1.3;
}

.home-content h3 {
    font-size: var(--h3-font);
    margin-bottom: 1rem;
    font-weight: 700;
}

.home-content p {
    font-size: var(--p-font);
    line-height: 1.7;
}

.home-img img {
    position: relative;
    width: 28vw;
    border-radius: 50%;
    border: 5px solid var(--main-color);
    box-shadow: 0 0 40px var(--main-color);
    cursor: pointer;
    transition: 0.2s linear;
}

.home-img img:hover {
    font-size: 1.8rem;
    font-weight: 500;
}

.social-icons a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background-color: transparent;
    border: 0.2rem solid var(--main-color);
    font-size: 2rem;
    border-radius: 50%;
    margin: 2.5rem 1.5rem 3rem 0;
    transition: 0.3s ease;
    color: var(--main-color);
}

.social-icons a:hover {
    color: black;
    transform: scale(1.3) translateY(-5px);
    background-color: var(--main-color);
    box-shadow: 0  0 25px var(--main-color);
}

.home-btn {
    display: inline-block;
    padding: 1rem 2.8rem;
    background-color: transparent;
    border-radius: 4rem;
    font-size: var(--p-font);
    color: var(--main-color);
    letter-spacing: 0.3rem;
    font-weight: 600;
    border: 2px solid var(--main-color);
    transition: 0.3s ease;
    cursor: pointer;
}

.home-btn:hover {
    transform: scale(1.03);
    background-color: var(--main-color);
    color: black;
    box-shadow: 0 0 25px var(--main-color);
}

.typing-text {
    font-size: 34px;
    font-weight: 600;
    min-width: 280px;
}

.typing-text span {
    position: relative;
}

.typing-text span::before {
    content: "software Developer";
    color: var(--main-color);
    animation: words 20s infinite;
}

.typing-text span::after {
    content: "";
    position: absolute;
    width: calc(100% + 8px);
    height: 100%;
    border-left: 3px solid black;
    right: -8;
    animation: cursor 0.6s infinite;
}

@keyframes cursor {
    to {
        border-left: 3px solid var(--main-color);
    }
}

@keyframes words {
    0%, 20% {
        content: "Multiplatform Dev";
    }
    21%, 40% {
        content: "Tech Enthusiast";
    }
    41%, 60% {
        content: "Problem Solver";
    }
    61%, 80% {
        content: "Dream Explorer";
    }
    81%, 100% {
        content: "Lifelong Learner";
    }
}

/* About */

.about {
    background: var(--second-bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about .title {
    font-size: var(--h3-font);
    font-weight: 700;
    text-align: left;
    padding-left: 25px;
    margin-bottom: 2rem;
}

.about-container {
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    max-width: 1200px;
}

.about-content {
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 1s ease, transform 1s ease;
}

.about-content.visible {
    opacity: 1;
    transform: translateX(0);
}

.about-visual {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 1s ease, transform 1s ease;
    transition-delay: 0.2s;
}

.about-visual.visible {
    opacity: 1;
    transform: translateX(0);
}

.about-content p {
    font-size: var(--p-font);
    line-height: 1.9;
    text-align: justify;
}

.quote {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-style: italic;
    margin: 2rem 0;
    padding-left: 1.5rem;
    border-left: 4px solid var(--main-color);
}

.stat-card {
    background: var(--bg-color);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 217, 255, 0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 217, 255, 0.2);
}

.stat-number {
    font-size: var(--stat-number-font);
    font-weight: 700;
    color: var(--main-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-color);
    font-size: var(--stat-label-font);
}

/* skills */

.skills {
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.skills .title {
    font-size: var(--h3-font);
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 3rem;
}

.box-skills {
    padding: 58px 40px 66px;
    background-color: var(--second-bg-color);
    border-radius: 28px;
    border: 1px solid transparent;
    box-shadow: 0 0 5px var(--main-color);
}

.box-skills h4 {
    text-align: center;
    font-size: var(--skill-title-font);
    margin-bottom: 20px;
    font-weight: 700;
}

.box-skills .skill-icons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--skill-icon-size), 1fr));
    gap: 1.5rem;
    justify-items: center;
}

.box-skills .skill-icons img {
    height: var(--skill-icon-size);
    width: var(--skill-icon-size);
}

/* Education */

.education {
    background: var(--second-bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.education .title {
    font-size: var(--h3-font);
    font-weight: 700;
    text-align: left;
    padding-left: 25px;
    margin-bottom: 2rem;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    padding-left: 30px;
}

.education .content {
    padding: 0px 30px;
    border-left: 2px solid #2d343f;
}

.education .content .list {
    position: relative;
    padding: 20px;
    background-color: var(--bg-color);
    margin-bottom: 25px;
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 15px;
}

.education .content .list::before {
    content: "";
    position: absolute;
    width: 15px;
    height: 15px;
    right: calc(100% + 22px);
    border-radius: 50%;
    top: 0;
    background-color: #2d343f;
    border: 2px solid var(--second-bg-color);
}

.list h4 {
    position: relative;
    font-size: 16px;
    color: var(--main-color);
}

.list h5 {
    font-size: 18px;
    padding: 10px 0px 6px;
    font-weight: 600;
}

.list p {
    font-size: 1.2rem; 
    line-height: 1.7;
    text-align: justify;
}

/* Projects */

.projects {
    background: var(--bg-color);
}

.projects .title {
    font-size: var(--h3-font);
    font-weight: 700;
    text-align: center;
    margin: 3.5rem 0 2rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto 0;
}

.project-card {
    background: var(--second-bg-color);
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid rgba(0, 217, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 25px 60px rgba(0, 217, 255, 0.2);
    border-color: var(--main-color);
}

.project-icon {
    width: 70px;
    height: 70px;
    background: var(--main-color);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.project-card h4 {
    font-size: 1.7rem;
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--text-color);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.project-links {
    display: flex;
    gap: 1rem;
    font-size: 1.2rem;
}

.project-link {
    flex: 1;
    padding: 1.2rem;
    text-align: center;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-link.primary {
    background: var(--main-color);
    color: var(--bg-color);
}

.project-link.secondary {
    background: transparent;
    border: 2px solid var(--main-color);
    color: var(--main-color);
}

.project-link:hover {
    transform: scale(1.05);
}

.more-project {
    display: none;
}

.more-project.show {
    display: block;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.see-more-btn {
    display: block;
    margin: 4rem auto 0;
    padding: 0;
    background: transparent;
    color: var(--main-color);
    border: none;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.see-more-btn:hover {
    color: var(--text-color);
}

.see-more-btn i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.see-more-btn.expanded i {
    transform: rotate(180deg);
}

/* Contact */

.contact{
    background: var(--second-bg-color);
}

.contact .title {
    font-size: var(--h3-font);
    font-weight: 700;
    text-align: center;
    margin: 3.5rem 0 2rem;
}

.contact-container {
    float: left;
    width: 100%;
    max-width: 500px;
    margin-left: 2.5rem;
}

.contact-container {
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 1s ease, transform 1s ease;
}

.contact-container.visible {
    opacity: 1;
    transform: translateX(0);
}

.form-container {
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 1s ease, transform 1s ease;
}

.form-container.visible {
    opacity: 1;
    transform: translateX(0);
}

.contact-intro {
    font-size: var(--p-font);
    line-height: 1.8;
    margin-top: 3rem;
    margin-bottom: 6rem;
    color: var(--text-color);
    padding-left: 1rem;
}

.contact-card {
    padding-bottom: 3.5rem;
    width: 100%;
    max-width: 440px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.contact-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
}

.contact-icon {
    width: 50px;
    height: 50px;
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-container {
    float: right;
    background: var(--bg-color);
    padding: 3rem;
    border-radius: 20px;
    margin-right: 2.5rem;
    border: 1px solid rgba(0, 217, 255, 0.2);
    position: relative;
    width: 100%;
    max-width: 620px;
}

form input,
form textarea {
    width: 100%;
    padding: 18px;
    outline: none;
    resize: none; /* Avoid box stretching */
    border: 2px solid rgba(0, 217, 255, 0.2);
    background: var(--second-bg-color);
    color: var(--text-color);
    font-size: 14px;
    margin-bottom:25px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

form input:focus,
form textarea:focus {
    box-shadow: 0 0 10px var(--main-color);
    border: 2px solid var(--main-color);
    background: var(--bg-color);
}

form input:valid:not(:placeholder-shown),
form textarea:valid:not(:placeholder-shown) {
    border: 2px solid var(--main-color);
}

form .submit-btn {
    display: inline-block;
    padding: 11px 26px;
    background: var(--main-color);
    color: var(--bg-color);
    border: 2px solid var(--main-color);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    transition: all .50s ease;
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

form .submit-btn:hover:not(:disabled) {
    background: transparent;
    color: var(--main-color);
    box-shadow: 0 0 20px var(--main-color);
    cursor: pointer;
}

form .submit-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-text {
    display: inline-block;
    color: inherit;
    font-size: 15px;
    font-weight: 600;
}

.loader {
    width: 30px;
    height: 30px;
    border: 4px solid var(--bg-color);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: none;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
} 

/* Footer */
    
.footer {
    padding: 3rem 0;
    background-color: var(--bg-color);
    text-align: center;
}

.footer p {
    font-size: var(--p-font);
    color: var(--text-color);
}

/* --------- Responsive styles --------- */

/* Tablet */
@media (max-width: 992px) {
    :root {
        --h1-font: 3.6rem;
        --h2-font: 3rem;
        --h3-font: 2.6rem;
        --p-font: 1.3rem;
        
        /* Tablet-specific sizes */
        --stat-number-font: 2.8rem;
        --stat-label-font: 1.3rem;
        --skill-title-font: 2rem;
        --skill-icon-size: 50px;
    }

    header {
        padding: 0 5%;
    }

    section {
        padding: 5rem 5% 5rem;
    }

    /* Home stacks */
    .home {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
        padding-top: 10rem;
    }

    .home-img img {
        width: 55vw;
        max-width: 360px;
    }

    /* About */
    .about-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about .title {
        padding-left: 0px;
    }

    .about-visual {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 2rem;
    }

    /* Skills */
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .box-skills {
        padding: 40px 30px 50px;
    }

    /* Education */
    .row {
        grid-template-columns: 1fr;
        row-gap: 2rem;
        padding-left: 10px;
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    /* Contact: stack and remove floats */
    .contact-container,
    .form-container {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .contact-intro {
        margin-top: 1rem;
        margin-bottom: 3rem;
        padding-left: 0;
        text-align: left;
    }

    .contact-card {
        width: 100%;
        max-width: 100%;
    }

    .form-container {
        margin-top: 1rem;
        padding: 2rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    html {
        overflow-x: hidden;
    }
    
    header {
        height: 50px;
    }

    header .container {
        height: 60px;
        padding-top: 0px;
    }

    :root {
        --h1-font: 2.4rem;
        --h2-font: 2rem;
        --h3-font: 1.8rem;
        --p-font: 1rem;
        
        /* Mobile-specific sizes */
        --stat-number-font: 2rem;
        --stat-label-font: 1rem;
        --skill-title-font: 1.5rem;
        --skill-icon-size: 45px;
    }

    header .container .logo {
        font-size: 18px;
    }

    /* Show hamburger */
    .menu-toggle {
        display: inline-flex;
    }

    /* Off-canvas nav */
    #navbar {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 58%;
        max-width: 320px;
        background: var(--second-bg-color);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        padding: 100px 24px 24px; /* account for fixed header */
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        z-index: 200;
    }

    #navbar.open {
        transform: translateX(0);
    }

    #navbar a {
        margin: 14px 0;
        font-size: 1.3rem;
        border-bottom: none;
    }

    #navbar a.c-btn {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }

    header .container {
        align-items: center;
        gap: 12px;
    }

    nav a.active {
        border-bottom: none;
        color: var(--main-color);
    }

    /* Home */
    .home {
        padding-top: 4rem;
    }

    .home-img img {
        width: 55vw;
        max-width: 260px;
    }

    .stat-card {
        padding: 1.8rem;
    }

    /* Skills */
    .skills .title {
        margin: 2.5rem 0 2rem;
    }

    .box-skills {
        padding: 35px 25px 40px;
    }

    .box-skills h4 {
        margin-bottom: 15px;
    }

    .box-skills .skill-icons {
        gap: 1.2rem;
    }

    /* Education */
    .education .title {
        margin: 2.5rem 0 2rem;
        padding-left: 0px;
    }

    .list h4 {
        font-size: 13px;
    }

    .list h5 {
        font-size: 15px;
    }

    .list p {
        font-size: 1rem;
    }

    /* Projects */
    .projects .title {
        margin: 2.5rem 0 2rem;
    }

    .project-card h4 {
        font-size: 1.4rem;
    }

    .project-card p {
        font-size: 1rem;
    }

    .project-links {
        font-size: 1rem;
    }

    .project-link {
        padding: 1rem;
    }

    .see-more-btn {
        font-size: 1rem;
    }

    /* Contact */
    .contact .title {
        margin: 2.5rem 0 2rem;
    }

    .contact-intro {
        font-size: 1rem;
        margin-bottom: 4rem;
    }

    .contact-card h4 {
        font-size: 1rem;
    }

    .contact-icon {
        width: 44px;
        height: 44px;
    }

    form input,
    form textarea {
        font-size: 13px;
        padding: 15px;
    }

    form .submit-btn {
        font-size: 14px;
        padding: 10px 22px;
    }

    .btn-text {
        font-size: 14px;
    }

    /* Prevent background scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

/* Very small devices */
@media (max-width: 420px) {
    :root {
        --h1-font: 2rem;
        --h2-font: 1.8rem;
        --h3-font: 1.6rem;
        --p-font: 0.95rem;
        
        /* Very small device-specific sizes */
        --stat-number-font: 1.8rem;
        --stat-label-font: 0.95rem;
        --skill-title-font: 1.4rem;
        --skill-icon-size: 40px;
    }

    /* Make image even smaller on very small screens */
    .home-img img {
        width: 45vw;
        max-width: 180px;
    }

    .stat-card {
        padding: 1.5rem;
    }

    /* Skills section - even smaller for very small devices */
    .box-skills {
        padding: 30px 20px 35px;
    }

    .box-skills h4 {
        margin-bottom: 12px;
    }

    .box-skills .skill-icons {
        gap: 1rem;
    }

    .about-visual {
        grid-template-columns: 1fr;
    }

    /* Education */
    .list h4 {
        font-size: 12px;
    }

    .list h5 {
        font-size: 14px;
    }

    .list p {
        font-size: var(--p-font);
    }

    /* Projects */
    .project-card h4 {
        font-size: 1.3rem;
    }

    .project-card p {
        font-size: var(--p-font);
    }

    .project-links {
        font-size: 0.95rem;
    }

    .project-link {
        padding: 0.9rem;
    }

    /* Contact */
    .contact-intro {
        font-size: 0.95rem;
        margin-bottom: 3rem;
    }

    .contact-card h4 {
        font-size: 1rem;
    }

    .contact-icon {
        width: 40px;
        height: 40px;
    }

    form input,
    form textarea {
        font-size: 12px;
        padding: 14px;
    }

    form .submit-btn {
        font-size: 13px;
        padding: 9px 20px;
    }

    .btn-text {
        font-size: 13px;
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }
}