:root {
  --background-color: #ffffffff;
  --text-color: #333333;
  --main-color: #1657cf;
  --secondary-color: #26c95d;
  --accent-color: #dddddd;
  --emphasis-color: #ffd700;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
  transition: all 0.5s ease;
  overflow-x: hidden;
}

body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
}

* {
  margin: 0;
  padding: 0;
  text-decoration: none;
  list-style: none;
  color: var(--text-color);
  transition: all 0.5s ease;
  box-sizing: border-box;
}

/*HEADER*/
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 3px 2px 4px var(--accent-color);
  background: var(--background-color);
  width: 100%;
  padding: 1rem;
  position: fixed;
  top: 0;
  z-index: 1000;
}

a:hover {
  color: var(--main-color);
}

header img {
  width: 6rem;
  max-width: 100%;
}

header img:hover {
  transform: scale(1.1);
}

nav {
  width: auto;
}

nav ul {
  display: flex;
  gap: 1.5rem;
}

.contact {
  background-color: var(--main-color);
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
}

.contact a {
  color: var(--background-color);
}

.contact a:hover {
  color: var(--accent-color);
}

.contact:hover {
  transform: scale(1.05);
  background: var(--secondary-color);
}

#menu-btn-container {
  display: none;
  cursor: pointer;
}

#menu-btn {
  width: 2rem;
  height: 2rem;
}

#overlay-header {
  background: var(--background-color);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  height: 100vh;
  width: 100vw;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 5rem;
  opacity: 1;
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
  visibility: visible;
}

#overlay-header.hidden {
  opacity: 0;
  visibility: hidden;
}

@keyframes fadeOut {
  from {
    opacity: 1;
    visibility: visible;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

#overlay-header ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

#overlay-header ul li {
  margin: 0;
}

#overlay-header .contact {
  margin-top: 1rem;
}

#overlay-header ul {
  transform: translateY(0);
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 1;
}

#overlay-header.fade-out ul {
  transform: translateY(-20px);
  opacity: 0;
}

/*HERO SECTION*/
#hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 4rem;
  background: url("./images/hero.webp") center/cover no-repeat;
  min-height: 100vh;
  text-align: center;
}

.hero-content {
  max-width: 100%;
  padding: 0 1rem;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--background-color);
  text-shadow: 2px 2px 4px var(--text-color);
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--background-color);
  text-shadow: 2px 2px 4px var(--text-color);
}

.cta-button {
  background: var(--secondary-color);
  color: var(--background-color);
  padding: 0.8rem 1.5rem;
  border-radius: 5px;
  text-transform: uppercase;
  font-weight: bold;
  display: inline-block;
}

.cta-button:hover {
  background: var(--main-color);
  transform: scale(1.05);
}

#rotating-words {
  color: var(--secondary-color);
  font-weight: bold;
  transition: opacity 0.5s ease;
}

/*PROJECTS*/
#featured-projects {
  background: var(--background-color);
  padding: 4rem 1rem;
  text-align: center;
}

.projects-content {
  max-width: 1200px;
  margin: 0 auto;
}

#featured-projects h2 {
  color: var(--main-color);
  font-size: 2rem;
  margin-bottom: 1rem;
}

#featured-projects .description {
  color: var(--text-color);
  font-size: 1rem;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 0 1rem;
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 300px;
}

.project-card:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.project-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
  filter: brightness(0.7);
}

.project-card:hover .project-image {
  transform: scale(1.1);
  filter: brightness(0.9);
}

.project-title {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--background-color);
  font-size: 1.2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.project-info {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  text-align: center;
  color: var(--background-color);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.project-card:hover .project-info {
  opacity: 1;
}

.project-info p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--background-color);
  text-shadow: 2px 2px 4px var(--text-color);
}

.tech-used {
  font-style: italic;
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
}

.project-button {
  background: var(--secondary-color);
  color: var(--background-color);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  text-transform: uppercase;
  font-weight: bold;
  text-decoration: none;
  font-size: 0.8rem;
}

.project-button:hover {
  background: var(--main-color);
  color: var(--background-color);
}

/*ABOUT US*/
#about-us {
  background: linear-gradient(135deg, var(--background-color), var(--accent-color));
  padding: 4rem 1rem;
  text-align: center;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.logo-container {
  margin-bottom: 2rem;
}

.animated-logo {
  width: 120px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px); 
  }
}

#about-us h2 {
  color: var(--main-color);
  font-size: 2rem;
  margin-bottom: 1rem;
}

#about-us .description {
  color: var(--text-color);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.stats {
  margin: 2rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 0 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
}

.stat-item h4 {
  color: var(--main-color);
  font-size: 1.5rem;
}

.stat-item p {
  color: var(--text-color);
  font-size: 0.9rem;
}

/*FOOTER*/
footer {
  background: var(--accent-color);
  color: var(--text-color);
  padding: 2rem 1rem;
  text-align: center;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo img {
  width: 8rem;
  max-width: 100%;
}

.footer-links h3,
.footer-contact h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a,
.footer-contact a {
  color: var(--text-color);
  transition: color 0.3s ease;
}

.footer-links a:hover,
.footer-contact a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 1rem;
}

.social-icons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.social-icons a {
  display: inline-block;
  transition: transform 0.3s ease;
}

.social-icons a:hover {
  transform: translateY(-5px);
}

.social-icons img {
  width: 24px;
  height: 24px;
}

.copyright {
  font-size: 0.8rem;
}

/*MEDIA QUERIES*/

/* Tablets */
@media (min-width: 600px) {
  .hero-content h1 {
    font-size: 3rem;
  }
  
  .hero-content p {
    font-size: 1.3rem;
  }
  
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Small desktops */
@media (min-width: 768px) {
  #hero {
    justify-content: flex-start;
    text-align: left;
    padding-left: 5rem;
  }
  
  .hero-content {
    max-width: 50%;
  }
  
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-top {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-links ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Large desktops */
@media (min-width: 992px) {
  header {
    padding: 1rem 3rem;
  }
  
  nav ul {
    gap: 2.5rem;
  }
  
  #featured-projects {
    padding: 5rem 2rem;
  }
  
  #featured-projects h2 {
    font-size: 2.5rem;
  }
  
  #featured-projects .description {
    font-size: 1.2rem;
  }
  
  .project-title {
    font-size: 1.5rem;
  }
  
  .project-info p {
    font-size: 1rem;
  }
  
  .project-button {
    font-size: 0.9rem;
  }
  
  #about-us h2 {
    font-size: 2.5rem;
  }
  
  #about-us .description {
    font-size: 1.2rem;
  }
  
  .stat-item h4 {
    font-size: 2rem;
  }
  
  .stat-item p {
    font-size: 1rem;
  }
}

/* Mobile menu */
@media (max-width: 768px) {
  nav {
    display: none;
  }
  
  #menu-btn-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
  }
  
  #menu-btn {
    width: 100%;
    height: 100%;
  }
  
  header img {
    margin-left: 0;
  }
}

/*DETALLES*/
#details-hero{
  margin-top: 5rem;
  background: url(./images/project1.jpg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  height: 70vh;
}

#categories{
  display: flex;
  align-items: center;
  margin-left: 1rem;
}

#categories ul li{
  color: var(--background-color);
  background: var(--main-color);
  padding: .5rem;
  border-radius: 25px;
}