/* Paleta*/
:root {
  --color-bg: #fefefe;
  --color-text: #222;
  --color-primary: #0077ff;
  --color-secondary: #ff6f61;
  --color-accent: #00c9a7;
  --color-light: #f3f8ff;
}

/* Tipografia i base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  scroll-behavior: smooth;
}

/*Header amb gradient */
header {
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.3rem;
}

header .sub {
  font-size: 1.1rem;
  opacity: 0.9;
}

.main-nav {
  margin-top: 1rem;
}

.main-nav a {
  color: white;
  margin: 0 0.8rem;
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: white;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.main-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Seccions generals */
section {
  padding: 3rem 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

section h2 {
  color: var(--color-primary);
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--color-accent);
  display: inline-block;
  padding-bottom: 0.3rem;
}

/* Skills */
.skills {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 1rem;
}

.skills li {
  background: var(--color-light);
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  font-weight: 500;
  transition: all 0.25s ease;
}

.skills li:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-3px);
}

/* Experiència */
article {
  background: white;
  border-left: 5px solid var(--color-secondary);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

article:hover {
  transform: translateY(-4px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
}

/* Projectes */
.project {
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.project a {
  color: #fff;
  text-decoration: underline;
  font-weight: 600;
}

/* Contacte */
#contact {
  background: var(--color-light);
  border-top: 3px solid var(--color-primary);
  text-align: center;
}

#contact a {
  color: var(--color-secondary);
  font-weight: 600;
  text-decoration: none;
}

#contact a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.2rem;
  background: var(--color-primary);
  color: white;
  font-size: 0.9rem;
}
footer a {
  color: var(--color-accent);
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 700px) {
  header h1 {
    font-size: 1.9rem;
  }
  .skills {
    justify-content: center;
  }
}
