/* =========================================================
   HORIZON AI INSTITUTE — CSS
   Tema: Academia de IA Espacial
   Idioma: Español | Target: España
   Estilo: Futurista, glassmorphism, degradados oscuros
   ========================================================= */

/* ---------- Variables de diseño ---------- */
:root {
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* Paleta espacial: oscuros, azules y violetas */
  --bg-void: #020617;        /* Slate 950 */
  --bg-deep: #0b1021;        /* Azul noche profundo */
  --bg-surface: #0f172a;     /* Slate 900 */
  --bg-panel: rgba(15, 23, 42, 0.6);

  /* Acentos */
  --cyan: #06b6d4;           /* Cyan 500 */
  --violet: #8b5cf6;         /* Violet 500 */
  --fuchsia: #d946ef;        /* Fuchsia 500 */
  --blue-glow: #3b82f6;

  /* Texto */
  --text-primary: #f1f5f9;   /* Slate 100 */
  --text-secondary: #94a3b8; /* Slate 400 */
  --text-muted: #64748b;     /* Slate 500 */

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.12);

  /* Espaciado */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Radios */
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.25);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* ---------- Reset y base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--bg-void);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

/* ---------- Utilidades de layout ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue-glow));
  color: #fff;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(6, 182, 212, 0.45);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--glass-border);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: var(--glass-bg);
  border-color: var(--glass-highlight);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--cyan), var(--violet), var(--fuchsia));
  opacity: 0;
  z-index: -1;
  filter: blur(12px);
  transition: opacity 0.3s ease;
}

.btn-glow:hover::after {
  opacity: 0.6;
}

/* ---------- Enlaces con flecha ---------- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--cyan);
  font-weight: 600;
  font-size: 0.9rem;
  transition: gap 0.2s ease;
}

.link-arrow::after {
  content: '→';
  transition: transform 0.2s ease;
}

.link-arrow:hover {
  gap: 0.75rem;
}

/* ---------- Header / Navegación ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: var(--space-sm) 0;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.header--scrolled {
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-icon {
  color: var(--cyan);
  font-size: 1.5rem;
  line-height: 1;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-link {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  padding: 0.25rem 0;
}

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

.nav-link:hover {
  color: var(--text-primary);
}

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

.nav-link--cta {
  background: linear-gradient(135deg, var(--violet), var(--fuchsia));
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.nav-link--cta::after {
  display: none;
}

.nav-link--cta:hover {
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.45);
}

/* Botón hamburguesa (solo móvil) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  position: relative;
  transition: background 0.2s ease;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  left: 0;
  transition: transform 0.3s ease, top 0.3s ease;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: 5rem;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0%, var(--bg-void) 85%);
  z-index: 1;
  pointer-events: none;
}

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

.hero-tag {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-highlight);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
  background: linear-gradient(180deg, #fff 40%, var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-indicator {
  display: block;
  width: 24px;
  height: 40px;
  border: 2px solid var(--glass-highlight);
  border-radius: 12px;
  position: relative;
}

.scroll-indicator::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--cyan);
  border-radius: 2px;
  animation: scrollPulse 2s infinite ease-in-out;
}

/* ---------- Secciones generales ---------- */
.section {
  padding: var(--space-2xl) 0;
  position: relative;
}

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

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

.section-header {
  text-align: center;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-xl);
}

.section-tag {
  display: inline-block;
  color: var(--violet);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ---------- Glassmorphism cards ---------- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-6px);
  border-color: var(--glass-highlight);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(139, 92, 246, 0.15));
  color: var(--cyan);
  margin-bottom: var(--space-md);
  border: 1px solid var(--glass-border);
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.glass-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
  font-weight: 700;
}

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

/* ---------- Programas / tarjetas holográficas ---------- */
.program-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.program-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.25);
}

.program-visual {
  position: relative;
  height: 120px;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hologram-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
  border: 1px solid rgba(6, 182, 212, 0.25);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.15);
  animation: float 6s ease-in-out infinite;
  position: relative;
}

.hologram-circle::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px dashed rgba(139, 92, 246, 0.4);
  animation: spin 12s linear infinite;
}

.hologram-ring {
  position: absolute;
  width: 120px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(217, 70, 239, 0.2);
  transform: rotateX(60deg);
  animation: pulse-glow 4s ease-in-out infinite;
}

.program-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: var(--space-xs);
  font-weight: 700;
}

.program-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

/* ---------- Laboratorio Espacial ---------- */
.lab-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8), rgba(11, 16, 33, 0.9));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.lab-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--fuchsia));
  opacity: 0.6;
}

.lab-card:hover {
  border-color: rgba(6, 182, 212, 0.25);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.1);
}

.lab-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.lab-mission {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(6, 182, 212, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lab-platform {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(139, 92, 246, 0.1);
  color: var(--violet);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lab-innovations {
  list-style: disc;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.lab-innovations li {
  margin-bottom: 0.35rem;
}

/* ---------- Contacto ---------- */
.contact-section {
  padding-bottom: var(--space-2xl);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
}

.contact-lead {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.contact-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.contact-list a,
.contact-list address {
  color: var(--text-primary);
  font-style: normal;
  font-weight: 500;
  transition: color 0.2s ease;
}

.contact-list a:hover {
  color: var(--cyan);
}

/* Formulario */
.contact-form .form-group {
  margin-bottom: var(--space-md);
}

.contact-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
}

.contact-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

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

.contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

.form-status {
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  min-height: 1.4em;
  color: var(--cyan);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--glass-border);
  padding: var(--space-lg) 0;
  background: var(--bg-void);
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: var(--space-md);
}

.footer-links a {
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ---------- Animaciones ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.4;
    transform: rotateX(60deg) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: rotateX(60deg) scale(1.05);
  }
}

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

/* Clases de animación controladas por JS */
[data-animate] {
  opacity: 0;
}

[data-animate].animate-in {
  opacity: 1;
  animation-duration: 0.8s;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-animate="fade-up"].animate-in {
  animation-name: fadeUp;
}

[data-animate="fade-right"].animate-in {
  animation-name: fadeRight;
}

[data-animate="fade-left"].animate-in {
  animation-name: fadeLeft;
}

/* Stagger delays */
[data-delay="1"].animate-in { animation-delay: 0.1s; }
[data-delay="2"].animate-in { animation-delay: 0.2s; }
[data-delay="3"].animate-in { animation-delay: 0.3s; }
[data-delay="4"].animate-in { animation-delay: 0.4s; }
[data-delay="5"].animate-in { animation-delay: 0.5s; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

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

  .nav-toggle {
    display: block;
    z-index: 110;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    padding: 5rem var(--space-md) var(--space-md);
    z-index: 105;
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .nav-link {
    font-size: 1.1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --space-2xl: 4rem;
    --space-xl: 2.5rem;
  }

  .glass-panel {
    padding: var(--space-lg);
  }

  .section-title {
    font-size: 1.6rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}