@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

html{
    font-size: 62.5%;
    scroll-behavior: smooth; /* Smooth scroll */
}

body{
    width: 100%;
    height: 100vh;
    overflow-x: hidden;
    background-color: black;
    color: white;
}

/* ---------- HEADER / NAV ---------- */

header{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.6rem 9%; /* adds spacing without pushing down */
    background-color: rgba(0,0,0,0.65);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(183, 75, 75, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

/* background on scroll */
header.scrolled{
    background: rgba(10, 10, 10, 0.82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(183, 75, 75, 0.25);
}

.logo{
    font-size: 3rem;
    color: #b74b4b;
    font-weight: 800;
    cursor: pointer;
    transition: 0.5s ease;
}

.logo:hover{
    transform: scale(1.1);
}

nav a{
    font-size: 1.8rem;
    color: white;
    margin-left: 4rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: 0.25s ease; /* smooth hover & active underline animation */
}

nav a:hover,
nav a.active{
    color: #b74b4b;
    border-bottom: 3px solid #b74b4b;
}

/* ---------- HAMBURGER MENU ---------- */

.menu-toggle{
    display: none;              /* hidden on desktop */
    width: 3rem;
    height: 2.4rem;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.menu-toggle span{
    display: block;
    height: 3px;
    width: 100%;
    border-radius: 999px;
    background: #f5f5f5;
    transition: 0.3s ease;
}

/* state when open (X icon) */
.menu-toggle.open span:nth-child(1){
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2){
    opacity: 0;
}

.menu-toggle.open span:nth-child(3){
    transform: translateY(-9px) rotate(-45deg);
}

@media(max-width:995px){
    /* show hamburger on mobile */
    .menu-toggle{
        display: flex;
    }

    nav{
        position: absolute;
        display: none;
        top: 100%;               /* just below header */
        right: 9%;
        width: 60%;
        border-left: 3px solid #b74b4b;
        border-bottom: 3px solid #b74b4b;
        border-bottom-left-radius: 2rem;
        padding: 1.5rem 2rem;
        background-color: #161616;
        border-top: 0.1rem solid rgba(0,0,0,0.1);
    }

    nav.active{
        display: block;
    }

    nav a{
        display: block;
        font-size: 2rem;
        margin: 1.5rem 0;
    }

    nav a:hover,
    nav a.active{
        padding: 0.6rem 0;
        border-radius: 0.5rem;
        border-bottom: 0.5rem solid #b74b4b;
    }
}

/* ---------- GLOBAL SECTIONS ---------- */

section{
    min-height: 100vh;
    padding: 5rem 9% 5rem;
}

.section-title{
    font-size: 4rem;
    font-weight: 700;
    text-align: center;
    margin-top: 8rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

span{
    color: #b74b4b;
}

/* ---------- HOME SECTION ---------- */

.home{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8rem;
    background-color: black;
}

/* Fade-in animation for home content */
.home-content{
    opacity: 0;
    animation: fadeIn 1.2s ease-in-out forwards;
}

.home .home-content h1{
    font-size: 6rem;
    font-weight: 700;
    line-height: 1.3;
}

.home-content h3{
    font-size: 4rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.home-content p{
    font-size: 1.6rem;
}

/* Group buttons side by side */
.button-group{
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.home-img{
    border-radius: 50%;
}

.home-img img{
    position: relative;
    width: 32vw;
    border-radius: 50%;
    box-shadow: 0 0 25px #b74b4b;
    cursor: pointer;
    transition: 0.2s linear;
}

/* Proper hover zoom & glow */
.home-img img:hover{
    transform: scale(1.05);
    box-shadow: 0 0 35px #b74b4b;
}

.social-icons a{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background-color: transparent;
    border: 0.2rem solid #b74b4b;
    font-size: 2rem;
    border-radius: 50%;
    margin: 3rem 1.5rem 3rem 0;
    transition: 0.3s ease;
    color: #b74b4b;
}

.social-icons a:hover{
    color: black;
    transform: scale(1.3) translateY(-5px);
    background-color: #b74b4b;
    box-shadow: 0  0 25px #b74b4b;
}

.btn{
    display: inline-block;
    padding: 1rem 2.8rem;
    background-color: black;
    border-radius: 4rem;
    font-size: 1.6rem;
    color: #b74b4b;
    letter-spacing: 0.3rem;
    font-weight: 600;
    border: 2px solid #b74b4b;
    transition: 0.3s ease;
    cursor: pointer;
}

.btn:hover{
    transform: scale3d(1.03, 1.03, 1.03);
    background-color: #b74b4b;
    color: black;
    box-shadow: 0 0 25px #b74b4b;
}

/* ---------- TYPING EFFECT (JS-based) ---------- */

.typing-text{
    font-size: 34px;
    font-weight: 600;
    min-width: 280px;
}

.typing-text span{
    position: relative;
    display: inline-block;
    color: #b74b4b;
}

/* blinking cursor only */
.typing-text span::after{
    content: "";
    position: absolute;
    width: 3px;
    height: 100%;
    right: -6px;
    background-color: #b74b4b;
    animation: blink 0.7s steps(1) infinite;
}

@keyframes blink{
    0%, 50%{
        opacity: 1;
    }
    51%, 100%{
        opacity: 0;
    }
}

/* ---------- SERVICES SECTION ---------- */

.services{
    background: #050505;
}

.services-container{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
}

.service-card{
    padding: 2.2rem;
    border-radius: 1.8rem;
    background: radial-gradient(circle at top left, #151515, #050505);
    border: 1px solid #222;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.service-card:hover{
    transform: translateY(-4px);
    box-shadow: 0 0 22px rgba(183, 75, 75, 0.7);
    border-color: #b74b4b;
}

.service-card h3{
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.service-card p{
    font-size: 1.5rem;
    color: #ddd;
    margin-bottom: 1.2rem;
}

.service-card ul{
    list-style: none;
    font-size: 1.4rem;
    color: #ccc;
}

.service-card ul li::before{
    content: "• ";
    color: #b74b4b;
}

/* ---------- SKILLS SECTION ---------- */

.skills{
    background: black;
}

.skills-container{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem;
}

.skill-group h3{
    font-size: 2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.skill-tags{
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tags span{
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    border: 1px solid #b74b4b;
    font-size: 1.3rem;
    color: #f5f5f5;
    background: rgba(183, 75, 75, 0.1);
    backdrop-filter: blur(4px);
}

/* ---------- PROJECTS SECTION ---------- */

.projects{
    background: #050505;
}

.projects-container{
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.project-card{
    display: flex;
    gap: 2.5rem;
    padding: 2.5rem;
    border-radius: 1.8rem;
    background: radial-gradient(circle at top left, #151515, #050505);
    border: 1px solid #222;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card:hover{
    transform: translateY(-4px);
    box-shadow: 0 0 25px rgba(183, 75, 75, 0.7);
    border-color: #b74b4b;
}

.project-thumb{
    flex: 0 0 220px;
    height: 140px;
    border-radius: 1.2rem;
    background: linear-gradient(135deg, #b74b4b, #3a0b0b);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    font-size: 1.6rem;
    font-weight: 600;
    color: #fff;
}

.project-content{
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-content h3{
    font-size: 2.4rem;
    font-weight: 600;
}

.project-description{
    font-size: 1.6rem;
    color: #ddd;
}

.project-tech{
    font-size: 1.5rem;
    color: #bbb;
}

.project-tech span{
    color: #b74b4b;
    font-weight: 600;
}

.project-buttons{
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.8rem;
}

/* ghost style secondary button */
.btn.btn-ghost{
    background-color: transparent;
    color: #b74b4b;
    border-color: #b74b4b;
}

.btn.btn-ghost:hover{
    background-color: #b74b4b;
    color: #000;
}

/* ---------- ACHIEVEMENTS SECTION ---------- */

.achievements{
    background: #050505;
}

.achievements-subtitle{
    text-align: center;
    font-size: 1.6rem;
    color: #ccc;
    max-width: 700px;
    margin: 0 auto 3rem auto;
}

.achievements-stats{
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 3.5rem;
}

.stat-card{
    min-width: 180px;
    padding: 1.6rem 2.2rem;
    border-radius: 1.6rem;
    background: radial-gradient(circle at top left, #171717, #050505);
    border: 1px solid #222;
    text-align: center;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.6);
}

.stat-number{
    display: block;
    font-size: 2.8rem;
    font-weight: 700;
    color: #b74b4b;
}

.stat-label{
    font-size: 1.4rem;
    color: #ddd;
}

/* Rows: each = timeline + certificate card */

.achievements-rows{
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.achievement-row{
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: flex-start;
    border-left: 1px solid #333;
    padding-left: 2.4rem;
}

.timeline-item{
    padding-left: 0.5rem;
}

.timeline-dot{
    position: absolute;
    left: -2.6rem;
    top: 0.8rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #b74b4b;
    box-shadow: 0 0 14px #b74b4b;
}

.timeline-content h3{
    font-size: 1.9rem;
    margin-bottom: 0.3rem;
}

.timeline-meta{
    font-size: 1.3rem;
    color: #aaa;
    margin-bottom: 0.4rem;
}

.timeline-content p{
    font-size: 1.4rem;
    color: #ddd;
}

/* Right side: cards with image + text */

.certificate-card{
    display: flex;
    gap: 1.4rem;
    padding: 1.4rem;
    border-radius: 1.4rem;
    background: radial-gradient(circle at top left, #151515, #050505);
    border: 1px solid #222;
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.certificate-card:hover{
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(183, 75, 75, 0.7);
    border-color: #b74b4b;
}

.certificate-thumb{
    flex: 0 0 130px;
    height: 90px;
    overflow: hidden;
    border-radius: 1rem;
    background: #000;
}

.certificate-thumb img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.certificate-card:hover .certificate-thumb img{
    transform: scale(1.07);
    filter: brightness(1.1);
}

.certificate-body h3{
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}

.certificate-body p{
    font-size: 1.4rem;
    color: #ddd;
}

/* Responsive */

@media (max-width: 950px){
    .achievement-row{
        grid-template-columns: 1fr;
        border-left: none;
        padding-left: 0;
    }

    .timeline-dot{
        left: 0;
    }
}

@media (max-width: 600px){
    .certificate-card{
        flex-direction: column;
    }

    .certificate-thumb{
        width: 100%;
        height: 150px;
    }
}

/* ---------- CONTACT SECTION ---------- */

.contact{
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #050505;
    padding-top: 8rem;
    padding-bottom: 8rem;
}

.contact-text{
    text-align: center;
    font-size: 1.8rem;
    color: #ccc;
    margin-bottom: 3rem;
    width: 100%;
}

.contact-container{
    width: 100%;
    max-width: 1100px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 5rem;
    flex-wrap: wrap;
}

.contact-info{
    flex: 1;
    font-size: 1.8rem;
}

.contact-info p{
    margin: 1.2rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-info a{
    color: #b74b4b;
    transition: 0.3s;
}

.contact-info a:hover{
    text-decoration: underline;
}

.contact-form{
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form input,
.contact-form textarea{
    background: #111;
    border: 2px solid #b74b4b;
    padding: 1.5rem;
    border-radius: 1rem;
    font-size: 1.6rem;
    color: white;
    transition: 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus{
    box-shadow: 0 0 15px #b74b4b;
}

.contact-form button{
    width: fit-content;
}

/* ---------- FULLSCREEN CERTIFICATE MODAL ---------- */

.modal{
    display: none;
    position: fixed;
    z-index: 999;
    inset: 0;
    background: rgba(0,0,0,0.9);
}

.modal-content{
    display: block;
    margin: 4% auto;
    width: 85%;
    max-width: 900px;
    border-radius: 1rem;
}

.close-modal{
    color: #fff;
    position: absolute;
    top: 15px;
    right: 35px;
    font-size: 4rem;
    cursor: pointer;
}

.close-modal:hover{
    color: #b74b4b;
}

/* ---------- ANIMATIONS ---------- */

@keyframes fadeIn{
    to{
        opacity: 1;
    }
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1000px){
    .home{
        gap: 4rem;
    }

    .services-container{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px){
    .home{
        flex-direction: column;
        margin: 5rem 4rem;
    }

    .home .home-content h3{
        font-size: 2.5rem;
    }

    .home-content h1{
        font-size: 5rem;
    }

    .home-img img{
        width: 70vw;
        margin-top: 4rem;
    }

    .button-group{
        justify-content: center;
    }

    .project-card{
        flex-direction: column;
    }

    .project-thumb{
        width: 100%;
    }

    .contact-container{
        flex-direction: column;
    }

    .contact-info,
    .contact-form{
        width: 100%;
    }
}

@media (max-width: 950px){
    .achievements-layout{
        flex-direction: column;
    }

    .achievements-timeline{
        border-left: none;
        padding-left: 0;
    }

    .timeline-dot{
        left: -1rem;
    }
}

@media (max-width: 700px){
    .services-container,
    .skills-container{
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px){
    .certificate-card{
        flex-direction: column;
    }

    .certificate-thumb{
        width: 100%;
        height: 150px;
    }
}
