:root {
  --bg: #000;
  --accent: #00f0ff;
  --text-muted: #aaa;
  --glass: rgba(255, 255, 255, 0.05);
}

body {
  margin: 0;
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

html { scroll-behavior: smooth; }

/* PROMPTS DE FONDO */
#code-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  opacity: 1;
}

.bg-code-line {
  position: absolute;
  font-family: 'monospace';
  font-size: 16px;
  white-space: nowrap;
  color: var(--accent);
  opacity: 0;
  filter: blur(1px);
  user-select: none;
}

@keyframes floatCode {
  0% { transform: translateY(20px); opacity: 0; }
  20% { opacity: 0.15; }
  80% { opacity: 0.15; }
  100% { transform: translateY(-60px); opacity: 0; }
}

/* --- INTRO --- */
#intro {
  position: fixed;
  inset: 0;
  min-height: 100vh; 
  min-height: 100dvh;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: pointer;
  transition: transform 1s cubic-bezier(0.85, 0, 0.15, 1), opacity 0.8s ease;
}

#intro.exit {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

#introTitle {
  position: relative;
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 600;
  z-index: 10;
  opacity: 0;
  animation: fadeIn 1s ease forwards 0.5s;
  text-shadow: 0 0 10px rgba(94, 18, 160, 0.678);
  word-break: break-word;
  text-align: center;
}

#introTitle::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 300%;
  height: 700%;
  background: radial-gradient(circle, rgba(0, 242, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(25px);
  animation: pulseNebula 8s infinite alternate ease-in-out;
}

@keyframes pulseNebula {
  0% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.95); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

.intro-sub {
  color: var(--accent);
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 0.9rem;
  z-index: 10;
  opacity: 0;
  animation: fadeIn 1s ease forwards 0.8s;
}

/* BURBUJAS */
.tech-orbit { position: absolute; width: 100%; height: 100%; pointer-events: none; }

.bubble {
  position: absolute;
  width: 55px; height: 55px;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--glass);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  top: 50%; left: 50%;
  opacity: 0;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.08), inset 0 0 10px rgba(255,255,255,0.05);
  backface-visibility: hidden;
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) translateZ(0);
  will-change: transform, opacity;
  animation: bubbleFadeIn 1s ease forwards, floatFree 8s infinite ease-in-out;
}

.bubble i { font-size: 22px; color: var(--accent); transition: 0.3s; }

.bubble:hover {
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) scale(1.2);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.3), inset 0 0 15px rgba(255,255,255,0.1);
}

.bubble:hover i { color: #fff; transform: scale(1.2); }

@keyframes fadeIn { to { opacity: 1; } }
@keyframes bubbleFadeIn { to { opacity: 0.7; } }
@keyframes floatFree {
  0%, 100% { transform: translate(-50%, -50%) translate(var(--x), var(--y)) scale(1); }
  50% { transform: translate(-50%, -50%) translate(calc(var(--x) + 10px), calc(var(--y) - 15px)) scale(1.08); }
}

/* --- CONTENIDO GENERAL --- */
.hero-mini { text-align: center; font-size: 1.4rem; }
.section { padding: 100px 10%; max-width: 900px; margin: 0 auto; opacity: 0; transform: translateY(40px); transition: 0.6s ease; }
.section.visible { opacity: 1; transform: translateY(0); }
.section h2 { font-size: 2.5rem; margin-bottom: 20px; font-family: 'Playfair Display', serif; }
.section p { color: var(--text-muted); line-height: 1.8; font-size: 1.1rem; }

.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 40px; }
.about-card { background: var(--glass); border: 1px solid #222; padding: 20px; transition: 0.3s; }
.about-card:hover { border-color: var(--accent); transform: translateY(-5px); }
.about-card h3 { margin-bottom: 10px; color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.tags span {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: monospace; font-size: 0.95rem; padding: 8px 12px;
  border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.1); transition: 0.3s;
}
.tags img { width: 16px; }
.tags span:hover { border-color: var(--accent); color: #fff; background: rgba(0, 240, 255, 0.05); }

.btn-primary {
  background: transparent; color: #fff; border: 1px solid var(--accent);
  padding: 15px 30px; cursor: pointer; font-size: 1rem; transition: 0.3s;
  margin-top: 20px; border-radius: 4px; text-transform: uppercase;
  letter-spacing: 1px; font-weight: 500;
}
.btn-primary:hover { background: var(--accent); color: #000; box-shadow: 0 0 20px var(--accent); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.bubble img.tech-icon { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(255, 45, 32, 0.6)) brightness(1.1); transition: 0.3s; }
.bubble:hover img.tech-icon { transform: scale(1.15); filter: drop-shadow(0 0 12px rgba(255, 45, 32, 1)) brightness(1.2); }

/* --- TRANSICIÓN A LA GALAXIA --- */
#galaxyTransition {
  position: fixed; inset: 0; z-index: 99999; pointer-events: none; overflow: hidden;
  background: radial-gradient(circle at center, #000 0%, #020617 100%); opacity: 0;
}
#galaxyTransition::before { content: ""; position: absolute; inset: 0; background: radial-gradient(white 1px, transparent 1px), radial-gradient(white 1px, transparent 1px); background-size: 3px 3px, 2px 2px; background-position: 0 0, 50px 50px; opacity: 0; }
#galaxyTransition::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, white, transparent 70%); opacity: 0; }
#galaxyTransition.active { opacity: 1; }
#galaxyTransition.active::before { animation: starWarp 0.9s ease forwards; }
#galaxyTransition.active::after { animation: flash 0.9s ease forwards; }

.star { position: absolute; width: 2px; height: 2px; background: white; top: 50%; left: 50%; opacity: 0; border-radius: 50%; filter: blur(1px); transform: translate(-50%, -50%); }

@keyframes warpMove {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) scale(2.5); opacity: 0; }
}

/* --- SECCIÓN DE PLANETAS INTERACTIVA --- */
#planetsSection {
  position: fixed; inset: 0; background: radial-gradient(circle at center, #0a0a1a 0%, #000 100%);
  z-index: 10000; opacity: 0; visibility: hidden; display: flex; transition: 0.8s;
  transform: scale(1.4); filter: blur(12px);
}
#planetsSection.active { opacity: 1; visibility: visible; animation: cameraLanding 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

@keyframes cameraLanding {
  0% { transform: scale(1.4); filter: blur(12px); opacity: 0; }
  40% { opacity: 1; }
  70% { transform: scale(1.05); filter: blur(2px); }
  100% { transform: scale(1); filter: blur(0); opacity: 1; }
}

#universe {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.1) 1px, transparent 1px),
    radial-gradient(circle at 80% 40%, rgba(255,255,255,0.08) 1px, transparent 1px),
    radial-gradient(circle at 50% 80%, rgba(255,255,255,0.06) 1px, transparent 1px), #000;
  background-size: 200px 200px;
}

.planet-wrapper {
  position: absolute;
  transition: transform 0.1s ease-out; /* Para el paralaje fluido */
}

.planet {
  position: relative;
  border-radius: 50%;
  cursor: pointer;
  background-size: 200% 100%;
  background-position: center;
  box-shadow: inset -60px -60px 120px rgba(0,0,0,0.95), inset 30px 30px 60px rgba(255,255,255,0.06), 0 0 50px rgba(255,255,255,0.08);
  outline: 2px solid transparent; outline-offset: 8px;
  animation: floatPlanet 6s ease-in-out infinite, planetRotation 60s linear infinite;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), outline-color 0.3s, box-shadow 0.3s;
}

@keyframes planetRotation {
  from { background-position: 0% 50%; }
  to { background-position: 200% 50%; }
}

@keyframes floatPlanet {
  0%,100% { transform: translateY(0px); }
  50% { transform: translateY(-18px); }
}

.planet:hover {
  animation: floatPlanet 6s ease-in-out infinite, planetRotation 15s linear infinite;
  outline-color: rgba(0, 240, 255, 0.4);
  box-shadow: inset -60px -60px 120px rgba(0,0,0,0.95), inset 30px 30px 60px rgba(255,255,255,0.06), 0 0 70px rgba(0, 240, 255, 0.4);
}

.planet.focused { transform: scale(1.8) !important; z-index: 100; box-shadow: 0 0 70px var(--accent); }

/* Anillos planetarios interactivos */
.planet.planet-ring::before {
  content: ""; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotateX(65deg) scale(0);
  width: 170%; height: 170%;
  border: 15px solid rgba(0, 240, 255, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2), inset 0 0 10px rgba(0, 240, 255, 0.1);
  opacity: 0; pointer-events: none; z-index: -2;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease;
}
.planet.planet-ring:hover::before { transform: translate(-50%, -50%) rotateX(65deg) scale(1.05); opacity: 1; }

/* Atmósfera de planetas */
@keyframes atmospherePulse {
  0% { transform: scale(1); opacity: 0.15; }
  100% { transform: scale(1.03); opacity: 0.25; }
}

.planet::after {
  content: ""; position: absolute; inset: -10%; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, rgba(0,0,0,0) 70%);
  filter: blur(15px); z-index: -1; pointer-events: none;
  animation: atmospherePulse 5s infinite alternate ease-in-out;
}
.planet:hover::after { background: radial-gradient(circle, rgba(94, 18, 160, 0.25) 0%, rgba(0,0,0,0) 70%); }

.particle {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); pointer-events: none;
  animation: explode 1s ease-out forwards;
}

@keyframes explode {
  from { transform: translate(0,0); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}

.btn-back-small {
  position: absolute; top: 20px; left: 20px; background: var(--glass);
  color: #fff; border: 1px solid #333; padding: 8px 15px; cursor: pointer; z-index: 101;
}

/* --- HUD DE INFORMACIÓN (Panel Interactivo) --- */
#planetInfo {
  position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%);
  background: rgba(5, 5, 15, 0.85);
  border: 1px solid var(--accent);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.15), inset 0 0 15px rgba(0, 240, 255, 0.05);
  border-radius: 16px; padding: 30px 40px;
  backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
  text-align: center; min-width: 380px; transition: all 0.4s ease;
}

#planetTitle { margin: 0 0 10px 0; color: #fff; font-family: 'Playfair Display', serif; text-shadow: 0 0 10px rgba(0, 240, 255, 0.5); }
#planetDesc { margin-bottom: 20px; font-size: 0.95rem; }

.tech-stack {
  display: flex; justify-content: center; gap: 15px; margin-bottom: 25px;
  padding: 15px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.tech-stack img { width: 24px; height: 24px; filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2)); transition: transform 0.3s ease, filter 0.3s ease; }
.tech-stack img:hover { transform: translateY(-5px) scale(1.1); filter: drop-shadow(0 0 8px var(--accent)); }

.planet-actions { display: flex; justify-content: center; gap: 15px; }
.btn-hud {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0, 240, 255, 0.05); color: #fff;
  border: 1px solid rgba(0, 240, 255, 0.3); padding: 10px 20px; border-radius: 8px;
  font-family: monospace; font-size: 0.9rem; text-decoration: none; cursor: pointer; transition: all 0.3s ease;
}
.btn-hud i { font-size: 1.1rem; }
.btn-hud:hover { background: var(--accent); color: #000; box-shadow: 0 0 15px rgba(0, 240, 255, 0.4); transform: translateY(-2px); }

/* --- CONTACTO --- */
.contact-container {
  display: grid; grid-template-columns: 1fr; gap: 30px; margin-top: 30px;
  background: var(--glass); border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 30px; border-radius: 12px; backdrop-filter: blur(10px);
}
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.input-group { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.input-group label { font-size: 0.9rem; color: var(--text-muted); font-family: monospace; }
.input-group input, .input-group textarea {
  background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px; color: #fff; border-radius: 6px; font-family: 'Inter', sans-serif; transition: 0.3s;
}
.input-group input:focus, .input-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 10px rgba(0, 240, 255, 0.2); }

.social-links { display: flex; justify-content: center; gap: 20px; margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.social-links a { color: var(--text-muted); font-size: 1.5rem; transition: 0.3s; }
.social-links a:hover { color: var(--accent); transform: translateY(-3px); }

.team-contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; margin-top: 30px; padding-top: 30px; border-top: 1px solid rgba(255, 255, 255, 0.1); text-align: center; }
.team-member h4 { margin: 0 0 15px 0; color: var(--accent); font-family: monospace; font-size: 1.1rem; letter-spacing: 1px; }
.team-member .social-links { margin-top: 0; padding-top: 0; border-top: none; }

/* --- NOTIFICACIONES --- */
#notification-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.notification {
  min-width: 280px; padding: 16px 24px; border-radius: 12px;
  background: rgba(86, 81, 160, 0.15); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(121, 115, 207, 0.3); color: #fff; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px rgba(121, 115, 207, 0.2);
  transform: translateX(120%); transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.notification.show { transform: translateX(0); }
.notification::after {
  content: ''; position: absolute; bottom: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, #5651A0, #7973CF); width: 100%; border-radius: 0 0 12px 12px;
  animation: progress 4s linear forwards;
}
@keyframes progress { from { width: 100%; } to { width: 0%; } }
.notif-icon { width: 12px; height: 12px; border-radius: 50%; background: #7973CF; box-shadow: 0 0 10px #7973CF; }
.notif-error .notif-icon { background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; }
.notif-error { border-color: #ff4d4d !important; background: rgba(255, 77, 77, 0.1) !important; }
.notif-error .notif-content span { color: #ff4d4d !important; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .bubble { width: 38px; height: 38px; }
  .bubble img.tech-icon { width: 20px; height: 20px; }
  .tech-orbit { transform: none; }
  #introTitle { font-size: 2.8rem; text-align: center; padding: 0 15px; line-height: 1.1; }
  .intro-sub { font-size: 0.75rem; letter-spacing: 2px; }
  #introTitle::before { width: 150%; height: 300%; filter: blur(20px); }
  #planetInfo { min-width: 90%; padding: 20px; bottom: 20px; }
  .planet-actions { flex-direction: column; }
}

@media (max-width: 380px) {
  .tech-orbit { transform: scale(0.55); }
  #introTitle { font-size: 2.2rem; }
}