/* ═══════════════════════════════════════════════════════════
   RESET & VARIABLES
═══════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --pink:   #ff006e;
  --cyan:   #00d9ff;
  --green:  #00ff88;
  --amber:  #ffb347;
  --dark:   #04040f;
  --muted:  #778899;
  --card-bg: rgba(255,255,255,0.04);
  --nav-h:  72px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Syne', sans-serif;
  background: var(--dark);
  color: #e8e8f0;
  overflow-x: hidden;
  padding-bottom: var(--nav-h);
}

/* ═══════════════════════════════════════════════════════════
   STARFIELD CANVAS
═══════════════════════════════════════════════════════════ */
#starCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════════════════════
   CUSTOM CURSOR (desktop only)
═══════════════════════════════════════════════════════════ */
.cursor-dot, .cursor-ring {
  display: none;
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}
.cursor-dot  { width: 6px; height: 6px; background: var(--cyan); }
.cursor-ring {
  width: 32px; height: 32px;
  border: 1.5px solid rgba(0,217,255,0.55);
  transition: width .22s ease, height .22s ease, border-color .22s ease;
}
body.cursor-hover .cursor-ring {
  width: 46px; height: 46px;
  border-color: var(--pink);
}

/* ═══════════════════════════════════════════════════════════
   PLANET NAV — MOBILE FIRST: barra horizontal inferior
   Con scroll lateral para ver todos los planetas
═══════════════════════════════════════════════════════════ */
.planet-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 800;
  background: rgba(4, 4, 15, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.planet-system {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  width: 100%;
  /* Scroll horizontal: muestra 4, desliza para el resto */
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.planet-system::-webkit-scrollbar { display: none; }

/* Gradiente derecho: indica al usuario que hay más planetas */
.planet-nav::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 38px;
  background: linear-gradient(to left, rgba(4,4,15,0.96) 0%, transparent 100%);
  pointer-events: none;
  z-index: 10;
}

/* Cada item ocupa 25% → se ven 4 a la vez, el gradiente insinúa el 5º */
.planet-item {
  flex: 0 0 25%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 8px 0;
  min-height: 56px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.planet-canvas {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: transform .35s cubic-bezier(0.22,1,0.36,1), filter .35s ease;
  filter: brightness(0.6) saturate(0.7);
}

.planet-item.active .planet-canvas {
  filter: brightness(1.1) saturate(1.2) drop-shadow(0 0 7px rgba(255,255,255,0.4));
  transform: scale(1.22);
}

.planet-label {
  font-family: 'Space Mono', monospace;
  font-size: .6rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: .04em;
  text-align: center;
  transition: color .25s;
  white-space: nowrap;
}

.planet-item.active .planet-label {
  color: rgba(255,255,255,0.9);
}

.planet-item::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 16px; height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  transition: transform .3s ease;
}
.planet-item.active::after {
  transform: translateX(-50%) scaleX(1);
}

@keyframes orbitSpin {
  0%   { transform: scale(1.1)  rotate(0deg); }
  50%  { transform: scale(1.35) rotate(180deg); }
  100% { transform: scale(1.22) rotate(360deg); }
}
.planet-item.orbiting .planet-canvas {
  animation: orbitSpin .55s cubic-bezier(0.22,1,0.36,1) forwards;
  filter: brightness(1.3) saturate(1.3) drop-shadow(0 0 12px rgba(255,200,100,0.7));
}

/* ═══════════════════════════════════════════════════════════
   SCROLL REVEAL
═══════════════════════════════════════════════════════════ */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity  .65s cubic-bezier(0.22,1,0.36,1) var(--reveal-delay, 0s),
    transform .65s cubic-bezier(0.22,1,0.36,1) var(--reveal-delay, 0s);
}
.scroll-reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-text {
  opacity: 0;
  transform: translateY(22px);
  animation: fadeInUp .85s cubic-bezier(0.22,1,0.36,1) forwards;
}

/* ═══════════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: calc(2rem + var(--nav-h)) 1.5rem calc(2rem + var(--nav-h));
  text-align: center;
}

.hero-content { position: relative; z-index: 2; }

.hero-label {
  font-family: 'Space Mono', monospace;
  font-size: .8rem;
  color: var(--cyan);
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: .9rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 11vw, 6.5rem);
  font-weight: 800;
  line-height: 1.04;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, #fff 0%, var(--cyan) 50%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(.9rem, 3.5vw, 1.2rem);
  color: var(--muted);
  margin-bottom: 2.4rem;
  max-width: 380px;
  margin-left: auto; margin-right: auto;
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════
   CTA BUTTON + RIPPLE
═══════════════════════════════════════════════════════════ */
.cta-button {
  position: relative;
  overflow: hidden;
  padding: .85rem 2rem;
  border: 1.5px solid var(--cyan);
  color: var(--cyan);
  background: transparent;
  font-family: 'Syne', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 50px;
  letter-spacing: .06em;
  transition: background .3s, color .3s, box-shadow .3s, transform .2s;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.cta-button:hover {
  background: var(--cyan);
  color: var(--dark);
  box-shadow: 0 0 26px rgba(0,217,255,.4);
  transform: translateY(-2px);
}
.ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(0,217,255,.3);
  transform: scale(0);
  animation: rippleAnim .55s linear forwards;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

/* ═══════════════════════════════════════════════════════════
   PROJECTS
═══════════════════════════════════════════════════════════ */
.projects {
  position: relative; z-index: 1;
  padding: 5rem 1.25rem calc(2rem + var(--nav-h));
}

.section-title {
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  margin-bottom: 2.8rem;
  text-align: center;
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -.7rem; left: 50%;
  transform: translateX(-50%);
  width: 55px; height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  border-radius: 2px;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform .4s cubic-bezier(0.22,1,0.36,1), box-shadow .4s ease, border-color .35s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.project-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(0,217,255,0.05) 50%, transparent 70%);
  background-size: 200% 100%;
  background-position: -100% 0;
  transition: background-position .6s ease;
  z-index: 0;
}
.project-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 18px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,0,110,0.3) inset;
  border-color: rgba(255,0,110,0.4);
}
.project-card:hover::before { background-position: 200% 0; }
.project-card:active {
  transform: translateY(-4px) scale(1.005);
  transition-duration: .1s;
}

.project-image {
  height: 150px;
  background: linear-gradient(135deg, #0d0d2b, #1a1040);
  position: relative; overflow: hidden;
  transition: height .35s ease;
}
.project-image--shaka {
  background: url('shaka/img/hero.jpg') center/cover no-repeat;
}
.project-image--drinking {
  background: url('drinkingGames/drinkingGames.png') center/contain no-repeat;
}
.project-image--molinet {
  background: url('molinet/img/header.jpg') center/cover no-repeat;
}

.project-card:hover .project-image { height: 165px; }
.project-image::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(0,217,255,0.18), transparent);
  animation: pulse 4s ease-in-out infinite;
}
.project-card:hover .project-image::after {
  background: radial-gradient(circle, rgba(255,0,110,0.22), transparent);
}

.project-content { padding: 1.2rem; position: relative; z-index: 1; }
.project-title   { font-size: 1.1rem; font-weight: 700; margin-bottom: .35rem; transition: color .3s; }
.project-card:hover .project-title { color: var(--cyan); }
.project-desc    { font-size: .85rem; color: var(--muted); margin-bottom: .9rem; line-height: 1.6; }
.project-tags    { display: flex; gap: .35rem; flex-wrap: wrap; }
.tag {
  padding: .22rem .65rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  font-size: .7rem;
  color: rgba(255,255,255,0.6);
  font-family: 'Space Mono', monospace;
  transition: background .3s, border-color .3s, color .3s;
}
.project-card:hover .tag {
  background: rgba(255,0,110,0.08);
  border-color: rgba(255,0,110,0.35);
  color: var(--pink);
}

/* ═══════════════════════════════════════════════════════════
   ABOUT
═══════════════════════════════════════════════════════════ */
.about {
  position: relative; z-index: 1;
  width: 100%;
  padding: 5rem 1.25rem calc(3rem + var(--nav-h));
}
.about-inner { max-width: 780px; margin: 0 auto; text-align: center; }
.about h2 {
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  margin-bottom: 2rem;
  position: relative; display: inline-block;
}
.about h2::after {
  content: '';
  position: absolute;
  bottom: -.55rem; left: 50%;
  transform: translateX(-50%);
  width: 45px; height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  border-radius: 2px;
}
.about p {
  font-size: clamp(.9rem, 2.5vw, 1.05rem);
  color: var(--muted);
  line-height: 1.95;
  margin-bottom: 1.4rem;
}

/* ═══════════════════════════════════════════════════════════
   ESPACIO (Tierra + Luna)
═══════════════════════════════════════════════════════════ */
.espacio {
  position: relative; z-index: 1;
  padding: 5rem 1.25rem calc(2rem + var(--nav-h));
}
.espacio-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.espacio-inner h2 {
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  margin-bottom: .8rem;
  position: relative;
  display: inline-block;
}
.espacio-inner h2::after {
  content: '';
  position: absolute;
  bottom: -.55rem; left: 50%;
  transform: translateX(-50%);
  width: 45px; height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  border-radius: 2px;
}
.espacio-intro {
  font-size: clamp(.9rem, 2.5vw, 1.1rem);
  color: var(--muted);
  max-width: 600px;
  margin: 1.6rem auto 3rem;
  line-height: 1.85;
}
.space-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  text-align: left;
}
.space-card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.6rem;
  transition: border-color .3s, transform .3s;
}
.space-card:hover {
  border-color: rgba(0,217,255,0.3);
  transform: translateY(-4px);
}
.space-card:active {
  transform: translateY(-2px);
  transition-duration: .1s;
}
.space-card-icon {
  font-size: 2rem;
  margin-bottom: .8rem;
  display: block;
}
.space-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--cyan);
}
.space-card p {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.8;
}

/* ═══════════════════════════════════════════════════════════
   JUEGO (Marte)
═══════════════════════════════════════════════════════════ */
.juego {
  position: relative; z-index: 1;
  padding: 5rem 1.25rem calc(2rem + var(--nav-h));
}
.juego-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.juego-desc {
  color: var(--muted);
  font-size: clamp(.85rem, 2.5vw, 1rem);
  max-width: 600px;
  margin: 0 auto 1.8rem;
  line-height: 1.75;
}
.game-ui {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .75rem;
  margin-bottom: 1rem;
}
.game-stats {
  display: flex;
  gap: .65rem;
  justify-content: center;
}
.game-ui .cta-button { width: 100%; }
.stat-box {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: .5rem .75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 76px;
  flex: 1;
}
.stat-label {
  font-family: 'Space Mono', monospace;
  font-size: .58rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .15rem;
}
.stat-box strong { font-size: 1.5rem; font-weight: 700; color: var(--green); }
.stat-escaped strong { color: var(--pink); }
.stat-level strong   { color: var(--cyan); }

#juegoCanvas {
  width: 100%;
  height: clamp(280px, 45vh, 420px);
  background: linear-gradient(180deg, #060002 0%, #120005 60%, #1e000a 100%);
  border-radius: 12px;
  border: 1px solid rgba(255,0,110,0.2);
  cursor: crosshair;
  display: block;
  margin: 1rem 0;
}
.game-hint {
  font-family: 'Space Mono', monospace;
  font-size: .62rem;
  color: rgba(255,255,255,0.25);
  text-align: center;
  margin-top: .4rem;
}

/* Glitch en secciones cuando escapan marcianos */
@keyframes sectionGlitch {
  0%,100% { filter: none; transform: none; }
  20% { filter: hue-rotate(80deg) brightness(1.3); transform: translateX(-2px) skewX(.5deg); }
  40% { filter: invert(.08) hue-rotate(180deg); transform: translateX(3px); }
  60% { filter: hue-rotate(270deg) saturate(2); transform: translateX(-1px) skewX(-.5deg); }
  80% { filter: brightness(1.5); transform: translateX(2px); }
}
.section-glitch {
  animation: sectionGlitch .45s infinite;
  outline: 1.5px solid var(--pink);
  outline-offset: -2px;
}

/* ═══════════════════════════════════════════════════════════
   BLOG (Júpiter)
═══════════════════════════════════════════════════════════ */
.blog {
  position: relative; z-index: 1;
  padding: 5rem 1.25rem calc(2rem + var(--nav-h));
}
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  max-width: 1200px;
  margin: 0 auto;
}
.blog-card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.6rem;
  position: relative;
  overflow: hidden;
  transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.blog-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  transform: scaleX(0);
  transition: transform .35s ease;
  transform-origin: left;
}
.blog-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0,217,255,0.25);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.blog-card:hover::before { transform: scaleX(1); }
.blog-card:active {
  transform: translateY(-3px);
  transition-duration: .1s;
}
.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .8rem;
}
.blog-date {
  font-family: 'Space Mono', monospace;
  font-size: .7rem;
  color: var(--cyan);
}
.blog-reading {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  padding: .15rem .5rem;
  border-radius: 4px;
}
.blog-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .6rem;
  line-height: 1.4;
  transition: color .3s;
}
.blog-card:hover h3 { color: var(--cyan); }
.blog-card p {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.blog-read {
  font-family: 'Space Mono', monospace;
  font-size: .75rem;
  color: var(--pink);
  text-decoration: none;
  transition: color .3s;
  display: inline-block;
  margin-top: .4rem;
}
.blog-read:hover { color: var(--cyan); }

/* ═══════════════════════════════════════════════════════════
   MÚSICA (Neptuno)
═══════════════════════════════════════════════════════════ */
.musica {
  position: relative; z-index: 1;
  padding: 5rem 1.25rem calc(2rem + var(--nav-h));
}
.musica-inner { max-width: 860px; margin: 0 auto; }
.musica-inner h2 {
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  text-align: center;
  margin-bottom: .5rem;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}
.musica-inner h2::after {
  content: '';
  position: absolute;
  bottom: -.55rem; left: 50%;
  transform: translateX(-50%);
  width: 45px; height: 3px;
  background: linear-gradient(90deg, var(--cyan), #c77dff);
  border-radius: 2px;
}
.musica-sub {
  text-align: center;
  color: var(--muted);
  font-size: clamp(.85rem, 2.5vw, 1rem);
  margin: 1.5rem 0 2.5rem;
}
.music-genres {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}
.genre-pill {
  padding: .4rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--gc, var(--cyan));
  color: var(--gc, var(--cyan));
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  background: rgba(255,255,255,0.03);
  transition: background .3s, transform .2s;
  cursor: default;
}
.genre-pill:hover { background: rgba(255,255,255,0.07); transform: scale(1.06); }
.music-artists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
  margin-bottom: 2.5rem;
}
.artist-card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: .9rem 1rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  transition: border-color .3s;
}
.artist-card:hover { border-color: rgba(255,255,255,0.18); }
.artist-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.artist-card strong { display: block; font-size: .9rem; margin-bottom: .15rem; }
.artist-card span { font-size: .75rem; color: var(--muted); font-family: 'Space Mono', monospace; }

/* Now Playing */
.now-playing {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.np-disc {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: conic-gradient(
    #1a0a00 0deg, #3a2000 60deg, #0a0010 120deg,
    #001020 180deg, #0a0a0a 240deg, #1a0a00 300deg, #3a2000 360deg
  );
  border: 3px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  animation: spinDisc 4s linear infinite;
  position: relative;
}
.np-disc::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #04040f;
  border: 1.5px solid rgba(255,255,255,0.15);
}
@keyframes spinDisc { to { transform: rotate(360deg); } }
.np-label {
  font-family: 'Space Mono', monospace;
  font-size: .62rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .08em;
  display: block;
  margin-bottom: .3rem;
}
.np-track { font-size: .95rem; font-weight: 600; margin-bottom: .6rem; }
.np-bars { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.np-bars span {
  display: block; width: 3px;
  background: var(--green);
  border-radius: 2px;
  animation: eqBar .6s ease-in-out infinite alternate;
}
.np-bars span:nth-child(1) { animation-duration:.50s; animation-delay:0s;    }
.np-bars span:nth-child(2) { animation-duration:.70s; animation-delay:.10s;  }
.np-bars span:nth-child(3) { animation-duration:.40s; animation-delay:.05s;  }
.np-bars span:nth-child(4) { animation-duration:.60s; animation-delay:.15s;  }
.np-bars span:nth-child(5) { animation-duration:.55s; animation-delay:.08s;  }
.np-bars span:nth-child(6) { animation-duration:.75s; animation-delay:.12s;  }
@keyframes eqBar { from { height: 3px; } to { height: 20px; } }

/* ═══════════════════════════════════════════════════════════
   PELÍCULAS (Saturno)
═══════════════════════════════════════════════════════════ */
.peliculas {
  position: relative; z-index: 1;
  padding: 5rem 1.25rem calc(2rem + var(--nav-h));
}
.movies-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
.movie-card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.movie-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 14px 35px rgba(0,0,0,0.5);
  border-color: rgba(255,179,71,0.3);
}
.movie-card:active {
  transform: translateY(-3px) scale(1.01);
  transition-duration: .1s;
}
.movie-poster {
  height: 110px;
  background: linear-gradient(135deg, var(--mp1, #0a0a1a), var(--mp2, #1a1a3a));
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: .6rem;
}
.movie-rating {
  font-size: .7rem;
  color: var(--amber);
  font-family: 'Space Mono', monospace;
  letter-spacing: .02em;
}
.movie-info { padding: .8rem; }
.movie-info h3 { font-size: .9rem; font-weight: 700; margin-bottom: .3rem; line-height: 1.3; }
.movie-meta {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  color: var(--muted);
  margin-bottom: .35rem;
}
.movie-genre-tag {
  font-size: .65rem;
  font-family: 'Space Mono', monospace;
  background: rgba(255,179,71,0.08);
  border: 1px solid rgba(255,179,71,0.25);
  color: var(--amber);
  padding: .15rem .5rem;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER / CONTACTO (Urano)
═══════════════════════════════════════════════════════════ */
.footer {
  position: relative; z-index: 1;
  padding: 5rem 1.25rem calc(3rem + var(--nav-h));
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-inner { max-width: 700px; margin: 0 auto; text-align: center; }
.footer-inner h2 {
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  margin-bottom: .5rem;
  position: relative;
  display: inline-block;
}
.footer-inner h2::after {
  content: '';
  position: absolute;
  bottom: -.55rem; left: 50%;
  transform: translateX(-50%);
  width: 45px; height: 3px;
  background: linear-gradient(90deg, var(--cyan), #4adada);
  border-radius: 2px;
}
.footer-sub {
  color: var(--muted);
  font-size: clamp(.85rem, 2.5vw, 1rem);
  margin: 1.4rem 0 2.5rem;
}
.contact-form { text-align: left; margin-bottom: 2.5rem; }
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: .8rem;
  margin-bottom: .8rem;
}
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label {
  font-family: 'Space Mono', monospace;
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.form-group input,
.form-group textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: .75rem 1rem;
  color: #e8e8f0;
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  transition: border-color .25s, box-shadow .25s;
  resize: vertical;
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,217,255,0.1);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(119,136,153,0.6); }
.contact-form .cta-button { margin-top: .8rem; }

.social-links {
  display: flex; justify-content: center;
  flex-wrap: wrap; gap: 1.5rem;
  margin: 2rem 0 1rem;
}
.social-links a {
  color: var(--muted);
  text-decoration: none;
  font-family: 'Space Mono', monospace;
  font-size: .82rem;
  position: relative;
  transition: color .3s;
}
.social-links a::after {
  content: '';
  position: absolute; bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--pink);
  transition: width .3s ease;
}
.social-links a:hover { color: var(--pink); }
.social-links a:hover::after { width: 100%; }
.footer-copy {
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  color: #334;
}

/* ═══════════════════════════════════════════════════════════
   KEYFRAMES GLOBALES
═══════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%,100% { opacity: .35; transform: scale(1); }
  50%     { opacity: .7;  transform: scale(1.06); }
}

/* ═══════════════════════════════════════════════════════════
   MÓVIL MUY PEQUEÑO <400px
═══════════════════════════════════════════════════════════ */
@media (max-width: 399px) {
  /* Películas en 1 columna en pantallas muy pequeñas */
  .movies-grid { grid-template-columns: 1fr; }
  .movie-poster { height: 90px; }

  /* Música: artistas en 1 columna */
  .music-artists { grid-template-columns: 1fr; }

  /* Reducir padding horizontal en secciones */
  .projects, .about, .espacio, .juego, .blog, .musica, .peliculas, .footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Hero más compacto */
  .hero { padding-left: 1rem; padding-right: 1rem; }

  /* Stat boxes en columna en pantallas muy pequeñas */
  .game-stats { gap: .45rem; }
  .stat-box   { padding: .45rem .5rem; min-width: 64px; }
  .stat-box strong { font-size: 1.2rem; }
}

/* ═══════════════════════════════════════════════════════════
   TABLET 600px+
═══════════════════════════════════════════════════════════ */
@media (min-width: 600px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .project-image { height: 170px; }
  .planet-canvas { width: 44px; height: 44px; }
  .planet-label  { font-size: .65rem; }
  .space-cards   { grid-template-columns: repeat(2, 1fr); }
  .blog-grid     { grid-template-columns: repeat(2, 1fr); }
  .movies-grid   { grid-template-columns: repeat(3, 1fr); }
  .form-row      { grid-template-columns: 1fr 1fr; }
  .music-artists { grid-template-columns: repeat(2, 1fr); }

  /* Juego: recuperar layout horizontal en tablet+ */
  .game-ui {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .game-ui .cta-button { width: auto; }
  .game-stats { justify-content: flex-start; }
  .stat-box { flex: none; }
}

/* ═══════════════════════════════════════════════════════════
   DESKTOP 1024px+ → nav lateral derecho
═══════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }

  .cursor-dot, .cursor-ring { display: block; }
  body { cursor: none; }

  .planet-nav {
    position: fixed;
    top: 50%; left: auto;
    right: 1.4rem; bottom: auto;
    transform: translateY(-50%);
    height: auto; width: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
  }

  /* El gradiente de scroll ya no aplica en desktop */
  .planet-nav::after { display: none; }

  .planet-system {
    flex-direction: column;
    gap: 1.1rem;
    width: auto;
    overflow: visible;
    scroll-snap-type: none;
    align-items: flex-end;
  }

  .planet-item {
    flex: none;
    flex-direction: row;
    width: auto;
    padding: 0;
    justify-content: flex-end;
    gap: 0;
    scroll-snap-align: none;
  }

  .planet-label {
    position: absolute;
    right: calc(100% + 12px);
    font-size: .72rem;
    background: rgba(4,4,15,0.85);
    border: 1px solid rgba(255,255,255,0.1);
    padding: .28rem .65rem;
    border-radius: 4px;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity .25s ease, transform .25s ease;
    white-space: nowrap;
    color: rgba(255,255,255,0.85);
  }
  .planet-item:hover .planet-label { opacity: 1; transform: translateX(0); }
  .planet-item.active .planet-label { color: rgba(255,255,255,0.85); }

  .planet-item::after {
    bottom: auto; left: auto;
    right: -10px; top: 50%;
    width: 3px; height: 18px;
    transform: translateY(-50%) scaleY(0);
  }
  .planet-item.active::after { transform: translateY(-50%) scaleY(1); }

  /* Tamaños proporcionales (escala comprimida): Sol ≫ Júpiter > Saturno > Neptuno ≈ Urano > Tierra ≈ Venus > Marte > Mercurio */
  .planet-item:nth-child(1) .planet-canvas { width: 50px; height: 50px; } /* Sol      */
  .planet-item:nth-child(2) .planet-canvas { width: 14px; height: 14px; } /* Mercurio */
  .planet-item:nth-child(3) .planet-canvas { width: 20px; height: 20px; } /* Venus    */
  .planet-item:nth-child(4) .planet-canvas { width: 22px; height: 22px; } /* Tierra   */
  .planet-item:nth-child(5) .planet-canvas { width: 17px; height: 17px; } /* Marte    */
  .planet-item:nth-child(6) .planet-canvas { width: 44px; height: 44px; } /* Júpiter  */
  .planet-item:nth-child(7) .planet-canvas { width: 27px; height: 27px; } /* Neptuno  */
  .planet-item:nth-child(8) .planet-canvas { width: 38px; height: 38px; } /* Saturno  */
  .planet-item:nth-child(9) .planet-canvas { width: 26px; height: 26px; } /* Urano    */

  .projects-grid { grid-template-columns: repeat(3, 1fr); }
  .project-image { height: 190px; }

  .projects, .about, .espacio, .juego, .blog, .musica, .peliculas, .footer {
    padding-left: 2.5rem;
    padding-right: 5rem;
  }
  .hero { padding-right: 5rem; }
  .space-cards { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .movies-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   DESKTOP GRANDE 1400px+
═══════════════════════════════════════════════════════════ */
@media (min-width: 1400px) {
  .planet-nav  { right: 2rem; }
  .projects    { padding: 7rem 3rem 7rem 3rem; }
  .about       { padding: 7rem 3rem; }
  .espacio, .juego, .blog, .musica, .peliculas { padding: 7rem 3rem; }
  .footer      { padding: 7rem 3rem; }
}
