/* ===== VARIABLES ===== */
:root {
  --bg-color: #f6f7f2;             
  --second-bg-color: #ffffff;       
  --text-color: #2e2e2e;     
  --main-color: #5a8f7b;             
  --transition: all 0.3s ease;
  --box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg-color: #1b1f1b;             
  --second-bg-color: #2b3230;        
  --text-color: #e4e4e4;             
  --main-color: #8fdcc0;            
  --box-shadow: 0 0 1rem rgba(0, 0, 0, 0.3);
}


/* ===== RESET & BASE STYLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

section {
    min-height: 100vh;
    padding: 10rem 3% 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    width: 100%;
}

/* ===== HEADER & NAVIGATION ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 3%;
    background: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: var(--box-shadow);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.header.sticky {
    border-bottom: .1rem solid rgba(0, 0, 0, .2);
    background: var(--bg-color);
}

.logo {
    font-size: 2.5rem;
    color: var(--text-color);
    font-weight: 600;
    cursor: default;
    transition: var(--transition);
}

.logo:hover {
    color: var(--main-color);
}

.navbar {
    display: none;
}

.navbar.active {
    display: block;
    position: fixed;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1rem 3%;
    background: var(--bg-color);
    border-top: .1rem solid rgba(0, 0, 0, .2);
    box-shadow: var(--box-shadow);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.navbar a {
    display: block;
    font-size: 2rem;
    color: var(--text-color);
    margin: 3rem 0;
    text-align: center;
    transition: var(--transition);
}

.navbar a:hover,
.navbar a.active {
    color: var(--main-color);
}

#menu-icon {
    font-size: 3.6rem;
    color: var(--text-color);
    display: block;
    cursor: pointer;
}

/* ===== HOME SECTION ===== */
.home {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4rem;
}

.home-content {
    width: 100%;
}

.home-content h3 {
    font-size: 2.2rem;
    font-weight: 700;
}

.home-content h3:nth-of-type(2) {
    margin-bottom: 2rem;
}

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

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

.home-img {
    width: 100%;
    display: flex;
    justify-content: center;
}

.home-img img {
    width: 60vw;
    max-width: 300px;
    border-radius: 50%;
    box-shadow: 0 0 2rem var(--main-color);
    animation: floatImage 4s ease-in-out infinite;
}

@keyframes floatImage {
    0% { transform: translateY(0); }
    50% { transform: translateY(-2.4rem); }
    100% { transform: translateY(0); }
}

/* ===== SOCIAL MEDIA & BUTTONS ===== */
.social-media {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 3rem 0;
}

.social-media a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 3.5rem;
    height: 3.5rem;
    background: transparent;
    border: .2rem solid var(--main-color);
    border-radius: 50%;
    font-size: 1.8rem;
    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);
}

.btn {
    display: inline-block;
    padding: 0.8rem 2.4rem;
    background: var(--main-color);
    border-radius: 4rem;
    box-shadow: 0 0 1rem var(--main-color);
    font-size: 1.4rem;
    color: var(--second-bg-color);
    letter-spacing: .1rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn:hover {
    box-shadow: none;
    transform: scale(1.05);
}

/* ===== ABOUT SECTION ===== */
.about {
    background: var(--second-bg-color);
    flex-direction: column-reverse;
    gap: 4rem;
}

.about-img {
    width: 100%;
    display: flex;
    justify-content: center;
}

.about-img img {
    width: 60vw;
    max-width: 300px;
    border-radius: 50%;
    box-shadow: 0 0 2rem var(--main-color);
}

.about-content {
    width: 100%;
    text-align: center;
}

.heading {
    text-align: center;
    font-size: 3.5rem;
    margin-bottom: 3rem;
}

.about-content h2 {
    text-align: center;
    line-height: 1.2;
}

.about-content h3 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
}

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

/* ===== SKILLS SECTION ===== */
.skills {
    background: var(--second-bg-color);
}

.skills-grid {
    width: 100%;
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 2rem;
}

.skill-card {
    width: 100%;
    background: var(--bg-color);
    border-radius: 1.2rem;
    padding: 1.6rem;
    box-shadow: var(--box-shadow);
    transition: transform .3s ease, box-shadow .3s ease;
}

.skill-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .8rem;
    font-size: 1.6rem;
    font-weight: 600;
}

.skill-percent {
    color: var(--main-color);
}

.skill-bar {
    position: relative;
    width: 100%;
    height: .9rem;
    background: rgba(0,0,0,.08);
    border-radius: 999px;
    overflow: hidden;
}

.skill-bar span {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--main-color), #9b59b6);
    border-radius: 999px;
    transition: width 1.2s ease;
}

/* ===== PORTFOLIO SECTION ===== */
.portfolio {
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.portfolio-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 2rem;
    justify-items: center;
}

.portfolio-box {
    position: relative;
    border-radius: 2rem;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    aspect-ratio: 16/9;
    
}
.portfolio-iframe{

    width: 100%;
    height: 100%;
    object-fit: cover;
}
.portfolio-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.portfolio-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, .1), var(--main-color));
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 0 4rem;
    transform: translateY(100%);
    transition: var(--transition);
}

.portfolio-box:hover .portfolio-layer {
    transform: translateY(0);
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.85) 60%, rgba(155, 89, 182, 0.7) 100%);
}

.portfolio-box:hover .portfolio-layer,
.portfolio-box:hover .portfolio-layer h4,
.portfolio-box:hover .portfolio-layer p,
.portfolio-box:hover .portfolio-layer a i {
    color: #fff;
}

.portfolio-layer h4 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.portfolio-layer p {
    font-size: 1.4rem;
    margin: .3rem 0 1rem;
}

.portfolio-layer a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 5rem;
    height: 5rem;
    background: var(--text-color);
    border-radius: 50%;
}

.portfolio-layer a i {
    font-size: 2rem;
    color: var(--second-bg-color);
}

/* ===== CONTACT SECTION ===== */
.contact {
    background: var(--second-bg-color);
}

.contact form {
    max-width: 70rem;
    margin: 1rem auto;
    text-align: center;
}

.contact form .input-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact form .input-box input,
.contact form textarea {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.4rem;
    color: var(--text-color);
    background: var(--bg-color);
    border-radius: .8rem;
    margin: .7rem 0;
}

.contact form textarea {
    resize: none;
}

/* ===== FOOTER ===== */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 2rem 3%;
    background: var(--bg-color);
}

.footer-text p {
    font-size: 1.4rem;
}

.footer-iconTop a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: .8rem;
    background: var(--main-color);
    border-radius: .8rem;
    transition: var(--transition);
}

.footer-iconTop a:hover {
    box-shadow: 0 0 1rem var(--main-color);
}

.footer-iconTop a i {
    font-size: 2.4rem;
    color: var(--second-bg-color);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    background: transparent;
    border: .2rem solid var(--main-color);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--main-color);
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
    box-shadow: 0 0 1rem var(--main-color);
}

/* ===== MEDIA QUERIES ===== */
/* Mobile */
/* @media screen and (max-width: 767px) {
    .about-img {
        display: none;
    }
} */

/* Tablet */
@media screen and (min-width: 768px) {
    html {
        font-size: 55%;
    }

    .navbar {
        display: block;
        position: static;
        width: auto;
        padding: 0;
        background: none;
        border: none;
        box-shadow: none;
    }

    .navbar a {
        display: inline-block;
        font-size: 1.7rem;
        margin: 0 0 0 4rem;
    }

    #menu-icon {
        display: none;
    }

    .home-content h3 {
        font-size: 2.6rem;
    }

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

    .portfolio-container {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
        justify-items: center;
    }
      .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }


    .contact form .input-box {
        flex-direction: row;
    }

    .contact form .input-box input {
        width: 49%;
    }
}

/* Desktop */
@media screen and (min-width: 1024px) {
    html {
        font-size: 62.5%;
    }

    section {
        padding: 10rem 9% 2rem;
    }

    .header {
        padding: 2rem 9%;
    }

    .home {
        flex-direction: row;
        text-align: left;
        gap: 2rem;
    }

    .home-content {
        flex: 1;
    }

    .home-img {
        flex: 1;
    }

    .home-img img {
        width: 35vw;
        max-width: none;
    }

    .about {
        flex-direction: row;
        text-align: left;
    }

    .about-content {
        flex: 1;
        text-align: left;
    }

    .about-img {
        flex: 1;
    }

    .about-img img {
        width: 35vw;
        max-width: none;
    }

    .portfolio-container {
        grid-template-columns: repeat(2, 1fr);
        justify-items: center;
    }
      .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }


    .contact form .input-box input,
    .contact form textarea {
        font-size: 1.6rem;
        padding: 1.5rem;
    }

    .btn {
        padding: 1rem 2.8rem;
        font-size: 1.6rem;
    }

    .social-media a {
        width: 4rem;
        height: 4rem;
        font-size: 2rem;
        margin: 3rem 1.5rem 3rem 0;
    }
}

/* Fix for iOS input zoom */
@media screen and (-webkit-min-device-pixel-ratio:0) { 
    select,
    textarea,
    input {
        font-size: 16px;
    }
}
