/* css reset */
/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}

/* end of css reset */

:root{
  --primary-color: #D4A373;
  --background-color: #FEFAE0;
  --text-color: #000;
  --card-bg-color: #FAEDCD;
  --font-primary: 'Roboto', sans-serif;
  --font-heading: 'Raleway', sans-serif;
}

body{
  background-color: var(--background-color);
  font-family: var(--font-primary);
  color: var(--text-color);
}

.logo{
  font-weight: 900;
  color: rgb(0, 0, 0);
}

nav{
  display: flex;
  background-color: var(--primary-color);
  justify-content: space-between;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  align-items: center;
} 

nav ul li, nav ul li a{
  display: inline-block;
  padding: 0 0.5rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 450;
}

nav ul li a:hover, nav ul li a:active{
  color: rgb(255, 255, 255);
}

nav ul{
  display: flex;
  justify-content: space-between;
}

main{
  width: 90%;
  margin: 0 auto; 
}

.porto-img{
  width: 100%;
  height: 30rem;
  object-fit: cover;
  border-radius: 0.9rem;
  object-position: 50% 30%;
}

#hero{
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  gap: 2rem;    
}

.hero-desc{
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: justify;
}

.hero-desc h1{
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: left;
  line-height: 1.2;
}

#about{
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  text-align: justify;
}

#about h2{
  font-size: 2rem;
  font-weight: 500;
}

.image-container{
  width: 100%;
  height: 15rem;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
}

.image-container img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#projects h2{
  font-size: 2rem;
  font-weight: 500;
  margin: 2rem 0;
}

.project-container{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;  
  gap: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 4rem;

}

.card-project{
  background-color: var(--card-bg-color);
  flex: 1 1 300px;
  max-width: 300px;
  display: flex;
  flex-direction: column;

  padding: 1.2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.project-content{
  flex-grow:1;
}

.card-project h3{
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

footer{
  height: 7rem;
  padding: 1rem 2rem;
  background-color: var(--primary-color);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

footer .footer-name{
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: black;
  text-align: left;
}

footer .footer-copyright{
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Make cards smaller on small screens to maintain a 3x3 layout as much as possible. */
@media (max-width: 1024px){
  .card-project{
    flex: 1 1 250px;
  }

   nav ul{
    padding: 0;
  }
}

/* Stack the navigation bar and the hero section (image and description) from row to column. */
@media (max-width: 800px){
  nav{
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  nav .logo{
    margin-bottom: 1.5rem;
    text-align: center;
  }

   nav ul{
    flex-direction: column;
    align-items: center;
  }

  nav ul li{
    margin-bottom: 1rem;
    align-items: center;
    text-align: center;
  }

  #hero{
    flex-direction: column;
  }

  #hero h1{
    font-size: 2rem;
  }

}

