/* ==========================================================================
   DESIGN SYSTEM CORE ARCHITECTURE
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Plus+Jakarta+Sans:wght@600;700;800;900&display=swap');

:root {
  /* High-End Clinical Sapphire & Indigo Architecture */
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eeebff;
  
  /* System Neutral Continuum */
  --dark: #0f172a;
  --text: #334155;
  --light-text: #64748b;
  --white: #ffffff;
  --light: #f8fafc;
  --border-subtle: #e2e8f0;
  
  /* Elevation Tokens */
  --shadow-sm: 0 4px 20px rgba(15, 23, 42, 0.02);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.08);
  
  /* Structural Tokens */
  --radius-lg: 24px;
  --radius-md: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Font Family Stacks */
  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ==========================================================================
   GLOBAL RESET & DOCUMENT BASELINE
   ========================================================================== */

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

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

body {
  font-family: var(--font-ui);
  background-color: #ffffff;
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}

section {
  padding: 100px 0;
  position: relative;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
  color: var(--dark);
  letter-spacing: -0.025em;
  font-weight: 700;
}

.container {
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   WEBKIT BROWSER ENVIRONMENT OPTIMIZATION
   ========================================================================== */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 20px;
  border: 2px solid var(--light);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--light-text);
}

/* ==========================================================================
   BUTTONS & ACTION INTERFACES
   ========================================================================== */

.btn-main {
  background: var(--primary);
  color: var(--white) !important;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.2);
}

.btn-main:hover {
  background: var(--brand-indigo-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

.btn-light-custom {
  background: var(--white);
  color: var(--primary) !important;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-light-custom:hover {
  transform: translateY(-2px);
  background: var(--light);
  box-shadow: var(--shadow-md);
}

.btn-whatsapp {
  background: #25D366;
  color: var(--white) !important;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.2);
}

.btn-whatsapp:hover {
  background: #1ebe5d;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

.btn-map {
  background: var(--dark);
  color: var(--white) !important;
  padding: 16px 28px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
  z-index: 2;
}

.btn-map:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

/* ==========================================================================
   NAVIGATION LAYER (STYLING BLUR BACKDROP MAP)
   ========================================================================== */

.navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 0;
  transition: var(--transition);
  border-bottom: 1px solid rgba(241, 245, 249, 0.8);
}

.navbar-brand {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--dark) !important;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.navbar-nav .nav-link {
  color: var(--light-text);
  margin-left: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 16px !important;
  border-radius: 8px;
  transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary) !important;
  background-color: var(--primary-light);
}

/* ==========================================================================
   LANDING HERO STACKS
   ========================================================================== */

.hero {
  background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 100%);
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding-top: 140px;
}

.hero h1 {
  font-size: 3.75rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--dark);
}

.hero p {
  margin: 24px 0 35px;
  color: var(--light-text);
  line-height: 1.7;
  font-size: 1.1rem;
  max-width: 600px;
}

.hero-image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   PAGE CONTEXT HEROS
   ========================================================================== */

.page-hero {
  background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 100%);
  padding: 140px 0 70px;
  text-align: center;
}

.page-hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 16px;
}

.page-hero p {
  max-width: 600px;
  margin: auto;
  color: var(--light-text);
  line-height: 1.6;
  font-size: 1.1rem;
}

/* ==========================================================================
   SECTION CONTROLS & COMPOSITIONS
   ========================================================================== */

.section-title {
  text-align: center;
  margin-bottom: 60px;
}

.section-title h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 16px;
}

.section-title p {
  color: var(--light-text);
  max-width: 600px;
  margin: auto;
  line-height: 1.6;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

/* ==========================================================================
   FEATURE DISPLAY PLATFORMS
   ========================================================================== */

.feature-card {
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.feature-card i {
  font-size: 2.5rem;
  color: var(--primary);
  display: inline-block;
  margin-bottom: 20px;
}

.feature-card h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--light-text);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================================================
   SERVICES GRID ARRANGEMENTS
   ========================================================================== */

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

.service-card {
  background: var(--light);
  border-radius: var(--radius-md);
  padding: 40px;
  transition: var(--transition);
  height: 100%;
  position: relative;
  border: 1px solid var(--border-subtle);
}

.service-card:hover {
  background: var(--white);
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.service-card i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 20px;
  display: inline-block;
}

.service-card h5 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.service-card p {
  color: var(--light-text);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================================================
   ABOUT NARRATIVE MODULES
   ========================================================================== */

.about {
  background: var(--light);
}

.about img,
.about-page img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
}

.about h2,
.about-page h2 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.about p,
.about-page p {
  color: var(--text);
  line-height: 1.7;
}

/* ==========================================================================
   DYNAMIC MASONRY PORTFOLIO ENVIRONMENT
   ========================================================================== */

.modern-gallery {
  background: var(--white);
}

.gallery-header {
  margin-bottom: 50px;
}

.gallery-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
}

.gallery-header p {
  max-width: 600px;
  margin: auto;
  color: var(--light-text);
}

.gallery-masonry-wrapper, .gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 24px;
}

.gallery-item, .masonry-node {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: var(--light);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.gallery-item img, .masonry-node img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Explicit Structure Dimension Rules */
.gallery-item.large, .masonry-node.span-large { grid-column: span 2; grid-row: span 2; }
.gallery-item.wide, .masonry-node.span-wide   { grid-column: span 2; grid-row: span 1; }
.gallery-item.tall, .masonry-node.span-tall   { grid-column: span 1; grid-row: span 2; }

.gallery-overlay, .node-overlay-card {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.2) 60%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-overlay h4, .node-overlay-card h4 {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

/* Hover Displacements */
.gallery-item:hover img, .masonry-node:hover img {
  transform: scale(1.05);
}

.gallery-item:hover .gallery-overlay,
.masonry-node:hover .node-overlay-card {
  opacity: 1;
}

.gallery-item:hover .gallery-overlay h4,
.masonry-node:hover .node-overlay-card h4 {
  transform: translateY(0);
}

/* ==========================================================================
   PROCEDURAL LOGISTICS OVERVIEW
   ========================================================================== */

.step-box {
  text-align: center;
  padding: 20px;
}

.step-number {
  width: 70px;
  height: 70px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

/* ==========================================================================
   CONVERSION TARGET HOOKS (CTA)
   ========================================================================== */

.cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  text-align: center;
}

.cta h2 {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--white);
}

.cta p {
  margin-bottom: 32px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
}

/* ==========================================================================
   NEWSLETTER ENGAGEMENT FLUID BOARDS
   ========================================================================== */

.newsletter {
  background: var(--white);
  text-align: center;
}

.newsletter input {
  height: 56px;
  border-radius: 12px;
  padding-left: 20px;
  border: 1px solid var(--border-subtle);
  background-color: var(--light);
}

.newsletter input:focus {
  box-shadow: none;
  background-color: var(--white);
  border-color: var(--primary);
}

/* ==========================================================================
   DATA SERVICES SPECIFIC MATRIX CATALOG
   ========================================================================== */

.services-intro { background: var(--white); }
.services-page { background: var(--light); }

.service-box {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 40px;
  height: 100%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

.service-box:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.service-icon i {
  font-size: 2rem;
  color: var(--primary);
}

.service-box h4 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.service-box p {
  color: var(--light-text);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.service-box ul {
  padding-left: 16px;
  margin: 0;
}

.service-box ul li {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.95rem;
}

.why-lab { background: var(--white); }

.why-card {
  background: var(--light);
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
  height: 100%;
}

.why-card:hover {
  transform: translateY(-6px);
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.why-card i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 16px;
  display: inline-block;
  transition: var(--transition);
}

.why-card h5 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  transition: var(--transition);
}

.why-card p {
  color: var(--light-text);
  font-size: 0.95rem;
  margin: 0;
  transition: var(--transition);
}

.why-card:hover i,
.why-card:hover h5,
.why-card:hover p {
  color: var(--white);
}

/* ==========================================================================
   MODERN INTERACTIVE CONTACT MODULES
   ========================================================================== */

.contact-hero {
  background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 100%);
  padding: 140px 0 70px;
}

.contact-hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
}

.contact-hero p {
  color: var(--light-text);
  font-size: 1.1rem;
  max-width: 600px;
}

.contact-cta-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.contact-hero-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}

.hero-contact-item {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.hero-contact-item:last-child {
  margin-bottom: 0;
}

.hero-contact-icon {
  min-width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.2);
}

.hero-contact-icon i {
  font-size: 1.25rem;
  color: var(--white);
}

.hero-contact-item span {
  display: block;
  color: var(--light-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.hero-contact-item h5 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.modern-contact-form {
  background: var(--white);
}

.contact-form-wrapper {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}

.form-side-content {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 60px 40px;
  height: 100%;
}

.form-side-content h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 16px;
}

.form-side-content p {
  color: rgba(255, 255, 255, 0.9);
}

.mini-contact-list {
  margin-top: 40px;
}

.mini-contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.mini-contact-item i {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.form-side-form {
  padding: 60px 40px;
}

.form-side-form label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--dark);
}

.form-side-form .form-control,
.form-side-form .form-select {
  height: 54px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--light);
  padding-left: 16px;
  box-shadow: none;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-side-form textarea.form-control {
  height: auto;
  padding-top: 14px;
  resize: none;
}

.form-side-form .form-control:focus,
.form-side-form .form-select:focus {
  border-color: var(--primary);
  background: var(--white);
}

.modern-map-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}

.modern-map-card iframe {
  width: 100%;
  height: 500px;
  border: 0;
}

/* ==========================================================================
   PERSISTENT FOOTER ARCHITECTURE
   ========================================================================== */

.footer {
  background: var(--dark);
  color: var(--white);
  padding: 100px 0 30px;
}

.footer h4,
.footer h5 {
  color: var(--white);
  margin-bottom: 24px;
  font-size: 1.15rem;
  font-weight: 700;
}

.footer p {
  color: #94a3b8;
  font-size: 0.95rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.95rem;
}

/* Clean lateral hover translation offset */
.footer-links a:hover {
  color: var(--white);
  transform: translateX(4px);
  display: inline-block;
}

.social-icons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.social-icons a {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-icons a:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 60px;
  padding-top: 30px;
  text-align: center;
  font-size: 0.9rem;
  color: #64748b;
}

/* ==========================================================================
   ADAPTIVE RESPONSIVE MATRIX CONTROL (MEDIA QUERIES)
   ========================================================================== */

@media (max-width: 1199px) {
  .hero h1,
  .page-hero h1 {
    font-size: 3.25rem;
  }
  .gallery-masonry-wrapper, .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 240px;
  }
  /* Normalize spans on mid viewports to preserve layout boundaries */
  .gallery-item.large, .masonry-node.span-large,
  .gallery-item.wide, .masonry-node.span-wide,
  .gallery-item.tall, .masonry-node.span-tall {
    grid-column: span 1;
    grid-row: span 1;
  }
}

@media (max-width: 991px) {
  section {
    padding: 80px 0;
  }
  .hero {
    text-align: center;
    padding-top: 120px;
  }
  .hero p {
    margin: 20px auto 30px;
  }
  .hero-image {
    margin-top: 40px;
  }
  .contact-hero h1 {
    font-size: 2.75rem;
  }
  .contact-hero-card {
    margin-top: 40px;
  }
  .navbar-collapse {
    background-color: var(--white);
    margin-top: 12px;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
  }
  .navbar-nav {
    align-items: flex-start !important;
  }
  .navbar-nav .nav-link {
    margin-left: 0;
    width: 100%;
    padding: 10px 14px !important;
  }
}

@media (max-width: 767px) {
  .hero h1,
  .page-hero h1 {
    font-size: 2.5rem;
  }
  .section-title h2,
  .gallery-header h2,
  .about h2,
  .about-page h2,
  .cta h2,
  .form-side-content h2 {
    font-size: 2rem;
  }
  .gallery-masonry-wrapper, .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 250px;
    gap: 16px;
  }
  .form-side-content,
  .form-side-form {
    padding: 40px 24px;
  }
  .modern-map-card iframe {
    height: 350px;
  }
  .contact-cta-buttons {
    flex-direction: column;
  }
  .contact-cta-buttons a {
    width: 100%;
    justify-content: center;
  }
}
