/* =========================================================
   COLORS / PALETA
   ========================================================= */

.color-accent-pink { background: #ff0066; }
.color-accent-magenta { background: #bd2b84; }
.color-accent-purple { background: #733c81; }

.color-bg-dark { background: #202731; }
.color-bg-mid { background: #373860; }
.color-bg-deep { background: #151a2e; }

.dark { background: #17142a; }


/* =========================================================
   RESET + BODY
   ========================================================= */

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  color: white;
  background: #202731;
  overflow-x: hidden;
}

strong em,
em strong {
  color: #f1c43a;
}

html {
  scroll-behavior: smooth;
}


/* =========================================================
   Navbar
   ========================================================= */


.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;

  background: rgba(23, 20, 42, 0.85);
  backdrop-filter: blur(10px);
  z-index: 9999;
}

.nav-burger{
  display: none;
}

.nav-mobile-menu{
  display: none;
}

.navbar-inner {
  max-width: calc(350px * 4 + 3em); /* mateix ample visual que la grid */
  margin: 0 auto;
  height: 100%;

  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;

  padding: 0 1rem;
}

.nav-left {
  justify-self: start;
}

.nav-center {
  justify-self: center;
}

.nav-right {
  justify-self: end;
}

.navbar a {
  color: white;
  text-decoration: underline;
  font-size: 21px;
  cursor: pointer;
  font-weight: 600;
}

.navbar a {
  cursor: pointer;
  position: relative;
}

.navbar a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform .2s ease;
}

.navbar a:hover::after {
  transform: scaleX(1);
}



/* =========================================================
   PERSONAL INFORMATION (TEXT)
   ========================================================= */

#personal-information h1 {
  padding-top: 0;
  font-size: 80px;
  text-align: left;
}

#personal-information h2 {
  padding-top: 0;
  font-size: 35px;
  text-align: center;
  text-decoration: underline;
}

#personal-information h4 {
  text-align: left;
  margin-left: 4px;
  padding: 15px 0;
  font-size: 21px;
}

#personal-information p {
  margin-top: auto;
  text-align: center;
  font-size: 15px;
}

.item h1,
.item h2,
.item h3,
.item h4 {
  margin: 0;
}

#hero h4{
  color: #f7e084;
}


/* =========================================================
   SECTIONS
   ========================================================= */

section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 100px;
}

#firstBG { height: 300px; }
#secondBG { height: 200px; }
#thirdBG { height: 130px; }
#fourthBG { height: 100px; }
#fivethBG { height: 250px; }


/* =========================================================
   GRID + ITEMS
   ========================================================= */

.grid-container {
  margin-top: 30px;
  display: grid;
  grid-auto-columns: 350px;
  grid-auto-rows: 350px;
  gap: 1em;
  grid-template-areas: 
    "box-2 box-1 box-1 box-4"
    "box-2 box-5 box-3 box-3";
}

.item {
  padding: 2%;
  z-index: 10;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  border: 2px solid #ffffff10;
  backdrop-filter: blur(50px);
  display: flex;
  flex-direction: column;
}


/* =========================================================
   NAME + AVATAR
   ========================================================= */

.name-avatar {
  display: flex;
  align-items: center;
  width: 100%;
}

.name-avatar h1 {
  font-size: 80px;
  white-space: nowrap;
  flex-shrink: 0;
}

.avatar-space {
  flex: 1;
  display: flex;
  justify-content: center;
}

.avatar-space img {
  width: 145px;
  height: 145px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  outline: 2px solid rgba(255,255,255,0.6);
}


/* =========================================================
   SOCIAL BUTTONS
   ========================================================= */

.role-social {
  display: flex;
  justify-content: center;
  gap: 80px;
  margin: auto 0;
  padding: 0;
  list-style: none;
}

.role-social .social-btn {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  transition: all .2s ease;
}

.role-social .social-btn svg {
  width: 28px;
  height: 28px;
}

.role-social .social-btn:hover {
  color: #f1c43a;
  border-color: #f1c43a;
  background: rgba(255,255,255,0.18);
  transform: translateY(-2px);
}


/* =========================================================
   TIMELINE 
   ========================================================= */

.box-2 {
  position: relative;
}

.timeline-svg {
  position: absolute;
  top: 12%;
  left: -3.5%;
  height: 88%;
  pointer-events: none;
  z-index: 0;
}

.box-2 > :not(.timeline-svg) {
  position: relative;
  z-index: 1;
}

.box-2 li {
  font-size: 14px;
}



#zitro,
#freelance,
#dolores {
  position: absolute;   
  width: 96%;
}



.timeline-title {
  position: absolute;
  top: 0.2em;
  left: 8.5%;
  font-size: 22px;
  color: #f7e084;
}

.timeline-time {
  position: absolute;
  top: 1.6em;
  left: 10%;
  font-size: 13px;
  opacity: 0.7;
}

.timeline-list {
  margin-top: 4.5em;              
  margin-left: 4%;
  padding: 0.6em 0 0.8em 8%;
  width: 90.5%;
  background: rgba(255,255,255,0.12);
}

.timeline-list li:not(:last-child) {
  margin-bottom: 0.4em;
}



/* =========================================================
   TECH STACK
   ========================================================= */

.box-4 h2 {
    text-align: center;
    margin-bottom: .5rem;
}

.wrapper {
  width: 100%;
  margin-inline: auto;
  margin-block: 1.25rem; /* ← separació entre carrusels */
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(
    to right,
    rgba(0,0,0,0),
    rgba(0,0,0,1) 20%,
    rgba(0,0,0,1) 80%,
    rgba(0,0,0,0)
  );
}

.wrapper.main {
  height: auto;
  background-color: rgba(255,255,255,0.2);
  padding: 0.5em 0em;
}

.wrapper.small {
  height: auto;
  padding: .5em 0em;
  -webkit-filter: grayscale(100%);
  filter: grayscale(100%);
  opacity: 0.6;
  filter: alpha(opacity=60);

  background-color: rgba(255,255,255,0.2);
}

.track {
  display: flex;
  align-items: center;
  will-change: transform;
}

.wrapper.main .logo {
  height: 50px;
}

.wrapper.small .logo {
  height: 25px;
}

.logo-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  width: auto;
  display: block;
  pointer-events: none;
}

/* Zona arrossegable */
.wrapper {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

/* Quan s’està arrossegant */
.wrapper.dragging {
  cursor: grabbing;
}

/* Important: el track NO ha de sobreescriure el cursor */
.track {
  cursor: inherit;
}


/* =========================================================
   AWARDS
   ========================================================= */



.award {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.5rem;
}

/* CONTENIDOR DE LA IMATGE (controla mida) */
.award-image {
  height: 187px;
  display: flex;
  align-items: center;
  justify-content: center;
  
}

.award-image img {
  height: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 8px;  
}

/* TEXT → MÉS AMPLE QUE LA IMATGE */
.award figcaption {
  margin-top: 0.5rem;
  width: 150%;
  text-align: center;
  line-height: 1.25;
}

.award figcaption strong {
  display: block;
  font-size: 0.95rem;
  color: #ffffff;
}

.award figcaption span {
  display: block;
  font-size: 0.75rem;
  color: #a0a0a0;
  margin-top: 0.4rem;
}

#awards {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}



/* =========================================================
   STUDIES
   ========================================================= */

.study-main,
.study-secondary {
  width: 100%;
  margin: 0;
}

.box-3 {
  padding-top: 5px;
  align-items: stretch;
}

.box-3 h3{
  color: #ffe066;
}

.study-main {
  margin-top: 24px;

  border-radius: 8px;
  border: 2px solid #ffffff10;
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);

  padding: 1% 1.5% 0% 1.5%;
  width: 100%;

  box-sizing: border-box;
  overflow: hidden;  
}

.study h3 {
  margin: 0;
  font-size: 18px;
  margin-bottom: 0px;
}



.study-meta {
  font-size: 13px;
  opacity: 0.75;
}

.study-secondary {
  margin-top: 18px;
  
  border-radius: 8px;
  border: 2px solid #ffffff10;
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);

  padding: 1% 1.5% 0% 1.5%;
  width: 100%;

  box-sizing: border-box;
  overflow: hidden;

}


.study-list {
  margin-top: 1rem;
  padding-left: 1.1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 0.4rem;
  font-size: 12.5px;
  column-gap: 1.9rem;
}

.study-list li {
  line-height: 1.3;
}


/* =========================================================
   SHAPES / BACKGROUNDS
   ========================================================= */

.curve {
  position: absolute;
  height: 250px;
  width: 100%;
  bottom: 0;
}

.curve::before {
  content: '';
  position: absolute;
  border-radius: 100% 50%;
  width: 55%;
  height: 100%;
  transform: translate(85%, 60%);
  background-color: hsl(216, 21%, 16%);
}

.curve::after {
  content: '';
  position: absolute;
  border-radius: 100% 50%;
  width: 55%;
  height: 100%;
  background-color: #17142a;
  transform: translate(-4%, 40%);
  z-index: -2;
}

.bubble::after { 
    content: ''; 
    border-top-left-radius: 50% 100%; 
    border-top-right-radius: 50% 100%; 
    position: absolute; 
    bottom: 0; 
    z-index: -1; 
    width: 100%; 
    background-color: #151a2e; 
    height: 75%; 
}

.spacer {
  aspect-ratio: 960 / 300;
  width: 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-color: hsl(216, 21%, 16%);
}

.layer1 { background-image: url('./public/bgs/layer1.svg'); }
.layer2 { background-image: url('./public/bgs/layer2.svg'); }

.flip { transform: rotate(180deg); }

.spacer.layer1 {
  margin-top: -1px;
}
/*
  PROJECTS
*/

.projects * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.projects-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

.card-wrapper {
  max-width: 1100px;
  margin: 0 auto 35px;
  padding: 20px 10px;
}

.card-list .card-item {
  list-style: none;
}

/* CARD */
.card-list .card-item .card-link {
  display: block;
  background: #333b4f;              /* abans #fff */
  padding: 18px;
  user-select: none;
  border-radius: 12px;
  text-decoration: none;
  
  box-shadow: none;                 /* fora ombra clara */
  transition: 0.2s ease;
}

/* CARD NAME (títol superior de la card) */
.card-list .card-link .card-name {
  color: #f7e084;          /* mateix groc que headings/timeline */
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 12px 0;      /* separació amb la imatge */
  line-height: 1.1;
}


.card-list .card-item .card-link:hover {
  border-color: #5372F0;
}

/* IMAGE */
.card-list .card-link .card-image {
  width: 100%;
  border-radius: 10px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card-list .card-image {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}


/* BADGES */
.card-list .card-link .badge {
  color: #7aa2ff;
  width: fit-content;
  padding: 8px 16px;
  font-size: 0.95rem;
  border-radius: 50px;
  font-weight: 500;
  background: #222b44;
  margin: 16px 0 18px;
}

/* BADGES – estil neutre */
.card-list .card-link .badge {
  color: #e6e9f2;          /* gris molt clar, gairebé blanc */
  background: #4a536b;     /* gris-blau clar coherent amb cards */
  width: fit-content;
  padding: 6px 14px;
  font-size: 0.9rem;
  border-radius: 50px;
  font-weight: 500;
  margin: 16px 0 18px;
  letter-spacing: 0.2px;
}
.card-list .card-link .badge {
  display: inline-flex;
}

/* TITLE */
.card-list .card-link .card-title {
  color: #ffffff;                  /* abans negre */
  font-size: .8rem;
  font-weight: 600;
}

.card-title {
  min-height: 5.5em; /* ~3 línies */
  line-height: 1.4;
}

.card-title {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}


/* CARD BUTTON (NO TOCAT, NOMÉS COLOR) */
.card-list .card-link .card-button {
  height: 35px;
  width: 35px;
  color: #7aa2ff;
  margin: 30px 0 5px;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  border: 2px solid #7aa2ff;
  transform: rotate(-45deg);
  transition: 0.4s ease;
}

.card-list .card-link .card-button-2 {
  height: 35px;
  width: 35px;
  color: #7aa2ff;
  margin: 30px 0 5px;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  transition: 0.4s ease;

  
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.card-list .card-link .card-button-3 {
  height: 35px;
  width: 35px;
  color: #7aa2ff;
  border: 2px solid #7aa2ff;
  margin: 30px 0 5px;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  transition: 0.4s ease;

  
  display: flex;
  align-items: center;
  justify-content: center;
}


.card-button-2 svg {
  width: 80%;
  height: 80%;
  display: block;
}

.card-button-3 svg {
  width: 60%;
  height: 60%;
  display: block;
}


.card-list .card-link:hover .card-button{
  color: #ffffff;
  background: #7aa2ff;
}

.card-list .card-link:hover .card-button-2 {
 color: #ffffff;
  background: #7aa2ff;
}

.card-list .card-link:hover .card-button-3 {
 color: #ffffff;
  background: #7aa2ff;
}






.nav-block .swiper-button-prev,
.nav-block .swiper-button-next {
  position: static !important;
}


.nav-block {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 100px;
  margin-bottom: 40px;
}

.nav-block .swiper-button-prev,
.nav-block .swiper-button-next {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(5px);
}

/* Bullets inactius */
.nav-block .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: rgba(122, 162, 255, 0.35); /* 👈 blau suau visible */
  opacity: 1;                            /* 👈 IMPORTANT */
}

/* Bullet actiu */
.nav-block .swiper-pagination-bullet-active {
  width: 10px;
  height: 10px;
  background: #7aa2ff;                   /* blau fort */
}






.card-item {
  position: relative;
}

/* Pestanya integrada */
.card-tab {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
}

.card-tab a {
  display: inline-flex;
  align-items: center;
  gap: 8px;              /* abans 6px */

  padding: 8px 16px;    /* abans 6px 12px */
  font-size: 0.85rem;   /* abans 0.75rem */
  font-weight: 600;

  color: #e6e9f2;
  background: #333b4f;  /* mateix fons que la card */

  border-left: 2px solid #424b63;
  border-bottom: 2px solid #424b63;

  border-radius: 0 14px 0 10px; /* una mica més suau */
  text-decoration: none;
}

.card-tab a:hover {
  background: #7aa2ff;
  color: #ffffff;
}

.card-tab svg {
  width: 16px;   /* abans 14px */
  height: 16px;
}



.card-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid #424b63; /* ✅ border neutre */
  border-radius: 12px;
  pointer-events: none;
  z-index: 0;
  transition: border-color 0.25s ease;
}

.card-item:hover .card-link::before {
  border-color: #5372F0; /* blau només en hover */
}

.card-tab {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
}

.card-tab a {
  position: relative;
  z-index: 3;

  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;

  background: #333b4f;
  color: #e6e9f2;

  border-left: 2px solid #424b63;   /* ✅ neutre */
  border-bottom: 2px solid #424b63; /* ✅ neutre */

  border-radius: 0 12px 0 10px;
  text-decoration: none;

  transition: 
    border-color 0.25s ease,
    background 0.25s ease,
    color 0.25s ease;
}

.card-item:hover .card-tab a {
  border-left-color: #5372F0;
  border-bottom-color: #5372F0;
}

#projects {
  scroll-margin-top: 100px; 
}

.spacer.layer1 {
  aspect-ratio: 960 /220;
}



/* =========================================================
   Media Queries
   ========================================================= */


@media(max-width: 95em){ 
    .grid-container{ 
        grid-template-areas: 
        "box-1 box-1 box-5" 
        "box-2 box-3 box-3" 
        "box-2 box-4 box-4"; 
    }     

    #firstBG { height: 300px; }
    #separator-first { height: 200px; }
    #secondBG { height: 200px; }
    #thirdBG { height: 300px; }
    #fourthBG { height: 100px; }
    #fivethBG { height: 250px; }

    .navbar-inner {
      max-width: calc(350px * 3 + 2em); /* mateix ample visual que la grid */
      grid-template-columns: 1fr 1fr 1fr;
    }
} 

@media(max-width: 72em){ 
    .grid-container{ 
        grid-template-areas: 
        "box-1 box-1" 
        "box-2 box-4" 
        "box-2 box-5" 
        "box-3 box-3"; 
    } 

    #firstBG { height: 500px; }
    #separator-first { height: 300px; }
    #secondBG { height: 500px; }
    #thirdBG { height: 350px; }
    #fourthBG { height: 100px; }
    #fivethBG { height: 250px; }

    .navbar-inner {
      max-width: calc(350px * 2 + 1em); /* mateix ample visual que la grid */
      grid-template-columns: 1fr 1fr 1fr;
    }

    
} 

@media (max-width: 50em) {  
  .grid-container {
      gap: 1.5em;
      grid-template-areas:
        "box-1"
        "box-2"
        "box-3"
        "box-4"
        "box-5";

      grid-template-rows:
        1.25fr   
        1.785fr  
        1.25fr    
        1fr      
        1fr;     
    }

    #firstBG { height: 1120px; }
    #separator-first { height: 550px; }
    #secondBG { height: 100px; }
    #thirdBG { height: 650px; }
    #fourthBG { height: 80px; }
    #fivethBG { height: 250px; }

  .bubble::after { 
    border-top-left-radius: 35% 100%; 
    border-top-right-radius: 35% 100%;  
  }

  .navbar-inner {
    max-width: calc(350px * 1 + 0em); /* mateix ample visual que la grid */
    grid-template-columns: auto 1fr auto;
  }

  #hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  #hero .avatar-space {
    margin-top: 1rem;
    order: 1;
    margin-bottom: .5rem;
  }

  #hero h1 {
    text-align: center;
    margin-top: 2%;
    font-size: 42px;
    line-height: 1.1;
  }

  #hero h4 {
    text-align: center;
    font-size: 16px;
    margin-top: 6px;
  }

  #hero .name-avatar {
    flex-direction: column;
    align-items: center;
  }

  #hero .role-social {
    gap: 32px;
    margin: 1rem 0;
  }

  #hero p {
    font-size: 14px;
    max-width: 90%;
  }

  .award-image {
    height: 210px;   
  }

  #awards img {    
    margin-top: 2rem;
  }

  .award figcaption {
    margin-top: 2rem;
  }


  .box-4 h2 {
      text-align: center;
      margin-bottom: 1.5rem;
  } 

  .timeline-svg {
    left: -4.3%;
  }

  /* Amaguem links desktop */
  .nav-center,
  .nav-right {
    display: none;
  }

  /* Mostrem burger */
  .nav-burger {
    display: block;
    justify-self: end;
    font-size: 26px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
  }

  /* Menú desplegable */
  .nav-mobile-menu {
      display: flex;              /* 👈 sempre flex */
    flex-direction: column;
    width: 100%;
    background: rgba(23, 20, 42, 0.95);

    max-height: 0;              /* 👈 clau */
    overflow: hidden;

    opacity: 0;
    transform: translateY(-8px);

    transition:
    max-height 0.3s ease,
    opacity 0.25s ease,
    transform 0.25s ease;
  }

  .nav-mobile-menu a {
    padding: 1rem;
    text-align: center;
    font-size: 18px;
    border-top: 1px solid rgba(255,255,255,0.15);

    transition: background 0.2s ease;
  }

  .nav-mobile-menu a:active {
    background: rgba(255,255,255,0.08);
  }


  .nav-mobile-menu.open {
    max-height: 200px;          /* prou per Projects + Resume */
    opacity: 1;
    transform: translateY(0);
  }


  .nav-left {
    grid-column: 1;
  }

  .nav-burger {
    grid-column: 3;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: auto;

    font-size: 26px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
  }

  .navbar-inner {
    grid-template-columns: auto 1fr auto;
  }

  .nav-burger svg {
    width: 100%;
    height: 100%;
  }

  .nav-burger {
    width: 44px;
    height: 44px;
    padding: 0%;
  }
  /* DESACTIVEM underline animada al menú mòbil */
  .nav-mobile-menu a::after {
    content: none !important;
  }

  .navbar a:hover::after {
    transition: none;
    transform: scaleX(0);
  }

  #projects{
    margin-top: 30px;
  }

  .grid-container{
    margin-top: 20px;
  }

  @keyframes underline-once {
  0%   { transform: scaleX(0); }
  25%  { transform: scaleX(1); }
  70%  { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}
.navbar a.flash-underline::after {
  animation: underline-once .45s ease-out;
}

}
