/* Estilos generales para la web de HAFI */

/* Variables de color para facilitar ajustes */
:root {
  --bg-color: #0e1012;
  --accent-color: #00a8e8;
  --accent-color-light: #33c7f3;
  --text-color: #e4e4e4;
  --alt-bg: #17191c;
  --card-bg: #1d1f23;
}

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

html,
body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Navegación */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  z-index: 100;
  background: rgba(14, 16, 18, 0.6);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

.nav-links a {
  margin-left: 1.5rem;
  text-decoration: none;
  font-weight: 500;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent-color);
}

/* Secciones */
.section {
  position: relative;
  min-height: 100vh;
  padding: 6rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.section-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 1s ease;
}

.container {
  position: relative;
  z-index: 5;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--accent-color-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Animaciones de fondo */
@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(5deg);
  }

  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

@keyframes pulse-glow {
  0% {
    opacity: 0.3;
    filter: blur(40px);
  }

  50% {
    opacity: 0.6;
    filter: blur(60px);
  }

  100% {
    opacity: 0.3;
    filter: blur(40px);
  }
}

@keyframes drift {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 100% 100%;
  }
}

/* Estilos específicos de fondo para secciones */
#principios .section-bg {
  background: radial-gradient(circle at 20% 30%, rgba(0, 168, 232, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(51, 199, 243, 0.1) 0%, transparent 50%);
}

#nodo .section-bg {
  background-image:
    linear-gradient(rgba(0, 168, 232, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 168, 232, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.3;
}

#loop .section-bg {
  background: conic-gradient(from 180deg at 50% 50%, rgba(0, 168, 232, 0) 0deg, rgba(0, 168, 232, 0.1) 180deg, rgba(0, 168, 232, 0) 360deg);
  animation: rotate 20s linear infinite;
}

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

  to {
    transform: rotate(360deg);
  }
}

#versiones .section-bg {
  background: radial-gradient(ellipse at center, rgba(14, 16, 18, 0) 0%, rgba(0, 168, 232, 0.05) 100%);
}

#plantillas .section-bg {
  background: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect x="10" y="10" width="80" height="80" fill="none" stroke="rgba(0,168,232,0.1)" stroke-width="1"/></svg>');
  background-size: 150px 150px;
  opacity: 0.4;
}

#contacto .section-bg {
  background: radial-gradient(circle at 50% 50%, rgba(0, 168, 232, 0.15), transparent 70%);
  animation: pulse-glow 4s ease-in-out infinite;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 30% 30%, #0b3c57, #0e1012);
}

#three-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-overlay {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.hero-overlay h1 {
  font-size: clamp(5rem, 15vw, 10rem);
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
  font-weight: 800;
  text-shadow: 0 0 40px rgba(0, 168, 232, 0.4);
}

.hero-overlay p {
  font-size: clamp(1.4rem, 4vw, 2.5rem);
  margin-bottom: 3.5rem;
  color: var(--accent-color-light);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.3;
}

.hero-overlay .btn {
  font-size: 1.2rem;
  padding: 1rem 3rem;
  box-shadow: 0 0 20px rgba(0, 168, 232, 0.2);
}

/* Botones */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  margin-top: 2rem;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #0e1012;
}

.btn-primary:hover {
  background-color: var(--accent-color-light);
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
}

.btn-secondary:hover {
  background-color: var(--accent-color);
  color: #0e1012;
}

/* Listas y Nodos de Principios (Diseño Anti-estándar) */
.principios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 2rem;
  margin-top: 3rem;
  width: 100%;
  max-width: 1200px;
}

.principio-node {
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 168, 232, 0.2);
  padding: 3rem 2rem 2rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 10px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: default;
}

.principio-node:nth-child(even) {
  clip-path: polygon(0 20px, 20px 0, 100% 0, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

.principio-node:hover {
  background: rgba(0, 168, 232, 0.08);
  border-color: var(--accent-color);
  transform: translateY(-5px);
  box-shadow: 0 10px 40px rgba(0, 168, 232, 0.3);
}

.node-number {
  font-size: 2.5rem;
  font-weight: 900;
  color: rgba(0, 168, 232, 0.08);
  position: absolute;
  top: 5px;
  right: 15px;
  line-height: 1;
  pointer-events: none;
}

.principio-node:hover .node-number {
  color: rgba(0, 168, 232, 0.3);
}

.node-content {
  position: relative;
  z-index: 1;
  text-align: left;
}

.node-content h3 {
  color: var(--accent-color);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.node-content p {
  font-size: 0.95rem;
  color: #ccc;
  line-height: 1.5;
}

.node-content strong {
  display: block;
  color: var(--text-color);
  margin-bottom: 0.3rem;
}


/* Nodo de Valor (Esquema Técnico) */
.nodo-schematic {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
  width: 100%;
  max-width: 1200px;
}

.nodo-component {
  background: rgba(0, 168, 232, 0.02);
  border-left: 3px solid var(--accent-color);
  padding: 1.5rem;
  text-align: left;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

.nodo-component::after {
  content: '';
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 168, 232, 0.05), transparent);
  transition: right 0.6s ease;
}

.nodo-component:hover {
  background: rgba(0, 168, 232, 0.05);
  transform: translateX(10px);
}

.nodo-component:hover::after {
  right: 100%;
}

.comp-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.comp-icon {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  padding: 2px 6px;
  opacity: 0.7;
}

.comp-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.comp-desc {
  font-size: 0.9rem;
  color: #aaa;
  line-height: 1.4;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.nodo-component:hover .comp-desc {
  opacity: 1;
  color: var(--text-color);
}


/* Ciclo operativo */
.loop-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.loop-step {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: left;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}

.loop-step:hover {
  transform: translateY(-4px);
}

.loop-step h3 {
  margin-bottom: 0.5rem;
  color: var(--accent-color);
  font-size: 1.3rem;
}

/* Timeline de versiones */
.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.timeline-item {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: left;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}

.timeline-item:hover {
  transform: translateY(-4px);
}

.timeline-item h3 {
  margin-bottom: 0.5rem;
  color: var(--accent-color);
  font-size: 1.3rem;
}

/* Footer */
.footer {
  background-color: #0d0f11;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Botón de Hamburguesa */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  z-index: 101;
}

.menu-toggle .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--accent-color);
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Animación del botón a X */
.menu-toggle.active .bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Responsividad */
@media (max-width: 768px) {
  .nav {
    padding: 1rem;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(14, 16, 18, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 100;
  }

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

  .nav-links a {
    margin: 1.5rem 0;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
  }

  .hero-overlay h1 {
    font-size: 4rem;
    line-height: 1.1;
  }

  .hero-overlay p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
  }
}