/* ============================================
   QUANTUM AI AEROSPACE INSTITUTE — STYLES
   ============================================ */

/* 1. VARIABLES & RESET
   ============================================ */
:root {
  --bg-deep: #010b1e;
  --bg-navy: #0a192f;
  --neon-cyan: #00f3ff;
  --neon-violet: #bd00ff;
  --text-primary: #e0e6ed;
  --text-secondary: #8a9bb8;
  --glass-bg: rgba(10, 25, 47, 0.6);
  --glass-border: rgba(0, 243, 255, 0.18);
  --glass-border-strong: rgba(0, 243, 255, 0.35);
  --radius: 12px;
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 0;
}

h1,
h2,
h3,
h4 {
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.5px;
}

address {
  font-style: normal;
}

/* 2. ANIMATED BACKGROUND CANVAS
   ============================================ */
#orbital-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* 3. HEADER & NAVIGATION
   ============================================ */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(2, 11, 30, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition);
}

.main-header.scrolled {
  background: rgba(2, 11, 30, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.logo span {
  color: var(--neon-cyan);
}

.nav-menu {
  display: flex;
  gap: 2.5rem;
}

.nav-link {
  position: relative;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
  transition: color 0.3s;
  padding: 0.25rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-violet));
  transition: width 0.3s;
}

.nav-link:hover {
  color: #fff;
}

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

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.bar {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px auto;
  background-color: #fff;
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

/* 4. HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 70px;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.hero-content {
  max-width: 650px;
}

.hero-content h1 {
  font-size: clamp(2.6rem, 5.5vw, 4.8rem);
  line-height: 1.05;
  margin-bottom: 1rem;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-slogan {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-style: italic;
}

.cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-violet));
  color: var(--bg-deep);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 4px;
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.35);
  transition: transform 0.3s, box-shadow 0.3s;
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 35px rgba(0, 243, 255, 0.55), 0 0 70px rgba(189, 0, 255, 0.25);
}

/* Orbital visual */
.hero-visual {
  position: relative;
  width: 420px;
  height: 420px;
  flex-shrink: 0;
}

.orbit-system {
  position: relative;
  width: 100%;
  height: 100%;
  animation: float 6s ease-in-out infinite;
}

.center-planet {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--neon-cyan), var(--bg-deep) 70%);
  box-shadow: 0 0 40px rgba(0, 243, 255, 0.25);
  z-index: 2;
}

.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid var(--glass-border-strong);
}

.ring-1 {
  width: 260px;
  height: 260px;
  animation: rotate 14s linear infinite;
}

.ring-2 {
  width: 380px;
  height: 380px;
  border-color: rgba(189, 0, 255, 0.25);
  animation: rotate 22s linear infinite reverse;
}

.satellite {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan);
  transform: translateX(-50%);
}

.satellite-violet {
  background: var(--neon-violet);
  box-shadow: 0 0 12px var(--neon-violet);
  top: auto;
  bottom: -5px;
}

/* 5. SHARED SECTION UTILITIES
   ============================================ */
.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 4rem;
  font-size: 1.05rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

[id] > .container > h2 {
  text-align: center;
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  color: #fff;
  text-transform: uppercase;
}

.section-dark {
  background: radial-gradient(ellipse at center, #0a1a35 0%, var(--bg-deep) 70%);
}

.section-navy {
  background: linear-gradient(180deg, var(--bg-deep) 0%, #050d1f 100%);
}

/* 6. SOBRE EL INSTITUTO — SISTEMAS
   ============================================ */
.systems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.glass-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2.25rem 1.75rem;
  transition: transform 0.35s, box-shadow 0.35s, border-color 0.35s;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  transition: left 0.6s;
  pointer-events: none;
}

.glass-panel:hover::before {
  left: 100%;
}

.glass-panel:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border-strong);
  box-shadow: 0 15px 45px rgba(0, 243, 255, 0.08);
}

.panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  color: var(--neon-cyan);
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.12), rgba(189, 0, 255, 0.12));
  border: 1px solid rgba(0, 243, 255, 0.25);
  margin-bottom: 1.5rem;
}

.glass-panel h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  color: #fff;
}

.glass-panel p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* 7. PROGRAMAS
   ============================================ */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.program-card {
  padding: 2.25rem 1.75rem;
  background: rgba(255, 255, 255, 0.025);
  border-left: 4px solid var(--neon-cyan);
  border-radius: 0 14px 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: var(--transition);
}

.program-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: #fff;
}

.program-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

.program-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-left-color: var(--neon-violet);
  transform: translateX(6px);
  box-shadow: 0 8px 30px rgba(189, 0, 255, 0.06);
}

/* 8. SPACE LAB
   ============================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(0, 243, 255, 0.05), rgba(189, 0, 255, 0.05));
  border: 1px solid rgba(189, 0, 255, 0.18);
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(189, 0, 255, 0.45);
  box-shadow: 0 20px 50px rgba(189, 0, 255, 0.08);
}

.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 243, 255, 0.025) 2px,
    rgba(0, 243, 255, 0.025) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.holo-content {
  position: relative;
  padding: 2.25rem 1.75rem;
  z-index: 2;
}

.holo-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #fff;
  letter-spacing: 1px;
}

.platform {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: rgba(0, 243, 255, 0.12);
  border: 1px solid rgba(0, 243, 255, 0.3);
  border-radius: 20px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  color: var(--neon-cyan);
  margin-bottom: 1rem;
  letter-spacing: 0.8px;
}

.innovation {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(0, 243, 255, 0.35);
  box-shadow: 0 0 14px rgba(0, 243, 255, 0.35);
  animation: scan 3.5s linear infinite;
  z-index: 3;
  pointer-events: none;
}

/* 9. CONTACTO
   ============================================ */
.section-contact {
  background: radial-gradient(ellipse at bottom, #0a1a35, var(--bg-deep));
}

.contact-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.glass-form {
  position: relative;
  background: rgba(5, 15, 30, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 2.5rem;
}

.form-row {
  display: flex;
  gap: 1.5rem;
}

.form-row.two-columns .form-group {
  flex: 1;
}

.form-group {
  margin-bottom: 1.5rem;
}

.glass-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.glass-form input,
.glass-form textarea,
.glass-form select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 243, 255, 0.2);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.glass-form input::placeholder,
.glass-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.glass-form input:focus,
.glass-form textarea:focus,
.glass-form select:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.15);
}

.glass-form select option {
  background: var(--bg-deep);
  color: var(--text-primary);
}

.btn-submit {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-violet));
  border: none;
  border-radius: 6px;
  color: var(--bg-deep);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
}

.btn-submit:hover {
  transform: scale(1.02);
  filter: brightness(1.15);
}

.contact-info {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
}

.info-item h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--neon-cyan);
  margin-bottom: 0.4rem;
  letter-spacing: 1px;
}

.info-item a,
.info-item address,
.info-item p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.4;
  transition: color 0.3s;
}

.info-item a:hover {
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 243, 255, 0.35);
}

/* 10. FOOTER
   ============================================ */
.main-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--glass-border);
  background: var(--bg-deep);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* 11. REVEAL ANIMATIONS
   ============================================ */
.reveal-hidden {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* 12. KEYFRAMES
   ============================================ */
@keyframes rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes scan {
  0% {
    top: 0;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* 13. RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
    padding-top: 3rem;
  }

  .hero-visual {
    margin-top: 3rem;
    width: 320px;
    height: 320px;
  }

  .contact-container {
    grid-template-columns: 1fr;
  }

  .contact-info {
    margin-top: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(2, 11, 30, 0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    transition: right 0.35s ease-in-out;
    z-index: 999;
  }

  .nav-menu.active {
    right: 0;
  }

  .hamburger {
    display: block;
    z-index: 1001;
  }

  .form-row.two-columns {
    flex-direction: column;
    gap: 0;
  }

  .projects-grid,
  .systems-grid,
  .programs-grid {
    gap: 1.5rem;
  }

  .container {
    padding: 4rem 0;
  }

  .cta-button {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  #orbital-canvas {
    display: none;
  }
}