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

body {
  --text-color: rgba(163, 161, 161, 0.615);
  color: var(--text-color);
  font-family: system-ui, sans-serif;
  background: url("assets/IE2025-FONDO.jpg") no-repeat center center/cover;
  min-height: 100vh;
  overflow-y: scroll;
  padding: 3rem;
  transition: background 0.3s ease, color 0.3s ease;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  left: 0;
  width: 100%;
  height: 12rem;
  pointer-events: none;
  z-index: 5;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px) saturate(300%) brightness(0.95);
  -webkit-backdrop-filter: blur(6px) saturate(300%) brightness(0.95);
}

body::before {
  top: 0;
  mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
}

body::after {
  bottom: 0;
  mask-image: linear-gradient(to top, black 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, black 0%, transparent 100%);
}

#container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 1400px;
  margin: auto;
  padding-top: 2rem;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  text-align: justify;
  text-align-last: center;
  padding: 1.5rem 2rem;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px) saturate(300%) brightness(0.95);
  border: 1px solid rgba(220, 220, 220, 0.6);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32), 0 6px 14px rgba(173, 216, 255, 0.45);
  transition: all 2s ease, color 1s ease, transform 0.4s ease; 
  color: var(--text-color);
  max-width: 1400px;      
  margin-left: auto;
  margin-right: auto;
  transform-origin: center; 
}

header:hover {
  backdrop-filter: blur(6px) saturate(350%) brightness(1.15);
  border-color: rgba(240, 240, 240, 1);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45), 0 0 36px rgba(173, 216, 255, 0.55);
  color: #fff;
  transform: scale(1.05); 
}

.intro {
  padding: 2rem;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px) saturate(300%) brightness(0.95);
  border: 2px solid rgba(220, 220, 220, 0.8);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32), 0 6px 14px rgba(173, 216, 255, 0.45);
  color: var(--text-color);
  transition: all 2s ease, color 0.8s ease, transform 0.2s ease;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3rem; 
  z-index: 1;
  transform-origin: center;
}

.intro:hover {
  backdrop-filter: blur(6px) saturate(350%) brightness(1.15);
  border-color: rgba(240, 240, 240, 1);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45), 0 0 36px rgba(173, 216, 255, 0.55);
  color: #fff;
  transform: scale(1.1);
}

.intro button {
  margin-top: 1rem;
}

.intro-texto {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.8s ease, opacity 0.6s ease;
}

.intro-texto.active {
  max-height: 800px; 
  opacity: 1;
}

.sobre-p5js {
  position: relative;
  padding: 2rem;
  border-radius: 40px; 
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px) saturate(300%) brightness(0.7);
  -webkit-backdrop-filter: blur(6px) saturate(300%) brightness(0.95);
  border: 1px solid rgba(220, 220, 220, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32), 0 6px 14px rgba(173, 216, 255, 0.45);
  color: var(--text-color);
  transition: all 0.4s ease, color 0.4s ease, transform 0.4s ease; 
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 0; 
  z-index: 1;
  transform-origin: center;
}

.sobre-p5js:hover {
  backdrop-filter: blur(6px) saturate(350%) brightness(1.5);
  -webkit-backdrop-filter: blur(6px) saturate(350%) brightness(1);
  border-color: rgba(240, 240, 240, 1);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45), 0 0 36px rgba(173, 216, 255, 0.55);
  color: #fff;
  transform: scale(1.1);
}

.sobre-p5js p,
.sobre-p5js button {
  color: inherit;
  transition: inherit;
}

.sobre-p5js .contenido {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.6s ease, opacity 0.6s ease;
}

.sobre-p5js.active .contenido {
  max-height: 1000px; 
  opacity: 1;
}

.sobre-p5js p,
.sobre-p5js button {
  color: inherit;
  transition: inherit;
}
.sobre-p5js .contenido {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.6s ease, opacity 0.6s ease;
}

.sobre-p5js.active .contenido {
    max-height: 1000px; 
    opacity: 1;
}

button {
  display: inline-block;
  width: 100%;
  padding: .6rem 1.2rem;
  border-radius: 30px;
  border: 2px solid rgba(220, 220, 220, 0.8);
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.6s ease, color 0.4s ease;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px) saturate(300%) brightness(0.95);
  color: var(--text-color);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32), 0 4px 10px rgba(173, 216, 255, 0.45);
  box-sizing: border-box;
}

button:hover {
  padding: .8rem 1.5rem;
  backdrop-filter: blur(6px) saturate(350%) brightness(1.15);
  border-color: rgba(240, 240, 240, 1);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5), 0 0 44px rgba(173, 216, 255, 0.6);
  color: #fff;
}

.galeria {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  max-width: 1400px;
  margin: auto;
  max-height: 0; 
  opacity: 0;
  overflow: hidden; 
  transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.6s ease; 
}

.galeria.active {
  max-height: 2000px; /* Valor suficiente para la mayoría de galerías (ajusta si tu contenido es más alto, e.g., 3000px+).
                         Para un valor dinámico ideal, usa JS: maxHeight = this.scrollHeight + 'px'; */
  opacity: 1;
  overflow: visible; /* Permite que el contenido se expanda completamente una vez animado */
}

.galeria .tarjeta {
  flex: 1 1 calc(50% - 1.5rem / 2); 
  min-width: 280px; 
  min-width: 0; 
}

@media (max-width: 768px) {
  .galeria .tarjeta {
    flex: 1 1 100%; 
  }
  .galeria {
    gap: 1rem; 
  }
}

.tarjeta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px) saturate(300%) brightness(0.95);
  border: 2px solid rgba(220, 220, 220, 0.8);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32), 0 8px 18px rgba(173, 216, 255, 0.45);
  overflow: hidden;
  cursor: pointer;
  color: var(--text-color, #333);
  transition: transform 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease, border 0.4s ease, color 0.4s ease;
}

.tarjeta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 34px;
  pointer-events: none;
  background: inherit;
  mix-blend-mode: color;
  filter: blur(30px) brightness(1.2);
  opacity: 0.6;
  z-index: 1;
}

.tarjeta img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 18px;
  z-index: 2;
}

.tarjeta h3 {
  flex: 1;
  text-align: justify;
  font-size: 1.1rem;
  z-index: 2;
}

.tarjeta:hover {
  transform: scale(1.05); 
  backdrop-filter: blur(6px) saturate(350%) brightness(1.15);
  border-color: rgba(240, 240, 240, 1);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.45), 0 0 44px rgba(173, 216, 255, 0.55);
  color: #fff;
}

.expand-clone {
  position: fixed !important; 
  overflow: visible !important; 
  z-index: 1000 !important; 
  margin: 0 !important;
  box-sizing: border-box !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.expand-clone::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 34px;
  pointer-events: none;
  background: inherit;
  mix-blend-mode: color;
  filter: blur(30px) brightness(1.2);
  opacity: 0.6;
  z-index: 1;
}

.expand-clone::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 34px;
  pointer-events: none;
  background: transparent;
  border: 2px solid rgba(98, 1, 1, 0.55);
  mix-blend-mode: screen;
  filter: blur(6px) hue-rotate(45deg) saturate(600%);
  z-index: 3;
  box-sizing: border-box;
}

.expand-clone:hover::after {
  border-color: rgba(255, 0, 255, 0.8);
  border: 2.5px solid rgba(0, 191, 255, 0.5);
  filter: blur(10px) hue-rotate(60deg) saturate(800%);
}

.expand-clone img {
  width: 90% !important;
  height: 90% !important;
  object-fit: contain !important;
  margin: auto !important;
  display: block !important;
  pointer-events: none !important;
  border-radius: 18px !important;
  z-index: 2 !important;
}

.proyectos h2 {
  position: relative;
  margin: 2rem auto 1rem auto;
  max-width: 1400px;
  padding: 1rem 2rem;
  font-size: 2rem;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  z-index: 1;
  transition: color 0.4s ease, text-shadow 0.4s ease; 
  text-align: left; 
  color: rgb(205, 205, 205); 
  text-shadow: 0 5px 7px rgb(0, 0, 0); 
}

.proyectos h2::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px) saturate(300%) brightness(0.95);
  border: 1px solid rgba(220, 220, 220, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease,
              border-color 0.4s ease,
              backdrop-filter 0.4s ease,
              box-shadow 0.4s ease,
              transform 0.4s ease; 
  z-index: -1;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25),
              0 4px 10px rgba(173, 216, 255, 0.25);
  transform-origin: center;
  transform: scale(0.95); 
}

.proyectos h2:hover::after {
  opacity: 1;
  backdrop-filter: blur(6px) saturate(350%) brightness(1.15);
  border-color: rgba(240, 240, 240, 0.8);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35),
              0 6px 18px rgba(173, 216, 255, 0.35);
  transform: scale(1); 
}

.proyectos h2:hover {
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); 
}

.proyectos:has(.galeria.active) h2::after {
  opacity: 1;
  backdrop-filter: blur(6px) saturate(350%) brightness(1.15);
  border-color: rgba(240, 240, 240, 0.8);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35),
              0 6px 18px rgba(173, 216, 255, 0.35);
  transform: scale(1); 
}

.proyectos:has(.galeria.active) h2 {
  text-shadow: none;
}

header,
.intro,
button,
.tarjeta,
.tarjeta.expand {
  border: 1px solid rgba(220, 220, 220, 0.4);
}

body {
  font-size: 1.15rem;
  line-height: 1.75;
}

h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.6rem;
  font-weight: 500;
}

p {
  font-size: 1.2rem;
}

button {
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sobre-autor {
  position: relative;
  padding: 2rem;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px) saturate(300%) brightness(0.7);
  -webkit-backdrop-filter: blur(6px) saturate(300%) brightness(0.95);
  border: 1px solid rgba(220, 220, 220, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32),
              0 6px 14px rgba(173, 216, 255, 0.45);
  color: var(--text-color);
  transition: all 0.4s ease, color 0.8s ease, transform 0.4s ease;
  max-width: 1400px;
  margin: 4rem auto;
  z-index: 1;
  cursor: pointer;
  transform-origin: center;
}

.sobre-autor:hover {
  backdrop-filter: blur(6px) saturate(400%) brightness(1.5);
  -webkit-backdrop-filter: blur(6px) saturate(350%) brightness(1);
  border-color: rgba(240, 240, 240, 1);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45),
              0 0 36px rgba(173, 216, 255, 0.55);
  color: #fff;
  transform: scale(1.1);
}

.autor-contenido {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.6s ease, opacity 0.5s ease;
}

.autor-contenido.active {
  max-height: 600px;
  opacity: 1;
}

.sobre-autor p,
.sobre-autor h2 {
  transition: color 0.6s ease;
}

.sobre-autor:hover p,
.sobre-autor:hover h2 {
  color: #fff;
}

footer {
  margin-top: 3rem;
  padding: 2rem;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px) saturate(300%) brightness(0.7);
  -webkit-backdrop-filter: blur(6px) saturate(300%) brightness(0.95);
  border: 1px solid rgba(220, 220, 220, 0.6);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32),
              0 6px 14px rgba(173, 216, 255, 0.45);
  color: var(--text-color);
  text-align: center;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  transition: all 1s ease, color 0.8s ease;
}

footer:hover {
  backdrop-filter: blur(6px) saturate(350%) brightness(1.5);
  -webkit-backdrop-filter: blur(6px) saturate(350%) brightness(1);
  border-color: rgba(240, 240, 240, 1);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45),
              0 0 36px rgba(173, 216, 255, 0.55);
  color: #fff;
}

.footer-container {
  max-width: 1000px;
  margin: 0 auto;
}

.footer-container p {
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
}

.social-icons a {
  display: inline-block;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.social-icons a img {
  width: 28px;
  height: 28px;
  filter: invert(50%) drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
  transition: filter 0.4s ease, transform 0.4s ease;
}

.social-icons a:hover img {
  transform: scale(1.25);
  filter: invert(0%) drop-shadow(0 0 14px rgba(173, 216, 255, 0.75));
}

.sketch-container {
  width: 100%;
  max-width: 1400px;        
  margin: 3rem auto;        
  padding: 2rem;           
  border-radius: 40px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(6px) saturate(300%) brightness(0.95);
  border: 1px solid rgba(220,220,220,0.4);
  box-shadow: 0 12px 28px rgba(0,0,0,0.32), 0 6px 14px rgba(173,216,255,0.45);
  overflow: hidden;
  position: relative;       
  min-height: clamp(360px, 45vh, 720px); 
  transition: all 0.4s ease, transform 0.4s ease, color 0.4s ease; 
  transform-origin: center; 
  cursor: pointer; 
  color: var(--text-color); 
}
.sketch-container:hover {
  backdrop-filter: blur(6px) saturate(350%) brightness(1.15);
  border-color: rgba(240, 240, 240, 1);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45), 0 0 36px rgba(173, 216, 255, 0.55);
  transform: scale(1.05);  
  color: #fff; 
}

#sketch-holder,
.sketch-container {
  width: 100% !important;
  max-width: 1400px !important;   
  margin-left: auto !important;
}
