@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%; /* Base font size: 10px = 1rem */
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: black;
    color: white;
    -webkit-font-smoothing: antialiased; /* Smooth fonts */
}

header {
    margin-top: 20px;
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 9%;
    background-color: transparent;
    filter: drop-shadow(0px 4px 10px rgba(0, 0, 0, 0.2));
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo {
    font-size: 3rem;
    color: #b74b4b;
    font-weight: 800;
    cursor: pointer;
    transition: 0.5s ease;
}

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

nav {
    display: flex;
    align-items: center;
}

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

nav a:hover,
nav a.active {
    color: #b74b4b;
    border-bottom: 3px solid #b74b4b;
}

.hamburger {
    display: none; /* Hidden by default */
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
}

@media (max-width: 1200px) {
    .logo {
        font-size: 2.5rem; /* Reduce logo size */
    }

    nav a {
        font-size: 1.6rem; /* Reduce font size of nav links */
    }
}

@media (max-width: 995px) {
    .hamburger {
        display: block; /* Show hamburger menu */
    }

    nav {
        flex-direction: column; /* Stack items */
        background-color: #161616;
        padding: 1rem;
        position: absolute;
        top: 100%; /* Position below header */
        right: 0;
        width: 100%; /* Full width */
        border-top: 0.1rem solid rgba(0, 0, 0, 0.1);
        display: none; /* Hide initially */
    }

    nav.active {
        display: block; /* Show when active */
    }

    nav a {
        display: block; /* Stack nav items */
        margin: 1.5rem 0; /* Space between items */
        padding: 0.5rem 1rem; /* Padding for clickable area */
    }
}

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

.home {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8rem;
    background-color: black;
}

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

span {
    color: #b74b4b;
}

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

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

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

.home-img img {
    position: relative;
    width: 32vw; /* Responsive width */
    max-width: 300px; /* Prevent image from being too large */
    border-radius: 50%;
    box-shadow: 0 0 25px rgba(183, 75, 75, 0.5);
    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 #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: scale(1.05);
    background-color: #b74b4b;
    color: black;
    box-shadow: 0 0 25px #b74b4b;
}

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

.typing-text span {
    position: relative;
}

.typing-text span::before {
    content: "Software Developer";
    color: #b74b4b;
    animation: words 18s infinite ease-in-out;
}

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

/* Keyframes for Cursor */
@keyframes cursor {
    0%, 100% {
        opacity: 1;
        border-left-color: #b74b4b;
    }
    50% {
        opacity: 0;
    }
}

/* Keyframes for Words Animation */
@keyframes words {
    0%, 20% {
        content: "Web Developer";
    }
    21%, 40% {
        content: "App Developer";
    }
    41%, 60% {
        content: "Web Designer";
    }
    61%, 80% {
        content: "Programmer";
    }
    81%, 100% {
        content: "AI Developer";
    }
}

/* Mobile Adjustments for Keyframes */
@media (max-width: 800px) {
    .typing-text {
        font-size: 2.6rem;
    }
    /* Slightly reduce animation duration on medium screens */
    .typing-text span::before {
        animation: words 15s infinite ease-in-out;
    }
    .typing-text span::after {
        animation: cursor 0.6s infinite;
    }
}

@media (max-width: 500px) {
    .typing-text {
        font-size: 2rem;
    }
    /* Further reduce duration for faster rotation on small screens */
    .typing-text span::before {
        animation: words 12s infinite ease-in-out;
    }
    .typing-text span::after {
        animation: cursor 0.5s infinite;
    }
}


@media (max-width: 800px) {
    .home {
        gap: 4rem; /* Reduce gap between elements */
        flex-direction: column; /* Stack elements vertically */
        margin: 5rem 2rem; /* Add margin for small screens */
    }

    .home .home-content h3 {
        font-size: 2.5rem; /* Adjust font size */
    }

    .home-content h1 {
        font-size: 5rem; /* Adjust font size */
    }

    .home-img img {
        width: 70vw; /* Responsive width */
        margin-top: 4rem; /* Space above the image */
    }

    nav {
        width: 100%; /* Full width for nav */
        padding: 1rem; /* Adjust padding */
    }
}

@media (max-width: 500px) {
    .logo {
        font-size: 2.5rem; /* Smaller logo */
    }

    nav a {
        font-size: 1.4rem; /* Smaller nav links */
    }

    .btn {
        font-size: 1.4rem; /* Smaller button text */
        padding: 0.8rem 2rem; /* Adjust button padding */
    }

    .social-icons a {
        width: 3.5rem; /* Smaller social icon size */
        height: 3.5rem; /* Smaller social icon size */
        font-size: 1.5rem; /* Smaller icon font size */
    }
}
