body {
  margin: 0;
  background: #000;
  color: #fff;
  font-family: 'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
}

/* HERO */
#hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 10%;
}

#hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 600;
  margin: 0;
}

#hero p {
  font-size: 1.2rem;
  color: #aaa;
  margin-top: 20px;
}

/* SECTIONS */
.section {
  padding: 100px 10%;
  max-width: 900px;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.section p {
  color: #aaa;
  line-height: 1.6;
}

/* TAGS */
.tags span {
  border: 1px solid #333;
  padding: 8px 14px;
  margin: 5px;
  display: inline-block;
  color: #ccc;
  transition: 0.3s;
}

.tags span:hover {
  border-color: #fff;
  color: #fff;
}

/* PROJECTS */
#arena {
  position: relative;
  height: 400px;
}

.word {
  position: absolute;
  font-size: 1.4rem;
  color: #888;
  cursor: pointer;
  transition: 0.3s;
}

.word:hover {
  color: #fff;
  transform: scale(1.1);
}

/* MODAL */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}

#modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: #111;
  padding: 40px;
  max-width: 500px;
}

.modal-content h3 {
  margin-top: 0;
}

.modal-content a {
  display: inline-block;
  margin-top: 20px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #555;
}

/* INTRO FULLSCREEN */
#intro {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: pointer; /* Indica que es clickable */
  transition: transform 1s cubic-bezier(0.85, 0, 0.15, 1), opacity 1s ease;
}

/* TEXTO */
#introTitle {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 600;
  opacity: 0;
  transform: translateY(40px);
  animation: introFade 1.8s ease forwards;
}

#introTitle {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 600;
  pointer-events: none; /* El clic pasa al padre #intro */
  animation: introFade 1.8s ease forwards;
}

#intro.exit {
  transform: translateY(-100%);
  opacity: 0;
}

.intro-sub {
  color: #777;
  margin-top: 10px;
  opacity: 0;
  animation: introFade 2.5s ease forwards;
}

/* ANIMACIÓN ENTRADA */
@keyframes introFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CUANDO SALE */
#intro.exit {
  transform: translateY(-100%);
  opacity: 0;
}

/* BLOQUEAR SCROLL AL INICIO */
body.lock {
  overflow: hidden;
}

#bubbleMenu {
  height: 100vh;
  position: relative;
  overflow: hidden;
}

#bubbleMenu.focus .bubble {
  opacity: 0.2;
}

#bubbleMenu.focus .bubble.active {
  opacity: 1;
}

/* BURBUJAS */
.bubble {
  position: absolute;
  padding: 18px 26px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  color: #aaa;
  cursor: pointer;
  transition: 0.3s;
  backdrop-filter: blur(10px);
}

/* Hover */
.bubble:hover {
  color: #fff;
  border-color: #fff;
  transform: scale(1.1);
}


/* Animaciones flotantes */
@keyframes float1 {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes float2 {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(15px); }
}

@keyframes float3 {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Posiciones */
.bubble:nth-child(1) {
  top: 30%; left: 20%;
  animation: float1 6s infinite ease-in-out;
}
.bubble:nth-child(2) {
  top: 20%; left: 60%;
  animation: float2 7s infinite ease-in-out;
}
.bubble:nth-child(3) {
  top: 60%; left: 40%;
  animation: float3 5s infinite ease-in-out;
}
.bubble:nth-child(4) {
  top: 70%; left: 70%;
  animation: float1 6.5s infinite ease-in-out;
}

/* EXPLOSIÓN */
.bubble.explode {
  animation: explode 0.6s forwards;
}

@keyframes explode {
  to {
    transform: scale(2);
    opacity: 0;
  }
}

#planetsSection {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #0a0a1a 0%, #000 100%);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  display: flex; /* Cambiado de none a flex para centrar contenido */
  transition: opacity 0.8s ease, visibility 0.8s ease;
  overflow: hidden !important;
}

#planetsSection.active {
  opacity: 1;
  visibility: visible;
}

/* BOTÓN CERRAR */


.btn-back-small {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.03); /* Casi transparente */
  color: rgba(255, 255, 255, 0.6); /* Texto suave para no distraer */
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem; 
  font-weight: 500;
  letter-spacing: 1.5px;
  cursor: pointer;
  z-index: 1001;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  display: inline-flex;
  width: auto;
  align-items: center;
  gap: 8px;
  border-radius: 2px;
  box-sizing: border-box;
}

.btn-back-small span {
  font-size: 0.8rem;
}

.btn-back-small:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

/* Para que en móviles no estorbe tanto, podemos hacerlo aún más pequeño */
@media (max-width: 768px) {
  .btn-back-small {
    top: 15px;
    left: 15px;
    padding: 5px 10px;
  }
}

/* UNIVERSO */
#universe {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* PLANETAS */
.planet {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.8s;
  box-shadow: 
    inset -30px -30px 60px rgba(0, 0, 0, 0.9),  
    inset 10px 10px 30px rgba(255, 255, 255, 0.15),
    0 0 20px rgba(255, 255, 255, 0.05);
    
  overflow: hidden; 
}

.planet::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.15;
  mix-blend-mode: overlay;
}

.planet:hover {
  transform: scale(1.1) translateY(-10px);
  box-shadow: 
    inset -20px -20px 50px rgba(0, 0, 0, 0.9),  
    inset 5px 5px 20px rgba(255, 255, 255, 0.2),
    0 0 40px rgba(255, 255, 255, 0.1);
}

.planet::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: inherit;
  filter: blur(10px);
  opacity: 0.2;
  z-index: -1;
  transition: opacity 0.5s;
}

.planet:hover::after {
  opacity: 1;
}

.planet.focused {
  transform: scale(2.5);
  z-index: 100;
  box-shadow: 
    inset -40px -40px 80px rgba(0, 0, 0, 1),
    inset 15px 15px 40px rgba(255, 255, 255, 0.1),
    0 0 60px rgba(255, 255, 255, 0.15);
}

/* INFO */
#planetInfo {
  background: rgba(10, 10, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  border-radius: 2px; /* Más cuadrado = más tecnológico */
  padding: 30px;
  backdrop-filter: blur(15px);
}

#planetInfo h3 {
  font-family: 'Playfair Display', serif; /* Contraste elegante */
  letter-spacing: 2px;
  text-transform: uppercase;
}

@keyframes spaceDrift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(10px, 15px); }
  100% { transform: translate(-5px, -10px); }
}

.planet:not(.focused) {
  animation: spaceDrift 15s infinite alternate ease-in-out;
}

#planetInfo p {
  color: #aaa;
}

#planetInfo a {
  display: inline-block;
  margin-top: 10px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #555;
}

#planetsSection::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(1px 1px at 20px 30px, #fff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 150px 50px, #fff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 100px 100px, #fff, rgba(0,0,0,0));
  background-size: 200px 200px; /* Repite el patrón */
  opacity: 0.3;
  animation: starsTwinkle 4s infinite alternate;
}

@keyframes starsTwinkle {
  from { opacity: 0.2; }
  to { opacity: 0.5; }
}