@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;700;900&family=Share+Tech+Mono&display=swap');

:root {
  --fg: #e0f7ff;
  --cyan: #00f2ff;
  --cyan-dim: rgba(0, 242, 255, 0.15);
  --cyan-glow: rgba(0, 242, 255, 0.4);
  --dark-glass: rgba(2, 8, 16, 0.65);
  --dark-solid: rgba(2, 8, 16, 0.85);
  --border-glass: rgba(100, 200, 255, 0.15);
  --font-head: 'Rajdhani', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  --blur: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0; padding: 0;
  background: #000;
  color: var(--fg);
  font-family: var(--font-head);
  overflow: hidden;
  cursor: none; /* Ocultamos el cursor del sistema */
}

canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.page { position: relative; z-index: 5; min-height: 560vh; }
.content { position: relative; padding-top: 120vh; padding-bottom: 220vh; }

/* --- CURSOR PERSONALIZADO --- */
.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 40px; height: 40px;
  border: 1px solid rgba(0, 242, 255, 0.4);
  background: radial-gradient(circle, rgba(0,242,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 100;
  mix-blend-mode: screen;
  transition: width 0.15s, height 0.15s;
}

/* --- HUD LAYOUT --- */
.hud {
  position: fixed; inset: 0; z-index: 10;
  pointer-events: none; padding: 40px 60px;
}

.hud-layer {
  position: absolute; inset: 0; display: grid;
  opacity: 0; transform: translateY(15px) scale(0.98);
  transition: opacity 0.5s ease;
}
.hud-layer.is-active {
  opacity: 1; transform: translateY(0) scale(1);
  animation: tech-enter 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* --- ESTILO DE PANELES (SCI-FI) --- */
.heroStack, .stageStack, .scanHud {
  position: relative;
  background: 
    linear-gradient(rgba(0, 242, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 255, 0.03) 1px, transparent 1px),
    linear-gradient(135deg, var(--dark-glass) 0%, var(--dark-solid) 100%);
  background-size: 20px 20px, 20px 20px, cover;
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border-glass);
  border-left: 3px solid var(--cyan);
  border-radius: 4px 20px 4px 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), inset 0 0 30px var(--cyan-dim);
  padding: 30px; overflow: hidden;
}

/* Esquina Tech */
.heroStack::after, .stageStack::after, .scanHud::after {
  content: ''; position: absolute; top: -1px; right: -1px;
  width: 25px; height: 25px;
  border-top: 2px solid var(--cyan); border-right: 2px solid var(--cyan);
  border-radius: 0 18px 0 0; box-shadow: 2px -2px 10px var(--cyan-glow); opacity: 0.8;
}

/* Escaneo de luz */
.heroStack::before, .stageStack::before, .scanHud::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(0,242,255,0.1) 50%, transparent);
  transform: translateY(-100%); animation: hologram-scan 4s linear infinite;
  pointer-events: none; z-index: 1;
}

/* --- ESPECÍFICOS --- */
/* --- ESPECÍFICOS --- */
.heroStack {
  align-self: end; justify-self: start;
  max-width: 900px;
  margin-bottom: 5vh;
  
  /* NUEVA LÍNEA: Separa el cuadro del borde izquierdo */
  margin-left: 5vw; 
}
.heroTitle {
  font-weight: 900; font-size: clamp(48px, 7vw, 100px); text-transform: uppercase;
  margin: 0; line-height: 0.9; text-shadow: 0 0 20px var(--cyan-glow);
}
.heroSub { font-family: var(--font-mono); font-size: 16px; color: #aaccff; margin-top: 20px; border-left: 2px solid rgba(255,255,255,0.1); padding-left: 15px; }
.hint { margin-top: 25px; display: flex; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.1em; }
.dot { width: 6px; height: 6px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 10px var(--cyan); animation: blink 2s infinite; }

/* Plankton */
.stageStack { align-self: center; justify-self: start; width: min(650px, 80vw); margin-left: 6vw; }
.stageTitle { font-weight: 800; font-size: 42px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--cyan); margin: 0 0 15px 0; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; display: inline-block; width: 100%; animation: text-flicker 4s infinite alternate; }
.stageSub { font-family: var(--font-mono); font-size: 16px; color: #cceeff; line-height: 1.6; }

/* Scan HUD */
.scanHud { align-self: center; justify-self: end; width: min(800px, 90vw); padding: 0; display: flex; flex-direction: column; margin-right: 4vw; }
.scanHeader { padding: 15px 25px; background: rgba(0, 242, 255, 0.05); border-bottom: 1px solid var(--border-glass); display: flex; justify-content: space-between; align-items: center; }
.scanTitle { font-weight: 700; letter-spacing: 0.2em; color: var(--cyan); font-size: 14px; text-transform: uppercase; }
.scanStatus { font-family: var(--font-mono); font-size: 11px; color: #fff; padding: 4px 8px; background: rgba(0,0,0,0.4); border: 1px solid var(--cyan-glow); border-radius: 3px; animation: blink 1s infinite alternate; }
.scanGrid { padding: 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.scanCard { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); padding: 15px; border-radius: 4px; transition: 0.3s; }
.scanCard:hover { border-color: var(--cyan-glow); background: rgba(0, 242, 255, 0.05); }
.scanLabel { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--cyan); margin-bottom: 6px; letter-spacing: 0.1em; }
.scanValue { font-size: 18px; color: #fff; font-weight: 500; }
.scanFooter { padding: 12px 25px; font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.5); border-top: 1px solid var(--border-glass); text-align: right; background: rgba(0,0,0,0.2); }

/* End */
.endStack { align-self: center; justify-self: center; text-align: center; }
.endQuote { font-family: var(--font-mono); font-size: 14px; color: var(--cyan); margin-bottom: 20px; letter-spacing: 0.1em; opacity: 0.8; }
.endName { font-weight: 900; font-size: clamp(30px, 5vw, 60px); letter-spacing: 0.2em; color: #fff; text-shadow: 0 0 30px var(--cyan); animation: text-flicker 5s infinite; }
.endRole { font-family: var(--font-mono); font-size: 12px; color: #88aadd; margin-top: 10px; letter-spacing: 0.2em; }
.replayHint { margin-top: 40px; font-family: var(--font-mono); font-size: 11px; color: var(--cyan); cursor: pointer; border: 1px solid var(--cyan-dim); padding: 10px 20px; border-radius: 4px; transition: 0.3s; pointer-events: auto; }
.replayHint:hover { background: var(--cyan-dim); box-shadow: 0 0 15px var(--cyan-glow); }

/* Extras */
.depth-meter { position: fixed; bottom: 40px; right: 60px; font-family: var(--font-mono); color: var(--cyan); font-size: 14px; opacity: 0.6; border-left: 2px solid var(--cyan-dim); padding-left: 10px; z-index: 20; }
.depth-meter .unit { font-size: 10px; opacity: 0.7; }
.underwaterTint { position: fixed; inset: 0; z-index: 8; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, rgba(0,40,80,0.2), rgba(0,10,20,0.95)); transition: opacity 0.2s linear; mix-blend-mode: multiply; }

/* Animaciones */
@keyframes hologram-scan { 0% { transform: translateY(-120%); } 100% { transform: translateY(120%); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes text-flicker { 0%, 18%, 22%, 25%, 53%, 57%, 100% { text-shadow: 0 0 10px var(--cyan-glow), 0 0 20px var(--cyan-glow); opacity: 1; } 20%, 24%, 55% { text-shadow: none; opacity: 0.5; } }
@keyframes tech-enter { 0% { opacity: 0; transform: translateX(-40px) scaleY(0.9); filter: blur(12px); border-left-color: transparent; } 40% { opacity: 0.6; transform: translateX(-10px); filter: blur(4px); } 70% { transform: translateX(5px); border-left-color: var(--cyan); } 100% { opacity: 1; transform: translateX(0) scaleY(1); filter: blur(0); } }

@media (max-width: 840px) {
  .hud { padding: 20px; }
  .stageStack, .scanHud { margin: 0; width: 100%; justify-self: center; }
  .scanGrid { grid-template-columns: 1fr; }
  .cursor-glow { display: none; } /* Sin cursor en movil */
  body { cursor: auto; }
}