/*
  ALSANSOFT - Hoja de Estilos Principal
  Versión: 1.2 (Enfoque fluido y responsivo moderno)
  Autor: Alsansoft
*/

/* 1. Variables Globales y Reseteo Básico
-------------------------------------------------- */
:root {
  --color-primary-cyan: #06b6d4;
  --color-primary-sky: #0ea5e9;
  --color-dark: #111827;
  --color-light: #ffffff;
  --color-gray-light: #f9fafb;
  --color-gray-medium: #6b7280;
  --color-gray-dark: #374151;
  --color-border: #e5e7eb;
  
  --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-height: 80px;
  --border-radius: 0.75rem;
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  /* Tipografía fluida para todo el sitio */
  font-size: clamp(16px, 1.6vw, 18px);
}

body {
  font-family: var(--font-family-base);
  color: var(--color-gray-dark);
  background-color: var(--color-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-width: 320px; /* Evita que el layout se rompa en pantallas muy pequeñas */
}

img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin-left: auto; margin-right: auto; padding-left: 1.5rem; padding-right: 1.5rem; }

/* 2. Clases de Utilidad
-------------------------------------------------- */
.gradient-text {
  background: linear-gradient(to right, var(--color-primary-sky), var(--color-primary-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn {
  display: inline-block;
  padding: 0.8em 2em; /* Usar 'em' para que el padding escale con el texto */
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
}
.btn:hover { opacity: 0.9; transform: translateY(-2px); }
.btn-primary { background: linear-gradient(to right, var(--color-primary-sky), var(--color-primary-cyan)); color: var(--color-light); }
.btn-secondary { background-color: var(--color-light); color: var(--color-primary-cyan); border-color: var(--color-primary-cyan); }
.btn-full { width: 100%; text-align: center; }

.section { padding: clamp(3rem, 10vw, 5rem) 0; } /* Padding vertical fluido */
.section-gray { background-color: var(--color-gray-light); }
.section-gradient { background: linear-gradient(to bottom right, var(--color-gray-light), var(--color-light)); }

.section-header { text-align: center; margin-bottom: 4rem; }
.section-title { font-size: clamp(2.2rem, 5vw, 2.8rem); font-weight: 800; margin-bottom: 1rem; }
.section-subtitle { font-size: clamp(1.1rem, 2.5vw, 1.25rem); color: var(--color-gray-medium); max-width: 600px; margin: 0 auto; }

.text-xl { font-size: 1.25rem; line-height: 1.7; margin-bottom: 1.5rem; }

/* 3. Header y Navegación
-------------------------------------------------- */
.header {
  position: fixed; top: 0; left: 0; width: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  z-index: 1000;
  height: var(--header-height);
}
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav-logo { height: 40px; width: auto; }
.nav-desktop { display: none; list-style: none; gap: 2rem; }
.nav-desktop a { text-decoration: none; color: var(--color-gray-dark); font-weight: 500; transition: color 0.3s ease; }
.nav-desktop a:hover { color: var(--color-primary-cyan); }
.nav-contact-btn { display: none; }
.nav-mobile-btn { display: block; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-mobile-btn svg { width: 24px; height: 24px; color: var(--color-gray-dark); }
.nav-mobile {
  display: none; position: absolute; top: var(--header-height); left: 0; right: 0;
  background-color: var(--color-light); padding: 1.5rem 0; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.nav-mobile.active { display: block; }
.nav-mobile ul { list-style: none; display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.nav-mobile a { text-decoration: none; color: var(--color-gray-dark); font-weight: 500; padding: 0.5rem 1rem; display: block; }

/* 4. Hero Section
-------------------------------------------------- */
.hero {
    min-height: 100vh;
  position: relative; padding-top: calc(var(--header-height) + 4rem); padding-bottom: 5rem;
  text-align: center; overflow: hidden;
  background: linear-gradient(to bottom right, #f0f9ff, #e0f2fe, white);
}
#techBackground { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.hero-content { position: relative; z-index: 1; }
.hero-title { font-size: clamp(2.8rem, 8vw, 4.5rem); font-weight: 800; line-height: 1.2; margin-bottom: 1.5rem; }
.hero-title span { display: block; margin-top: 0.5rem; }
.hero-subtitle { font-size: clamp(1.2rem, 4vw, 1.3rem); color: var(--color-gray-medium); margin: 0 auto 2.5rem auto; max-width: 700px; }
.hero-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* 5. Secciones con Grid Fluido
-------------------------------------------------- */
.services-grid, .portfolio-grid {
  display: grid;
  gap: 2rem;
  /* ✨ MAGIA RESPONSIVA: Crea columnas que se adaptan solas */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.service-card {
  background-color: var(--color-light); border: 1px solid var(--color-border);
  border-radius: var(--border-radius); padding: 2rem; box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.card-icon {
  width: 56px; height: 56px; border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, var(--color-primary-sky), var(--color-primary-cyan));
}
.card-icon svg { width: 28px; height: 28px; color: white; }
.card-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }

/* 6. About Us Section
-------------------------------------------------- */
.about-container { display: grid; gap: 3rem; align-items: center; }
.about-image img { border-radius: var(--border-radius); box-shadow: var(--shadow-lg); }
.about-text .section-title { text-align: left; }

/* 7. Portfolio Section
-------------------------------------------------- */
.portfolio-item {
  display: block; text-decoration: none; position: relative;
  border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.portfolio-item img {
  width: 100%; height: 256px; object-fit: cover;
  transition: transform 0.4s ease;
}
.portfolio-item:hover img { transform: scale(1.05); }
.portfolio-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: white; padding: 3rem 1.5rem 1.5rem 1.5rem; text-align: center;
  transition: opacity 0.4s ease;
}
.portfolio-overlay h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }

/* 8. Contact Section
-------------------------------------------------- */
.contact-grid { display: grid; gap: 3rem; }
.contact-form-wrapper { background-color: white; padding: 2.5rem; border-radius: var(--border-radius); box-shadow: var(--shadow-lg); border: 1px solid var(--color-border); }
.contact-form div { margin-bottom: 1.5rem; }
.contact-form label { display: block; font-weight: 600; margin-bottom: 0.5rem; }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; padding: 0.8rem 1rem; border: 1px solid var(--color-border);
  border-radius: 0.5rem; font-size: 1rem; font-family: var(--font-family-base);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--color-primary-cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}
.contact-form textarea { resize: vertical; }
.contact-info { display: flex; flex-direction: column; gap: 2rem; }
.contact-card {
  background-color: white; padding: 2rem; border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--color-border);
  display: flex; align-items: flex-start; gap: 1rem;
}
.contact-card h3 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.contact-card p { color: var(--color-gray-medium); }
.contact-card a { color: var(--color-primary-cyan); text-decoration: none; }
.contact-card a:hover { text-decoration: underline; }

/* 9. Footer
-------------------------------------------------- */
.footer { background-color: var(--color-dark); color: #d1d5db; padding-top: 4rem; }
.footer-container { display: grid; gap: 2.5rem; grid-template-columns: 1fr; } /* Mobile first */
.footer-col h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; color: white; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col a { text-decoration: none; color: inherit; transition: color 0.3s; }
.footer-col a:hover { color: var(--color-primary-cyan); }
.footer-brand { font-size: 1.8rem; font-weight: 800; margin-bottom: 1rem; }
.footer-social { display: flex; gap: 1rem; }
.footer-social-link {
  width: 40px; height: 40px; background-color: var(--color-gray-dark);
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.3s;
}
.footer-social-link:hover { background-color: var(--color-primary-cyan); }
.footer-social-link svg { width: 20px; height: 20px; color: white; }
.footer-bottom { border-top: 1px solid var(--color-gray-dark); text-align: center; padding: 2rem 0; margin-top: 3rem; color: #9ca3af; }

/* 10. WhatsApp & Preloader
-------------------------------------------------- */
.whatsapp-float {
  position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px;
  background-color: #25D366; color: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 100;
  transition: transform 0.3s ease;
}
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { width: 32px; height: 32px; }
#preloader {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background-color: var(--color-dark); z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.7s ease, visibility 0.7s ease;
  opacity: 1; visibility: visible;
}
body.loaded #preloader { opacity: 0; visibility: hidden; }
.spinner-svg { width: 80px; height: 80px; animation: rotate 2s linear infinite; }
.spinner-circle-under, .spinner-circle-over { fill: none; stroke-width: 8; }
.spinner-circle-under { stroke: #4b5563; }
.spinner-circle-over {
  stroke: var(--color-primary-sky); stroke-linecap: round;
  stroke-dasharray: 187; stroke-dashoffset: 0;
  animation: stretch 1.5s ease-in-out infinite;
}
.loading-text { margin-top: 1.25rem; font-size: 1.1rem; font-weight: 500; color: #60a5fa; letter-spacing: 0.1em; }
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes stretch {
  0% { stroke-dasharray: 1, 187; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90, 187; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 90, 187; stroke-dashoffset: -187; }
}

/* 11. Media Queries (Puntos de quiebre)
-------------------------------------------------- */
@media (min-width: 768px) {
  .nav-desktop, .nav-contact-btn { display: flex; }
  .nav-mobile-btn { display: none; }
  .about-container { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 2fr 1fr; }
  .footer-container { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
}

/* Fin de css/style.css */