:root {
  --navy: #16294a;
  --navy-soft: #44567c;
  --accent: #b15a4d;
  --accent-light: #cd7e6f;
  --accent-tint: #f7e9e6;
  --ink: #20283a;
  --gray: #647088;
  --gray-light: #9aa3b5;
  --bg: #fafbfc;
  --bg-soft: #f1f3f7;
  --white: #ffffff;
  --line: #e6e9f0;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(22, 41, 74, 0.06);
  --shadow-lg: 0 20px 45px rgba(22, 41, 74, 0.12);
  --container: 1180px;
  font-size: 16px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .logo {
  font-family: 'Poppins', sans-serif;
  line-height: 1.2;
}

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

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

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn--primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(177, 90, 77, 0.25);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(177, 90, 77, 0.35); background: var(--accent-light); }
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--navy);
}
.btn--ghost:hover { background: var(--bg-soft); border-color: var(--navy-soft); }
.btn--full { width: 100%; }

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 16px;
}
.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
}
.logo span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 32px; }
.nav__link {
  color: var(--navy-soft);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav__link:hover { color: var(--accent); }
.nav__cta {
  background: var(--accent);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
}
.nav__cta:hover { color: var(--white); background: var(--accent-light); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px; height: 44px;
  flex-shrink: 0;
  background: none; border: none;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, #ffffff, #f5f7fb 55%, #eef1f7);
  color: var(--ink);
  padding-top: calc(76px + env(safe-area-inset-top) + 84px);
  padding-bottom: 100px;
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
}
.eyebrow--center { text-align: center; }
.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--navy);
}
.hero h1 .highlight { color: var(--accent); }
.hero__lead {
  font-size: 1.05rem;
  color: var(--gray);
  max-width: 540px;
  margin-bottom: 32px;
}
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

.hero__note {
  font-size: 0.92rem;
  color: var(--gray);
  max-width: 620px;
  margin-bottom: 44px;
}
.hero__note-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  white-space: nowrap;
  transition: color 0.2s;
}
.hero__note-link:hover { color: var(--navy); }
.hero__note-link::after { content: " →"; }

.hero__stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  list-style: none;
}
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong { font-size: 1.8rem; font-weight: 700; color: var(--navy); }
.hero__stats span { font-size: 0.85rem; color: var(--gray); max-width: 160px; }

.hero__media { position: relative; }
.hero__photo {
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(145deg, var(--bg-soft), #e3e7ee);
  border: 1px solid var(--line);
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.hero__photo--placeholder { display: flex; align-items: center; justify-content: center; }
.hero__photo--placeholder img { display: none; }
.hero__photo--placeholder::after {
  content: "Foto de Alejandro Guzmán";
  color: var(--gray-light);
  font-size: 0.9rem;
  text-align: center;
  padding: 24px;
}
.hero__media-badge {
  position: absolute;
  bottom: -20px;
  left: -20px;
  background: var(--white);
  color: var(--navy);
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}
.hero__media-badge span { color: var(--gray); font-size: 0.75rem; }
.hero__media-badge strong { font-family: 'Poppins', sans-serif; font-size: 1rem; }

/* ---------- Media strip ---------- */
.media-strip { background: var(--white); padding: 28px 0; border-bottom: 1px solid var(--line); }
.media-strip__inner { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.media-strip__label { font-size: 0.85rem; color: var(--gray); font-weight: 600; }
.media-strip__logos { display: flex; gap: 24px; flex-wrap: wrap; }
.media-strip__logos span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  padding: 8px 14px;
  background: var(--bg-soft);
  border-radius: 999px;
}

/* ---------- About ---------- */
.about { padding: 100px 0; background: var(--white); }
.about__inner {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 64px;
  align-items: center;
}
.about__photo {
  aspect-ratio: 1/1;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(145deg, var(--bg-soft), #e7ebf1);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.about__photo img { width: 100%; height: 100%; object-fit: cover; }
.about__photo--placeholder { display: flex; align-items: center; justify-content: center; }
.about__photo--placeholder img { display: none; }
.about__photo--placeholder::after {
  content: "Foto de Alejandro Guzmán";
  color: var(--gray-light);
  font-size: 0.9rem;
  text-align: center;
  padding: 24px;
}
.about__content h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 20px; color: var(--navy); }
.about__content p { color: var(--gray); margin-bottom: 16px; }
.about__list {
  list-style: none;
  margin-top: 24px;
  display: grid;
  gap: 12px;
}
.about__list li {
  padding-left: 28px;
  position: relative;
  font-weight: 500;
  color: var(--navy);
}
.about__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Services ---------- */
.services { padding: 100px 0; background: var(--bg-soft); }
.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--navy);
  max-width: 700px;
  margin: 0 auto 16px;
}
.section-lead {
  text-align: center;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto 56px;
}
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.service-card {
  background: var(--white);
  padding: 36px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.service-card::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  margin-bottom: 22px;
}
.service-card h3 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin-bottom: 14px;
  color: var(--navy);
}
.service-card p { color: var(--gray); font-size: 0.95rem; }

/* ---------- Clients ---------- */
.clients { padding: 100px 0; background: var(--white); }

.clients__carousel {
  position: relative;
  overflow: hidden;
  margin: 48px 0 36px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.clients__track {
  display: flex;
  align-items: center;
  gap: 48px;
  width: max-content;
  animation: clients-scroll 40s linear infinite;
}
.clients__carousel:hover .clients__track,
.clients__carousel:focus-within .clients__track {
  animation-play-state: paused;
}
.clients__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 64px;
  flex-shrink: 0;
}
.clients__logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(1) opacity(0.55);
  transition: filter 0.2s ease;
}
.clients__logo:hover img { filter: grayscale(0) opacity(1); }

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

@media (prefers-reduced-motion: reduce) {
  .clients__track { animation: none; }
}
.clients__more {
  text-align: center;
  color: var(--gray);
  max-width: 820px;
  margin: 0 auto;
  font-size: 0.92rem;
}

/* ---------- Contact ---------- */
.contact { padding: 100px 0; background: var(--bg-soft); }
.contact__inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
}
.contact__info h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 18px; color: var(--navy); }
.contact__info p { color: var(--gray); margin-bottom: 32px; }
.contact__details { list-style: none; display: grid; gap: 18px; }
.contact__details li { display: flex; flex-direction: column; }
.contact__details strong { color: var(--accent); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.contact__details span { color: var(--navy-soft); }

.contact__form {
  background: var(--white);
  color: var(--ink);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  display: grid;
  gap: 18px;
}
.form-row { display: grid; gap: 6px; }
.form-row[hidden] { display: none; }
.form-row label { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.form-row input, .form-row textarea {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.2s;
  background: var(--white);
  width: 100%;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-row--segment { border: none; }
.form-row--segment legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  padding: 0;
  margin-bottom: 10px;
}
.segment {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.segment input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}
.segment label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy-soft);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.segment label:hover { border-color: var(--navy-soft); }
.segment input:checked + label {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}
.segment input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-status { font-size: 0.9rem; min-height: 20px; font-weight: 500; }
.form-status[data-state="success"] { color: #1f8a4c; }
.form-status[data-state="error"] { color: #c0392b; }

/* ---------- Footer ---------- */
.footer { background: var(--white); color: var(--gray); padding: 48px 0 24px; border-top: 1px solid var(--line); }
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.logo--footer { display: inline-block; margin-bottom: 8px; }
.footer__inner p { font-size: 0.9rem; max-width: 280px; }
.footer__links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer__links a { font-size: 0.9rem; color: var(--navy-soft); }
.footer__links a:hover { color: var(--accent); }
.footer__copy { text-align: center; font-size: 0.8rem; padding-top: 20px; color: var(--gray-light); }

/* ---------- Service cards — clickable ---------- */
.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
}
.service-card p { flex: 1; }
.service-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.2s ease;
  text-decoration: none;
}
.service-card__more::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.service-card:hover .service-card__more { gap: 10px; }

/* ---------- Service detail pages ---------- */
.service-hero {
  background: linear-gradient(160deg, #ffffff, #f5f7fb 55%, #eef1f7);
  padding-top: calc(76px + env(safe-area-inset-top) + 64px);
  padding-bottom: 72px;
}
.service-hero .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--gray);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.service-hero .breadcrumb a { color: var(--accent); font-weight: 500; }
.service-hero .breadcrumb a:hover { text-decoration: underline; }
.service-hero .breadcrumb span { color: var(--gray-light); }
.service-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--navy);
  max-width: 700px;
  margin-bottom: 20px;
}
.service-hero__lead {
  font-size: 1.1rem;
  color: var(--gray);
  max-width: 620px;
  line-height: 1.7;
}

.service-body { padding: 80px 0; background: var(--white); }
.service-body__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: start;
}
.service-body h2 { font-size: 1.5rem; color: var(--navy); margin-bottom: 16px; }
.service-body p { color: var(--gray); margin-bottom: 16px; line-height: 1.75; }
.service-includes, .service-forwhom {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}
.service-includes h3, .service-forwhom h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 18px;
}
.service-includes ul, .service-forwhom ul {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 0;
}
.service-includes li, .service-forwhom li {
  padding-left: 24px;
  position: relative;
  color: var(--navy-soft);
  font-size: 0.95rem;
}
.service-includes li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.service-forwhom li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--navy-soft);
  font-weight: 600;
}
.service-sidebar { display: grid; gap: 24px; }

.service-cta-strip {
  background: var(--navy);
  padding: 80px 0;
  text-align: center;
}
.service-cta-strip h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--white);
  margin-bottom: 16px;
}
.service-cta-strip p {
  color: var(--gray-light);
  max-width: 560px;
  margin: 0 auto 36px;
}
.service-cta-strip .btn--primary { background: var(--accent); }
.service-cta-strip .btn--ghost {
  color: var(--white);
  border-color: rgba(255,255,255,0.35);
}
.service-cta-strip .btn--ghost:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.6); }
.service-cta-strip__actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Gallery ---------- */
.gallery { padding: 100px 0; background: var(--bg-soft); }
.gallery__wrapper {
  position: relative;
  margin-top: 48px;
}
.gallery__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 48px;
  -ms-overflow-style: none;
  scrollbar-width: none;
  cursor: grab;
}
.gallery__track:active { cursor: grabbing; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__item {
  flex-shrink: 0;
  height: 340px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  scroll-snap-align: start;
}
.gallery__item img {
  height: 100%;
  width: auto;
  max-width: none;
  display: block;
  object-fit: cover;
}
.gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: var(--white);
  border: 1.5px solid var(--line);
  color: var(--navy);
  font-size: 2rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.gallery__arrow:hover { background: var(--accent); color: var(--white); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.gallery__arrow--prev { left: 0; }
.gallery__arrow--next { right: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .service-body__grid { grid-template-columns: 1fr; }
  .service-body { padding: 60px 0; }
  .hero__inner, .about__inner { grid-template-columns: 1fr; }
  /* En una columna el formulario sube: los datos de contacto pasan debajo.
     display:contents saca la caja de .contact__info para poder ordenar
     sus hijos junto al formulario; los márgenes propios dan el espaciado. */
  .contact__inner { display: flex; flex-direction: column; gap: 0; }
  .contact__info { display: contents; }
  .contact__form { order: 1; margin-bottom: 36px; }
  .contact__details { order: 2; }
  .hero__media { max-width: 380px; margin: 0 auto; }
  .about__photo { max-width: 360px; margin: 0 auto; }
  .services__grid { grid-template-columns: repeat(2, 1fr); }
  .about, .services, .clients, .contact { padding: 72px 0; }
}

/* Tablets and phones (incl. landscape) get the collapsible menu */
@media (max-width: 980px) {
  /* backdrop-filter on .header creates a containing block for fixed children,
     which would break .nav's viewport-relative top/bottom sizing below */
  .header { backdrop-filter: none; }
  .nav {
    position: fixed;
    top: 76px; left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 24px 32px;
    gap: 4px;
    transform: translateY(-110%);
    transition: transform 0.3s ease;
  }
  .nav.is-open { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .nav__link {
    padding: 14px 4px;
    width: 100%;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
  }
  .nav__cta { width: 100%; text-align: center; margin-top: 12px; border-bottom: none; }
}

@media (max-width: 760px) {
  .gallery__item { height: 240px; }
  .gallery__track { padding: 8px 16px; }
  .gallery__arrow { display: none; }
  .hero { padding-bottom: 60px; }
  .hero__note { margin-bottom: 34px; }
  .hero__stats { gap: 16px 28px; }
  .hero__stats li { flex: 0 0 calc(50% - 14px); }
  .services__grid { grid-template-columns: 1fr; }
  .contact__form { padding: 28px; }
  .clients__logos { gap: 32px; }
  .media-strip__inner { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (max-width: 480px) {
  .hero { padding-bottom: 48px; }
  .about, .services, .clients, .contact { padding: 56px 0; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .hero__note-link { white-space: normal; }
  .segment { grid-template-columns: 1fr; }
  .hero__stats li { flex: 0 0 100%; }
  .contact__form { padding: 22px; }
  .footer__inner { flex-direction: column; }
}
