/* base y variables ya están en main.css */

.portfolio-hero {
  position: relative;
  overflow: hidden;
  min-height: 90vh;
  padding: 8rem 6% 4rem;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(4, 115, 240, 0.06), rgba(244, 249, 254, 1));
}

.portfolio-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/background-hero-triangle.png");
  background-repeat: no-repeat;
  background-position: top right;
  background-size: 420px;
  opacity: 0.1;
  transform: translateX(45px) rotate(12deg);
  animation: driftHero 18s ease-in-out infinite alternate;
  pointer-events: none;
}

.portfolio-hero::after {
  content: "";
  position: absolute;
  left: -60px;
  bottom: -80px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle at 35% 35%, rgba(4, 115, 240, 0.16), transparent 55%);
  filter: blur(30px);
  opacity: 0.9;
  animation: floatGlow 20s ease-in-out infinite alternate;
  pointer-events: none;
}

.portfolio-hero-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(340px, 1.05fr) minmax(340px, 0.95fr);
  gap: 3rem;
  align-items: start;
}

.portfolio-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 620px;
}

.portfolio-hero-visual {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  width: 100%;
}

.visual-stack {
  width: 100%;
  max-width: 520px;
  display: grid;
  gap: 1rem;
}

.portfolio-hero .eyebrow {
  font-family: var(--ff-texts);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--clr-light-blue);
  font-size: 0.95rem;
}

.portfolio-hero h1 {
  font-family: var(--ff-titles);
  font-size: clamp(2.8rem, 4vw, 4.5rem);
  line-height: 1.05;
  max-width: 700px;
}

.portfolio-hero p {
  font-family: var(--ff-texts);
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 620px;
  opacity: 0.8;
}

.portfolio-hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.portfolio-hero .secondaryBtn,
.portfolio-hero .contactoBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  font-family: var(--ff-texts);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-hero .contactoBtn {
  background: var(--clr-light-blue);
  color: var(--clr-white);
}

.portfolio-hero .secondaryBtn {
  border: 1px solid #292827;
  color: #292827;
  background: transparent;
}

.portfolio-hero .contactoBtn:hover,
.portfolio-hero .secondaryBtn:hover {
  transform: translateY(-2px);
}

.portfolio-hero-visual {
  display: flex;
  justify-content: flex-end;
}

.visual-stack {
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: 520px;
}

.visual-card {
  position: relative;
  overflow: hidden;
  border-radius: 2rem;
  background: #eef7ff;
  box-shadow: 0 30px 70px rgba(4, 115, 240, 0.12);
  min-height: 180px;
}

.visual-card-main {
  min-height: 340px;
}

.visual-card-small {
  min-height: 200px;
}

.visual-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.visual-card:hover img {
  transform: scale(1.06);
}

.visual-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.visual-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.6rem 1.4rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(3, 29, 65, 0.88) 100%);
  color: #ffffff;
}

.visual-caption .card-label {
  font-family: var(--ff-texts);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: rgba(158, 216, 255, 0.95);
  margin-bottom: 0.55rem;
}

.visual-caption h2 {
  font-family: var(--ff-titles);
  font-size: 1.65rem;
  margin: 0;
  line-height: 1.1;
}

.visual-card-small .visual-caption {
  padding: 1.1rem 1rem;
}

.visual-card-small .visual-caption p {
  margin: 0;
  font-size: 0.95rem;
}

.visual-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 55%);
  pointer-events: none;
}

@keyframes driftHero {
  0% {
    transform: translateX(45px) rotate(12deg);
    opacity: 0.16;
  }

  100% {
    transform: translateX(-15px) rotate(8deg);
    opacity: 0.12;
  }
}

@keyframes floatGlow {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.95;
  }

  100% {
    transform: translateY(-16px) scale(1.04);
    opacity: 0.82;
  }
}

.visual-card-small::after {
  width: 70px;
  height: 70px;
  right: 1rem;
  top: 1rem;
}

.stack-section {
  position: relative;
  padding: 4rem 6% 1rem;
  overflow: hidden;
  width: 100%;
}

.stack-section::after {
  content: "";
  position: absolute;
  right: -100px;
  top: 40px;
  width: 380px;
  height: 380px;
  background-image: url("../img/background-hero-circle-&-dots.png");
  background-repeat: no-repeat;
  background-size: 100%;
  opacity: 0.3;
  pointer-events: none;
  animation: driftPattern 15s linear infinite alternate;
}

.section-header {
  max-width: 820px;
  margin: 0 auto 2rem;
  text-align: center;
}

.section-header h2 {
  font-family: var(--ff-titles);
  font-size: clamp(2.6rem, 4vw, 3.5rem);
  margin: 1rem 0;
}

.section-header p {
  font-family: var(--ff-texts);
  font-size: 1.1rem;
  line-height: 1.8;
  opacity: 0.75;
  width: 80%;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.stack-grid .tech-card:nth-child(1) { grid-column: span 2; }
.stack-grid .tech-card:nth-child(2) { grid-column: span 1; }
.stack-grid .tech-card:nth-child(3) { grid-column: span 1; }
.stack-grid .tech-card:nth-child(4) { grid-column: span 2; }
.stack-grid .tech-card:nth-child(5) { grid-column: 1 / -1; }

.tools-section {
  position: relative;
  padding: 2rem 6% 5%;
  overflow: hidden;
  width: 100%;
}

.tools-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto 0.9rem;
  width: min(100%, 1100px);
}

.tools-header p,
.tools-header h2 {
  margin: 0;
}

.tools-header p {
  font-family: var(--ff-texts);
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.78;
}

.tools-header h2 {
  font-family: var(--ff-titles);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1.1;
}

.tools-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 1100px);
  margin: 0 auto;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(4, 115, 240, 0.12);
  box-shadow: 0 10px 18px rgba(4, 115, 240, 0.05);
  font-family: var(--ff-texts);
  font-size: 0.92rem;
  line-height: 1.4;
  color: #292827;
  flex: 1 1 140px;
  min-width: 130px;
  justify-content: center;
  position: relative;
  overflow: visible;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.tool-chip:hover {
  transform: translateY(-3px);
  border-color: rgba(4, 115, 240, 0.22);
  box-shadow: 0 14px 26px rgba(4, 115, 240, 0.12);
}

.tool-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.6rem);
  transform: translateX(-50%) scale(0.9);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(4, 115, 240, 0.95);
  color: #ffffff;
  font-family: var(--ff-texts);
  font-size: 0.77rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 2;
}

.tool-chip:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.tool-chip strong {
  font-family: var(--ff-titles);
  font-size: 0.95rem;
  font-weight: 700;
}
.tool-chip span {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(4, 115, 240, 0.1);
  font-size: 0.95rem;
}

.tool-chip strong {
  font-family: var(--ff-titles);
  font-size: 0.95rem;
  font-weight: 700;
}

.tech-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 0.9rem;
  padding: 1.5rem 1.6rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}

.stack-grid .tech-card:nth-child(1)::before { background: linear-gradient(180deg, #61dafb, #0473f0); }
.stack-grid .tech-card:nth-child(2)::before { background: linear-gradient(180deg, #68a063, #3c873a); }
.stack-grid .tech-card:nth-child(3)::before { background: linear-gradient(180deg, #ffca28, #ff6f00); }
.stack-grid .tech-card:nth-child(4)::before { background: linear-gradient(180deg, #555, #111); }
.stack-grid .tech-card:nth-child(5)::before { background: linear-gradient(180deg, #f7df1e, #d4a017); }

.tech-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04), 0 12px 28px rgba(0, 0, 0, 0.06);
  border-color: rgba(4, 115, 240, 0.15);
}

.tech-number {
  position: absolute;
  right: 1rem;
  bottom: -0.5rem;
  font-family: var(--ff-titles);
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.04;
  pointer-events: none;
}

.tech-card h3 {
  font-family: var(--ff-titles);
  font-size: 1.15rem;
  margin: 0;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.01em;
}

.tech-card p {
  font-family: var(--ff-texts);
  font-size: 0.85rem;
  line-height: 1.6;
  opacity: 0.7;
}

.about-portfolio {
  position: relative;
  padding: 6rem 10%;
  padding-bottom: 5%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

.about-portfolio::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 480px;
  height: 480px;
  background-image: url("../img/background-hero-triangle.png");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.1;
  pointer-events: none;
  transform: translate(-60px, -40px);
}

.about-copy {
  max-width: 620px;
}

.about-copy h2 {
  font-family: var(--ff-titles);
  font-size: clamp(2.6rem, 4vw, 3.2rem);
  margin: 1rem 0;
}

.about-copy p {
  font-family: var(--ff-texts);
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.82;
}

.about-points {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.about-points div {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.4rem;
  border: 1px solid rgba(4, 115, 240, 0.12);
  box-shadow: 0 25px 45px rgba(4, 115, 240, 0.06);
}

.about-points strong {
  display: block;
  font-family: var(--ff-titles);
  margin-bottom: 0.65rem;
}

.about-points p {
  font-family: var(--ff-texts);
  font-size: 0.98rem;
  line-height: 1.7;
  opacity: 0.82;
}

.about-details {
  display: grid;
  gap: 1rem;
}

.detail-card {
  background: #ffffff;
  border-radius: 1.5rem;
  padding: 1.75rem;
  border: 1px solid rgba(4, 115, 240, 0.15);
  box-shadow: 0 25px 55px rgba(4, 115, 240, 0.08);
}

.detail-label {
  display: inline-block;
  font-family: var(--ff-texts);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--clr-light-blue);
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
}

.detail-card h3 {
  font-family: var(--ff-titles);
  font-size: 1.35rem;
  margin: 0;
}

.detail-card p {
  font-family: var(--ff-texts);
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.82;
  margin: 0.85rem 0 0;
}

.projects-section {
  position: relative;
  padding: 4rem 6% 4rem;
  margin-bottom: 2rem;
  overflow: hidden;
  width: 100%;
}

.projects-section::before {
  content: "";
  position: absolute;
  right: 12%;
  top: -45px;
  width: 480px;
  height: 480px;
  background-image: url("../img/background-triangle-pattern.png");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.1;
  pointer-events: none;
}

.projects-top {
  max-width: 1100px;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.projects-top .section-header {
  flex: 1 1 420px;
  margin-bottom: 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 1rem;
}

.project-card:nth-child(1) { grid-column: span 2; }
.project-card:nth-child(2) { grid-column: span 1; }
.project-card:nth-child(3) { grid-column: span 1; }
.project-card:nth-child(4) { grid-column: span 2; }

.project-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 0.9rem;
  padding: 1.3rem 1.4rem 1.4rem 1.8rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, var(--clr-light-blue), #6bb7ff);
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: rgba(4, 115, 240, 0.15);
}

.project-card.expanded {
  border-color: rgba(79, 240, 4, 0.25);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(4, 115, 240, 0.1);
}

.project-card.expanded::after {
  content: "";
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0473f0;
}

.project-card h3 {
  font-family: var(--ff-titles);
  font-size: 1.05rem;
  margin: 0;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.01em;
}

.cv-item-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}

.company-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(4, 115, 240, 0.07);
  color: #0473f0;
  font-size: 1rem;
  flex-shrink: 0;
}

.icon-closet::before {
  content: "👗";
}

.icon-oil::before {
  content: "🛢️";
}

.icon-music::before {
  content: "🎧";
}

.icon-vinyl::before {
  content: "🎵";
}

.icon-code::before {
  content: "💻";
}

.company-meta {
  font-family: var(--ff-texts);
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.45);
  margin: 0.1rem 0 0;
}

.project-card ul {
  padding-left: 0;
  margin: 0;
  list-style: none;
  color: #292827;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease,
              margin 0.25s ease;
  margin-top: 0;
}

.project-card li {
  position: relative;
  margin-bottom: 0.4rem;
  padding-left: 1.1rem;
  font-family: var(--ff-texts);
  font-size: 0.82rem;
  line-height: 1.55;
  opacity: 0.75;
}

.project-card li::before {
  content: "•";
  position: absolute;
  left: 0.2rem;
  top: 0.3rem;
  color: var(--clr-light-blue);
  font-size: 0.7rem;
}

.project-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -16px;
  width: 80px;
  height: 60px;
  background: radial-gradient(circle at 70% 30%, rgba(4, 115, 240, 0.04), transparent 60%);
  filter: blur(10px);
  pointer-events: none;
}

.card-details {
  margin-top: 0.6rem;
  max-height: 120px;
  overflow: hidden;
  transition: opacity 0.25s ease, margin 0.25s ease, max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-details p {
  font-family: var(--ff-texts);
  font-size: 0.82rem;
  line-height: 1.6;
  opacity: 0.65;
  margin: 0 0 0.5rem;
}

.card-link {
  display: inline-block;
  font-family: var(--ff-texts);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--clr-light-blue);
  text-decoration: none;
  transition: color 0.2s ease, gap 0.2s ease;
}

.card-link:hover {
  color: #035cc4;
}

.project-card:hover ul,
.project-card.expanded ul {
  max-height: 140px;
  opacity: 1;
  margin-top: 0.5rem;
}

.project-card:hover .card-details,
.project-card.expanded .card-details {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.projects-top .contactoBtn {
  margin-left: auto;
}

.footerContainer {
  padding: 5rem 6% 6rem;
}

/* Estilos para botón de descarga moderno */
.downloadBtn,
.descargarBtn,
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #0473f0 0%, #6bb7ff 100%);
  color: #ffffff;
  font-family: var(--ff-texts);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(4, 115, 240, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.12s;
}

.downloadBtn svg,
.btn-download svg {
  width: 18px;
  height: 18px;
  display: block;
}

.downloadBtn:hover,
.descargarBtn:hover,
.btn-download:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(4, 115, 240, 0.16);
}

.downloadBtn:active,
.descargarBtn:active,
.btn-download:active {
  transform: translateY(-1px) scale(0.995);
}

.downloadBtn:focus,
.descargarBtn:focus,
.btn-download:focus {
  outline: 3px solid rgba(4, 115, 240, 0.18);
  outline-offset: 3px;
  border-radius: 999px;
}

/* Variante outline (si se prefiere un estilo menos dominante) */
.downloadBtn.outline {
  background: transparent;
  border: 1px solid rgba(4, 115, 240, 0.12);
  color: #0473f0;
  box-shadow: none;
}

@keyframes sectionIntro {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardPop {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes driftPattern {
  from {
    transform: translateX(0) translateY(0);
  }

  to {
    transform: translateX(-14px) translateY(12px);
  }
}

@media (max-width: 1024px) {

  .portfolio-hero-content,
  .about-portfolio {
    grid-template-columns: 1fr;
  }

  .portfolio-hero-visual {
    justify-content: center;
  }

  .about-details,
  .about-points {
    width: 100%;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card:nth-child(n) {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {

  .stack-section,
  .tools-section,
  .about-portfolio,
  .cv-section,
  .projects-section {
    padding: 3rem 4%;
  }

  .projects-grid,
  .stack-grid {
    grid-template-columns: 1fr;
  }

  .stack-grid .tech-card:nth-child(n),
  .project-card:nth-child(n) {
    grid-column: 1 / -1;
  }

  .tools-chips {
    justify-content: center;
  }

  .tool-chip {
    flex: 1 1 130px;
    min-width: 110px;
  }

  .cv-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .cv-card .contactoBtn {
    width: 100%;
    text-align: center;
  }

  .stack-section::after {
    opacity: 0.1;
  }

  .portfolio-hero-content {
    max-width: 100%;
    overflow: hidden;
  }

  .visual-stack {
    max-width: 100%;
  }

  .visual-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .portfolio-hero {
    min-height: auto;
    padding: 7rem 4% 3rem;
  }

  .portfolio-hero h1 {
    font-size: clamp(2rem, 6vw, 2.8rem);
  }

  .about-portfolio {
    padding: 3rem 4%;
    grid-template-columns: 1fr;
  }

  .about-copy {
    max-width: 100%;
  }
}