/* styles.css */

:root {
  --primary: #0f172a;
  --secondary: #1e293b;
  --accent: #38bdf8;
  --text: #f8fafc;
  --transition: all 0.3s ease-in-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0f172a; /* color de fondo fallback */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  overflow: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


body.loaded #preloader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}



html, body {
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--primary);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
}

/* Evitar scroll interno no deseado en secciones */
.section,
.sobre-mi,
.proyectos,
.contacto {
  overflow: hidden;
}

/* También asegurarse que elementos posicionados no salgan de su contenedor */
.sobre-mi::after,
.orbit-container,
.orbit-1::before,
.orbit-2::before,
.orbit-3::before,
.orbit-4::before,
.orbit-5::before,
.orbit-6::before,
.orbit-7::before,
.orbit-8::before,
.orbit-9::before {
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}

/* Opcional: prevenir scroll vertical si se generan bordes por padding/margin */
body {
  position: relative;
  padding-right: 0 !important;
  margin-right: 0 !important;
}

.header {
  background: var(--secondary);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}


.logo {
  font-size: 2rem;
  color: var(--accent);
  font-weight: bold;
}

.nav {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.nav a:hover {
  color: var(--accent);
}

.section {
  padding: 4rem 0;
}

.inicio {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}


.inicio h2{
    font-size: 3rem;
    font-weight: 900;
}

.inicio h3{
    font-size: 1rem;
    color: #5dccfc;
}

.inicio p{
    font-size: 3rem;
    color: #00b3ff;
    font-weight: 900;
    overflow: hidden;
}

.comet-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, var(--accent), transparent);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.8;
  z-index: 1;
  animation: fadeOut 0.6s linear forwards;
}

@keyframes fadeOut {
  to {
    transform: rotate(240deg);
  background: linear-gradient(45deg, var(--accent), transparent);
  width: 16px;
  height: 16px;
  border-radius: 10px;
  box-shadow: 0 0 12px var(--accent);
  opacity: 0.8;
  }
}


.redes-sociales {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
  overflow: hidden;
}

.social {
  width: 5rem;
  height: 5rem;
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: grayscale(100%) brightness(0.8);
  border-radius: 50%;
}

.social:hover {
  transform: scale(1) rotate(10deg);
  filter: grayscale(0%) brightness(1.2);
}

.social.whatsapp {
  background-image: url('icons/w.png');
}
.social.tiktok {
  background-image: url('icons/t.png');
}
.social.youtube {
  background-image: url('icons/y.png');
}
.social.facebook {
  background-image: url('icons/f.png');
}


.orbit-container {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  animation: rotateOrbit 10s linear infinite;
  z-index: 1;
}

.orbit-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.inicio img {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  border: 5px solid var(--accent);
  animation: pulse 5s infinite;
  z-index: 12;
  position: relative;
}

/* Órbita 1 */
.orbit-1 {
  width: 420px;
  height: 320px;
  animation-duration: 8s;
  position: absolute;
}
.orbit-1::before {
  transform: rotate(240deg);
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  background-image: url('icons/html.png'); /* tu imagen aquí */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 2;
  opacity: 0.9;
}


/* Órbita 2 */
.orbit-2 {
  width: 280px;
  height: 280px;
  animation-duration: 12s;
}
.orbit-2::before {
  transform: rotate(240deg);
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  background-image: url('icons/css.png'); /* tu imagen aquí */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 2;
  opacity: 0.9;
}

/* Órbita 3 */
.orbit-3 {
  width: 320px;
  height: 320px;
  animation-duration: 6s;
}
.orbit-3::before {
  transform: rotate(240deg);
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  background-image: url('icons/js.png'); /* tu imagen aquí */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 2;
  opacity: 0.9;
}

/* Órbita 4 */
.orbit-4 {
  width: 290px;
  height: 370px;
  animation-duration: 10s;
}
.orbit-4::before {
  transform: rotate(240deg);
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  background-image: url('icons/servidor-sql.png'); /* tu imagen aquí */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 2;
  opacity: 0.9;
}

/* Órbita 5 */
.orbit-5 {
  width: 400px;
  height: 120px;
  animation-duration: 6s;
}
.orbit-5::before {
  transform: rotate(240deg);
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  background-image: url('icons/php.png'); /* tu imagen aquí */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 2;
  opacity: 0.9;
}

/* Órbita 6 */
.orbit-6 {
  width: 500px;
  height: 400px;
  animation-duration: 16s;
}
.orbit-6::before {
  transform: rotate(240deg);
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  background-image: url('icons/piton.png'); /* tu imagen aquí */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 2;
  opacity: 0.9;
}

/* Órbita 7 */
.orbit-7 {
  width: 700px;
  height: 120px;
  animation-duration: 40s;
}
.orbit-7::before {
  transform: rotate(240deg);
  background: linear-gradient(45deg, var(--accent), transparent);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  box-shadow: 0 0 12px var(--accent);
  opacity: 0.8;
}

/* Órbita 8 */
.orbit-8 {
  width: 120px;
  height: 150px;
  animation-duration: 3s;
}
.orbit-8::before {
  transform: rotate(240deg);
  background: linear-gradient(45deg, var(--accent), transparent);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  box-shadow: 0 0 12px var(--accent);
  opacity: 0.8;
}

/* Órbita 9 */
.orbit-9 {
  width: 400px;
  height: 400px;
  animation-duration: 11s;
}
.orbit-9::before {
  transform: rotate(240deg);
  background: linear-gradient(45deg, var(--accent), transparent);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  box-shadow: 0 0 12px var(--accent);
  opacity: 0.8;
}


@keyframes rotateOrbit {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent); }
  50% { box-shadow: 0 0 20px 10px transparent; }
}

/* Fondo animado degradado infinito */
.sobre-mi {
  background: linear-gradient(135deg, #0f172a, #2563eb, #38bdf8);
  background-size: 800% 800%;
  animation: gradientShift 15s ease infinite;

  position: relative;
  border-radius: 12px;
  padding: 3rem 2rem;
  margin-top: 2rem;
  backdrop-filter: blur(4px);
  color: var(--text);
  overflow: hidden;
  z-index: 1;
}

/* Fondo degradado animado */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Tarjetas informativas estilo futurista */
.bloques-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.info-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
  transition: transform 0.3s ease;
}

.info-card:hover {
  transform: translateY(-5px);
}

/* Título de skills */
.tech-title {
  text-align: center;
  margin-top: 3rem;
  font-size: 1.5rem;
  color: var(--accent);
}

/* Íconos tecnológicos */
.tech-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.tech-icons img {
  width: 50px;
  height: 50px;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: grayscale(100%) brightness(0.8);
}

.tech-icons img:hover {
  transform: scale(1.2);
  filter: grayscale(0%) brightness(1.2);
}


.comet-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, var(--accent), transparent);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.8;
  z-index: 1;
  animation: fadeOut 0.6s linear forwards;
}

@keyframes fadeOut {
  to {
    transform: rotate(240deg);
  background: linear-gradient(45deg, var(--accent), transparent);
  width: 16px;
  height: 16px;
  border-radius: 10px;
  box-shadow: 0 0 12px var(--accent);
  opacity: 0.8;
  }
}

.proyectos-grid {
  background: #1f2937;
  padding: 1.5rem;
  border-radius: 8px;
  transition: var(--transition);
  overflow: hidden; /* ✔✔ Evita scroll vertical interno */
}

.proyectos {
  background: radial-gradient(circle at top left, #0f172a 20%, #1e3a8a 120%);
  padding: 4rem 2rem;
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.1);
  position: relative;
  overflow: hidden;
}

.proyectos::before {
  content: "";
  position: absolute;
  top: -100px;
  left: -100px;
  width: 200%;
  height: 200%;
  background: repeating-radial-gradient(rgba(255,255,255,0.03) 1px, transparent 2px);
  animation: stars 60s linear infinite;
  z-index: 0;
}

@keyframes stars {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.proyectos h2 {
  text-align: center;
  font-size: 2.8rem;
  color: #38bdf8;
  text-shadow: 0 0 12px #38bdf8;
  margin-bottom: 3rem;
  position: relative;
  z-index: 2;
}

.proyectos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  z-index: 2;
  position: relative;
}

.proyecto-card {
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.1);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  text-decoration: none;
  color: white;
  display: flex;
  flex-direction: column;
}

.proyecto-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.4);
}

.preview {
  height: 160px;
  background-size: cover;
  background-position: center;
  filter: brightness(0.8) contrast(1.1);
  transition: filter 0.3s ease;
}

.proyecto-card:hover .preview {
  filter: brightness(1) contrast(1.2);
}

.proyecto-card h3 {
  padding: 1rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: #38bdf8;
  text-shadow: 0 0 4px #38bdf8;
}

@media (max-width: 480px) {
  .preview {
    height: 120px;
  }
  .proyecto-card h3 {
    font-size: 1rem;
  }
}

.contacto {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  padding: 4rem 2rem;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.1);
}

.contacto::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(56,189,248,0.05), transparent 70%);
  animation: pulseBackground 10s linear infinite;
  z-index: 0;
}

@keyframes pulseBackground {
  0% {
    transform: rotate(0deg) scale(1);
  }
  100% {
    transform: rotate(360deg) scale(1.1);
  }
}

.contacto h2 {
  text-align: center;
  color: #38bdf8;
  margin-bottom: 2rem;
  z-index: 1;
  position: relative;
}

.contacto form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1;
  position: relative;
}

.contacto input,
.contacto textarea {
  padding: 1rem;
  border: none;
  border-radius: 8px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 1rem;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.1);
  transition: border 0.3s ease;
}

.contacto input:focus,
.contacto textarea:focus {
  outline: none;
  border: 2px solid #38bdf8;
}

.contacto button {
  padding: 0.9rem;
  border: none;
  border-radius: 8px;
  background: #38bdf8;
  color: #0f172a;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.contacto button:hover {
  background: #0ea5e9;
  transform: scale(1.05);
}

button {
  padding: 0.75rem;
  background: var(--accent);
  color: var(--primary);
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden; /* ✔✔ Asegura que el contenido no desborde */
  max-width: 100%;
  white-space: nowrap; /* Opcional, evita que el texto del botón haga salto de línea */
}

button:hover {
  background: #0ea5e9;
}

.contacto {
  background: var(--secondary);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
  overflow: hidden; /* ✔✔ Esto previene desbordamiento */
  
}

.footer {
  text-align: center;
  padding: 1rem 0;
  margin-top: 2rem;
  border-top: 1px solid #334155;
}
