/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ===== VARIABLES ===== */
:root {
    --bg-color: #1f242d;
    --second-bg-color: #323946;
    --text-color: #fff;
    --main-color: #ffcc00;
    --hover-color: #e6b800;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --transition: 0.3s ease;
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
}

section {
    min-height: 100vh;
    padding: 10rem 9% 2rem;
}

/* ===== HEADER STYLES ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 9%;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: var(--transition);
}

.header.sticky {
    background: var(--bg-color);
    box-shadow: 0 .5rem 1rem var(--shadow-color);
}

.logo {
    font-size: 2.5rem;
    color: var(--text-color);
    font-weight: 600;
    cursor: default;
}

.navbar a {
    font-size: 1.7rem;
    color: var(--text-color);
    margin-left: 4rem;
    transition: var(--transition);
    position: relative;
}

.navbar a:hover,
.navbar a.active {
    color: var(--main-color);
}

.navbar a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background: var(--main-color);
    left: 0;
    bottom: -6px;
    transition: var(--transition);
}

.navbar a:hover::after,
.navbar a.active::after {
    width: 100%;
}

#menu-icon {
    font-size: 3.6rem;
    color: var(--text-color);
    display: none;
    cursor: pointer;
}

/* ===== HOME SECTION ===== */
.home {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.home-content h3 {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.home-content h3:nth-of-type(2) {
    margin-bottom: 2rem;
}

.home-content h1 {
    font-size: 5.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 2rem;
}

.home-content p {
    font-size: 1.6rem;
    margin-bottom: 3rem;
    line-height: 1.7;
}

.home-content h3 span {
    position: relative;
    display: inline-block;
}

/* Typing animation */
.typing-animation {
    overflow: hidden;
    white-space: nowrap;
    color: var(--main-color);
    animation: typing 3.5s steps(30, end) infinite,
               cursor 0.4s step-end infinite alternate;
    border-right: 3px solid var(--main-color);
}

@keyframes typing {
    0% { width: 0 }
    70% { width: 100% }
    90% { width: 100% }
    100% { width: 0 }
}

@keyframes cursor {
    50% { border-color: transparent }
}

.social-media {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 3rem;
}

.social-media a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: 2px solid var(--main-color);
    margin-right: 2rem;
    background: transparent;
    font-size: 2rem;
    color: var(--main-color);
    transition: var(--transition);
}

.social-media a:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
    box-shadow: 0 0 1rem var(--main-color);
    transform: scale(1.1);
}

.btn {
    display: inline-block;
    padding: 1.2rem 2.8rem;
    background: var(--main-color);
    border-radius: 4rem;
    box-shadow: 0 0 1rem var(--shadow-color);
    font-size: 1.6rem;
    color: var(--second-bg-color);
    letter-spacing: 0.1rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn:hover {
    background: var(--hover-color);
    box-shadow: 0 0 2rem var(--main-color);
    transform: translateY(-2px);
}

.home-img img {
    width: 35vw;
    max-width: 450px;
    min-width: 300px; /* Minimum width to prevent the image from becoming too small */
    border-radius: 2rem;
    box-shadow: 0 0 2rem var(--shadow-color);
    animation: floatImage 4s ease-in-out infinite;
}

@keyframes floatImage {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2.4rem);
    }
    100% {
        transform: translateY(0);
    }
}

/* ===== ABOUT SECTION ===== */
.about {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8rem;
    background: var(--second-bg-color);
}

.about-img img {
    width: 35vw;
    max-width: 450px;
    min-width: 300px; /* Minimum width to prevent the image from becoming too small */
    border-radius: 2rem;
    box-shadow: 0 0 2rem var(--shadow-color);
    transition: var(--transition);
}

.about-img img:hover {
    transform: scale(1.05);
}

.heading {
    text-align: center;
    font-size: 4.5rem;
    margin-bottom: 4rem;
}

.heading span {
    color: var(--main-color);
}

.about-content h2 {
    text-align: left;
}

.about-content h3 {
    font-size: 2.6rem;
    margin-bottom: 2rem;
}

.about-content p {
    font-size: 1.6rem;
    line-height: 1.8;
    margin-bottom: 3rem;
}

/* Skills bar */
.skills {
    margin-bottom: 3rem;
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-name {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.skill-bar {
    width: 100%;
    height: 1rem;
    background: var(--bg-color);
    border-radius: 1rem;
    position: relative;
}

.skill-percent {
    position: absolute;
    height: 100%;
    background: var(--main-color);
    left: 0;
    top: 0;
    border-radius: 1rem;
}

.html {
    width: 90%;
}

.css {
    width: 85%;
}

.javascript {
    width: 70%;
}

.design {
    width: 80%;
}

/* ===== SERVICES SECTION ===== */
.services h2 {
    margin-bottom: 5rem;
}

.services-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.service-box {
    flex: 1 1 30rem;
    background: var(--second-bg-color);
    padding: 3rem 2rem 4rem;
    border-radius: 2rem;
    text-align: center;
    border: .2rem solid var(--bg-color);
    transition: var(--transition);
    min-height: 35rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.service-box:hover {
    border-color: var(--main-color);
    transform: scale(1.02);
    box-shadow: 0 0 2rem var(--shadow-color);
}

.service-box i {
    font-size: 6rem;
    color: var(--main-color);
    margin-bottom: 2rem;
}

.service-box h3 {
    font-size: 2.6rem;
    margin-bottom: 1.5rem;
}

.service-box p {
    font-size: 1.6rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* ===== PORTFOLIO SECTION ===== */
.portifolio {
    background: var(--second-bg-color);
}

.portifolio h2 {
    margin-bottom: 4rem;
}

.portifolio-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    gap: 2.5rem;
}

.portifolio-box {
    position: relative;
    border-radius: 2rem;
    box-shadow: 0 0 1rem var(--bg-color);
    overflow: hidden;
    display: flex;
    height: 25rem;
}

.portifolio-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.portifolio-box:hover img {
    transform: scale(1.1);
}

.portifolio-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.1), var(--bg-color));
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 0 4rem;
    transform: translateY(100%);
    transition: var(--transition);
}

.portifolio-box:hover .portifolio-layer {
    transform: translateY(0);
}

.portifolio-layer h4 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.portifolio-layer p {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.portifolio-layer a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 5rem;
    height: 5rem;
    background: var(--text-color);
    border-radius: 50%;
}

.portifolio-layer a i {
    font-size: 2rem;
    color: var(--second-bg-color);
}

/* Filter buttons */
.portfolio-filter {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-btn {
    padding: 0.8rem 2rem;
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 4rem;
    font-size: 1.6rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--main-color);
    color: var(--second-bg-color);
}

/* ===== CONTACT SECTION ===== */
.contact h2 {
    margin-bottom: 3rem;
}

.contact form {
    max-width: 70rem;
    margin: 1rem auto;
    text-align: center;
    margin-bottom: 3rem;
}

.contact form .input-box {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.contact form .input-box input,
.contact form textarea {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
    background: var(--second-bg-color);
    border-radius: 0.8rem;
    margin: 0.7rem 0;
    box-shadow: 0 0 0.5rem var(--shadow-color);
    transition: var(--transition);
}

.contact form .input-box input:focus,
.contact form textarea:focus {
    box-shadow: 0 0 1rem var(--main-color);
}

.contact form .input-box input {
    width: 49%;
}

.contact form textarea {
    resize: none;
}

.contact form .btn {
    margin-top: 2rem;
    cursor: pointer;
}

/* ===== FOOTER ===== */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 2rem 9%;
    background: var(--second-bg-color);
}

.footer-text p {
    font-size: 1.6rem;
}

.footer-iconTop a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.8rem;
    background: var(--main-color);
    border-radius: 0.8rem;
    transition: var(--transition);
}

.footer-iconTop a:hover {
    box-shadow: 0 0 1rem var(--main-color);
    transform: translateY(-5px);
}

.footer-iconTop a i {
    font-size: 2.4rem;
    color: var(--second-bg-color);
}

/* ===== SCROLL REVEAL ===== */
.sr-reveal {
    position: relative;
    transform: translateY(80px);
    opacity: 0;
    transition: all 2s ease;
}

.sr-reveal.active {
    transform: translateY(0);
    opacity: 1;
}

/* ===== BREAKPOINTS ===== */
@media (max-width: 1200px) {
    html {
        font-size: 55%;
    }

    .home-img img,
    .about-img img {
        width: 40vw;
    }
}

@media (max-width: 991px) {
    .header {
        padding: 2rem 3%;
    }

    section {
        padding: 10rem 3% 2rem;
    }

    .services {
        padding-bottom: 7rem;
    }

    .portifolio {
        padding-bottom: 7rem;
    }

    .contact {
        min-height: auto;
    }

    .footer {
        padding: 2rem 3%;
    }

    .portifolio-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #menu-icon {
        display: block;
    }

    .navbar {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 1rem 3%;
        background: var(--bg-color);
        border-top: .1rem solid rgba(0, 0, 0, .2);
        box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .2);
        display: none;
    }

    .navbar.active {
        display: block;
    }

    .navbar a {
        display: block;
        font-size: 2rem;
        margin: 3rem 0;
        text-align: center;
    }

    .home {
        flex-direction: column;
        text-align: center;
    }

    .home-content h3 {
        font-size: 2.6rem;
    }

    .home-content h1 {
        font-size: 5rem;
    }

    .home-img {
        margin-top: 4rem;
    }

    .home-img img {
        width: 10vw;
    }

    .about {
        flex-direction: column-reverse;
        text-align: center;
    }

    .about-img {
        margin-top: 4rem;
    }

    .about-img img {
        width: 50vw;
    }

    .services h2 {
        margin-bottom: 3rem;
    }

    .portifolio h2 {
        margin-bottom: 3rem;
    }

    .portifolio-container {
        grid-template-columns: 1fr;
    }

    .social-media {
        justify-content: center;
    }
}

@media (max-width: 450px) {
    html {
        font-size: 50%;
    }

    .contact form .input-box input {
        width: 100%;
    }

    .home-img img {
        width: 70vw;
    }

    .about-img img {
        width: 80vw;
    }
}

@media (max-width: 365px) {
    .home-img img {
        width: 90vw;
    }

    .about-img img {
        width: 90vw;
    }

    .footer {
        flex-direction: column-reverse;
    }

    .footer p {
        text-align: center;
        margin-top: 2rem;
    }
}
