/* ==================== ESPACIAL BASE - FONDO AMARILLO PERMANENTE ==================== */

/* ==================== Variables CSS ==================== */
:root {
  --text-primary: #ffffff;
  --text-secondary: #72d6ff;
  --accent: #72d6ff;
  --accent-purple: #ff7fff;
  --retro-text: #2C3E50;
  --retro-blue: #2196F3;
  --retro-blue-dark: #1976D2;
  --retro-radius: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 70px;
  --base-blur: 16px;
}

@media (hover: none) and (pointer: coarse) {
  :root {
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --base-blur: 8px;
  }
}

@media (min-width: 1024px) and (hover: hover) {
  :root {
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --base-blur: 20px;
  }
}

/* ==================== Reset & Base ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* ==================== FONDO AMARILLO - SIEMPRE VISIBLE ==================== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Fondo amarillo - NO SE SOBRESCRIBE NUNCA */
  background: linear-gradient(180deg,
    #FFF9C4 0%,
    #FFF59D 50%,
    #FFF176 100%);
  pointer-events: none;
  z-index: 0;
}

@media (min-width: 1024px) and (hover: hover) {
  body::before {
    animation: gradientShift 20s ease infinite;
  }

  @keyframes gradientShift {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
  }
}

/* ==================== Starfield ==================== */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.spiral-galaxy {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(700px, 90vw);
  height: min(700px, 90vw);
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, 
    rgba(114, 214, 255, 0.03) 0%, 
    rgba(255, 127, 255, 0.03) 30%, 
    transparent 70%);
  border-radius: 50%;
}

@media (min-width: 1024px) and (hover: hover) {
  .spiral-galaxy {
    animation: spiralRotate 120s linear infinite;
  }

  @keyframes spiralRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
  }
}

/* Auroras - solo PC */
@media (min-width: 1024px) and (hover: hover) {
  .aurora {
    position: absolute;
    width: 100%;
    height: 250px;
    opacity: 0.12;
    animation: auroraWave 25s ease-in-out infinite;
    filter: blur(40px);
  }

  .aurora-1 {
    top: 10%;
    background: linear-gradient(90deg, 
      transparent 0%, 
      rgba(114, 214, 255, 0.3) 25%, 
      rgba(255, 127, 255, 0.3) 50%, 
      rgba(114, 214, 255, 0.3) 75%, 
      transparent 100%);
  }

  .aurora-2 {
    top: 30%;
    background: linear-gradient(90deg, 
      transparent 0%, 
      rgba(255, 127, 255, 0.2) 30%, 
      rgba(114, 214, 255, 0.2) 60%, 
      transparent 100%);
    filter: blur(50px);
    animation-delay: -12s;
  }

  @keyframes auroraWave {
    0%, 100% { 
      transform: translateX(-10%) skewX(-5deg); 
      opacity: 0.08;
    }
    50% { 
      transform: translateX(10%) skewX(5deg); 
      opacity: 0.15;
    }
  }
}

/* Estrellas */
.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
}

@media (min-width: 1024px) and (hover: hover) {
  .star {
    animation: twinkle 4s ease-in-out infinite;
  }

  @keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
  }
}

.star.layer-1 { z-index: 1; }
.star.layer-2 { z-index: 2; }
.star.layer-3 { z-index: 3; }

/* Shooting stars - solo PC */
@media (min-width: 1024px) and (hover: hover) {
  .shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: linear-gradient(90deg, #fff, transparent);
    border-radius: 50%;
    animation: shoot 4s ease-out infinite;
    opacity: 0;
  }

  @keyframes shoot {
    0% {
      transform: translateX(0) translateY(0);
      opacity: 1;
    }
    100% {
      transform: translateX(-300px) translateY(300px);
      opacity: 0;
    }
  }
}

/* Cometas - solo PC */
@media (min-width: 1024px) and (hover: hover) {
  .comet {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #fff, rgba(114, 214, 255, 0.8));
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(114, 214, 255, 0.8);
    animation: cometFly 10s ease-in infinite;
    opacity: 0;
  }

  .comet::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 3px;
    background: linear-gradient(90deg, 
      rgba(114, 214, 255, 0.8), 
      rgba(255, 127, 255, 0.4), 
      transparent);
    transform: translate(-10%, -50%);
    border-radius: 50%;
    filter: blur(2px);
  }

  @keyframes cometFly {
    0% {
      transform: translate(0, 0) rotate(-45deg);
      opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
      transform: translate(-700px, 700px) rotate(-45deg);
      opacity: 0;
    }
  }
}

/* Planetas - tablet+ */
@media (min-width: 768px) {
  .planet {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
  }

  .planet-1 {
    width: 70px;
    height: 70px;
    top: 15%;
    right: 10%;
    background: radial-gradient(circle at 30% 30%, 
      rgba(255, 127, 255, 0.3), 
      rgba(114, 214, 255, 0.15));
    box-shadow: 
      inset -10px -10px 25px rgba(0, 0, 0, 0.3),
      0 0 35px rgba(255, 127, 255, 0.2);
  }

  .planet-2 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 8%;
    background: radial-gradient(circle at 35% 35%, 
      rgba(114, 214, 255, 0.3), 
      rgba(255, 127, 255, 0.15));
    box-shadow: 
      inset -15px -15px 35px rgba(0, 0, 0, 0.3),
      0 0 45px rgba(114, 214, 255, 0.2);
  }

  .planet-3 {
    width: 60px;
    height: 60px;
    top: 60%;
    right: 15%;
    background: radial-gradient(circle at 40% 40%, 
      rgba(255, 200, 100, 0.3), 
      rgba(255, 127, 255, 0.2));
    box-shadow: 
      inset -8px -8px 20px rgba(0, 0, 0, 0.3),
      0 0 30px rgba(255, 200, 100, 0.2);
  }
}

@media (min-width: 1024px) and (hover: hover) {
  .planet {
    animation: planetFloat 35s ease-in-out infinite;
  }

  .planet-2 { animation-delay: -17s; }
  .planet-3 { animation-delay: -22s; }

  @keyframes planetFloat {
    0%, 100% { 
      transform: translateY(0) rotate(0deg); 
    }
    50% { 
      transform: translateY(-25px) rotate(180deg); 
    }
  }
}

/* Polvo estelar - solo PC */
@media (min-width: 1024px) and (hover: hover) {
  .stardust {
    position: absolute;
    width: 1px;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: dustFloat 20s linear infinite;
  }

  @keyframes dustFloat {
    0% {
      transform: translateY(0) translateX(0);
      opacity: 0;
    }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% {
      transform: translateY(-100vh) translateX(50px);
      opacity: 0;
    }
  }
}

/* ==================== Footer ==================== */
.site-footer {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(245, 248, 255, 0.9) 50%,
    rgba(235, 242, 255, 0.95) 100%);
  padding: 0rem;
  text-align: center;
  border-radius: var(--retro-radius) var(--retro-radius) 0 0;
  border-top: 1px solid rgba(200, 220, 255, 0.8);
  box-shadow: 
    0 -4px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--retro-text);
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 2;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%);
  border-radius: var(--retro-radius) var(--retro-radius) 0 0;
  pointer-events: none;
}

.site-footer a {
  color: var(--retro-blue);
  text-decoration: none;
  font-weight: bold;
  transition: all 0.2s ease;
}

.site-footer a:hover {
  color: var(--retro-blue-dark);
  text-shadow: 0 0 8px rgba(33, 150, 243, 0.5);
}

/* ==================== Scrollbar Windows 7 ==================== */
@media (min-width: 1024px) and (hover: hover) {
  ::-webkit-scrollbar {
    width: 16px;
  }

  ::-webkit-scrollbar-track {
    background: linear-gradient(90deg, 
      rgba(230, 235, 245, 0.9) 0%, 
      rgba(240, 245, 255, 0.9) 100%);
    border: 1px solid rgba(200, 210, 230, 0.8);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
  }

  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
      rgba(180, 200, 230, 0.95) 0%,
      rgba(150, 180, 220, 0.9) 50%,
      rgba(180, 200, 230, 0.95) 100%);
    border-radius: 8px;
    box-shadow: 
      0 2px 6px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
      rgba(100, 181, 246, 0.95) 0%,
      rgba(64, 169, 255, 0.9) 50%,
      rgba(100, 181, 246, 0.95) 100%);
  }
}

@media (hover: none) and (pointer: coarse) {
  ::-webkit-scrollbar {
    width: 8px;
  }

  ::-webkit-scrollbar-track {
    background: rgba(230, 235, 245, 0.8);
  }

  ::-webkit-scrollbar-thumb {
    background: rgba(150, 180, 220, 0.8);
    border-radius: 4px;
  }
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  :root {
    --header-height: 120px;
  }
  
  .spiral-galaxy {
    width: min(500px, 80vw);
    height: min(500px, 80vw);
  }
}

/* Ocultar elementos pesados en móviles */
@media (hover: none) and (pointer: coarse) and (max-width: 768px) {
  .spiral-galaxy,
  .aurora,
  .comet,
  .shooting-star,
  .planet,
  .stardust {
    display: none;
  }
}

/* ==================== Optimizaciones ==================== */
body {
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
}

@supports (-webkit-touch-callout: none) {
  body {
    min-height: -webkit-fill-available;
  }
}

@media (hover: none) and (pointer: coarse) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ==================== FIN DEL ARCHIVO ==================== */