/* ============================================
   1. Variables y Reset
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --neon-blue: #00f3ff;
  --neon-orange: #ff9f00;
  --bg-dark: #0b0d12;
  --bg-graphite: #12151c;
  --bg-panel: rgba(255,255,255,0.03);
  --glass-border: rgba(0,243,255,0.12);
  --glass-border-light: rgba(255,255,255,0.08);
  --text-main: #e0e0e0;
  --text-dim: #8a8f98;
  --header-height: 70px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================
   2. Utilidades y Componentes Base
   ============================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-dark {
  background: var(--bg-dark);
}

.section-graphite {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-graphite) 50%, var(--bg-dark) 100%);
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 60px;
}

.section-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: #ffffff;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.text-accent {
  color: var(--neon-blue);
  text-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.section-desc {
  color: var(--text-dim);
  font-size: 1.1rem;
}

.fade-in-target {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in-target.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   3. Header y Navegación
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(11, 13, 18, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
  transition: background 0.3s;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.25rem;
  text-decoration: none;
  display: flex;
  gap: 4px;
}

.logo-main {
  color: #ffffff;
  font-weight: 700;
}

.logo-sub {
  color: var(--neon-blue);
  font-weight: 400;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 40px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 5px 0;
  transition: color 0.3s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--neon-blue);
  box-shadow: 0 0 8px var(--neon-blue);
  transition: width 0.3s;
}

.nav-link:hover {
  color: var(--neon-blue);
}

.nav-link:hover::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--neon-blue);
  box-shadow: 0 0 6px var(--neon-blue);
  transition: all 0.3s;
  border-radius: 2px;
}

/* ============================================
   4. Hero Section
   ============================================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at center, #151924 0%, #0b0d12 80%);
  padding-top: var(--header-height);
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.6;
  pointer-events: none;
}

.hero-lines {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.prod-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-blue), var(--neon-orange), transparent);
  opacity: 0.4;
  border-radius: 2px;
}

.line-1 { top: 30%; width: 80%; left: -20%; animation: moveLine 8s linear infinite; }
.line-2 { top: 50%; width: 60%; left: 60%; animation: moveLine 10s linear infinite reverse; }
.line-3 { top: 70%; width: 70%; left: -10%; animation: moveLine 12s linear infinite; }

.robot-node {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--neon-blue);
  background: rgba(0, 243, 255, 0.15);
  box-shadow: 0 0 10px var(--neon-blue);
  border-radius: 3px;
  animation: floatNode 6s ease-in-out infinite;
  opacity: 0.6;
}

.node-1 { top: 28%; left: 20%; animation-delay: 0s; }
.node-2 { top: 48%; left: 75%; animation-delay: 2s; border-color: var(--neon-orange); box-shadow: 0 0 10px var(--neon-orange); }
.node-3 { top: 68%; left: 40%; animation-delay: 4s; }

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
}

.hero-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(0, 243, 255, 0.25);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-dim);
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.cta-button {
  display: inline-block;
  padding: 18px 44px;
  border: 2px solid var(--neon-blue);
  color: var(--neon-blue);
  text-decoration: none;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  background: transparent;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.2), transparent);
  transition: left 0.5s;
}

.cta-button:hover {
  background: var(--neon-blue);
  color: #000000;
  box-shadow: 0 0 40px rgba(0, 243, 255, 0.35), inset 0 0 20px rgba(0, 243, 255, 0.2);
}

.cta-button:hover::before {
  left: 100%;
}

/* ============================================
   5. Sistemas (Sobre el Instituto)
   ============================================ */
.sistemas {
  padding: 120px 0 100px;
}

.grid-sistemas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}

.glass-card {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-light);
  border-radius: 20px;
  padding: 40px 30px;
  transition: transform 0.4s, box-shadow 0.4s, border-color 0.4s;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-orange));
  opacity: 0;
  transition: opacity 0.4s;
}

.glass-card:hover {
  transform: translateY(-10px);
  border-color: var(--glass-border);
  box-shadow: 0 10px 40px rgba(0, 243, 255, 0.08);
}

.glass-card:hover::before {
  opacity: 1;
}

.card-icon {
  color: var(--neon-orange);
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(255, 159, 0, 0.3);
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(255, 159, 0, 0.1);
}

.card-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.15rem;
  color: #ffffff;
  margin-bottom: 12px;
}

.card-text {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ============================================
   6. Programas
   ============================================ */
.programas {
  padding: 120px 0 100px;
}

.grid-programas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.program-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border-light);
  border-radius: 20px;
  padding: 35px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: transform 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.program-card:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border);
  box-shadow: 0 8px 30px rgba(0, 243, 255, 0.06);
}

.program-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  color: #ffffff;
  margin-bottom: 10px;
}

.program-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
}

.program-dashboard {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  height: 100px;
  padding: 15px;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.dash-bar {
  width: 8px;
  border-radius: 4px;
  background: linear-gradient(to top, var(--neon-orange), var(--neon-blue));
  height: 0;
  transition: height 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.program-link {
  color: var(--neon-blue);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s, text-shadow 0.3s;
}

.program-link:hover {
  color: var(--neon-orange);
  text-shadow: 0 0 10px rgba(255, 159, 0, 0.4);
}

/* ============================================
   7. Robotics Lab
   ============================================ */
.lab {
  padding: 120px 0 100px;
}

.grid-lab {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.lab-card {
  background: linear-gradient(135deg, rgba(0,243,255,0.03), rgba(255,159,0,0.03));
  border: 1px solid rgba(0, 243, 255, 0.15);
  border-radius: 16px;
  padding: 35px 30px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.lab-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, var(--neon-blue), transparent 30%);
  animation: rotate 4s linear infinite;
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 0;
}

.lab-card:hover::before {
  opacity: 0.2;
}

.lab-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: var(--bg-dark);
  border-radius: 15px;
  z-index: 1;
}

.lab-card:hover {
  transform: translateY(-8px);
  border-color: var(--neon-blue);
  box-shadow: 0 15px 40px rgba(0, 243, 255, 0.1);
}

.lab-badge {
  position: relative;
  z-index: 2;
  display: inline-block;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  color: var(--neon-orange);
  border: 1px solid rgba(255, 159, 0, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 18px;
  letter-spacing: 1px;
}

.lab-name {
  position: relative;
  z-index: 2;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  color: #ffffff;
  margin-bottom: 16px;
}

.lab-meta {
  position: relative;
  z-index: 2;
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 10px;
  line-height: 1.5;
}

.lab-meta strong {
  color: var(--text-main);
  font-weight: 500;
}

/* ============================================
   8. Contacto
   ============================================ */
.contacto {
  padding: 120px 0 120px;
  position: relative;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-light);
  border-radius: 24px;
  padding: 45px;
  position: relative;
  overflow: hidden;
}

.panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  color: #ffffff;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group {
  position: relative;
  margin-bottom: 24px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  color: #ffffff;
  font-size: 1rem;
  padding: 12px 0;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  font-family: 'Roboto', sans-serif;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group label {
  position: absolute;
  top: 12px;
  left: 0;
  color: var(--text-dim);
  font-size: 1rem;
  pointer-events: none;
  transition: all 0.3s;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: -10px;
  font-size: 0.8rem;
  color: var(--neon-blue);
}

.form-group input:focus,
.form-group textarea:focus {
  border-bottom-color: var(--neon-blue);
  box-shadow: 0 6px 12px -8px rgba(0, 243, 255, 0.3);
}

.submit-btn {
  display: inline-block;
  width: 100%;
  padding: 16px;
  border: 2px solid var(--neon-blue);
  background: transparent;
  color: var(--neon-blue);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.4s;
  margin-top: 10px;
}

.submit-btn:hover {
  background: var(--neon-blue);
  color: #000000;
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.3);
}

.form-feedback {
  margin-top: 16px;
  font-size: 0.95rem;
  min-height: 1.5em;
  color: var(--text-dim);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.info-value {
  color: #ffffff;
  font-size: 1.05rem;
  text-decoration: none;
  font-style: normal;
  transition: color 0.3s;
}

.link-neon:hover {
  color: var(--neon-blue);
  text-shadow: 0 0 8px rgba(0, 243, 255, 0.3);
}

.holo-decoration {
  position: absolute;
  bottom: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  pointer-events: none;
}

.holo-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  opacity: 0.35;
  animation: pulse 4s ease-in-out infinite;
}

.ring-blue {
  width: 180px;
  height: 180px;
  border-color: var(--neon-blue);
  top: 10px;
  left: 10px;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
}

.ring-orange {
  width: 140px;
  height: 140px;
  border-color: var(--neon-orange);
  top: 30px;
  left: 30px;
  animation-delay: 2s;
  box-shadow: 0 0 20px rgba(255, 159, 0, 0.1);
}

/* ============================================
   9. Footer
   ============================================ */
.footer {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 40px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ============================================
   10. Animaciones
   ============================================ */
@keyframes moveLine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

@keyframes floatNode {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.1); opacity: 0.6; }
}

/* ============================================
   11. Responsive
   ============================================ */
@media (max-width: 992px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  .nav-links {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: rgba(11, 13, 18, 0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    transition: right 0.35s ease;
    border-left: 1px solid var(--glass-border);
  }
  .nav-links.is-active {
    right: 0;
  }
  .nav-link {
    font-size: 1.2rem;
  }
  .grid-sistemas,
  .grid-programas,
  .grid-lab {
    grid-template-columns: 1fr;
  }
  .hero-subtitle {
    margin-bottom: 30px;
  }
  .glass-panel {
    padding: 30px;
  }
  .holo-decoration {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in-target {
    opacity: 1;
    transform: none;
  }
}