@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: "Nunito", sans-serif;
}

:root {
    --bg-color: #fff;
    --snd-bg-color: #ecebeb;
    --text-color: #000000;
    --main-color: #59B2F4;
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

section {
    min-height: 100vh;
    padding: 10rem 9% 2rem;
}



/* Theme overrides and transitions */
/* Smoothly animate color/background changes when switching theme */
html, body {
    transition: background-color .1s ease, color .1s ease;
}

/* Dark theme: set on <body class="dark"> */

body.dark {
    --bg-color: #0b1220;
    --snd-bg-color: #071016;
    --text-color: #e6eef7;
    --main-color: #59B2F4;
}
/* -----------------------------------*/





/* -----Theme toggle button -----*/
.theme-toggle {
    background: transparent;
    color: var(--text-color);
    font-size: 1.5rem;
    padding: .4rem .6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
    margin-left: 1rem;
}
/* -----------------------------------*/





/*-----Header section-----*/
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 9%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo {
    font-size: 2.5rem;
    color: var(--main-color);
    font-weight: 700;
    cursor: default;
}

.navbar a {
    display: inline-block;
    position: relative;
    font-size: 1.5rem;
    color: var(--text-color);
    margin-left: 4rem;
    font-weight: 700;
    padding: .4rem 0;
    transition: color .35s ease, transform .25s ease;
    -webkit-tap-highlight-color: transparent;
}

.navbar a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -0.6rem;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    width: 75%;
    height: 3px;
    background: var(--main-color);
    border-radius: 4px;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s;
    opacity: 0;
}

.navbar a:hover,
.navbar a:focus {
    color: var(--main-color);
    transform: translateY(-4px);
    text-shadow: 0 6px 14px rgba(89,178,244,0.08);
}


.navbar a:hover::after,
.navbar a:focus::after,
.navbar a.active::after {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
}

.navbar a.active {
    color: var(--main-color);
    transform: translateY(-4px);
}

#menu-icon {
    font-size: 3.6rem;
    color: var(--text-color);    
    display: none;
    cursor: pointer;
}
/* -----------------------------------*/





/* Align theme toggle near the navbar on wide screens */
.header > .theme-toggle {
    /* push the toggle to the right side so it's visually adjacent to the navbar */
    margin-left: auto;
}

.header .navbar {
    /* small gap between toggle and navbar */
    margin-left: .8rem;
}
/* -----------------------------------*/





/*-----Home section-----*/
.home {
    display: flex;
    justify-content: center;
    align-items: center;
}

.home-content h3 {
    font-size: 3.2rem;
    font-weight: 700;
}

.home-content h3:nth-of-type(2) {
    margin-bottom: 2rem;
}

span {
    color: var(--main-color);
}

.home-content h1 {
    font-size: 5.6rem;
    font-weight: 700;
    line-height: 1.3;
}

.home-img {
    padding-left: 5%;
    width: 35vw;
    height: 35vw;
    animation: floatImage 10s ease-in-out infinite;
}

.hero-image {
    width: 35vw;
    height: 35vw;
    border-radius: 50%;
    border: 0.5rem solid var(--main-color);
}

@keyframes floatImage {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2.4rem);
    }
    100% {
        transform: translateY(0);
    }
}

.home-content p {
    font-size: 1.9rem;
    line-height: 1.5;
}

.social-media a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background: transparent;
    border: .2rem solid var(--main-color);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--main-color);
    margin: 3rem 1.5rem 3rem 0;
    transition: .5s ease;
}

.social-media a:hover {
    background: var(--main-color);
    color: var(--snd-bg-color);
    box-shadow: 0 0 1rem var(--main-color);
}

.btn {
    display: inline-block;
    padding: 1rem 2.8rem;
    background: var(--main-color);
    border-radius: 4rem;
    box-shadow: 0 0 1rem var(--main-color);
    font-size: 1.6rem;
    color: var(--bg-color);
    letter-spacing: .1rem;
    font-weight: 600;
    transition: .5s ease;
}

.btn:hover {
    box-shadow: none;
}
/* -----------------------------------*/





/*-----About section-----*/
/* About section: use a centered block layout to match other sections */
.about {
    background: var(--bg-color);
    text-align: center;
}

.about h2 {
    margin-bottom: 5rem;
}

.heading {
    text-align: center;
    font-size: 4.5rem;
}

.about-content {
    max-width: 90rem;
    margin: 0 auto;
    padding: 0 2rem;
}

.about-content p {
    font-size: 1.9rem;
    margin: 1rem auto 3rem;
    line-height: 1.5;
}
/* -----------------------------------*/





/*-----Services section-----*/
.services h2 {
    margin-bottom: 5rem;
}

.services-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.services-container .services-box {
    flex: 1 1 30rem;
    background: var(--bg-color);
    padding: 3rem 2rem 4rem;
    border-radius: 2rem;
    text-align: center;
    border: .2rem solid var(--main-color);
    transition: .5s ease;
}

.services-container .services-box:hover {
    border-color: var(--main-color);
    transform: scale(1.02);
}

.services-box i {
    font-size: 7rem;
    color: var(--main-color);
}

.services-box h3 {
    font-size: 2.6rem;
}

.services-box p {
    font-size: 1.9rem;
    margin: 1rem 0 3rem;
}
/* -----------------------------------*/





/*-----Portfolio section-----*/
.portfolio {
    background: var(--bg-color);
}

.portfolio h2 {
    margin-bottom: 4rem;
}

.portfolio h4 {
    /* Ensure project titles are visible on top of image overlays in both light and dark themes */
    color: #fff;
}

.portfolio-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    gap: 2.5rem;
}

.portfolio-container .portfolio-box {
    position: relative;
    border-radius: 2rem;
    box-shadow: 0 0 1rem var(--main-color);
    overflow: hidden;
    display: flex;
}

.portfolio-box img {
    width: 100%;
    transition: .5s ease;
    opacity: 1;
}

.portfolio-box:hover img {
    transform: scale(1.1);
}

.portfolio-box .portfolio-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.1) var(--main-color));
    display: flex;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 0 4rem;
    transform: translateY(100%);
    transition: .2s ease;
}

.portfolio-box:hover .portfolio-layer {
    transform: translateY(0);
}

.portfolio-layer h4 {
    font-size: 3rem;
    color: #fff; /* explicit white so it stays readable in dark mode */
}

.portfolio-layer p {
    font-size: 1.9rem;
    margin: .3rem 0 1rem;
}

.portfolio-layer a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 5rem;
    height: 5rem;
    background: var(--main-color);
    border-radius: 50%;
}
/* -----------------------------------*/





/*-----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(--snd-bg-color);
    border-radius: .8rem;
    margin: .7rem 0;
}

.contact form .input-box input {
    width: 49%;
}

.contact form textarea {
    resize: none;
}

.contact form .btn {
    margin-top: 2rem;
    cursor: pointer;
}
/* -----------------------------------*/





/*-----Footer section-----*/
.footer {
   display: flex;
   justify-content: center;
   align-items: center;
   flex-wrap: wrap;
   padding: 1.6rem 9%;
   background: var(--snd-bg-color);
}

.footer-text {
    font-size: 1.6rem;
}    

.footer-iconTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-size: 2.6rem;
    color: var(--main-color);
    background: var(--main-color);
    width: 4rem;
    height: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 1rem var(--main-color);
    transition: .5s ease;
    overflow: hidden; 
    -webkit-tap-highlight-color: transparent;
}

.footer-iconTop a {
    display: inline-flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: transparent;
}

.footer-iconTop:hover,
.footer-iconTop:focus,
.footer-iconTop a:hover,
.footer-iconTop a:focus {
    background: var(--main-color);
    color: var(--snd-bg-color);
    box-shadow: none;
    outline: none;
}
/* -----------------------------------*/





/*-----Responsive Media Queries-----*/
@media (max-width: 768px) {
  .header{padding:1.2rem 5%;flex-direction:column;align-items:flex-start;gap:.8rem}
  .logo{font-size:2rem}

    /* on smaller screens header becomes column — don't push the toggle with auto margin */
    .header > .theme-toggle { margin-left: 0; }
  
  .navbar {
        position: absolute;
        top: 100%;
        left: 50%;
        width: 50%;
        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: right;
        padding-right: 2rem;
    }


    .navbar a::after {
        display: none;
    }

    .navbar a:hover,
    .navbar a:focus,
    .navbar a.active {
        transform: none;
    }  

  #menu-icon{display:block;position:absolute;right:5%;top:1.2rem;z-index:110}
  section{padding:8rem 6% 2rem}
  .home{flex-direction:column;gap:2rem}
  
  /* Place hero image above the text on mobile by changing order */
  .home-img{order:-1}
  .home-content h1{font-size:4.2rem}
  .home-content h3{font-size:2.6rem}
  .home-img{width:45vw}

  /* About: on mobile keep block stacking and add side padding for readability */
  .about{padding:0 2rem}
  .about-img img{width:70vw}
  .services-container{flex-direction:column}
  .services-container .services-box{flex:1 1 100%}
  .portfolio-container{grid-template-columns:repeat(2,1fr)}
  .portfolio-box img{opacity:1}
  .contact form .input-box input{width:100%}
  .footer-iconTop{right:1.2rem;bottom:1.2rem;width:3.4rem;height:3.4rem;font-size:2.6rem}

  /* Place theme toggle near the menu icon on mobile (left of the menu button) */
  .header > .theme-toggle {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;

  /* place slightly left of the menu icon which is at right:5% */
    right: calc(5% + 3.6rem);
    z-index: 111;
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  html{font-size:56%}
  .header{padding:1rem 4%}
  .logo{font-size:1.8rem}
  .navbar a{font-size:1.3rem;margin-right:.8rem}
  .home-content h1{font-size:3.6rem}
  .home-img{width:60vw}
  .about-img img{width:80vw}
  .portfolio-container{grid-template-columns:1fr}
  .services-box i{font-size:5.6rem}
  .footer-iconTop{width:4rem;height:4rem;font-size:2.6rem}
}
/* -----------------------------------*/