/* =====================================================
   1. VARIABLES E IDENTIDAD VISUAL
===================================================== */

:root {
  --naranja: #FF9900;
  --fuego: #FF3300;
  --gris: #2C353D;
  --orbital: #FF8800;

  --fondo: #F7F8FA;
  --blanco: #FFFFFF;
  --texto: #26313A;
  --texto-secundario: #697680;
  --borde: #E5E9ED;

  --sombra: 0 12px 35px rgba(31, 43, 52, 0.08);
  --radio: 16px;
  --ancho: 1160px;
}

/* Reinicio general */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  line-height: 1.65;
}

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

button {
  font: inherit;
}

.container {
  width: min(92%, var(--ancho));
  margin: 0 auto;
}

.section {
  padding: 90px 0;
}

.section-heading {
  max-width: 690px;
  margin-bottom: 42px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: #D97900;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.section-heading h2 {
  color: var(--gris);
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-heading p {
  color: var(--texto-secundario);
  font-size: 1.05rem;
}

/* =====================================================
   2. ENCABEZADO Y NAVEGACIÓN
===================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--borde);
  backdrop-filter: blur(12px);
}

.nav {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--gris);
}

.logo-img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.logo-name {
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}

.nav-links a {
  color: #4B5963;
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #D97900;
}

.nav-contact {
  padding: 10px 19px;
  border: 1px solid var(--naranja);
  border-radius: 8px;
  color: var(--gris) !important;
  transition: background 0.2s ease;
}

.nav-contact:hover {
  background: #FFF3E0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gris);
  font-size: 1.8rem;
  cursor: pointer;
}

/* =========================================
   MENÚ RESPONSIVO
   ========================================= */

@media (max-width: 768px) {

  /* Referencia para posicionar el menú desplegable */
  .nav {
    position: relative;
    gap: 12px;
  }

  /* Muestra el botón únicamente en móviles */
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 1.8rem;
    line-height: 1;
  }

  /* Posiciona la navegación debajo del encabezado */
  .nav nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
  }

  /* Menú cerrado */
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding: 10px 20px 18px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--borde);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  }

  /* Menú abierto */
  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 13px 8px;
  }

  .nav-links .nav-contact {
    margin-top: 5px;
    padding: 12px;
  }
}

/* =====================================================
   3. PORTADA PRINCIPAL
===================================================== */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--gris);
  color: var(--blanco);
  padding: 115px 0 120px;
}

.hero::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  top: -280px;
  right: -120px;
  border: 1px solid rgba(255, 153, 0, 0.2);
  border-radius: 50%;
}

.hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  top: -210px;
  right: -50px;
  border: 1px solid rgba(255, 136, 0, 0.18);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: none;
  min-width: 0;
}

.hero-label {
  display: inline-block;
  padding: 7px 13px;
  margin-bottom: 25px;
  border: 1px solid rgba(255, 153, 0, 0.45);
  border-radius: 30px;
  color: #FFB94D;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 680px;
  margin-bottom: 24px;
  font-size: clamp(2.6rem, 6vw, 4.7rem);
  line-height: 1.08;
  letter-spacing: -2px;
}

.hero h1 span {
  color: var(--naranja);
}

.hero-description {
  max-width: 620px;
  margin-bottom: 35px;
  color: #C6CDD2;
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 23px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  transition: transform 0.2s, background 0.2s;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--naranja);
  color: #252D33;
}

.button-primary:hover {
  background: #FFAD33;
}

.button-outline {
  border: 1px solid rgba(255,255,255,0.35);
  color: var(--blanco);
}

.button-outline:hover {
  background: rgba(255,255,255,0.08);
}


/* =====================================================
   4. PRESENTACIÓN INSTITUCIONAL
===================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 65px;
  align-items: center;
}

.about-text p {
  margin-bottom: 17px;
  color: var(--texto-secundario);
}

.about-panel {
  position: relative;
  overflow: hidden;
  padding: 38px;
  border-radius: var(--radio);
  background: var(--gris);
  color: var(--blanco);
  box-shadow: var(--sombra);
}

.about-panel::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -70px;
  border: 20px solid rgba(255,153,0,0.14);
  border-radius: 50%;
}

.about-panel h3 {
  position: relative;
  margin-bottom: 15px;
  color: var(--naranja);
  font-size: 1.5rem;
}

.about-panel p {
  position: relative;
  color: #D1D7DB;
}

/* =====================================================
   SERVICIOS
===================================================== */

.services {
  background: var(--blanco);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.service-card {
  padding: 22px;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: var(--blanco);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--sombra);
}

/* Imagen superior de cada servicio */
.service-image {
  width: 100%;
  height: 190px;
  margin-bottom: 22px;
  overflow: hidden;
  border-radius: 9px;
  background: #20282F;
}

.service-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.service-card:hover .service-image img {
  transform: scale(1.06);
}

/* Título del servicio */
.service-card h3 {
  margin-bottom: 12px;
  color: var(--gris);
  font-size: 1.2rem;
}

/* Descripción del servicio */
.service-card p {
  color: var(--texto-secundario);
  font-size: 0.94rem;
}

/* =====================================================
   6. METODOLOGÍA
===================================================== */

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

.process-step {
  position: relative;
  padding-top: 20px;
}

.process-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  margin-bottom: 19px;
  border-radius: 50%;
  background: var(--gris);
  color: var(--naranja);
  font-weight: 800;
}

.process-step h3 {
  margin-bottom: 9px;
  color: var(--gris);
  font-size: 1.08rem;
}

.process-step p {
  color: var(--texto-secundario);
  font-size: 0.92rem;
}

/* =====================================================
   7. CONTACTO
===================================================== */

.contact {
  background: #FFF3E4;
}

.contact-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
}

.contact-text {
  max-width: 650px;
}

.contact-text h2 {
  margin-bottom: 14px;
  color: var(--gris);
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1.2;
}

.contact-text p {
  color: #68737B;
}

/* =========================================
   PORTADA 3D - RED NEURONAL DE ONTOSOF
   ========================================= */

.hero {
  position: relative;
  overflow: hidden;
}

/* Distribución del contenido y la escena 3D */
.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 30px;
  min-height: 620px;
}

/* Texto de la portada */
.hero-content {
  position: relative;
  z-index: 2;
  min-width: 0;
}

/* Área de visualización tridimensional */
.hero-visual {
  position: relative;
  width: 100%;
  height: 540px;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
}

/* Canvas de Three.js */
#neuralCanvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

/* Etiqueta inferior de la visualización */
.neural-caption {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  color: rgba(255, 153, 0, 0.8);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  pointer-events: none;
}

/* Indicador luminoso */
.neural-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FF9900;
  box-shadow: 0 0 12px #FF9900;
  animation: neuralBlink 2s infinite;
}

@keyframes neuralBlink {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 12px #FF9900;
  }

  50% {
    opacity: 0.4;
    box-shadow: 0 0 4px #FF9900;
  }
}

/* Adaptación a tabletas */
@media (max-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 65px;
  }

  .hero-content {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    height: 440px;
    max-width: 650px;
    margin: 0 auto;
  }
}

/* Adaptación a móviles */
@media (max-width: 600px) {
  .hero-layout {
    padding-top: 45px;
  }

  .hero-visual {
    height: 340px;
  }

  .neural-caption {
    bottom: 15px;
    font-size: 8px;
    letter-spacing: 1.5px;
  }
}


/* =====================================================
   PÁGINAS INSTITUCIONALES - AVISO DE PRIVACIDAD
===================================================== */

.legal-page {
  background: var(--blanco);
}

/* Encabezado del documento */
.legal-hero {
  padding: 75px 0 55px;
  background: #F4F5F6;
  border-bottom: 1px solid var(--borde);
}

.legal-hero h1 {
  margin: 18px 0;
  color: var(--gris);
  font-size: clamp(2.3rem, 5vw, 3.7rem);
  line-height: 1.12;
  letter-spacing: -1.5px;
}

.legal-hero h1 span {
  color: var(--naranja);
}

.legal-hero > .container > p {
  max-width: 750px;
  color: var(--texto-secundario);
  font-size: 1.05rem;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 25px;
  margin-top: 30px;
  color: #77828A;
  font-size: 0.82rem;
}

/* Distribución del documento */
.legal-content {
  padding: 65px 0 45px;
}

.legal-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  gap: 55px;
}

/* Índice lateral */
.legal-index {
  padding: 23px;
  background: #F6F7F8;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
}

.legal-index h2 {
  margin-bottom: 18px;
  color: var(--gris);
  font-size: 1.05rem;
}

.legal-index nav {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.legal-index a {
  color: var(--texto-secundario);
  font-size: 0.84rem;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-index a:hover {
  color: #C96C00;
}

/* Documento */
.legal-document {
  min-width: 0;
  color: var(--texto-secundario);
  font-size: 0.96rem;
  line-height: 1.85;
}

.legal-intro {
  margin-bottom: 35px;
  padding: 22px 25px;
  background: #FFF8ED;
  border-left: 3px solid var(--naranja);
  border-radius: 0 8px 8px 0;
  color: var(--gris);
}

.legal-section {
  margin-bottom: 38px;
  scroll-margin-top: 35px;
}

.legal-section h2 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--borde);
  color: var(--gris);
  font-size: 1.3rem;
  line-height: 1.4;
}

.legal-section p {
  margin-bottom: 14px;
}

.legal-section ul {
  margin: 12px 0 18px;
  padding-left: 25px;
}

.legal-section li {
  margin-bottom: 8px;
  padding-left: 3px;
}

.legal-section strong {
  color: var(--gris);
}

/* Datos de contacto */
.legal-contact {
  margin-top: 20px;
  padding: 23px;
  background: #F6F7F8;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
}

.legal-contact strong {
  display: block;
  margin-bottom: 10px;
  color: var(--gris);
}

.legal-contact p {
  margin-bottom: 0;
}

.legal-contact a {
  color: #C96C00;
  text-decoration: none;
  font-weight: 600;
}

.legal-contact a:hover {
  text-decoration: underline;
}

/* Cierre del documento */
.legal-closing {
  margin-top: 45px;
  padding-top: 22px;
  border-top: 1px solid var(--borde);
  color: #77828A;
  font-size: 0.88rem;
}

/* Adaptación a tabletas */
@media (max-width: 850px) {

  .legal-layout {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .legal-index {
    padding: 20px;
  }

  .legal-index nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 20px;
  }

}

/* Adaptación a móviles */
@media (max-width: 650px) {

  .legal-hero {
    padding: 55px 0 40px;
  }

  .legal-content {
    padding: 40px 0 30px;
  }

  .legal-index nav {
    grid-template-columns: 1fr;
  }

  .legal-intro {
    padding: 18px;
  }

  .legal-section h2 {
    font-size: 1.15rem;
  }

  .legal-meta {
    flex-direction: column;
    gap: 8px;
  }

}

/* =====================================================
   8. PIE DE PÁGINA
===================================================== */

.footer {
  padding: 45px 0 22px;
  background: var(--gris);
  color: var(--blanco);
}

/* Distribución principal */
.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
  padding-bottom: 30px;
}

/* Identidad corporativa */
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--naranja);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-decoration: none;
}

.footer-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.footer-slogan {
  margin-top: 8px;
  color: #C0C8CE;
  font-size: 0.83rem;
}

/* Enlaces institucionales */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 24px;
}

.footer-links a {
  color: #C0C8CE;
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.25s ease;
}

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

/* Derechos reservados */
.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-copy {
  color: #AEB8BF;
  font-size: 0.82rem;
  text-align: center;
}

/* =====================================================
   9. ADAPTACIÓN A TABLETAS
===================================================== */

@media (max-width: 850px) {

  .nav-links {
    gap: 17px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 35px;
  }

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

  .process-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 35px;
  }

  .footer-content {
    align-items: flex-start;
    flex-direction: column;
    gap: 25px;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

/* =====================================================
   10. ADAPTACIÓN A MÓVILES
===================================================== */

@media (max-width: 650px) {

  .nav {
    min-height: 70px;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 5%;
    background: var(--blanco);
    border-bottom: 1px solid var(--borde);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 13px 5px;
  }

  .nav-contact {
    display: inline-block !important;
    width: fit-content;
    margin: 7px 0 12px;
  }

  .hero {
    padding: 85px 0 90px;
  }

  .hero h1 {
    letter-spacing: -1px;
  }

  .section {
    padding: 70px 0;
  }

  .services-grid,
  .process-grid {
    grid-template-columns: 1fr;
  }

  .contact-content {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer {
    padding-top: 35px;
  }

  .footer-content {
    align-items: flex-start;
    flex-direction: column;
    gap: 25px;
  }

  .footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .footer-copy {
    text-align: left;
  }
}

.enlace-subrayado {
  text-decoration: underline;
}

