/* ============================================
   ESTUDIO PRECINTO - SISTEMA DE DISEÑO
   Tecnología que resuelve
   ============================================ */

/* === VARIABLES CSS === */
:root {
  /* Colores del Logo */
  --color-bg-primary: #0e132b;
  --color-bg-card: #39506b;
  --color-text-primary: #e0e1dd;
  --color-text-secondary: rgba(224, 225, 221, 0.7);
  --color-accent: #a28a68;
  --color-accent-hover: #b89a78;
  --color-accent-glow: rgba(162, 138, 104, 0.3);

  /* Tipografía */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* Tamaños de Fuente */
  --text-xs: 0.75rem;
  /* 12px */
  --text-sm: 0.875rem;
  /* 14px */
  --text-base: 1rem;
  /* 16px */
  --text-lg: 1.125rem;
  /* 18px */
  --text-xl: 1.25rem;
  /* 20px */
  --text-2xl: 1.5rem;
  /* 24px */
  --text-3xl: 1.875rem;
  /* 30px */
  --text-4xl: 2.25rem;
  /* 36px */
  --text-5xl: 3rem;
  /* 48px */
  --text-6xl: 3.75rem;
  /* 60px */

  /* Espaciado */
  --space-1: 0.25rem;
  /* 4px */
  --space-2: 0.5rem;
  /* 8px */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.25rem;
  /* 20px */
  --space-6: 1.5rem;
  /* 24px */
  --space-8: 2rem;
  /* 32px */
  --space-10: 2.5rem;
  /* 40px */
  --space-12: 3rem;
  /* 48px */
  --space-16: 4rem;
  /* 64px */
  --space-20: 5rem;
  /* 80px */
  --space-24: 6rem;
  /* 96px */

  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--color-accent-glow);

  /* Bordes */
  --radius-sm: 0.375rem;
  /* 6px */
  --radius-md: 0.5rem;
  /* 8px */
  --radius-lg: 0.75rem;
  /* 12px */
  --radius-xl: 1rem;
  /* 16px */

  /* Transiciones */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 1040;
  --z-tooltip: 1050;
}

/* === RESET CSS === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-weight-regular);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  background-image:
    linear-gradient(rgba(224, 225, 221, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 225, 221, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

ul,
ol {
  list-style: none;
}

/* === CUSTOM SCROLLBAR === */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* === UTILIDADES === */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section {
  padding: var(--space-20) 0;
}

.section-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-12);
  text-align: center;
  background: linear-gradient(135deg, var(--color-text-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-accent {
  color: var(--color-accent);
}

.text-secondary {
  color: var(--color-text-secondary);
}

/* === GRID DECORATIVO === */
.grid-background {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(224, 225, 221, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 225, 221, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* === BOTONES === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-hover));
  color: var(--color-bg-primary);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-outline:hover {
  background: var(--color-accent);
  color: var(--color-bg-primary);
  transform: translateY(-2px);
}

/* === TARJETAS === */
.card {
  background: rgba(57, 80, 107, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(224, 225, 221, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  border-color: rgba(162, 138, 104, 0.3);
}

.card:hover::before {
  opacity: 1;
}

/* === HEADER === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  transition: all var(--transition-base);
}

.header.scrolled {
  background: rgba(14, 19, 43, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
}

.logo {
  height: 40px;
  width: auto;
  transition: transform var(--transition-base);
}

.logo:hover {
  transform: scale(1.05);
}

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

.nav-link {
  font-weight: var(--font-weight-medium);
  position: relative;
  transition: color var(--transition-base);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

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

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

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-2);
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  transition: all var(--transition-base);
}

/* === HERO SECTION === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--space-20);
}

.hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: var(--text-6xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-6);
  line-height: 1.1;
  animation: fadeInUp 0.8s ease-out;
  text-align: center;
}

.hero-subtitle {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-10);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.8s ease-out 0.2s both;
  text-align: center;
}

.hero-cta {
  animation: fadeInUp 0.8s ease-out 0.4s both;
  display: flex;
  justify-content: center;
}

/* === SERVICIOS (BENTO GRID) === */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.service-card {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.service-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-hover));
  border-radius: var(--radius-lg);
  font-size: var(--text-3xl);
  color: var(--color-bg-primary);
  box-shadow: var(--shadow-md);
}

.service-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
}

.service-description {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* === PORTFOLIO (MASONRY GRID) === */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-12);
}

.portfolio-item {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
}

.portfolio-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14, 19, 43, 0.95), transparent);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-6);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.portfolio-item:hover .portfolio-image {
  transform: scale(1.1);
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
}

.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.portfolio-tag {
  padding: var(--space-1) var(--space-3);
  background: rgba(162, 138, 104, 0.2);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-accent);
}

/* === TESTIMONIOS (CAROUSEL) === */
.testimonials-carousel {
  position: relative;
  max-width: 900px;
  margin: var(--space-12) auto 0;
  overflow: hidden;
}

.testimonials-track {
  display: flex;
  transition: transform var(--transition-slow);
}

.testimonial-card {
  min-width: 100%;
  padding: var(--space-10);
  text-align: center;
}

.testimonial-quote {
  font-size: var(--text-2xl);
  font-style: italic;
  margin-bottom: var(--space-6);
  position: relative;
  color: var(--color-text-primary);
}

.testimonial-quote::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--text-6xl);
  color: var(--color-accent);
  opacity: 0.3;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.testimonial-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--color-accent);
  object-fit: cover;
}

.testimonial-name {
  font-weight: var(--font-weight-bold);
  font-size: var(--text-lg);
}

.testimonial-company {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.testimonial-rating {
  display: flex;
  gap: var(--space-1);
  color: var(--color-accent);
  font-size: var(--text-lg);
}

.carousel-controls {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.carousel-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(57, 80, 107, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(224, 225, 221, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  color: var(--color-accent);
  transition: all var(--transition-base);
}

.carousel-btn:hover {
  background: var(--color-accent);
  color: var(--color-bg-primary);
  transform: scale(1.1);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(224, 225, 221, 0.3);
  transition: all var(--transition-base);
}

.carousel-dot.active {
  background: var(--color-accent);
  width: 30px;
  border-radius: var(--radius-sm);
}

/* === ABOUT === */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.about-text {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
  line-height: 1.8;
}

.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-12);
}

.about-feature {
  padding: var(--space-6);
  background: rgba(57, 80, 107, 0.2);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(224, 225, 221, 0.1);
  transition: all var(--transition-base);
}

.about-feature:hover {
  background: rgba(57, 80, 107, 0.4);
  border-color: var(--color-accent);
  transform: translateY(-4px);
}

.about-feature-title {
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-2);
  color: var(--color-accent);
}

/* === CTA FINAL === */
.cta-section {
  background: linear-gradient(135deg, rgba(57, 80, 107, 0.4), rgba(162, 138, 104, 0.2));
  border-radius: var(--radius-xl);
  padding: var(--space-20) var(--space-8);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-6);
}

.cta-text {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* === FOOTER === */
.footer {
  background: rgba(14, 19, 43, 0.8);
  border-top: 1px solid rgba(224, 225, 221, 0.1);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: var(--space-20);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer-section h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-4);
  color: var(--color-accent);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-link {
  color: var(--color-text-secondary);
  transition: color var(--transition-base);
}

.footer-link:hover {
  color: var(--color-accent);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-8);
  border-top: 1px solid rgba(224, 225, 221, 0.1);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.footer-logo {
  height: 60px;
  margin-bottom: var(--space-4);
}

/* === ANIMACIONES === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Intersection Observer Classes */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

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

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  :root {
    --text-6xl: 3rem;
    --text-5xl: 2.5rem;
    --text-4xl: 2rem;
  }

  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  :root {
    --text-6xl: 2.5rem;
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --space-20: 3rem;
  }

  .menu-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(14, 19, 43, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--space-8);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-xl);
  }

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

  .hero {
    min-height: 80vh;
  }

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

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

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --text-6xl: 2rem;
    --text-4xl: 1.5rem;
  }

  .container {
    padding: 0 var(--space-3);
  }

  .testimonial-quote {
    font-size: var(--text-lg);
  }
}