/* ══════════════════════════════════════════
   ETAPA 1 — CINEMATIC HERO DIRECTION
   Visual: Apple × OpenAI × xAI × Tesla × Linear
   ══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,700;0,800;0,900;1,700;1,800&family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --bg-primary: #0A040F;
  --bg-secondary: #11131A;
  --bg-tertiary: #1A1E26;
  --white: #EDE8FF;
  --gray-100: #EDE8FF;
  --gray-200: #A78BFA;
  --gray-300: #7D5CFF;
  --gray-400: #5B30FF;
  --gray-500: #3f3f46;
  --gray-600: #2a2a32;
  --gray-700: #1c1c22;
  --gray-800: #0A040F;
  --accent-glow: rgba(91, 48, 255, 0.1);
  --accent-blue: rgba(26, 226, 224, 0.05);
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Satoshi', 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-cinematic: cubic-bezier(0.77, 0, 0.175, 1);
}

/* ── GLOBAL RESET ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: initial; /* Lenis handles this */
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

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

::selection {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

/* ── NOISE TEXTURE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* ── PRELOADER ── */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s var(--ease-expo), visibility 0.8s;
}

.preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__ring {
  width: 48px;
  height: 48px;
  border: 1.5px solid rgba(255,255,255,0.08);
  border-top-color: rgba(255,255,255,0.5);
  border-radius: 50%;
  animation: preloaderSpin 1.2s linear infinite;
}

.preloader__text {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gray-400);
}

@keyframes preloaderSpin {
  to { transform: rotate(360deg); }
}

/* ── TECH GRID BACKGROUND ── */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 100%);
}

/* ── VOLUMETRIC LIGHT ── */
.volumetric-light {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  will-change: transform, opacity;
}

.volumetric-light--top {
  width: 800px;
  height: 600px;
  top: -300px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(91, 48, 255, 0.08) 0%, transparent 70%);
}

.volumetric-light--left {
  width: 500px;
  height: 500px;
  top: 20%;
  left: -200px;
  background: radial-gradient(ellipse, rgba(26, 226, 224, 0.05) 0%, transparent 70%);
}

.volumetric-light--right {
  width: 400px;
  height: 600px;
  bottom: -100px;
  right: -150px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
}

/* ── HERO SECTION ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 120px 24px 80px;
}

.hero__container {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

/* ── HERO BADGE ── */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 8px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-300);
  margin-bottom: 32px;
  cursor: default;
  transition: border-color 0.5s, background 0.5s;
  opacity: 0;
  transform: translateY(20px);
}

.hero__badge:hover {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1AE2E0;
  box-shadow: 0 0 10px rgba(26, 226, 224, 0.6);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ── HEADLINE ── */
.hero__headline {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: clamp(2.8rem, 5.5vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 24px;
}

.hero__headline .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.hero__headline .word-inner {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  will-change: transform, opacity;
}

.hero__headline .accent {
  background: linear-gradient(135deg, #5B30FF 0%, #1AE2E0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── SUBHEADLINE ── */
.hero__sub {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 1.2vw, 1.2rem);
  font-weight: 400;
  line-height: 1.7;
  color: var(--gray-400);
  max-width: 480px;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(20px);
}

/* ── CTA BUTTON ── */
.hero__cta-group {
  display: flex;
  align-items: center;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
}

.hero__cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 14px;
  background: var(--white);
  color: var(--bg-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.4s var(--ease-expo), box-shadow 0.4s;
}

.hero__cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(26, 226, 224, 0.2) 100%);
  opacity: 0;
  transition: opacity 0.4s;
}

.hero__cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 40px rgba(91, 48, 255, 0.3), 0 0 80px rgba(26, 226, 224, 0.1);
}

.hero__cta:hover::before {
  opacity: 1;
}

.hero__cta:active {
  transform: translateY(0) scale(0.98);
}

.hero__cta-icon {
  display: flex;
  align-items: center;
  transition: transform 0.4s var(--ease-expo);
}

.hero__cta:hover .hero__cta-icon {
  transform: translateX(3px);
}

.hero__cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  border-radius: 14px;
  background: transparent;
  color: var(--gray-300);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.4s var(--ease-expo);
}

.hero__cta-secondary:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.03);
  color: var(--white);
}

/* ── FLOATING DASHBOARD PANEL ── */
.hero__visual {
  position: relative;
  perspective: 1200px;
  opacity: 0;
  transform: translateY(40px);
}

.dashboard {
  position: relative;
  border-radius: 20px;
  background: rgba(10, 10, 10, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  overflow: hidden;
  transform: rotateY(-4deg) rotateX(2deg);
  transition: transform 0.8s var(--ease-expo);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.02),
    0 20px 60px rgba(0, 0, 0, 0.7),
    0 0 120px rgba(255, 255, 255, 0.01);
}

.dashboard:hover {
  transform: rotateY(-1deg) rotateX(0.5deg);
}

.dashboard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
}

.dashboard__dots {
  display: flex;
  gap: 7px;
}

.dashboard__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dashboard__dot--red { background: #ff5f57; }
.dashboard__dot--yellow { background: #febc2e; }
.dashboard__dot--green { background: #28c840; }

.dashboard__title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-500);
  letter-spacing: 0.1em;
}

.dashboard__body {
  padding: 24px;
}

/* ── TERMINAL INSIDE DASHBOARD ── */
.terminal {
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.04);
  padding: 20px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--gray-400);
  overflow: hidden;
}

.terminal__line {
  opacity: 0;
  transform: translateX(-10px);
}

.terminal__prompt {
  color: var(--gray-500);
}

.terminal__command {
  color: var(--gray-200);
}

.terminal__success {
  color: #1AE2E0;
  text-shadow: 0 0 10px rgba(26, 226, 224, 0.4);
}

.terminal__accent {
  color: rgba(255, 255, 255, 0.6);
}

.terminal__cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--gray-300);
  margin-left: 2px;
  animation: cursorBlink 1s step-end infinite;
  vertical-align: middle;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── METRICS ROW ── */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.4s, background 0.4s;
  opacity: 0;
  transform: translateY(15px);
}

.metric:hover {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}

.metric__value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.metric__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-500);
}

/* ── FLOATING CARDS ── */
.floating-card {
  position: absolute;
  border-radius: 14px;
  background: rgba(5, 5, 5, 0.8);
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-300);
  z-index: 20;
  opacity: 0;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  pointer-events: none;
  transition: transform 0.6s var(--ease-expo);
}

.floating-card--top {
  top: -20px;
  right: -30px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-card--bottom {
  bottom: -15px;
  left: -25px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-card__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.floating-card__icon--green {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.floating-card__icon--blue {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

/* ── PARTICLES CANVAS ── */
#particles-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
}

/* ── SCROLL INDICATOR ── */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
  opacity: 0;
}

.scroll-indicator__mouse {
  width: 22px;
  height: 34px;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 11px;
  position: relative;
}

.scroll-indicator__dot {
  width: 3px;
  height: 6px;
  background: rgba(255,255,255,0.4);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollDot {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(14px); opacity: 0; }
}

.scroll-indicator__text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gray-500);
}

/* ── HOLOGRAPHIC GLOW LINE ── */
.hero__glow-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.03) 30%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 70%, transparent 100%);
}

/* ── RESPONSIVE ── */
@media (max-width: 968px) {
  .hero {
    padding: 100px 20px 60px;
  }

  .hero__container {
    grid-template-columns: 1fr;
    gap: 50px;
    text-align: center;
  }

  .hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero__sub {
    max-width: 100%;
  }

  .hero__cta-group {
    flex-direction: column;
    width: 100%;
  }

  .hero__cta,
  .hero__cta-secondary {
    width: 100%;
    justify-content: center;
  }

  .hero__visual {
    max-width: 500px;
    margin: 0 auto;
  }

  .dashboard {
    transform: none;
  }

  .dashboard:hover {
    transform: none;
  }

  .floating-card--top {
    top: -10px;
    right: -5px;
  }

  .floating-card--bottom {
    bottom: -10px;
    left: -5px;
  }

  .volumetric-light--top {
    width: 400px;
    height: 300px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 80px 16px 50px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .floating-card {
    display: none;
  }
}
