* {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #080808;
    color: #fff;
}

#header {
    width: 100%;
    height: 100vh;
    background-image: url(images/philip-myrtorp-w7M4oUyQLDE-unsplash.jpg);
    background-size: cover;
    background-position: center;
}

.container {
    padding: 50px 5%; /* Reduced side padding for better use of space */
    width: 100%; /* Ensure container spans the full width */
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo {
    width: 500px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin: 10px 20px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    position: relative;
}

nav ul li a::after {
    content: '';
    width: 0;
    height: 3px;
    background: #03cffc;
    position: absolute;
    left: 0;
    bottom: -6px;
    transition: 0.5s;
}

nav ul li a:hover::after {
    width: 100%;
}

.header-text {
    font-size: 30px;
    margin-bottom: 20px;
}

.header-text h1 {
    font-size: 60px;
    margin-top: 20px;
}

.header-text h1 span {
    color: #03cffc;
}

#about {
    margin-top: -50px; /* Pull the about section up to remove gap */
    padding-top: 50px; /* Add padding to compensate for the negative margin */
    padding: 80px 5%; /* Reduced side padding */
    color: #ababab;
}

.row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.about-col-1 {
    flex-basis: 35%;
}

.about-col-1 img {
    width: 100%;
    border-radius: 15px;
}

.about-col-2 {
    flex-basis: 60%;
}

.sub-title {
    font-size: 50px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
}

.tab-titles {
    display: flex;
    margin: 20px 0 40px;
}

.tab-links {
    margin-right: 50px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
}

.tab-links::after {
    content: '';
    width: 0;
    height: 3px;
    background: #03cffc;
    position: absolute;
    left: 0;
    bottom: -8px;
    transition: 0.5s;
}

.tab-links.active-link::after {
    width: 50%;
}

.tab-contents ul li {
    list-style: none;
    margin: 10px 0;
}

.tab-contents ul li span {
    color: #04b0d6;
    font-size: 14px;
}

.tab-contents {
    display: none;
}

.tab-contents.active-tab {
    display: block;
}

#portfolio {
    padding: 80px 5%; /* Reduced side padding */
}

.work-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 40px;
    margin-top: 50px;
}

.work {
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.work img {
    width: 100%;
    border-radius: 10px;
    display: block;
    transition: transform 0.5s;
}

.layer {
    width: 100%;
    height: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.6), #03cffc);
    border-radius: 10px;
    position: absolute;
    left: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    font-size: 14px;
    transition: height 0.5s;
}

.layer h3 {
    font-weight: 500;
    margin-bottom: 20px;
}

.layer a {
    margin-top: 20px;
    color: #03cffc;
    text-decoration: none;
    font-size: 18px;
    line-height: 60px;
    background: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
}

.work:hover img {
    transform: scale(1.1);
}

.work:hover .layer {
    height: 100%;
}

.contact-left {
    flex-basis: 35%;
}

.contact-right {
    flex-basis: 60%;
}

.contact-left p {
    margin-top: 30px;
}

.contact-left p i {
    color: #03cffc;
    margin-right: 15px;
    font-size: 25px;
}

.social-icons {
    margin-top: 30px;
}

.social-icons a {
    text-decoration: none;
    font-size: 30px;
    margin-right: 15px;
    color: #ababab;
    display: inline-block;
    transition: transform 0.5s;
}

social-icons a:hover {
    color: #03cffc;
    transform: translateY(-5px);
}

.btn {
    display: block;
    margin: 50px auto;
    width: fit-content;
    border: 1px solid #03cffc;
    padding: 14px 50px;
    border-radius: 6px;
    text-decoration: none;
    color: #fff;
    transition: background 0.5s;
}

.btn:hover {
    background: #03cffc;
}

.btn.btn2 {
    display: inline-block;
    background: #03cffc;
}

.contact-right form {
    width: 100%;
}

form input,
form textarea {
    width: 100%;
    border: 0;
    outline: none;
    background: #262626;
    padding: 15px;
    margin: 15px 0;
    color: #fff;
    font-size: 18px;
    border-radius: 6px;
}

form .btn2 {
    padding: 14px 60px;
    font-size: 18px;
    margin-top: 20px;
    cursor: pointer;
}

nav .fa-solid {
    display: none;
}

/* Mobile-specific styles */
@media only screen and (max-width: 600px) {
    #header {
        background-image: url(images/istockphoto-542171472-170667a.webp);
    }

    .logo {
        width: 300px;
    }

    .header-text {
        font-size: 20px;
        margin-top: 20%;
    }

    .header-text h1 {
        font-size: 36px;
    }

    nav .fa-solid {
        display: block;
        font-size: 25px;
        cursor: pointer;
    }

    nav ul {
        background: #03cffc;
        position: fixed;
        top: 0;
        right: -200px;
        width: 200px;
        height: 100vh;
        padding-top: 50px;
        z-index: 2;
        transition: right 0.5s;
    }

    nav ul li {
        display: block;
        margin: 25px;
    }

    nav ul .fa-solid {
        position: absolute;
        top: 25px;
        left: 25px;
        cursor: pointer;
    }

    .sub-title {
        font-size: 28px;
    }

    .about-col-1,
    .about-col-2 {
        flex-basis: 100%;
        margin-left: 0;
    }

    .tab-links {
        font-size: 14px;
        margin-right: 10px;
    }

    .contact-left,
    .contact-right {
        flex-basis: 100%;
    }

    #typing-animation {
        min-height: 40vh; /* Reduce height for smaller screens */
        padding: 10px; /* Adjust padding for smaller screens */
    }

    .code-box {
        font-size: 4vw; /* Adjust font size for smaller screens */
        padding: 15px 20px; /* Adjust padding for smaller screens */
        max-width: 90%; /* Ensure it fits within the screen */
    }

    .cursor {
        width: 2px; /* Adjust cursor width for smaller screens */
        height: 0.9em; /* Adjust cursor height */
    }
}

#typing-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh; /* Ensure it fits within the screen */
    background: #080808;
    margin: 0;
    padding: 0 20px; /* Add horizontal padding to prevent overflow */
    position: relative;
}

.code-box {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2.5vw; /* Adjusted font size for better fit */
    color: #03cffc;
    background: linear-gradient(145deg, #1e1e1e, #2a2a2a); /* Subtle gradient for modern look */
    padding: 20px 30px; /* Adjusted padding for better spacing */
    border-radius: 12px; /* Smooth rounded corners */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6); /* Enhanced shadow for depth */
    width: 90%; /* Ensure it fits within the container */
    max-width: 700px; /* Limit the maximum width */
    white-space: normal; /* Allow text to wrap naturally */
    text-align: center; /* Center-align the text */
    overflow: hidden;
    border: 1px solid #03cffc; /* Add a border for better definition */
    line-height: 1.5; /* Improve line spacing for readability */
}

.cursor {
    display: inline-block;
    background: #03cffc;
    width: 7px; /* Sleeker width */
    height: 1.29em; /* Adjusted height for better alignment with text */
    margin-left: 3px; /* Slightly increased margin for spacing */
    animation: blink 0.6s steps(2, start) infinite; /* Faster blinking for smoother effect */
    vertical-align: text-bottom; /* Aligns cursor with the text baseline */
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}