/* Active Theory Inspired Styling & UI System for Código Cero */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Cinzel:wght@500;700;800&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', monospace;
  --font-display: 'Cinzel', serif;
  --color-bg: #04070e;
  --color-card: rgba(10, 16, 28, 0.7);
  --color-emerald: #00ffaa;
  --color-cyan: #00d2ff;
  --color-violet: #9d4edd;
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--color-bg);
  color: #e2e8f0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  overflow-x: hidden;
  position: relative;
}

.font-mono {
  font-family: var(--font-mono);
}

.font-display {
  font-family: var(--font-display);
}

/* Hairline Grid & Cyber Lines */
.hairline-border {
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.hairline-b {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hairline-t {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Glass Panels with Active Theory Aesthetics */
.at-panel {
  background: rgba(8, 14, 25, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.at-panel:hover {
  border-color: rgba(0, 255, 170, 0.35);
  background: rgba(11, 20, 36, 0.9);
  box-shadow: 0 20px 40px -15px rgba(0, 255, 170, 0.1);
}

/* Custom Interactive Follower Cursor (Active Theory signature) */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border: 1.5px solid rgba(0, 255, 170, 0.75);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
  mix-blend-mode: difference;
}

#custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  background: #00ffaa;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
}

#custom-cursor.active {
  width: 54px;
  height: 54px;
  background-color: rgba(0, 255, 170, 0.15);
  border-color: #00ffaa;
}

/* Equalizer Bars for Audio State */
.eq-bar {
  display: inline-block;
  width: 2px;
  height: 12px;
  background-color: #00ffaa;
  margin: 0 1px;
  transform-origin: bottom;
  animation: eqAnimation 1s ease-in-out infinite alternate;
}
.eq-bar:nth-child(1) { animation-delay: 0.1s; height: 8px; }
.eq-bar:nth-child(2) { animation-delay: 0.3s; height: 14px; }
.eq-bar:nth-child(3) { animation-delay: 0.2s; height: 6px; }
.eq-bar:nth-child(4) { animation-delay: 0.4s; height: 12px; }

@keyframes eqAnimation {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1.2); }
}

.eq-paused .eq-bar {
  animation: none;
  transform: scaleY(0.2);
  opacity: 0.4;
}

/* Three.js Canvas Container */
#stage-canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* p5 Canvas Container */
#p5-canvas-container {
  width: 100%;
  height: 100%;
  min-height: 480px;
  background: #040813;
  overflow: hidden;
  border-radius: 0.75rem;
}

/* Glow & Accent Gradients */
.text-gradient-emerald {
  background: linear-gradient(135deg, #00ffaa 0%, #00d2ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-cyan {
  background: linear-gradient(135deg, #00d2ff 0%, #9d4edd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Microinteracciones de Iconos */
.arrow-icon {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Split Slider (Antes / Después) */
#before-after-slider {
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#slider-after-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
  transition: clip-path 0.05s ease-out;
}

#slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 100%;
  background: #00ffaa;
  cursor: ew-resize;
  transform: translateX(-50%);
  z-index: 30;
  box-shadow: 0 0 15px #00ffaa;
}

.slider-handle-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  background: #04070e;
  border: 2px solid #00ffaa;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #00ffaa;
  box-shadow: 0 0 15px rgba(0, 255, 170, 0.5);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #04070e;
}
::-webkit-scrollbar-thumb {
  background: #141f33;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #00ffaa;
}

/* Accesibilidad: Reducción de Movimiento */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #custom-cursor, #custom-cursor-dot {
    display: none !important;
  }
}
