/* =========================================================
   RESET
========================================================= */
* {
  box-sizing: border-box;
}

/* =========================================================
   ANALYTICS CONSENT
========================================================= */
.cookie-consent {
  position: fixed;
  z-index: 9999;
  right: 24px;
  bottom: 24px;
  left: 24px;
  width: auto;
  max-width: none;
  margin: 0 auto;
  padding: 20px;
  color: #28232f;
  background: #ffffff;
  border: 1px solid rgba(40, 35, 47, 0.10);
  border-radius: 18px;
  box-shadow:
    0 12px 28px rgba(40, 35, 47, 0.16),
    0 0 0 1px rgba(40, 35, 47, 0.05);
}

.cookie-consent__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.cookie-consent__copy h2 {
  margin: 0 0 6px;
  color: #28232f;
  font-size: 18px;
  line-height: 1.3;
  text-align: left;
}

.cookie-consent__copy p {
  margin: 0;
  color: #28232f;
  font-size: 14px;
  line-height: 1.5;
}

.cookie-consent__copy a {
  color: #234d8d;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-consent__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.cookie-consent__button {
  min-height: 44px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
}

.cookie-consent__button--primary {
  color: #ffffff;
  background: #28232f;
  border: 2px solid #28232f;
}

.cookie-consent__button--secondary {
  color: #28232f;
  background: #ffffff;
  border: 2px solid #28232f;
}

.cookie-consent__button:focus-visible,
.cookie-settings-link:focus-visible {
  outline: 3px solid #3e6fb3;
  outline-offset: 3px;
}

.cookie-settings-link {
  display: block;
  margin-top: 8px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 700px) {
  .cookie-consent {
    right: 16px;
    bottom: 16px;
    left: 16px;
    padding: 18px;
  }

  .cookie-consent__content,
  .cookie-consent__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent__content {
    gap: 16px;
  }

  .cookie-consent__actions {
    gap: 8px;
  }
}

/* ---- Corazón de despedida al cerrar el aviso de cookies ----
   Aparece exactamente donde estaba el popup (misma posición y tamaño,
   calculados en JS con getBoundingClientRect), con un pequeño "puff"
   de chispas alrededor. Dura ~2.4s y se auto-elimina del DOM. */
.consent-heart-poof {
  position: fixed;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.consent-heart-poof__icon {
  width: 56px;
  height: 56px;
  color: #e8536f;
  animation: consentHeartPoof 2.4s ease forwards;
}

.consent-heart-poof__spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #f6c15c;
  opacity: 0;
  animation: consentSparkPoof 1.4s ease-out forwards;
}
.consent-heart-poof__spark--1 {
  --tx: -34px;
  --ty: -30px;
  animation-delay: 0.15s;
}
.consent-heart-poof__spark--2 {
  --tx: 34px;
  --ty: -30px;
  animation-delay: 0.22s;
}
.consent-heart-poof__spark--3 {
  --tx: -30px;
  --ty: 28px;
  animation-delay: 0.3s;
}
.consent-heart-poof__spark--4 {
  --tx: 30px;
  --ty: 26px;
  animation-delay: 0.38s;
}

@keyframes consentHeartPoof {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  15% {
    transform: scale(1.15);
    opacity: 1;
  }
  30% {
    transform: scale(1);
    opacity: 1;
  }
  70% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

@keyframes consentSparkPoof {
  0% {
    transform: translate(0, 0) scale(0.4);
    opacity: 0;
  }
  25% {
    transform: translate(calc(var(--tx) * 0.4), calc(var(--ty) * 0.4)) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0.3);
    opacity: 0;
  }
}

.privacy-content h2 {
  text-align: left;
  margin-top: 36px;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Arial, Helvetica, sans-serif;
  color: #28232f;
  background: #f7f7f7;
  font-size: 16px;
  line-height: 1.5;
}
a {
  color: inherit;
}
/* =========================================================
   HEADER
========================================================= */
.header {
  width: calc(100% - 180px);
  max-width: 1200px;
  margin: 24px auto 32px;
  padding: 14px 40px;
  background: white;
  border-radius: 999px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 0 0 1px rgba(40, 35, 47, .08);
}
.logo {
  width: 85px;
  height: auto;
}
.logo-link {
  display: inline-flex;
  align-items: center;
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.logo-link:hover {
  opacity: 0.75;
  transform: scale(1.03);
}
.logo-link.active {
  opacity: 1;
}
/* ---- Media corona de rama de olivo al hover del logo (se inyecta con JS) ---- */
.logo-link {
  position: relative;
}
.logo-branch-wrap {
  position: absolute;
  left: 100%;
  bottom: -4px;
  margin-left: -4px;
  display: inline-flex;
  align-items: flex-end;
  pointer-events: none;
  z-index: 5;
}
.logo-branch-svg {
  display: block;
  overflow: visible;
}
.menu-toggle {
  display: none;
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13px;
}
.nav-link {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-link:hover {
  background-color: rgba(40, 35, 47, 0.08);
}
.nav-link.active {
  background-color: #28232f;
  color: white;
}
/* ---- "Volver al inicio" (a la puerta SALAM) ----
   Misma familia tipográfica que Home / About me (Arial/Helvetica,
   la del resto del sitio), pero en cursiva y en negrita, sin la
   forma de pastilla (sin relleno, sin border-radius) y separado
   del resto del nav por una línea vertical, como si fuera una
   firma o una inscripción aparte y no una pestaña más de
   navegación. El grosor del trazo de la flecha (stroke-width)
   está calculado para igualar el grosor visual de la letra en
   negrita. Reactividad clara en hover (se desplaza y aclara de
   color) y en click/active (se oscurece y se "hunde" un poco). */
.nav-link-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 4px 18px 4px 0;
  margin-right: 14px;
  border-right: 1px solid rgba(40, 35, 47, .18);
  border-radius: 0;
  background-color: transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-style: italic;
  font-weight: 700;
  font-size: 14px;
  color: #234D8D;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}
.nav-link-back .arrow-icon {
  flex-shrink: 0;
  overflow: visible;
  color: inherit;
  transition: color 0.2s ease, transform 0.15s ease;
}
.nav-link-back:hover {
  background-color: transparent;
  color: #3E6FB3;
  border-color: rgba(35, 77, 141, .4);
  transform: translateX(-3px);
}
.nav-link-back:active {
  background-color: transparent;
  color: #1c3a69;
  transform: translateX(-1px) scale(0.96);
}
/* =========================================================
   GLOBAL LAYOUT
========================================================= */
.main {
  width: calc(100% - 180px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0 48px;
  flex: 1;
}
/* =========================================================
   TYPOGRAPHY
========================================================= */
h1,
h2,
h3,
p {
  color: #28232f;
}
/* ---- Grupo Títulos (celeste = violeta en las notas) ----
   Misma familia, peso y line-height para todos los h1/h2/h3
   que funcionan como título. Cada uno conserva su propio
   font-size definido más abajo (hero, project-title-row, etc). */
h1,
h2,
h3,
.hero h1,
.project-title-row h1,
.privacy-content h1,
.work-card h3,
.pokemon-card h3,
.experience h3,
.more h3,
.device-block h3 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  line-height: 1.2;
}
h2 {
  font-size: 28px;
  text-align: center;
  margin: 0 0 36px;
}
h3 {
  font-size: 18px;
  margin: 0 0 8px;
}
h4 {
  font-size: 16px;
  line-height: 1.5;
  margin: 18px 0 8px;
  font-weight: 700;
}
/* ---- Grupo Cuerpo de texto (amarillo = rosa en las notas) ----
   Todos los párrafos y listas comparten tamaño, peso e
   interlineado. No se toca ningún color. */
p,
li,
.hero p,
.work-card p,
.article-section p,
.project-intro p,
.project-overview p,
.privacy-content p,
.experience li,
.more li,
.table-contents li,
.table-contents a,
.footer p,
.footer a,
.confidentiality-note p,
.values,
.pokemon-card p {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}
p {
  margin: 0 0 14px;
}
ul {
  padding-left: 18px;
  margin: 0;
}
li {
  margin-bottom: 6px;
}
/* ---- Grupo Cuerpo de texto en negrita (marrón en las notas) ----
   Misma base que el cuerpo (16px / 1.5) pero en negrita.
   Cada elemento conserva su propio color. */
.hero h4,
.project-intro h4,
.project-overview h4,
.table-contents h4,
.footer h4,
.company-description,
.date {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}
/* =========================================================
   BUTTONS
========================================================= */
.button {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 22px;
  background: #28232f;
  color: white;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s ease;
}
.button:hover {
  background: #3a3443;
  transform: translateY(-2px);
}
.button:active {
  background: #1d1922;
  transform: translateY(0);
}
.button:focus-visible {
  outline: 2px solid #28232f;
  outline-offset: 3px;
}
/* ---- CV buttons (hero) ---- */
.cv-buttons {
  display: flex;
  gap: 6%;
  flex-wrap: wrap;
  margin-top: 18px;
  width: 100%;
}
.cv-buttons .button {
  margin-top: 0;
}
/* =========================================================
   HERO
========================================================= */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
  margin-bottom: 72px;
}
.hero h1 {
  font-size: 34px;
  line-height: 1.1;
  margin: 0 0 24px;
}
.hero p {
  max-width: 460px;
}
.hero-image {
  width: 100%;
  height: auto;
}
.hero-image img {
  width: 100%;
  max-height: 520px;
  height: auto;
  object-fit: cover;
  object-position: center top;
  display: block;
}
/* =========================================================
   HOME / ABOUT SECTIONS
========================================================= */
.experience,
.more {
  margin: 56px 0;
}
.columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px;
}
.values {
  text-align: right;
  margin-top: 40px;
}
/* =========================================================
   POKEMON CARDS SECTION
========================================================= */
.hero.about-hero {
  margin-bottom: 0;
}
.pokemon-section + .experience {
  margin-top: 0;
}
.pokemon-section {
  --pokemon-space: clamp(64px, 6vw, 88px);
  position: relative;
  width: 100%;
  container: pokemon / inline-size;
  margin: 0;
  padding-block: var(--pokemon-space);
}
.pokemon-fan {
  position: relative;
  width: 100%;
  height: var(--fan-height, 480px);
  overflow: visible;
}
.pokemon-card {
  position: absolute;
  left: calc(50% + var(--card-x) + var(--fan-offset-x, -340px));
  top: calc(var(--card-y) + var(--fan-offset-y, 0px));
  transform: rotate(var(--card-angle));
  width: 280px;
  cursor: pointer;
  transition:
    transform .35s ease,
    box-shadow .2s ease;
}
.pokemon-collectible {
  padding: 7px;
  border: 5px solid #fff;
  border-radius: 23px;
  background: var(--card-frame);
  box-shadow:
    0 3px 6px rgba(46, 35, 70, .12),
    0 10px 24px rgba(46, 35, 70, .13);
}
.pokemon-card:hover {
  box-shadow:
    0 3px 8px rgba(46, 35, 70, .16),
    0 14px 28px rgba(46, 35, 70, .17);
}
.pokemon-card-face {
  container-type: inline-size;
  padding: 12px;
  border-radius: 12px;
  background: var(--card-background);
  color: #10183f;
}
.pokemon-card-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  /* Two lines for every title, including Community and Facilitation. */
  font-size: clamp(15px, 7.7cqi, 24px);
  min-height: 2.3em;
  margin-bottom: 12px;
}
.pokemon-card-heading h3 {
  min-width: 0;
  margin: 0;
  font-size: inherit;
  line-height: 1.15;
  color: inherit;
  text-align: left;
}
.pokemon-card-meta {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 4px;
}
.pokemon-card-code {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(18px, 9cqi, 28px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.03em;
  white-space: nowrap;
}
.pokemon-card-icon {
  display: grid;
  place-items: center;
  width: clamp(18px, 8.5cqi, 26px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--card-icon-background);
  color: #11234c;
}
.pokemon-card-icon svg {
  display: block;
  width: 88%;
  height: 88%;
}
.pokemon-card-photo {
  display: block;
  width: 100%;
  aspect-ratio: 6 / 5;
  height: auto;
  object-fit: cover;
  border: 3px solid var(--card-photo-frame);
  border-radius: 9px;
}
.card-blue .pokemon-card-photo {
  object-position: center 66%;
}
.pokemon-card-face > p {
  position: relative;
  margin: 0;
  margin-top: 13px;
  padding-top: 13px;
  font-size: clamp(14px, 6cqi, 18px);
  line-height: 1.4;
  color: inherit;
}
.pokemon-card-face > p::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-divider);
}
/* Match Facilitation's text area without stretching the other content. */
.pokemon-card:not(.card-purple) .pokemon-card-face > p {
  min-height: var(--card-text-height, 0px);
}
.card-blue {
  --card-background: linear-gradient(135deg, #d6ecf6 0%, #e3f4ed 42%, #ded9f4 100%);
  --card-frame: linear-gradient(135deg, #c9e5f3, #d5e8e9 45%, #d8d2ef);
  --card-photo-frame: #d8d9ed;
  --card-divider: linear-gradient(90deg, #9daee8, #9ec9e4);
  --card-icon-background: #bfe3ff;
}
.card-purple {
  --card-background: linear-gradient(135deg, #eadcf7 0%, #f7e0ed 45%, #dfeaf9 100%);
  --card-frame: linear-gradient(135deg, #e1d2ef, #eed8ea 50%, #d9e4f3);
  --card-photo-frame: #ecd6e7;
  --card-divider: linear-gradient(90deg, #c4a0e6, #bca6df);
  --card-icon-background: #e3caff;
}
.card-green {
  --card-background: linear-gradient(150deg, #e2f0c7 0%, #d2f0da 50%, #d9edeb 100%);
  --card-frame: linear-gradient(135deg, #d1e4d9, #dcedc8 45%, #cce8dc);
  --card-photo-frame: #d5e6c9;
  --card-divider: linear-gradient(90deg, #86c999, #86baa0);
  --card-icon-background: #c8f1c3;
}
.card-orange {
  --card-background: linear-gradient(135deg, #fcf0bf 0%, #fce1c6 60%, #f5d9e4 100%);
  --card-frame: linear-gradient(135deg, #f4e3c3, #fae9c3 45%, #f0d8d3);
  --card-photo-frame: #f2ddcb;
  --card-divider: linear-gradient(90deg, #efbe7d, #e8abbb);
  --card-icon-background: #ffe0a8;
}
.pokemon-card.position-1 {
  --card-x: 20px;
  --card-y: 64px;
  --card-angle: -14deg;
  z-index: 1;
}
.pokemon-card.position-2 {
  --card-x: 145px;
  --card-y: 32px;
  --card-angle: -6deg;
  z-index: 2;
}
.pokemon-card.position-3 {
  --card-x: 270px;
  --card-y: 32px;
  --card-angle: 6deg;
  z-index: 3;
}
.pokemon-card.position-4 {
  --card-x: 395px;
  --card-y: 64px;
  --card-angle: 14deg;
  z-index: 4;
}
/* ---- Pokemon expand button ---- */
.pokemon-expand-button {
  position: absolute;
  bottom: calc((var(--pokemon-space) - 48px) / 2);
  right: 16px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: #28232f;
  color: white;
  font-size: 22px;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 4px 16px rgba(40, 35, 47, .18);
  transition: transform .2s ease, background .2s ease;
}
.pokemon-expand-button:hover {
  background: #3a3443;
  transform: translateY(-2px);
}
/* Use the available column width, including on narrow tablets. */
@container pokemon (max-width: 800px) {
  .pokemon-card {
    width: 240px;
  }
  .pokemon-card.position-1 {
    --card-x: 20px;
    --card-y: 60px;
  }
  .pokemon-card.position-2 {
    --card-x: 125px;
    --card-y: 32px;
  }
  .pokemon-card.position-3 {
    --card-x: 230px;
    --card-y: 32px;
  }
  .pokemon-card.position-4 {
    --card-x: 335px;
    --card-y: 60px;
  }
}
@container pokemon (max-width: 680px) {
  .pokemon-fan {
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
    scroll-padding-inline: 24px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .pokemon-fan::-webkit-scrollbar {
    display: none;
  }
  .pokemon-fan .pokemon-card {
    position: static;
    flex: 0 0 clamp(216px, 90%, 320px);
    width: auto;
    transform: none;
    scroll-snap-align: start;
    cursor: auto;
  }
}
/* ---- Pokemon modal / carousel ---- */
.pokemon-modal {
  position: fixed;
  inset: 0;
  display: none;
  visibility: hidden;
  opacity: 0;
  align-items: center;
  justify-content: center;
  padding: 64px 16px 16px;
  background: rgba(40, 35, 47, 0.72);
  z-index: 9999;
  pointer-events: none;
}
.pokemon-modal.open {
  display: flex;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.pokemon-modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: white;
  color: #28232f;
  font-size: 28px;
  cursor: pointer;
  z-index: 2;
}
.pokemon-modal-carousel {
  --modal-photo-height: max(180px, calc(100dvh - 300px));
  position: relative;
  width: 100%;
  max-width: none;
}
.pokemon-modal-track {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 16px;
}
.pokemon-modal-track::-webkit-scrollbar {
  display: none;
}
.pokemon-modal-slide {
  display: flex;
  justify-content: center;
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: center;
}
.pokemon-modal-card {
  /* Photo width + its border, face padding and outer frame. */
  width: calc((var(--modal-photo-height) - 6px) * var(--photo-ratio) + 54px);
  max-width: 100%;
  min-width: 0;
  height: calc(100dvh - 112px);
  overflow-y: auto;
}
.pokemon-modal-card .pokemon-card-face {
  min-height: 100%;
}
.pokemon-modal-card .pokemon-card-photo {
  height: var(--modal-photo-height);
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  background: rgba(255, 255, 255, .4);
}
@media (max-width: 600px) {
  .pokemon-modal {
    padding: 64px 0 16px;
  }
}
/* =========================================================
   STATS HOME
========================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 0 0 72px;
  text-align: center;
}
.stat strong {
  display: block;
  font-size: 38px;
  line-height: 1;
  color: #234D8D;
  margin-bottom: 10px;
}
.stat span {
  display: block;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  color: #28232f;
}
/* =========================================================
   WORK EXPERIENCE - DESCRIPTION
========================================================= */
/* ---------- Company ---------- */
.experience h4{
    min-height:48px;
    margin:18px 0 8px;
}
.experience h4 a{
    color:#234D8D;
    text-decoration:underline;
    text-decoration-color:rgba(35,77,141,.35);
    text-underline-offset:3px;
    transition:.2s ease;
}
.experience h4 a:hover{
    color:#3E6FB3;
    text-decoration-color:#3E6FB3;
}
/* ---------- Description ---------- */
.company-description{
    margin:6px 0 14px;
    min-height:112px;
    color:#66758C;
}
/* ---------- Date ---------- */
.date{
    min-height:24px;
    margin-bottom:18px;
    color:#8B96A8;
}
.experience ul{
    margin-top:20px;
    padding-top:20px;
    border-top:2px solid rgba(35,77,141,.20);
}
/* =========================================================
   PROJECT / ARTICLE PAGES
========================================================= */
.project-body .header {
  margin-bottom: 0;
  border-radius: 48px 48px 0 0;
  box-shadow: 0 0 0 1px rgba(40, 35, 47, .08);
}
.project-page {
  width: calc(100% - 180px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0 48px;
}
.project-intro {
  background-image: url("images/background.jpg");
  background-size: cover;
  background-position: center;
  margin: 0 0 30px;
  padding: 30px 90px;
  border-radius: 0;
}
.project-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 12px;
}
.project-title-row h1 {
  font-size: 40px;
  line-height: 1.1;
  margin: 0;
}
.project-title-row span {
  font-size: 12px;
  line-height: 1.5;
  margin-top: 8px;
}
.project-intro h4 {
  margin: 0 0 8px;
}
.project-intro p {
  max-width: 850px;
  margin: 0 0 18px;
}
.project-overview {
  margin-bottom: 30px;
  padding: 0;
}
.project-overview h4 {
  margin: 30px 0 8px;
}
.project-overview p {
  max-width: 900px;
  margin-bottom: 18px;
}
.project-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 30px 0 60px;
  text-align: center;
}
.project-links img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  margin-bottom: 12px;
}
.project-links p {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
  margin-bottom: 4px;
}
.project-links a {
  font-size: 12px;
  line-height: 1.4;
}
.table-contents {
  margin-bottom: 60px;
}
.table-contents h4 {
  margin-bottom: 8px;
}
.table-contents ol {
  padding-left: 20px;
}
.article-section {
  margin-bottom: 48px;
}
.article-section h2 {
  text-align: left;
  font-size: 28px;
  margin-bottom: 18px;
}
.article-section p {
  max-width: 900px;
  margin-bottom: 18px;
}
/* =========================================================
   CARDS
========================================================= */
.selected-work-list {
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:32px;
    width:100%;
    margin:0;
    align-items:stretch;
}
.work-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: white;
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(40, 35, 47, .08),
    0 12px 28px rgba(40, 35, 47, .08);
}
.work-card-image-link {
  display: block;
  flex-shrink: 0;
}
.work-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: top;
  display: block;
  background: #e7e5e8;
}
.work-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}
.work-card-category {
  color: #234D8D;
}
.work-card h3 {
  font-size: 24px;
  margin: 0 0 14px;
}
.work-card p {
  max-width: 700px;
  margin-bottom: 22px;
}
.work-card .button {
  margin-top: auto;
  align-self: flex-start;
}
.work-card.text-card {
  min-height: 320px;
}
.work-card.text-card .work-card-content {
  padding: 32px 24px;
}
/* =========================================================
   TAGS
========================================================= */
.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #28232f;
  letter-spacing: 0.2px;
}
.tag-research {
  background: #D3ECE6;
}
.tag-ia {
  background: #D6E6F5;
}
.tag-strategy,
.tag-ux-strategy {
  background: #DBDFF3;
}
.tag-prototype {
  background: #E2DAF0;
}
.tag-design-system {
  background: #E9D3EC;
}
.tag-rebranding {
  background: #F5D7E7;
}
.tag-handoff {
  background: #F6DED1;
}
.tag-testing {
  background: #F3E4C4;
}
.tag-documentation {
  background: #F1EEC6;
}
.tag-femtech {
  background: #F0D3E6;
}
.tag-creative-process {
  background: #F6DAD4;
}
.tag-personal-essay {
  background: #E9F0C9;
}
.tag-accessibility {
  background: #DCEBD1;
}
.tag-frontend {
  background: #CFEAF2;
}
.tag-personal-project {
  background: #EDE0D8;
}
.tag-ai-workflow {
  background: #D8E0EC;
}
/* =========================================================
   PRIVACY PAGE
========================================================= */
.privacy-page {
  padding: 30px 90px 80px;
}
.privacy-content {
  max-width: 720px;
  margin: 0 auto;
}
.privacy-content h1 {
  font-size: 34px;
  line-height: 1.1;
  margin: 0 0 30px;
}
.privacy-content p {
  margin-bottom: 18px;
}
/* =========================================================
   FOOTER
========================================================= */
.footer {
  background: #77757c;
  color: white;
  padding: 48px 90px 74px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 56px;
  position: relative;
  margin-top: auto;
}
.footer-logo {
  width: 150px;
  display: block;
  margin-bottom: 48px;
}
.footer h4 {
  margin: 0 0 14px;
  color: white;
}
.footer p,
.footer a {
  display: block;
  margin-bottom: 8px;
  color: white;
}
.privacy {
  position: absolute;
  left: 90px;
  bottom: 18px;
}
.copyright {
  position: absolute;
  right: 90px;
  bottom: 18px;
  font-size: 11px;
}
/* =========================================================
   BACK TO TOP
========================================================= */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: #28232f;
  color: white;
  font-size: 22px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity .25s ease,
    transform .25s ease,
    visibility .25s ease;
  box-shadow: 0 4px 16px rgba(40, 35, 47, .18);
  z-index: 999;
}
.back-to-top.show {
  opacity: .9;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  opacity: 1;
  transform: translateY(-2px);
}
/* =========================================================
   RESPONSIVE GALLERY
========================================================= */
.responsive-gallery {
  margin: 64px 0 56px;
}
.responsive-gallery h2 {
  text-align: left;
  margin-bottom: 32px;
}
.responsive-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  width: 100%;
}
.device-block {
  min-width: 0;
}
.device-block h3 {
  margin: 0 0 14px;
  font-size: 18px;
  text-align: center;
}
.device-carousel {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: white;
  border-radius: 20px;
  border: 1px solid rgba(40, 35, 47, .10);
  box-shadow: 0 6px 18px rgba(40, 35, 47, .08);
}
.device-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.device-carousel-track::-webkit-scrollbar {
  display: none;
}
.device-carousel-track img {
  flex: 0 0 100%;
  min-width: 100%;
  width: 100%;
  height: 100%;
  padding: 18px 42px;
  object-fit: contain;
  object-position: center;
  scroll-snap-align: start;
}
.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(40, 35, 47, .88);
  color: white;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}
.carousel-prev {
  left: 10px;
}
.carousel-next {
  right: 10px;
}
.carousel-arrow:hover {
  background: #28232f;
}
@media (max-width: 900px) {
  .responsive-gallery-grid {
    grid-template-columns: 1fr;
  }
  .device-carousel {
    height: 240px;
  }
}
@media (max-width: 600px) {
  .responsive-gallery {
    padding-left: 24px;
    padding-right: 24px;
  }
  .device-carousel {
    height: 220px;
  }
}
   /* ------------------------ confidentiality note ------------------------ */
.confidentiality-note{
    margin-top:56px;
    padding:24px 28px;
    background:#EEF4FF;
    border:2px solid #A9C4EE;
    border-left:6px solid #3E6FB3;
    border-radius:16px;
}
.confidentiality-note strong{
    display:block;
    margin-bottom:16px;
    color:#234D8D;
    font-size:18px;
}
.confidentiality-note p{
    margin:0;
}
.confidentiality-note p + p{
    margin-top:16px;
}
/* Shared caption alignment for media cards, galleries and image viewers. */
figcaption {
  text-align: right;
}

/* =========================================================
   CASE STUDY INTRO VIDEO
   Clip de cabecera al principio de un case study (Deep Dive),
   grabación de pantalla real del producto. Reutilizable en
   cualquier case study: educational-platform.html, etc.
========================================================= */
.case-study-video-note {
  margin: 0 0 30px;
}
.case-study-video-note .platform-name {
  font-weight: 700;
}
.case-study-video {
  margin: 0 0 40px;
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(40, 35, 47, .08),
    0 12px 28px rgba(40, 35, 47, .08);
}
.case-study-video video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #ECE9F1;
}
.case-study-video figcaption {
  padding: 14px 22px 20px;
  font-size: 13px;
  color: #66758C;
}
/* =========================================================
   INFO POPUP
   Botón "i" pequeño que abre un panel flotante anclado a su
   esquina inferior derecha. Reutilizable junto a cualquier
   enlace/texto que necesite una nota aclaratoria corta.
========================================================= */
.doc-link {
  color: #234D8D;
}
.doc-link:hover {
  color: #3E6FB3;
}
.info-popup {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
}
.info-popup__trigger {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: #28232f;
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.info-popup__trigger:hover {
  background: #3a3443;
}
.info-popup__panel {
  position: absolute;
  top: 100%;
  left: 100%;
  margin-top: 6px;
  width: 280px;
  max-width: 80vw;
  padding: 16px 18px;
  background: #EEF4FF;
  border: 2px solid #A9C4EE;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(40, 35, 47, .16);
  z-index: 20;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: #28232f;
}
@media (max-width: 600px) {
  .info-popup__panel {
    left: auto;
    right: 0;
    width: 240px;
  }
}
/* =========================================================
   ARTICLE IMAGE
========================================================= */
.article-image {
  position: relative;
  width: 100%;
  margin: 40px 0;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(40, 35, 47, .14);
  box-shadow: 0 6px 14px rgba(40, 35, 47, .10);
}
.article-image img {
  width: 100%;
  height: 140px;
  display: block;
  object-fit: cover;
  object-position: top;
  cursor: zoom-in;
}
/* Overlay de texto que cubre toda la miniatura: fondo blanco
   al 70% de opacidad (deja intuir la imagen detrás), contorno
   gris, texto oscuro. No aparece en el modal ampliado, solo
   sobre el thumbnail. Frase personalizable en cada <p>. */
.article-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(255, 255, 255, .75);
  border: 1px solid rgba(40, 35, 47, .18);
  pointer-events: none;
}
.article-image-overlay p {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: #28232f;
  margin: 0;
}
.image-zoom-button {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: #28232f;
  color: white;
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
}
.image-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(40, 35, 47, 0.72);
  z-index: 9999;
}
.image-modal.open {
  display: flex;
}
.image-modal img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 20px;
  display: block;
}
.image-modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: white;
  color: #28232f;
  font-size: 28px;
  cursor: pointer;
}
/* =========================================================
   TABLET
========================================================= */
@media (max-width: 900px) {
  .main,
  .project-page {
    padding: 0 40px 48px;
  }
  .privacy-page {
    padding: 30px 40px 80px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 72px;
  }
  .hero-image {
    height: auto;
  }
  .hero-image img {
    width: 100%;
    height: auto !important;
    max-height: none;
  }
  .columns {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .project-intro {
    margin: 0 -40px 30px;
    padding: 30px 40px;
  }
  .project-links {
    grid-template-columns: 1fr 1fr;
  }
  .selected-work-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .work-card-image {
    height: 200px;
  }
  .footer {
    grid-template-columns: 1fr;
    padding: 40px;
  }
  .privacy {
    position: static;
    margin-top: 24px;
  }
  .copyright {
    position: static;
    margin-top: 24px;
  }
}
/* =========================================================
   MOBILE
========================================================= */
@media (max-width: 600px) {
  .header {
    width: calc(100% - 32px);
    margin: 16px auto 24px;
    padding: 14px 22px;
    border-radius: 40px;
    position: relative;
  }
  .project-body .header {
    margin: 16px auto 0;
  }
  .logo {
    width: 70px;
  }
  .menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #28232f;
    cursor: pointer;
  }
  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 22px;
    width: 200px;
    padding: 18px;
    background: white;
    border: 1px solid rgba(40, 35, 47, .08);
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(40, 35, 47, .08);
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    z-index: 10;
  }
  .nav.open {
    display: flex;
  }
  .nav-link {
    padding: 8px 10px;
    font-size: 13px;
  }
  .nav-link-back {
    justify-content: center;
    margin-right: 0;
    padding: 0 0 12px;
    border-right: none;
    border-bottom: 1px solid rgba(40, 35, 47, .18);
  }
  .main {
    width: calc(100% - 32px);
    padding: 0 0 40px;
  }
  .project-page {
    width: calc(100% - 32px);
    padding: 0 0 40px;
  }
  .privacy-page {
    padding: 30px 24px 80px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 72px;
  }
  .hero h1 {
    font-size: 35px;
  }
  .cv-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .cv-buttons .button {
    text-align: center;
  }
  .hero-image {
    height: auto;
  }
  .hero-image img {
    width: 100%;
    height: auto !important;
    max-height: none;
    display: block;
  }
  h2 {
    font-size: 29px;
  }
  /* ---- Ajuste de legibilidad en mobile: el cuerpo de texto se
     queda igual que en desktop si no se sube aquí, así que se
     sube ~12% para que no dé sensación de tener que hacer zoom. ---- */
  p,
  li,
  .hero p,
  .work-card p,
  .article-section p,
  .project-intro p,
  .project-overview p,
  .privacy-content p,
  .experience li,
  .more li,
  .table-contents li,
  .table-contents a,
  .footer p,
  .footer a,
  .confidentiality-note p,
  .values {
    font-size: 18px;
  }
  h3 {
    font-size: 20px;
  }
  h4,
  .hero h4,
  .project-intro h4,
  .project-overview h4,
  .table-contents h4,
  .footer h4,
  .company-description,
  .date {
    font-size: 18px;
  }
  .project-intro {
    margin: 0 0 30px;
    padding: 30px 24px;
  }
  .project-overview,
  .project-links,
  .table-contents,
  .article-section {
    padding-left: 24px;
    padding-right: 24px;
  }
  .project-title-row {
    display: block;
  }
  .project-title-row span {
    display: block;
    margin-top: 12px;
  }
  .project-title-row h1 {
    font-size: 37px;
  }
  .project-links,
  .selected-work-list {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 18px;
  }
  .project-links article,
  .work-card {
    flex: 0 0 85%;
    scroll-snap-align: start;
  }
  .work-card {
    border-radius: 24px;
  }
  .work-card-image {
    height: 160px;
  }
  .work-card-content {
    padding: 24px;
  }
  .work-tags {
    gap: 6px;
  }
  .work-card h3 {
    font-size: 22px;
  }
  .work-card.text-card {
    min-height: 280px;
  }
  .footer {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }
  .footer-logo {
    width: 100px;
    margin-bottom: 18px;
  }
  .footer h4 {
    margin-bottom: 6px;
  }
  .footer p,
  .footer a {
    margin-bottom: 4px;
  }
  .privacy {
    margin-top: 8px;
  }
  .copyright {
    position: static;
    margin-top: 18px;
  }
  .back-to-top {
    width: 42px;
    height: 42px;
    right: 16px;
    bottom: 16px;
    font-size: 20px;
  }
   .stats {
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 64px;
}
.stat strong {
  font-size: 34px;
}
.stat span {
  font-size: 17px;
}
}
