/* RESET GENERAL */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* VARIABLES DE COLORS */
:root {
  --granate: rgb(173, 0, 0);
  --negro: #000;
  --blanco: #fff;
  --gris: #444;
}

/* BASE / BODY */
body {
  font-family: 'Work Sans', sans-serif;
  color: var(--negro);
  background-color: var(--blanco);
  overflow-x: hidden;
  margin-top: 40px;
}

/* BANNER SUPERIOR / NAV */
.banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background-color: #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 80px;
  z-index: 1000;
}

.banner a {
  font-family: 'Inter', sans-serif;
  color: white;
  text-decoration: none;
  font-weight: 400;
  font-size: 1.1rem;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.banner a:hover {
  color: var(--granate);
}

.banner .left { text-align: left; }
.banner .center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.banner .right { text-align: right; }

/* HERO */
.hero {
  width: 100%;
  height: 100vh;
  background-image: url('DSC_0797.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* TEXT PRINCIPAL HERO */
.text-hero h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  color: white;
  line-height: 1;
  text-align: center;
  letter-spacing: -2px;
  position: relative;
  z-index: 2;
  animation: fadeIn 1.5s ease;
}

/* IMATGE HERO RESPONSIVE */
.hero-img {
  position: absolute;
  bottom: 30%;
  right: 25%;
  width: clamp(260px, 26vw, 480px);
  z-index: 3;
  animation: fadeIn 3s ease;
  pointer-events: none;
}

/* SECCIÓ CONTINGUT CV */
.contingut {
  background-color: var(--blanco);
  color: var(--negro);
  max-width: 800px;
  margin: 0 auto;
  padding: 100px 20px;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.contingut .bloc {
  background-color: transparent;
  padding: 0;
}

.contingut .bloc h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--negro);
  padding-bottom: 5px;
}

.contingut .bloc p,
.contingut .bloc li {
  font-family: 'Work Sans', sans-serif;
  color: var(--gris);
  line-height: 1.8;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.contingut .bloc ul {
  padding-left: 20px;
  margin-top: 10px;
}

.contingut .bloc li {
  list-style: disc;
  margin-bottom: 10px;
}

/* HOVER BLOCS CV: només text vermell */
.contingut .bloc:hover h2,
.contingut .bloc:hover p,
.contingut .bloc:hover li {
  color: var(--granate);
}

/* PORTFOLI */
.titol-portfoli {
  text-align: center;
  margin-top: 100px;
  padding-top: 80px;
}

.titol-portfoli h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(3rem, 8vw, 8rem);
  color: black;
  font-weight: 700;
  letter-spacing: -1px;
  opacity: 0;
  animation: fadeInTitle 2s ease forwards;
}

.titol-portfoli p {
  font-family: 'Work Sans', sans-serif;
  font-weight: 300;
  color: #333;
  max-width: 600px;
  margin: 0 auto 60px auto;
  font-size: 1.1rem;
}

.portfoli {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 50px;
  max-width: 1400px;
  margin: -60px auto 100px auto;
  padding: 0 20px;
  background-color: white;
}

.item {
  background-color: #fff;
  border: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  padding: 30px;
  text-align: left;
  transition: transform 0.6s ease, box-shadow 0.6s ease;
  transform-origin: center;
  position: relative;
  overflow: hidden;
}

.item:hover {
  transform: translateY(-10px) scale(1.05) rotate3d(5,5,4,6deg);
  box-shadow: 0 15px 35px rgba(0,0,0,0.35);
}

.item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  margin-bottom: 20px;
  transition: filter 0.6s ease, transform 0.6s ease;
}

.item:hover img {
  filter: grayscale(100%) contrast(120%);
  transform: scale(1.05);
}

.item h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: #000;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.item p {
  font-family: 'Work Sans', sans-serif;
  font-size: 1rem;
  color: #444;
  line-height: 1.5;
}

/* IMATGE SOBRE TÍTOL PORTFOLI */
.wide-image-portfolio {
  position: relative;
  width: 100%;
  text-align: right;
  margin-top: -120px;
  margin-bottom: 80px;
  padding-right: 30%;
  z-index: 5;
}

.wide-image-portfolio img {
  width: 30%;
  height: auto;
  display: inline-block;
  object-fit: contain;
  filter: brightness(95%);
  transition: transform 0.8s ease, filter 0.8s ease;
}

/* RESPONSIVE GENERAL */
@media (max-width: 900px) {
  .hero-img { bottom: 28%; right: 18%; width: clamp(220px, 27vw, 400px); }
  .titol-portfoli h1 { font-size: 6rem; }
  .wide-image-portfolio { padding-right: 20%; text-align: right; }
  .wide-image-portfolio img { width: 35%; }
  .portfoli { grid-template-columns: 1fr; padding: 40px 20px; }
  .item img { height: 350px; }
}

@media (max-width: 700px) {
  .hero-img { bottom: 25%; right: 16%; width: clamp(180px, 32vw, 350px); }
  .titol-portfoli h1 { font-size: 4.5rem; }
  .wide-image-portfolio { padding-right: 0; text-align: center; margin-top: -80px; }
  .wide-image-portfolio img { width: 50%; margin: 0 auto; display: block; }
}

@media (max-width: 500px) {
  .hero-img { bottom: 22%; right: 14%; width: clamp(150px, 38vw, 300px); }
  .titol-portfoli h1 { font-size: 3.5rem; }
  .wide-image-portfolio img { width: 60%; }
}

@media (max-width: 380px) {
  .hero-img { bottom: 18%; right: 12%; width: clamp(120px, 42vw, 250px); }
  .titol-portfoli h1 { font-size: 3rem; }
  .wide-image-portfolio img { width: 65%; }
}

/* ANIMACIONS */
@keyframes fadeIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInTitle { to { opacity: 1; } }
