@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800&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 {
    --bg-color: rgb(0, 36, 53);
    --second-bg-color: rgb(0, 18, 31);
    --text-color: #fff;
    --accent-color: #b74b4b;
    --shadow-color: rgba(183, 75, 75, 0.3);
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
}

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

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

.heading {
    font-size: 4.5rem;
    text-align: center;
    margin-bottom: 5rem;
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 9%;
    background-color: transparent;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: 0.5s;
}

header.sticky {
    background-color: rgba(0, 18, 31, 0.9);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .2);
}

.logo {
    font-size: 3rem;
    color: var(--accent-color);
    font-weight: 800;
    cursor: pointer;
    transition: 0.5s ease;
}

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

nav a {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-left: 3rem;
    font-weight: 500;
    transition: 0.3s ease;
    border-bottom: 3px solid transparent;
}

nav a:hover,
nav a.active {
    color: var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
}

.menu-btn {
    font-size: 3rem;
    color: var(--text-color);
    cursor: pointer;
    display: none;
}

/* Home Section */
.home {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8rem;
    background-color: var(--second-bg-color);
}

.home-img {
    position: relative;
}

.home-img img {
    width: 32vw;
    border-radius: 50%;
    box-shadow: 0 0 25px var(--shadow-color);
    transition: 0.3s ease;
}

.home-img img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px var(--shadow-color);
}

.home-content h1 {
    font-size: 5.6rem;
    font-weight: 700;
    line-height: 1.3;
}

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

.home-content h3 {
    font-size: 3.2rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

.home-content p {
    font-size: 1.6rem;
    margin-bottom: 3rem;
}

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

.social-icons a:hover {
    color: var(--second-bg-color);
    transform: scale(1.2) translateY(-5px);
    background-color: var(--accent-color);
    box-shadow: 0 0 25px var(--shadow-color);
}

.btn {
    display: inline-block;
    padding: 1.2rem 2.8rem;
    background-color: var(--second-bg-color);
    border-radius: 4rem;
    font-size: 1.6rem;
    color: var(--accent-color);
    letter-spacing: 0.2rem;
    font-weight: 600;
    border: 2px solid var(--accent-color);
    transition: 0.3s ease;
    cursor: pointer;
}

.btn:hover {
    transform: scale(1.05);
    background-color: var(--accent-color);
    color: var(--second-bg-color);
    box-shadow: 0 0 25px var(--shadow-color);
}

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

.typing-text span{
    position: relative;
}

.typing-text span::before{
    content: "software Engineer";
    color: #b74b4b;
    animation: words 20s infinite;
}

.typing-text span::after{
    content: "";
    background-color: rgb(0, 18, 31);
    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 #b74b4b;
    }
}

@keyframes words{
    21%, 40%{
        content: "Web Developer";
    }
    41%, 60%{
        content: "C++ Developer";
    }
    61%, 80%{
        content: "ML Engineer";
    }
    81%, 100%{
        content: "Data Scientist";
    }
}

/* About Section */
.about {
    background-color: var(--bg-color);
}

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

.about-img {
    flex: 0 0 40%;
}

.about-img img {
    width: 100%;
    border-radius: 1rem;
    box-shadow: 0 0 20px var(--shadow-color);
}

.about-content {
    flex: 0 0 50%;
}

.about-content h3 {
    font-size: 2.6rem;
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.about-content p {
    font-size: 1.6rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.personal-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.info-item {
    font-size: 1.6rem;
}

.info-item span {
    font-weight: 600;
    margin-right: 1rem;
}

/* Services Section */
.services {
    background-color: var(--second-bg-color);
}

.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr));
    gap: 3rem;
}

.service-box {
    background-color: var(--bg-color);
    padding: 3rem 2rem;
    border-radius: 2rem;
    text-align: center;
    border: 2px solid transparent;
    transition: 0.5s ease;
}

.service-box:hover {
    border-color: var(--accent-color);
    transform: translateY(-1rem);
    box-shadow: 0 .5rem 2rem var(--shadow-color);
}

.service-box i {
    font-size: 6rem;
    color: var(--accent-color);
    margin-bottom: 2rem;
}

.service-box h3 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
}

.service-box p {
    font-size: 1.6rem;
    line-height: 1.6;
}

/* Skills Section */
.skills {
    background-color: var(--bg-color);
}

.skills-container {
    display: flex;
    justify-content: center;
}

.skills-content {
    width: 100%;
    max-width: 80rem;
}

.skills-content p {
    font-size: 1.6rem;
    margin-bottom: 4rem;
    text-align: center;
}

.skill-row {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 3rem;
}

.skill-box {
    flex: 1;
}

.skill-box h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.skill-bar {
    height: 1rem;
    background-color: var(--second-bg-color);
    border-radius: 0.5rem;
    position: relative;
}

.skill-percent {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 0.5rem;
    transition: width 1s ease;
}

/* Education & Experience Sections */
.education, .experience {
    background-color: var(--second-bg-color);
}

.timeline {
    position: relative;
    max-width: 80rem;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 0.4rem;
    background-color: var(--accent-color);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 4rem 6rem 4rem;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    background-color: var(--accent-color);
    border-radius: 50%;
    z-index: 1;
    top: 0;
    right: -2.5rem;
}

.timeline-item:nth-child(even) .timeline-icon {
    left: -2.5rem;
}

.timeline-icon i {
    font-size: 2rem;
    color: var(--second-bg-color);
}

.timeline-content {
    position: relative;
    padding: 2rem;
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.timeline-content h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.timeline-content h4 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

/* Projects Section */
.projects {
    background-color: var(--bg-color);
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 3rem;
}

.project-box {
    position: relative;
    border-radius: 1rem;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.2);
    overflow: hidden;
    height: 25rem;
}

.project-box img {
    width: 100%;
    transition: 0.5s ease;
    height: 100%;
    object-fit: cover;
}

.project-overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 18, 31, 0.7), var(--accent-color));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
    transition: 0.5s ease;
}

.project-box:hover .project-overlay {
    bottom: 0;
}

.project-box:hover img {
    transform: scale(1.1);
}

.project-overlay h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.project-overlay p {
    font-size: 1.6rem;
    margin-bottom: 2rem;
}

.project-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background-color: var(--bg-color);
    border-radius: 50%;
    margin: 0 1rem;
    transition: 0.3s ease;
}

.project-links a i {
    font-size: 2rem;
    color: var(--accent-color);
}

.project-links a:hover {
    transform: scale(1.2);
    background-color: var(--accent-color);
}

.project-links a:hover i {
    color: var(--bg-color);
}

/* Contact Section */
.contact {
    background-color: var(--second-bg-color);
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.contact-card {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    transition: 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-1rem);
    box-shadow: 0 0.5rem 1.5rem var(--shadow-color);
    border: 2px solid var(--accent-color);
}

.contact-card i {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.contact-card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.contact-card p {
    font-size: 1.6rem;
}

.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-group {
    position: relative;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 1.5rem 2rem;
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
    border: 2px solid transparent;
    transition: 0.3s ease;
}

.form-group textarea {
    height: 15rem;
    resize: none;
}

.form-group input:focus, 
.form-group textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 1rem var(--shadow-color);
}

/* Footer */
footer {
    background-color: var(--bg-color);
    padding: 3rem 9%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content p {
    font-size: 1.6rem;
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    width: 5rem;
    height: 5rem;
    background-color: var(--accent-color);
    color: var(--second-bg-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.3);
    z-index: 99;
    transition: 0.5s ease;
    opacity: 0;
    pointer-events: none;
}

.scroll-top-btn.active {
    opacity: 1;
    pointer-events: auto;
}

.scroll-top-btn:hover {
    background-color: var(--text-color);
    color: var(--accent-color);
    transform: translateY(-0.5rem);
}

/* JavaScript for the site */
@media (max-width: 1200px) {
    html {
        font-size: 55%;
    }
}

@media (max-width: 991px) {
    section {
        padding: 10rem 4% 2rem;
    }
    
    header {
        padding: 2rem 4%;
    }
    
    .home {
        gap: 4rem;
    }
    
    .about-container {
        flex-direction: column;
    }
    
    .about-img {
        flex: 0 0 100%;
        margin-bottom: 3rem;
    }
    
    .about-content {
        flex: 0 0 100%;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        margin-bottom: 3rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 50%;
    }
    
    .menu-btn {
        display: block;
    }
    
    nav {
        position: absolute;
        top: 100%;
        right: -100%;
        width: 80%;
        padding: 2rem;
        background-color: var(--bg-color);
        border-top: 0.1rem solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
        border-radius: 0 0 1rem 1rem;
        transition: 0.5s ease;
        z-index: 999;
    }
    
    nav.active {
        right: 0;
    }
    
    nav a {
        display: block;
        margin: 2rem 0;
        font-size: 2rem;
    }
    
    .home {
        flex-direction: column;
        padding-top: 15rem;
    }
    
    .home-img img {
        width: 70vw;
    }
    
    .home-content h1 {
        font-size: 4.5rem;
    }
    
    .home-content h3 {
        font-size: 2.5rem;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 7rem;
        padding-right: 2rem;
    }
    
    .timeline-item:nth-child(even) {
        left: 0;
    }
    
    .timeline::after {
        left: 2.5rem;
    }
    
    .timeline-icon {
        left: 0;
        right: auto;
    }
    
    .timeline-item:nth-child(even) .timeline-icon {
        left: 0;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 450px) {
    html {
        font-size: 45%;
    }
    
    .home-content h1 {
        font-size: 3.5rem;
    }
    
    .home-content h3 {
        font-size: 2.2rem;
    }
    
    .skill-row {
        flex-direction: column;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
}