:root{
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --text: #0b0d10;
  --muted: #5d6673;
  --card: #ffffff;
  --border: rgba(11,13,16,0.10);
  --shadow: 0 12px 30px rgba(11,13,16,0.08);
  --radius: 18px;
  --max: 1120px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
}

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

.container{
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.header{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
}
.brand-mark{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(11,13,16,0.06);
  font-weight: 700;
}
.brand-text{
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav{
  display: flex;
  gap: 16px;
  align-items: center;
}
.nav a{
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none !important;
  padding: 8px 10px;
  border-radius: 12px;
}
.nav a:hover{ background: rgba(11,13,16,0.04); color: var(--text); }
.nav-cta{
  background: var(--text);
  color: var(--bg) !important;
}
.nav-cta:hover{ background: #000; }

.nav-toggle{
  display: none;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 16px;
}

.hero{
  padding: 56px 0 10px;
}
.hero-grid{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}
.pill{
  display: inline-flex;
  gap: 8px;
  border: 1px solid var(--border);
  background: rgba(11,13,16,0.02);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
}
h1{
  margin: 14px 0 10px;
  font-size: clamp(34px, 4.5vw, 56px);
  line-height: 1.03;
  letter-spacing: -0.03em;
}
.subhead{
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 52ch;
}
.hero-actions{
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none !important;
  box-shadow: 0 10px 22px rgba(11,13,16,0.14);
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0px); }
.btn-ghost{
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}
.btn-wide{ width: 100%; }

.hero-stats{
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}
.stat{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px;
  background: rgba(11,13,16,0.01);
}
.stat-value{ font-weight: 900; letter-spacing: -0.02em; }
.stat-label{ color: var(--muted); font-size: 12px; margin-top: 2px; }

.hero-media{
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  min-height: 380px;
  box-shadow: var(--shadow);
}
.hero-video, .hero-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-fade{
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(255,255,255,0.92), rgba(255,255,255,0.0) 50%);
}

.section{
  padding: 70px 0;
}
.section-alt{
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-head h2{
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.section-head p{
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 70ch;
  line-height: 1.6;
}

.cards{
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 22px rgba(11,13,16,0.05);
}
.card h3{ margin: 0 0 6px; }
.card p{ margin: 0; color: var(--muted); line-height: 1.6; }

.grid{
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}
.item{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(11,13,16,0.05);
  cursor: pointer;
  transition: transform .15s ease;
}
.item:hover{ transform: none; }
.item-media{
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--bg-alt);
}
.item-body{
  padding: 14px 14px 16px;
}
.item-title{
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.tags{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag{
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(11,13,16,0.02);
  color: var(--muted);
  font-weight: 700;
}

.hint{
  margin-top: 16px;
  border: 1px dashed var(--border);
  padding: 14px 16px;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(11,13,16,0.01);
}

.steps{
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.step{
  display: flex;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 22px rgba(11,13,16,0.05);
}
.step-n{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 900;
}
.step h3{ margin: 0 0 6px; }
.step p{ margin: 0; color: var(--muted); line-height: 1.6; }

.contact-grid{
  margin-top: 22px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
}
.contact-card{
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 22px rgba(11,13,16,0.05);
}
.social{
  margin-top: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.social a{
  color: var(--muted);
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none !important;
}
.social a:hover{ color: var(--text); background: rgba(11,13,16,0.03); }

.form{
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 22px rgba(11,13,16,0.05);
}
label{
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 800;
  font-size: 13px;
}
input, textarea{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
  font: inherit;
  outline: none;
}
input:focus, textarea:focus{
  border-color: rgba(11,13,16,0.25);
}
.row{ margin-top: 6px; }

.muted{ color: var(--muted); }
.small{ font-size: 12px; line-height: 1.5; }
.mini{ margin-top: 12px; }

.footer{
  border-top: 1px solid var(--border);
  padding: 26px 0;
  background: var(--bg);
}
.footer-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}
.footer-links{
  display: flex;
  gap: 10px;
}
.footer-links a{
  color: var(--muted);
  text-decoration: none !important;
  padding: 8px 10px;
  border-radius: 12px;
}
.footer-links a:hover{ background: rgba(11,13,16,0.03); color: var(--text); }

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 60;
}
.modal.show{ display: block; }
.modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(11,13,16,0.5);
}
.modal-panel{
  position: relative;
  width: min(920px, calc(100% - 24px));
  margin: 60px auto;
  background: var(--bg);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 26px 70px rgba(11,13,16,0.35);
  overflow: hidden;
}
.modal-close{
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
}
.modal-body{
  padding: 18px;
}
.modal-grid{
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 16px;
}
.modal-media{
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-alt);
}
.modal-media img, .modal-media video{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.modal-meta h3{
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.modal-meta p{
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
}
.modal-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
  .hero-media{ min-height: 320px; }
  .cards{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: 1fr; }
  .steps{ grid-template-columns: 1fr; }
  .contact-grid{ grid-template-columns: 1fr; }
  .modal-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 760px){
  .nav{ display: none; }
  .nav.open{
    display: flex;
    position: absolute;
    right: 12px;
    top: 62px;
    flex-direction: column;
    background: rgba(255,255,255,0.95);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 10px;
    width: min(280px, calc(100% - 24px));
    box-shadow: var(--shadow);
  }
  .nav-toggle{ display: inline-flex; }
  .footer-inner{ flex-direction: column; align-items: flex-start; }
}

/* Controles del carrusel en el modal */
.carousel-controls{
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.icon-btn{
  border: 1px solid var(--border);
  background: rgba(11,13,16,0.03);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
}
.icon-btn:hover{ background: rgba(11,13,16,0.06); }
.thumb-row{
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 10px 2px 2px;
}
.thumb{
  width: 72px;
  height: 54px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  flex: 0 0 auto;
  cursor: pointer;
  background: var(--bg-alt);
}
.thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb.active{
  outline: 2px solid rgba(11,13,16,0.35);
}
.thumb video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* ===== CARD HOVER (FINAL, SOLO 1 SISTEMA) ===== */
/* ===== Hover básico (todas las fotos, sin videos) ===== */
.item-media-wrap.hover-stack{
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #000;
}

.item-media-wrap.hover-stack img.hover-frame{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 180ms ease;
}

.item-media-wrap.hover-stack img.hover-frame.is-active{
  opacity: 1;
}

/* Separador de secciones en el modal */
.divider-title{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.divider-title::before,
.divider-title::after{
  content: "";
  height: 1px;
  background: var(--border);
  flex: 1;
}

/* Evitar scroll horizontal accidental en móvil */
html, body{
  overflow-x: hidden;
}

img, video{
  max-width: 100%;
}

/* iOS: evitar “saltos” de ancho por 100vw */
.header, .container{
  max-width: 100%;
}

/* Footer: evitar que el último enlace se corte en móvil */
.footer-links{
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* En pantallas pequeñas: que los links ocupen varias líneas si hace falta */
@media (max-width: 760px){
  .footer-links{
    width: 100%;
    gap: 8px;
  }
}

@media (max-width: 760px){
  .footer-links a{
    padding: 8px 8px;
  }
}

/* Modal: scroll interno en móvil + bloquear scroll de fondo */
.modal.show{
  overflow: hidden;
}

.modal-panel{
  max-height: calc(100dvh - 40px);
  overflow: hidden;
}

.modal-body{
  max-height: calc(100dvh - 40px);
  overflow: auto;
  -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
}

/* Evita que el scroll se “escape” al body */
.modal-backdrop{
  touch-action: none;
}

@media (max-width: 980px){
  .modal-media{
    max-height: 48dvh;
  }
  .modal-media img,
  .modal-media video{
    height: 48dvh;
  }
}

@media (max-width: 980px){
  .modal-media video{
    width: 100%;
    height: auto;
    max-height: 48dvh;
  }
}

/* Botón play encima del vídeo en el modal */
.video-wrap{
  position: relative;
}

.video-play{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none; /* deja que el tap vaya al video */
}

.video-play span{
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
}

/* Asegurar que la X está por encima del media */
.modal-close{
  z-index: 999;
}

/* En móvil, un poco más separada del borde */
@media (max-width: 980px){
  .modal-close{
    top: 10px;
    right: 10px;
  }
}

.modal-panel{
  position: relative;
}
/* Alternativa: miniaturas en grid */
.thumb-row{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  overflow: visible;
}
.thumb{
  width: 100%;
  height: 54px;
}