:root {
  --navy: #131A22;
  --navy-2: #1B2530;
  --blue: #2B6CB0;
  --blue-light: #EBF4FF;
  --gray: #4A5568;
  --gray-light: #A0AEC0;
  --amber: #ED8936;
  --white: #FFFFFF;
  --line: #E2E8F0;
  --radius: 6px;
  --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans', Arial, sans-serif;
  color: var(--gray);
  background: var(--white);
  line-height: 1.55;
}

h1, h2, h3, .logo {
  font-family: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
  color: var(--navy);
  margin: 0;
}

a { color: inherit; }

img, svg { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.in-view > * {
  transition-delay: calc(var(--i, 0) * 90ms);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes belt-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
  .belt-track { transform: none !important; }
}

/* ---------- Header / nav ---------- */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

header.scrolled {
  background: rgba(19, 26, 34, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}

section, footer {
  scroll-margin-top: 84px;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 24px;
}

.logo {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo span { color: var(--amber); }

.logo img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: var(--white);
  padding: 4px;
}

footer .logo img {
  background: transparent;
  padding: 0;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

nav a {
  text-decoration: none;
  color: var(--blue-light);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

nav a:hover { color: var(--white); }

.nav-toggle {
  display: none;
}

@media (max-width: 768px) {
  header.menu-open {
    background: rgba(19, 26, 34, 0.98);
  }

  .nav-row {
    padding: 16px 20px;
  }

  header .logo {
    font-size: 0.98rem;
    gap: 8px;
  }

  header .logo img {
    width: 40px;
    height: 40px;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0;
    color: var(--white);
    transition: background 0.2s ease, border-color 0.2s ease;
  }

  .nav-toggle:hover, .nav-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.35);
  }

  .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
    transform-origin: center;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(19, 26, 34, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.45);
    padding: 16px 20px 24px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    pointer-events: none;
    z-index: 49;
  }

  nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  nav ul {
    flex-direction: column;
    gap: 6px;
  }

  nav a {
    display: block;
    padding: 12px 14px;
    font-size: 1.02rem;
    border-radius: var(--radius);
    transition: background 0.2s ease, color 0.2s ease;
  }

  nav a:hover, nav a:active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--amber);
  }
}

/* ---------- Hero ---------- */

.hero {
  background: var(--navy);
  color: var(--blue-light);
  padding: 130px 0 90px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-diagram { order: -1; max-width: 320px; margin: 0 auto 20px; }
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hero p.lead {
  margin-top: 20px;
  font-size: 1.08rem;
  max-width: 46ch;
  color: var(--gray-light);
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
}

.btn-primary:hover { background: #2C5D96; transform: translateY(-1px); }

.btn-ghost {
  border: 1px solid #33414F;
  color: var(--blue-light);
}

.btn-ghost:hover { border-color: var(--blue-light); }

.pulse { animation: pulse-dot 2.2s ease-in-out infinite; }
.pulse-2 { animation-delay: 0.4s; }
.pulse-3 { animation-delay: 0.8s; }

/* ---------- Section shell ---------- */

section { padding: 84px 0; }

.section-head {
  max-width: 56ch;
  margin-bottom: 48px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  font-weight: 600;
}

.section-head p {
  margin-top: 12px;
  font-size: 1.02rem;
}

/* ---------- Services (datasheet list, not cards) ---------- */

.service-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.service-row:hover {
  background: var(--blue-light);
  padding-left: 12px;
}

.services-list .service-row:last-child { border-bottom: 1px solid var(--line); }

.service-row h3 {
  font-size: 1.08rem;
  font-weight: 600;
}

.service-row p { margin: 0; font-size: 0.98rem; }

@media (max-width: 700px) {
  .service-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- Colaboradores ---------- */

.collab-row {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.collab-list .collab-row:last-child { border-bottom: 1px solid var(--line); }

.collab-row:hover { background: var(--blue-light); padding-left: 12px; }

.collab-name h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.collab-name span {
  display: block;
  font-size: 0.85rem;
  color: var(--blue);
  margin-top: 2px;
}

.collab-row p { margin: 0; font-size: 0.96rem; }

.collab-link {
  justify-self: end;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 9px 18px;
  border-radius: var(--radius);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.collab-link:hover { border-color: var(--blue); }

@media (max-width: 760px) {
  .collab-row { grid-template-columns: 1fr; gap: 8px; }
  .collab-link { justify-self: start; }
}

/* ---------- Proyectos (cinta con movimiento continuo) ---------- */

.projects { background: var(--navy-2); padding: 72px 0; overflow: hidden; }

.projects .section-head h2,
.projects .section-head p { color: var(--white); }

.projects .section-head p { color: var(--gray-light); }

.belt-viewport { overflow: hidden; }

.belt-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: belt-scroll 28s linear infinite;
}

.belt-viewport:hover .belt-track { animation-play-state: paused; }

.project-card {
  flex: 0 0 auto;
  width: 300px;
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
}

.project-card p {
  margin: 10px 2px 0;
  font-size: 0.88rem;
  color: var(--gray-light);
}

/* ---------- About ---------- */

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

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 780px) {
  .about-grid { grid-template-columns: 1fr; }
}

.about h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); }

.about p { font-size: 1.02rem; margin-top: 16px; }

.about-photo {
  border-radius: var(--radius);
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  transform: scale(1.08);
  animation: about-zoom 14s ease-in-out infinite alternate;
}

@keyframes about-zoom {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

.about-facts {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.fact {
  border-left: 2px solid var(--blue);
  padding-left: 16px;
}

.fact h4 {
  margin: 0 0 4px;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 600;
}

.fact p { margin: 0; font-size: 0.95rem; }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
}

@media (max-width: 780px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-info p { font-size: 1rem; }

.contact-line {
  margin: 22px 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.contact-line span {
  display: block;
  font-size: 0.85rem;
  color: var(--gray-light);
  margin-bottom: 4px;
}

.contact-line a, .contact-line strong {
  font-size: 1.08rem;
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
}

.contact-line a:hover { color: var(--blue); }

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  font-size: 0.88rem;
  color: var(--navy);
  font-weight: 500;
  margin-bottom: 6px;
  display: block;
}

input, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.98rem;
  color: var(--navy);
  background: var(--white);
  transition: border-color 0.2s ease;
}

input:focus, textarea:focus {
  border-color: var(--blue);
}

textarea { resize: vertical; min-height: 120px; }

.form-submit {
  align-self: flex-start;
  margin-top: 6px;
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 13px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: background 0.2s ease, transform 0.2s ease;
}

.form-submit:hover { background: #2C5D96; transform: translateY(-1px); }

/* ---------- Footer ---------- */

footer {
  background: var(--navy);
  color: var(--gray-light);
  padding: 32px 0;
  font-size: 0.88rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-row .logo { font-size: 0.95rem; }
