/* Improtech Ingeniería — global styles */
:root {
  --brand: #4f1448;
  --brand-hover: #3d0f38;
  --brand-soft: rgba(79, 20, 72, 0.08);
  --brand-border: rgba(79, 20, 72, 0.2);
  --text: #1a1a1f;
  --text-muted: #5c5c66;
  --bg: #faf9fb;
  --surface: #ffffff;
  --shadow: 0 4px 24px rgba(26, 26, 31, 0.06);
  --shadow-lg: 0 12px 48px rgba(26, 26, 31, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --max: 1120px;
  --nav-h: 72px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 1rem;
}

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

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--brand-hover);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--brand);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

/* Navbar */
.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(250, 249, 251, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--brand-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  min-height: var(--nav-h);
  flex-wrap: wrap;
}

@media (min-width: 901px) {
  .nav-inner {
    flex-wrap: nowrap;
  }
  .nav-links {
    flex: 1;
    justify-content: center;
  }
}

.logo {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}
.logo span {
  color: var(--brand);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}
.nav-links a:hover {
  color: var(--brand);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}
.lang-switch button {
  border: none;
  background: transparent;
  padding: 0.45rem 0.85rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}
.lang-switch button:not([aria-pressed="true"]):hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 12px rgba(79, 20, 72, 0.25);
}
.btn-primary:hover {
  background: var(--brand-hover);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}
.btn-outline:hover {
  background: var(--brand-soft);
  color: var(--brand-hover);
}

.btn-ghost {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--brand-border);
}
.btn-ghost:hover {
  background: var(--brand-soft);
}

/* Hero */
.hero {
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(4rem, 10vw, 6rem);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      ellipse 80% 50% at 70% -20%,
      rgba(79, 20, 72, 0.12),
      transparent 55%
    ),
    radial-gradient(ellipse 60% 40% at 10% 100%, rgba(79, 20, 72, 0.06), transparent 50%);
  pointer-events: none;
}

.hero .container {
  position: relative;
}

.hero h1 {
  margin: 0 0 1rem;
  max-width: 18ch;
  line-height: 1.12;
}

.hero-h1-lead {
  display: block;
  font-size: clamp(2.1rem, 4.8vw, 3.35rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--text);
}

.hero-h1-tail {
  display: block;
  margin-top: 0.45rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: clamp(1.15rem, 3vw, 1.85rem);
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #4f1448;
}

.hero .lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 42rem;
  margin: 0 0 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Section common */
section {
  padding: clamp(3.5rem, 7vw, 5rem) 0;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  line-height: 1.2;
}

.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  background: var(--brand);
  border-radius: 2px;
  margin-top: 0.75rem;
}

.divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--brand-border),
    transparent
  );
  margin: 0;
  border: none;
}

/* About */
.about-intro {
  max-width: 48rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.mv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.mv-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--brand);
}
.mv-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--brand);
}
.mv-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.timeline-wrap {
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.timeline {
  display: flex;
  gap: 0;
  min-width: min(100%, 900px);
  position: relative;
  padding-top: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), rgba(79, 20, 72, 0.35));
  border-radius: 2px;
}

.timeline-item {
  flex: 1 1 120px;
  min-width: 100px;
  padding-right: 0.75rem;
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  top: -1.5rem;
  left: 0;
  width: 12px;
  height: 12px;
  background: var(--brand);
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--brand);
}
.timeline-year {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--brand);
  margin-bottom: 0.35rem;
}
.timeline-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Founder */
.founder {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.founder-grid {
  display: grid;
  grid-template-columns: minmax(0, min(30%, 170px)) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 2.5rem);
  align-items: start;
}

.founder-photo {
  width: 100%;
  max-width: 170px;
  justify-self: start;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--brand-border);
  aspect-ratio: 4/5;
  background: var(--brand-soft);
}
.founder-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.founder-content {
  min-width: 0;
}

.founder-quote {
  font-size: 1.35rem;
  font-weight: 700;
  font-style: italic;
  color: var(--brand);
  margin: 0 0 1.5rem;
  line-height: 1.4;
  border-left: 4px solid var(--brand);
  padding-left: 1.25rem;
}

.founder-bio {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.founder-bio p {
  margin: 0 0 1rem;
}

.badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.badge {
  background: var(--surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.badge:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 20px rgba(79, 20, 72, 0.12);
}

/* Impact */
.impact {
  background: var(--surface);
  border-block: 1px solid var(--brand-border);
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
}

.impact-stat {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--brand-border);
  transition: transform 0.2s, border-color 0.2s;
}
.impact-stat:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
}
.impact-number {
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}
.impact-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.35;
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border-top: 5px solid var(--brand);
  transition: box-shadow 0.25s, transform 0.2s;
}
.service-card:hover {
  box-shadow: 0 8px 32px rgba(79, 20, 72, 0.15);
  transform: translateY(-2px);
}

.service-card h3 {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.service-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.service-card li {
  margin-bottom: 0.5rem;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.gallery-item:hover img {
  transform: scale(1.05);
}

/* Gallery lightbox (opened via JS; grid markup unchanged) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) 3.25rem max(0.75rem, env(safe-area-inset-bottom));
  padding-left: max(3.25rem, env(safe-area-inset-left));
  padding-right: max(3.25rem, env(safe-area-inset-right));
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 12, 0.92);
  cursor: pointer;
}

.lightbox-frame {
  position: relative;
  z-index: 1;
  max-width: min(100vw - 6.5rem, 100%);
  max-height: min(100dvh - 5rem, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lightbox-img {
  max-width: 100%;
  max-height: min(92dvh, 92vh);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.lightbox-btn {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.lightbox-btn:active {
  transform: scale(0.96);
}

.lightbox-close {
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
}

.lightbox-prev {
  left: max(0.5rem, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: max(0.5rem, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev:active,
.lightbox-next:active {
  transform: translateY(-50%) scale(0.96);
}

@media (max-width: 520px) {
  .lightbox {
    padding-left: max(2.75rem, env(safe-area-inset-left));
    padding-right: max(2.75rem, env(safe-area-inset-right));
  }

  .lightbox-frame {
    max-width: calc(100vw - 5.5rem);
  }

  .lightbox-btn {
    min-width: 2.5rem;
    min-height: 2.5rem;
    font-size: 1.2rem;
  }
}

/* Contact */
.contact {
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 50%);
}

.contact-subtitle {
  max-width: 36rem;
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.contact-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: stretch;
  justify-content: flex-start;
}

.contact-actions .btn {
  flex: 1 1 160px;
  min-width: min(100%, 10rem);
}

.contact-meta {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.contact-email {
  color: var(--text);
  text-decoration: none;
}

.contact-email:hover {
  color: var(--brand-hover);
}

.contact-email strong {
  font-weight: 800;
}

.contact-location {
  display: block;
}

/* Footer */
.site-footer {
  background: var(--text);
  color: #e8e6ea;
  padding: 2.5rem 0 1.5rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

@media (min-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
  }
}

.footer-logo {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}
.footer-logo span {
  color: #c9a0c4;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-nav a {
  color: #c4c0c8;
  font-weight: 600;
  font-size: 0.9rem;
}
.footer-nav a:hover {
  color: #fff;
}

.social-row {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-start;
}
@media (min-width: 768px) {
  .social-row {
    justify-content: flex-end;
  }
}

.social-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.social-row a:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.social-row svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.footer-bottom {
  padding-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: #9a959f;
}

/* Mobile menu — simplified: wrap nav */
@media (max-width: 900px) {
  .nav-inner {
    flex-direction: column;
    align-items: stretch;
    padding-block: 1rem;
  }
  .nav-links {
    flex: none;
    justify-content: center;
  }
  .nav-actions {
    justify-content: center;
  }
}
